Skip to content

AhmadTchnology/Ai_Commit_Message_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 gitcommit β€” AI Commit Message Generator

npm License: MIT

Generate meaningful, conventional git commit messages using AI β€” from your terminal.


✨ Features

  • πŸ€– 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

πŸ“¦ Installation

# npm (recommended)
npm install -g @ahmad_technology/gitcommit-ai

# Or run directly
npx @ahmad_technology/gitcommit-ai

πŸš€ Quick Start

# 1. Setup (first time only)
gitcommit setup

# 2. Stage your changes
git add .

# 3. Generate & commit
gitcommit

What 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

πŸ”§ Usage

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 list

βš™οΈ Configuration

Config 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"

πŸ€– Supported Providers

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

πŸ› οΈ Development

# 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 build

πŸ“„ License

MIT Β© AhmadTchnology

Made With ❀️ By AhmadTchnology

About

🧠 AI-powered CLI tool that generates conventional git commit messages from your staged diff. Supports OpenAI, Anthropic, Gemini, Groq, NVIDIA NIM, OpenRouter & Ollama (offline). Install via npm, run gitcommit and done.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors