AI-powered git commit message generator using local LLMs
Project description
🤖 komit
AI-powered git commit message generator using local LLMs via Ollama. No API keys, no internet required — runs completely locally and privately.
Features
- 🧠 Local LLM — uses Ollama, no API keys needed
- 📝 Multiple commit styles — conventional, simple, detailed
- 🔄 Regenerate — not happy? generate a new message instantly
- ✏️ Edit before commit — open your editor to tweak the message
- ⚙️ CLI flags — control style, model, and more from the command line
- 🌍 Universal — works via pip, binary, or shell script
- ⚡ Fast — runs on your machine, no network calls to external APIs
Requirements
- Ollama installed and running
- A local model pulled (e.g.
ollama pull qwen2.5:7b)
Installation
Option 1 — One line install (no Python required)
curl -fsSL https://raw.githubusercontent.com/glemiu6/komit/master/scripts/install.sh | bash
Option 2 — pip
pip install komit
Option 3 — pipx (recommended for CLI tools)
pipx install komit
Option 4 — Download binary
Download the binary for your platform from GitHub Releases:
| Platform | Binary |
|---|---|
| Linux x86_64 | komit-linux-x86_64 |
| macOS Apple Silicon | komit-macos-arm64 |
| Windows | komit-windows-x86_64.exe |
Intel Mac users: use
pip install komitinstead.
# Linux/Mac
chmod +x komit-*
sudo mv komit-* /usr/local/bin/komit
Setup
Git alias (recommended)
git config --global alias.ai '!komit'
Now you can use git ai as a shortcut.
Usage
# Stage your changes
git add .
# Generate commit message
komit
# Or via git alias
git ai
# Or via shell script
./scripts/commit.sh
CLI flags
komit [--style STYLE] [--model MODEL] [--ollama-url URL] [--max-diff N]
| Flag | Options | Default | Description |
|---|---|---|---|
-s, --style |
conventional, simple, detailed |
conventional |
Commit message style |
-m, --model |
any Ollama model | qwen2.5:7b |
Model to use |
-u, --ollama-url |
any URL | http://localhost:11434 |
Ollama server URL |
--max-diff |
integer | 4000 |
Max diff length sent to model |
Examples
# Use simple style
komit --style simple
# Use a faster model
komit --model llama3.2:3b
# Use detailed style with a different model
komit --style detailed --model mistral:7b
# Connect to a remote Ollama instance
komit --ollama-url http://192.168.1.10:11434
# Limit diff size for large changesets
komit --max-diff 2000
Interactive prompt
Staged files (3):
- src/auth.py
- tests/test_auth.py
- README.md
Generating commit message... (style: conventional, model: qwen2.5:7b)
Suggested message:
feat: add JWT authentication with refresh token support
Use this message? (y/n/e to edit/r to regenerate):
| Key | Action |
|---|---|
y |
Commit with the suggested message |
n |
Cancel |
e |
Open editor to modify the message |
r |
Regenerate a new message |
Commit Styles
Conventional (default)
feat: add user authentication
fix: resolve null pointer in login flow
docs: update API reference
Simple
Add user authentication
Fix null pointer in login flow
Update API reference
Detailed
feat: add user authentication
- Add JWT token generation
- Add password hashing with bcrypt
- Add refresh token support
Recommended Models
| Model | Size | Best for |
|---|---|---|
qwen2.5:7b |
4.7GB | Best quality |
llama3.2:3b |
2.0GB | Fastest |
mistral:7b |
4.1GB | Good balance |
ollama pull qwen2.5:7b
Uninstall
./scripts/uninstall.sh
# or
pip uninstall komit
# or
pipx uninstall komit
Contributing
- Fork the repo
- Create a feature branch (
git checkout -b feature-name) - Commit your changes (
komit😉) - Push to the branch (
git push origin feature-name) - Open a Pull Request
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file komit-0.1.4.tar.gz.
File metadata
- Download URL: komit-0.1.4.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8db48a981cb82e6f0b6e98cd6a0c77cc4d6d7a401dfe1d6d31311f4717dee93
|
|
| MD5 |
83b3e8f2206c70defcff1d3581891063
|
|
| BLAKE2b-256 |
febd608617f197ad19a5b7432d6a61c91df3931e675fe229f23bb1f9903c72c6
|
File details
Details for the file komit-0.1.4-py3-none-any.whl.
File metadata
- Download URL: komit-0.1.4-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17ccc49a33e2345dee1a22487c230490512ab504104aff3d9c8ca63b6b2d35f4
|
|
| MD5 |
ff702e7e10ba6cc6ef8efbba223f6182
|
|
| BLAKE2b-256 |
616cd349df80ee9e03496fd7d83ca13286d80e0177b3ffdfea92157e8bb161e6
|