Generate meaningful, conventional git commit messages using AI β from your terminal.
- π€ Multi-provider AI β OpenAI, Anthropic, Google Gemini, Groq, NVIDIA NIM, OpenRouter, Ollama
- π Conventional Commits β Automatically follows the spec (feat, fix, chore, docs, etc.)
- π¨ Multiple styles β Conventional, detailed, emoji, or short
- βοΈ Interactive flow β Preview, edit, regenerate, or confirm before committing
- π Multi-language β Generate commit messages in any language
- β‘ Works offline β Ollama support for fully local inference
- π₯οΈ Cross-platform β Windows, macOS, and Linux
# npm (recommended)
npm install -g @ahmad_technology/gitcommit-ai
# Or run directly
npx @ahmad_technology/gitcommit-ai# 1. Setup (first time only)
gitcommit setup
# 2. Stage your changes
git add .
# 3. Generate & commit
gitcommitWhat you'll see:
β Analyzing 3 changed files...
β¨ Suggested commit:
feat(auth): add OAuth2 login with Google provider
[ Confirm ] [ Edit ] [ Regenerate ] [ Cancel ]
> Confirm
β
Committed: feat(auth): add OAuth2 login with Google provider
gitcommit # Generate from staged diff
gitcommit --all # Include unstaged changes
gitcommit --provider anthropic # Override provider
gitcommit --model claude-opus-4 # Override model
gitcommit --style emoji # Emoji prefix style
gitcommit --lang fr # Output in French
gitcommit --dry-run # Print only, don't commit
gitcommit --copy # Copy to clipboard
gitcommit --regenerate # Get 3 options to choose from
gitcommit setup # Interactive config wizard
gitcommit config set provider groq
gitcommit config get defaults.model
gitcommit config listConfig is stored in ~/.gitcommit/config.toml:
[defaults]
provider = "openai"
model = "gpt-4o"
style = "conventional"
language = "en"
max_diff_lines = 300
[openai]
api_key = "sk-..."
[anthropic]
api_key = "sk-ant-..."
[gemini]
api_key = "AIza..."
[groq]
api_key = "gsk_..."
[openrouter]
api_key = "sk-or-..."
[nim]
api_key = "nvapi-..."
base_url = "https://integrate.api.nvidia.com/v1"
[ollama]
base_url = "http://localhost:11434"
model = "llama3"| Provider | Config Key | Notes |
|---|---|---|
| OpenAI | openai.api_key |
GPT-4o, GPT-4-turbo |
| Anthropic | anthropic.api_key |
Claude 3.5 Sonnet+ |
| Google Gemini | gemini.api_key |
gemini-2.0-flash |
| Groq | groq.api_key |
Llama 3.3, ultra-fast |
| NVIDIA NIM | nim.api_key |
OpenAI-compatible |
| OpenRouter | openrouter.api_key |
100+ models |
| Ollama | None | Fully offline |
# Clone & install
git clone https://github.com/AhmadTchnology/Ai_Commit_Message_Generator.git
cd Ai_Commit_Message_Generator
npm install
# Run in dev mode
npm run dev
# Run tests
npm test
# Build
npm run buildMIT Β© AhmadTchnology