komitto

Crates.iokomitto
lib.rskomitto
version0.1.3
created_at2025-05-08 02:07:18.586903+00
updated_at2025-05-09 01:58:02.165128+00
descriptionAI-powered Conventional Commit Message Generator for Git
homepagehttps://github.com/tsukuricase/komitto
repositoryhttps://github.com/tsukuricase/komitto
max_upload_size
id1664751
size52,238
jalever (Jalever)

documentation

README

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 --staged and 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

2. Build from source

git clone https://github.com/tsukuricase/komitto.git
cd komitto
cargo build --release

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:

export OPENROUTER_API_KEY=your-openrouter-api-key

(Recommended: add to your ~/.bashrc or ~/.zshrc for convenience)

Windows CMD:

set OPENROUTER_API_KEY=your-openrouter-api-key

๐Ÿšฆ Usage

1. Stage your changes

git add .

2. Generate commit message

target/release/komitto

The tool will automatically extract your staged changes, send to OpenRouter, and propose a commit message.

3. Use the suggested commit message

git commit -m "your AI-generated 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:

komitto --help

๐ŸŒ 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_KEY environment variable).
OpenAI direct keys are not yet supported.

For OpenRouter API docs and supported models, see: OpenRouter Developers


๐Ÿงช Testing

  • Run tests locally before publishing:
    cargo test
    
  • Our GitHub Actions CI will also automatically build & test for every push before publishing to crates.io.

๐Ÿค Contributing

  1. Fork this repo, create your feature branch (git checkout -b feat/my-feature)
  2. Write code & tests (cargo test)
  3. Make sure all checks pass and open a Pull Request

Questions? Suggestions? Open an issue!


๐Ÿ“„ License

MIT License ยฉ 2024 tsukuricase & contributors


๐Ÿ™ Acknowledgements

Commit count: 19

cargo fmt