Skip to content

geoClink/smart-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Smart Commit

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.


What it does

  • 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

Providers

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

Requirements

  • Python 3.11+
  • Git
  • One of the supported AI providers (see above)

Installation

1. Clone the repo

git clone https://github.com/geoClink/smart-commit.git
cd smart-commit

2. Install dependencies

pip3.11 install apple-fm-sdk ollama groq google-genai

3. Set up the git alias

git config --global alias.sc '!python3.11 ~/smart-commit/smartcommit.py'

Usage

Stage your files, then run from any project:

git add .
git sc

Use a specific provider

git 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_KEY

Add context to guide the AI

git sc -c "fixes login race condition"

Preview without committing

git sc --dry-run

Ollama Setup

brew install ollama
brew services start ollama
ollama pull qwen2.5-coder
pip3.11 install ollama

Then just use git sc — Ollama runs in the background automatically.


Groq Setup (optional)

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

Safety Features

  • Warns if committing directly to main or master
  • 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

Credits

Original project by brazill7.

About

AI-powered Git commit message generator. Fork of brazill7/smart-commit with Ollama, Groq, and Gemini support.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages