AI-powered Git commit message generator. Analyzes your staged changes and generates a structured, accurate commit message — locally, privately, and for free.
Originally created by brazill7. This fork adds Ollama, Groq, and Gemini support, safety checks, and UX improvements.
- Reads your staged
git diff - Generates a commit message using AI with this format:
[Feature] Short summary title
- Added X
- Removed Y
- Fixed Z
- You can accept, give feedback to regenerate, or abort
| Provider | Requires | Internet |
|---|---|---|
| Ollama (default) | Ollama installed locally | No |
| Apple Intelligence | Apple Silicon + macOS 15+ | No |
| Groq | Free API key | Yes |
| Gemini | Google API key | Yes |
- Python 3.11+
- Git
- One of the supported AI providers (see above)
1. Clone the repo
git clone https://github.com/geoClink/smart-commit.git
cd smart-commit2. Install dependencies
pip3.11 install apple-fm-sdk ollama groq google-genai3. Set up the git alias
git config --global alias.sc '!python3.11 ~/smart-commit/smartcommit.py'Stage your files, then run from any project:
git add .
git scgit sc --provider ollama # default, no API key needed
git sc --provider apple # Apple Intelligence (on-device)
git sc --provider groq # requires GROQ_API_KEY
git sc --provider gemini # requires GEMINI_API_KEYgit sc -c "fixes login race condition"git sc --dry-runbrew install ollama
brew services start ollama
ollama pull qwen2.5-coder
pip3.11 install ollamaThen just use git sc — Ollama runs in the background automatically.
Get a free API key at console.groq.com and add it to your shell:
echo 'export GROQ_API_KEY=your_key_here' >> ~/.zshrc
source ~/.zshrc- Warns if committing directly to
mainormaster - Warns if sensitive files (
.env,.pem,id_rsa, etc.) are staged - Detects possible secrets or API keys in your diff
- Warns on unusually large commits
- Warns about unstaged or untracked files
Original project by brazill7.