{"id":13644009,"url":"https://github.com/mikaelvesavuori/minion","last_synced_at":"2025-10-28T10:05:42.157Z","repository":{"id":190976270,"uuid":"683698075","full_name":"mikaelvesavuori/minion","owner":"mikaelvesavuori","description":"The easiest and most lightweight way for developers to use OpenAI APIs in a CLI.","archived":false,"fork":false,"pushed_at":"2024-08-15T12:04:44.000Z","size":68,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-15T03:03:22.079Z","etag":null,"topics":["ai","ai-developer-tools","chatgpt","cli","developer-tools","diagramming","llm","openai","openai-api","test-generation"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/mikaelvesavuori.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-27T12:23:37.000Z","updated_at":"2025-04-11T07:56:23.000Z","dependencies_parsed_at":"2023-08-27T13:46:18.016Z","dependency_job_id":"f49d472f-7833-4814-8711-d81a3d1b7824","html_url":"https://github.com/mikaelvesavuori/minion","commit_stats":null,"previous_names":["mikaelvesavuori/minion"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/mikaelvesavuori/minion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fminion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fminion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fminion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fminion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikaelvesavuori","download_url":"https://codeload.github.com/mikaelvesavuori/minion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikaelvesavuori%2Fminion/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265562228,"owners_count":23788488,"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","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":["ai","ai-developer-tools","chatgpt","cli","developer-tools","diagramming","llm","openai","openai-api","test-generation"],"created_at":"2024-08-02T01:01:56.233Z","updated_at":"2025-10-07T22:49:12.050Z","avatar_url":"https://github.com/mikaelvesavuori.png","language":"Shell","funding_links":[],"categories":["CLIs"],"sub_categories":[],"readme":"# Minion: Minimalist CLI wrapper for OpenAI APIs 👾\n\n## The easiest and most lightweight way for developers to use OpenAI APIs in a CLI.\n\nMinion is a simple CLI wrapper that calls OpenAI APIs (of your choice) with prefabbed prompts and, for some use cases, your Git diff data. It expedites proactive - rather than reactive - code reviews, commit messaging, test generation, and diagramming and many more things.\n\nIts key modalities are to:\n\n- **Assist**: Generate unit tests from code, integration tests from schemas, or any applicable tests from your changes.\n- **Feedback**: Code reviews from your files or changes.\n- **Coach**: Supportive and coaching prompts helps you build better solutions.\n\n## What to know\n\nThis solution uses cURL to call OpenAI APIs. OpenAI will not train their models based on API calls, so this is a \"safer\" solution than, for example, using the web version of ChatGPT.\n\n## Prerequisites\n\nYou will need an [OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key) and have it exported in the environment as `OPENAI_API_KEY`, i.e. run `export OPENAI_API_KEY=\"sk-SOME_RANDOM_STRING`.\n\n**Minion assumes you have Bash.**\n\nMinion also assumes that you have [jq](https://jqlang.github.io/jq/) installed. If you have [Homebrew](https://brew.sh/) installed, it's as easy as `brew install jq` to get it.\n\nFurther, the _installation script_ assumes a shell with Zsh support, as it modifies the `.zshrc` file. Exactly how you do the installation and mapping the command `minion` to the Bash script is ultimately up to you.\n\n## Features\n\n### Generate commit message\n\nEase the generation of a [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style commit message.\n\n```bash\nminion commit\n```\n\nPrompt:\n\n```text\nGenerate a Conventional Commits style commit message for the following changes. Use a compact and terse style. For things like dependencies and other verbose changes, bundle these changes into an overall change description. These are the changes:\n```\n\n### Code review\n\nHave the LLM generate a code review, focusing on issues and to give feedback on how the code could be refactored.\n\n```bash\nminion review changes # Review all changes\n\nminion review file {path} # Review a document at a given location\n\nminion review directory {path} # Review all source code files recursively from location\n\nminion review diagram {path} # Review diagram at location (jpeg, png, gif, webp)\n```\n\nPrompt:\n\n```text\nYou are a world-class software engineer. You have been assigned to review the following code. You will provide actionable feedback while having a supportive tone. Focus on issues and problems, not mincing words. Highlight the issues and address each separately. If one issue is very similar to another, group them together. If one issue has effect on another, explain how. Give feedback on things that could be refactored or improved with common design patterns. Also, ensure any new code has tests if applicable (i.e. not for dependencies, version changes, configuration, or similar). These are the changes:\n```\n\n### Write tests for changes or individual files\n\nGenerate tests for your changes or individual files, using your tool of choice.\n\n```bash\nminion test changes # Generate unit tests for all code changes using \"an appropriate tool\"\n\nminion test changes {tool_name} # Generate unit tests for all code changes using the provided tool\n\nminion test file {tool_name} {path} # Generate unit tests for the file at the path using the provided tool\n\nminion test api {tool_name} {path} # Generate integration tests for the schema/file at the path using the provided tool\n```\n\nPrompt:\n\n```text\nYou are a world-class software engineer. You have been asked to write appropriate {TEST_TYPE} tests using {TOOL} for the changes. Tests should only be made for our source code, not for dependencies, version changes, configuration, or similar. We are aiming for full code coverage, if possible. If there are no applicable changes, don't write any tests. Only provide code, no explanations. These are the changes:\n```\n\n### Create a diagram for changes\n\nGenerate one of several types of diagrams for your changes.\n\nThe allowed types are: `mermaid` (default), `uml`, `sequence_diagram`, `class_diagram`, `flowchart`, and `graphviz`.\n\n```bash\nminion diagram changes # Defaults to Mermaid\n\nminion diagram changes {diagram_type} # Choose your own format here\n\nminion diagram file {diagram_type} {path} # Generate diagrams for a specific file, such as an infrastructure-as-code configuration\n```\n\nPrompt:\n\n```text\nYou are a world-class software architect. You have been asked to produce diagrams using $TOOL for the changes. Focus on our own code, and only add external dependencies if necessary. If it's unclear what the solution is, then don't make diagrams and voice your concern and reasons for stopping. These are the changes:\n```\n\n### Ask a question\n\nFinally, you may just want to conveniently ask a question!\n\n```bash\nminion ask \"Tell me about 5 practical ways to minimize technical debt in a React project.\"\n```\n\n## Installation\n\nThe easiest \"one-off\" way would be to use Minion just as any old script in a project if you want...\n\n_But the nicer option is to use the `install.sh` script._\n\nIt will:\n\n- Make a root level directory named `.minion`\n- Copy `minion.sh` to the new directory\n- Add a line to your `.zshrc` with an alias (`minion`) that runs the script\n\n_Please refer to the [Prerequisites](#prerequisites) section above before installing._\n\nFeel free to modify the installation script or do it your way if this doesn't match how you'd like it to be set up.\n\nYou will need to source or reload your IDE for the changes to be activated.\n\n## Configuration and model choice\n\nStarting with version `1.4.0`, you will be presented with a list of models when you pass a command to Minion.\n\nIf you want to use a default model and skip manual input, then simply create a `minion.json` file with a `model` key with the value for the model you want to use. The file will be read from the current directory.\n\nExample:\n\n```json\n{\n  \"model\": \"gpt-4o-mini\"\n}\n```\n\nValid choices are:\n\n- `gpt-3.5-turbo`\n- `gpt-4`\n- `gpt-4-turbo`\n- `gpt-4o`\n- `gpt-4o-mini`\n- `chatgpt-4o-latest`\n\n## Usage\n\nRun `minion [commit|review|test|ask|diagram]` in a Git repository.\n\n## Contributing\n\nThere is a dedicated [CONTRIBUTING.md](CONTRIBUTING.md), but generally I'm happy to take suggestions and proposals for new features!\n\n## Future ideas\n\n- Support for non-OpenAI providers\n- Support for configuration files to additional concepts, like tool/language choices and such\n- Support for custom code/docs review policies\n- Generate code from diagram (`minion scaffold`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Fminion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikaelvesavuori%2Fminion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikaelvesavuori%2Fminion/lists"}