Thanks to visit codestin.com
Credit goes to github.com

Skip to content

caroljo0812/kommit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kommit

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

Why

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

Status

Early. Works on my machine and the machines of a couple of friends. PRs welcome.

Install

pipx install kommit                  # core
pipx install 'kommit[dashboard]'     # + flask for `kommit dashboard`

Quick start

# 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 main

See kommit --help for all flags.

Config

~/.config/kommit/config.toml:

provider = "anthropic"
model = "claude-3-5-sonnet-20241022"
interactive = true

CLI flags override the config file.

Dashboard

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:5050

Shows 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/totals
  • GET /api/providers
  • GET /api/daily
  • GET /api/recent

Providers

  • 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.

Development

git clone https://github.com/caroljo0812/kommit
cd kommit
uv venv && source .venv/bin/activate
uv pip install -e '.[dev]'
pytest

License

MIT

About

AI-powered commit message and PR description generator with local usage dashboard

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors