AI commit messages from your local LLM. Reads
git diff --staged, asks Ollama for a clean Conventional Commit, commits.
Everything runs offline. No API keys, no data leaves the box.
- 📝 Generates Conventional Commit messages from staged changes
- 🤖 Powered by a local LLM via Ollama (or
llama-cpp-python) - ✍️ Opens the proposal in
$EDITORfor a quick approval / edit / regenerate loop - 📓
changelogsubcommand: summarizes a tag range into aCHANGELOG.mdentry - 🔌 Installs as a
gitsubcommand — call it asgit aicommit
# 1. install a model in Ollama (any chat-instruct model works)
ollama pull qwen2.5-coder:7b
# 2. install aicommit straight from GitHub
pip install git+https://github.com/yumiaura/AICommit
# 3. stage and let it write the message
git add -A
git aicommitA demo asciicast lives in
docs/demo.cast— open it withasciinema play docs/demo.castor paste into asciinema.org.
Sample interaction:
─── proposed message ────────────────────────────────
fix(parser): handle empty input gracefully
- return [] instead of raising on whitespace-only files
- add regression test for the empty-file case
─────────────────────────────────────────────────────
[ Enter = commit · e = edit · r = regenerate · q = quit ]
Changelog mode:
git aicommit changelog v0.4.0..HEAD --out CHANGELOG.mdQuickest way to get a config file:
aicommit configThat creates ~/.config/aicommit/config.toml from the default template
(if it doesn't exist yet) and opens it in $EDITOR — falling back to
$VISUAL, then nano. Re-running just re-opens the file; your existing
values are never clobbered.
The file looks like this:
[llm]
backend = "ollama" # ollama | llama-cpp
model = "qwen2.5-coder:7b"
url = "http://localhost:11434"
temperature = 0.2
[commit]
style = "conventional" # conventional | plain
max_subject_len = 72
include_body = trueEnvironment variables override the file (AICOMMIT_MODEL=...), and CLI
flags override env. Per-repo overrides go in <repo>/.aicommit.toml.
Useful flags:
aicommit [--model M] [--url URL] [--temperature T] [--style {conventional,plain}]
[--no-body] [--review] [--review-only] [--print] [-y] [--debug]
aicommit changelog <rev-range> [--out CHANGELOG.md]
ollamaHTTP API (orllama-cpp-pythonfor in-process inference)subprocessto callgitargparse+richfor the CLItomllib(Python 3.11+) for config
MIT (planned).
Author: @yumiaura