komitto
๐ AI-powered Conventional Commit Message Generator for Git.
Automatically generate professional, well-structured Git commit messages using large language models (LLMs) via OpenRouter.
โจ Features
- One-command automation: Summarizes your
git diff --stagedand generates a commit message with a single command. - Conventional Commits: Output messages conform to Conventional Commits style (e.g., feat, fix, chore).
- Supports OpenRouter (OpenAI-compatible): Only OpenRouter API Key is supported currently.
- Multilingual: Outputs commit messages in both English and Chinese (auto-detect by LLM).
- Model Flexibility: Choose any OpenRouter-supported model (e.g.,
gpt-4,gpt-3.5, Llama, etc). - Cross-platform: Lightning-fast Rust CLI utility (macOS, Linux, Windows supported).
- Security: API keys are handled via environment variables.
๐ฆ Installation
1. Prerequisites
- Rust toolchain installed
- OpenRouter account and API Key
2. Build from source
After build, the binary is at: target/release/komitto
3. Set up your OpenRouter API Key
Add your API Key to your environment, e.g.:
Linux/Mac:
(Recommended: add to your ~/.bashrc or ~/.zshrc for convenience)
Windows CMD:
set OPENROUTER_API_KEY=your-openrouter-api-key
๐ฆ Usage
1. Stage your changes
2. Generate commit message
The tool will automatically extract your staged changes, send to OpenRouter, and propose a commit message.
3. Use the suggested commit message
โ๏ธ CLI options
| Argument | Description | Example |
|---|---|---|
--model |
Specify OpenRouter model (default: openai/gpt-4.1) |
--model gpt-3.5 |
--staged |
Use staged changes only (git diff --staged, default: false) |
--staged |
--help |
Show help message | --help |
Try:
๐ Internationalization
- The prompt is optimized for English Conventional Commits, but models may return content in English or Chinese based on your code/comments/context.
- Contributors interested in further i18n support may open an Issue or PR!
๐ OpenRouter Only
โ ๏ธ Notice:
Currently, komitto only supports OpenRouter API Key (OPENROUTER_API_KEYenvironment variable).
OpenAI direct keys are not yet supported.
For OpenRouter API docs and supported models, see: OpenRouter Developers
๐งช Testing
- Run tests locally before publishing:
- Our GitHub Actions CI will also automatically build & test for every push before publishing to crates.io.
๐ค Contributing
- Fork this repo, create your feature branch (
git checkout -b feat/my-feature) - Write code & tests (
cargo test) - Make sure all checks pass and open a Pull Request
Questions? Suggestions? Open an issue!
๐ License
MIT License ยฉ 2024 tsukuricase & contributors
๐ Acknowledgements
- Powered by OpenRouter
- Built with Rust
- Inspired by Conventional Commits