AI-powered commit message and PR description generator, with a local usage dashboard so you can see what you're spending on tokens.
$ git add .
$ kommit
feat(auth): add refresh token rotation
- rotate refresh token on every /auth/refresh
- invalidate previous token family on reuse detection
- add 7-day expiry for refresh tokens
I got tired of typing "fix stuff" and copy-pasting JIRA tickets into commits. Wanted something that:
- runs locally against my own Ollama if I don't want to send code to a cloud
- handles big diffs without choking on context limits
- doesn't pretend the changes are more interesting than they are
- tells me how much I've actually spent on tokens this month
Early. Works on my machine and the machines of a couple of friends. PRs welcome.
pipx install kommit # core
pipx install 'kommit[dashboard]' # + flask for `kommit dashboard`# uses OPENAI_API_KEY by default
kommit
# anthropic
kommit --provider anthropic
# local model via ollama
kommit --provider ollama --model llama3.1
# pick / edit / regenerate before committing
kommit -i --commit
# write a PR description for branch vs main
kommit pr --base mainSee kommit --help for all flags.
~/.config/kommit/config.toml:
provider = "anthropic"
model = "claude-3-5-sonnet-20241022"
interactive = trueCLI flags override the config file.
Every generation gets logged to ~/.local/share/kommit/usage.db (sqlite, no telemetry, doesn't leave your machine).
kommit dashboard
# → http://127.0.0.1:5050Shows totals, tokens by provider, recent runs, and a rough cost estimate from public list pricing.
JSON endpoints if you want to scrape it elsewhere:
GET /api/totalsGET /api/providersGET /api/dailyGET /api/recent
- openai — needs
OPENAI_API_KEY. Default model:gpt-4o-mini. - anthropic — needs
ANTHROPIC_API_KEY. Default model:claude-3-5-sonnet-20241022. Best subjects in my experience. - ollama — local, talks to
http://localhost:11434. Default model:llama3.1. Good enough for routine commits.
git clone https://github.com/caroljo0812/kommit
cd kommit
uv venv && source .venv/bin/activate
uv pip install -e '.[dev]'
pytestMIT