{"id":31766156,"url":"https://github.com/nassimberrada/patchllm","last_synced_at":"2025-10-10T00:29:35.176Z","repository":{"id":315865879,"uuid":"1042804893","full_name":"nassimberrada/patchllm","owner":"nassimberrada","description":"Lightweight tool to manage contexts and update code with llms","archived":false,"fork":false,"pushed_at":"2025-09-13T12:58:23.000Z","size":578,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-21T09:27:51.047Z","etag":null,"topics":["copilot","llm","tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nassimberrada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-22T15:50:09.000Z","updated_at":"2025-09-13T12:58:27.000Z","dependencies_parsed_at":"2025-09-21T09:27:56.202Z","dependency_job_id":"fe71134e-c801-4df6-a787-83d9dda7fbcf","html_url":"https://github.com/nassimberrada/patchllm","commit_stats":null,"previous_names":["nassimberrada/patchllm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nassimberrada/patchllm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nassimberrada%2Fpatchllm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nassimberrada%2Fpatchllm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nassimberrada%2Fpatchllm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nassimberrada%2Fpatchllm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nassimberrada","download_url":"https://codeload.github.com/nassimberrada/patchllm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nassimberrada%2Fpatchllm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002359,"owners_count":26083356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["copilot","llm","tool"],"created_at":"2025-10-10T00:29:27.159Z","updated_at":"2025-10-10T00:29:35.164Z","avatar_url":"https://github.com/nassimberrada.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource srcset=\"./assets/logo_dark.png\" media=\"(prefers-color-scheme: dark)\"\u003e\n    \u003csource srcset=\"./assets/logo_light.png\" media=\"(prefers-color-scheme: light)\"\u003e\n    \u003cimg src=\"./assets/logo_light.png\" alt=\"PatchLLM Logo\" height=\"200\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n## About\nPatchLLM is a command-line tool that lets you flexibly build LLM context from your codebase, provide instructions, and automatically apply file edits directly from the LLM's response.\n\n## Getting Started\n\n**1. Initialize a configuration file:**\nThis creates a `scopes.py` file to define file collections.\n```bash\npatchllm --init\n```\n\n**2. (Optional) Create a recipe file:**\nCreate a `recipes.py` for reusable tasks.\n```python\n# recipes.py\nrecipes = {\n    \"add_tests\": \"Write comprehensive pytest unit tests for the provided code. Mock any external dependencies.\",\n    \"refactor_dry\": \"Refactor the code to improve readability and reduce duplication (DRY principle).\",\n    \"add_docs\": \"Generate Google-style docstrings for all public functions and classes.\"\n}\n```\n\n**3. Run a task:**\nCombine a **scope**, a **task** (or **recipe**), and an **action** (`--patch`).\n\n```bash\n# Run with an ad-hoc task\npatchllm -s default -t \"Add type hints to the main function\" -p\n\n# Run with a pre-defined recipe\npatchllm -s default -r add_docs -p\n```\n\n## Modes of Operation\n\n- **Direct Mode:** The standard CLI usage shown above.\n- **Chat Mode:** A guided, conversational interface for complex changes.\n  ```bash\n  patchllm --chat\n  ```\n- **Interactive Mode:** Visually select files and folders to build the context.\n  ```bash\n  patchllm --interactive -t \"My task for the selected files\" -p\n  ```\n\n## All Commands \u0026 Options\n\n#### **Core Actions**\n| Flag | Alias | Description |\n|---|---|---|\n| `--patch` | `-p` | **Main action:** Query the LLM and apply file changes. |\n| `--chat` | `-c` | Start an interactive chat session. |\n| `--interactive` | `-in`| Interactively select files/folders for the context. |\n\n#### **Task \u0026 Recipe Input**\n| Flag | Alias | Description |\n|---|---|---|\n| `--task \"\u003c...\u003e\" `| `-t` | Provide a specific instruction to the LLM. |\n| `--recipe \u003cname\u003e` | `-r` | Use a predefined task from `recipes.py`. |\n| `--voice` | `-v` | Use voice recognition for the task instruction. |\n\n#### **Scope \u0026 Context Definition**\n| Flag | Alias | Description |\n|---|---|---|\n| `--scope \u003cname\u003e` | `-s` | Use a static scope from `scopes.py` or a dynamic one (e.g., `@git:staged`, `@search:\"term\"`). |\n| `--init` | `-i` | Create a new `scopes.py` file. |\n| `--list-scopes`| `-sl`| List all available scopes. |\n| `--show-scope` | `-ss`| Display the settings for a specific scope. |\n\n#### **Input/Output**\n| Flag | Alias | Description |\n|---|---|---|\n| `--context-out` | `-co` | Export the generated context to a file (e.g., `context.md`). |\n| `--context-in` | `-ci` | Use a local context file as input. |\n| `--to-file` | `-tf` | Save LLM response to a file instead of patching. |\n| `--to-clipboard`| `-tc`| Copy LLM response to the clipboard. |\n| `--from-file` | `-ff` | Apply patches from a local file. |\n| `--from-clipboard`|`-fc`| Apply patches from the clipboard. |\n\n#### **General Options**\n| Flag | Alias | Description |\n|---|---|---|\n| `--model` | `-m` | Specify a different model (default: `gemini/gemini-1.5-flash`). |\n\n## Setup\n\nPatchLLM uses [LiteLLM](https://github.com/BerriAI/litellm). Refer to their documentation for setting up API keys (e.g., `OPENAI_API_KEY`, `GEMINI_API_KEY`) in a `.env` file.\n\nOptional features require extra dependencies:\n```bash\n# For --voice\npip install \"patchllm[voice]\"\n\n# For URL support in scopes\npip install \"patchllm[url]\"\n\n# For --interactive and --chat modes\npip install \"patchllm[interactive]\"\n```\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnassimberrada%2Fpatchllm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnassimberrada%2Fpatchllm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnassimberrada%2Fpatchllm/lists"}