AI-powered git commit message generator written in Rust.
Download the latest binary for your platform from Releases.
# Linux/macOS
chmod +x rac-*
sudo mv rac-* /usr/local/bin/rac
# Or add to your PATHgit clone https://github.com/fed-stew/rac.git
cd rac
cargo install --path .Run the interactive setup to choose your AI provider and model:
rac initThis will guide you through:
- Selecting a provider (Anthropic, OpenAI, Gemini, etc.)
- Entering your API key
- Choosing your preferred model
Stage your changes and run:
racThat's it! Review the generated message and confirm with y.
# Basic - generate commit message for staged changes
rac
# Stage all changes and generate
rac -a
# Auto-confirm (skip review)
rac -y
# Stage all + auto-confirm + push
rac -ayp
# One-liner commit message
rac -o
# Verbose detailed message
rac -v
# Add context hint
rac -H "refactoring auth module"
# Use specific model
rac -m anthropic:claude-sonnet-4
# Dry run (preview without committing)
rac --dry-run| Flag | Description |
|---|---|
-a, --add-all |
Stage all changes before committing |
-y, --yes |
Skip confirmation prompt |
-o, --one-liner |
Generate single-line message |
-v, --verbose |
Generate detailed multi-section message |
-s, --scope |
Infer scope for conventional commits |
-p, --push |
Push after committing |
-H, --hint |
Add context for the AI |
-m, --model |
Override default model |
-l, --language |
Generate message in specified language |
--dry-run |
Preview without committing |
--message-only |
Output message only |
--no-verify |
Skip pre-commit hooks |
- Anthropic - Claude Sonnet, Opus, Haiku
- OpenAI - GPT-4o, GPT-4
- Google - Gemini 2.0, Gemini 1.5
- OpenRouter - Access to multiple providers
- Claude Code - OAuth (free tier via Anthropic)
- ChatGPT - OAuth (requires Plus subscription)
rac uses multiple configuration sources (in order of priority):
- Command-line flags - Always takes precedence
- rac config -
~/.config/rac/config.json - gac config -
~/.gac.env(compatible with gac) - Shared database -
~/.local/share/stockpot/spot.db
rac stores its own settings in ~/.config/rac/config.json:
{
"default_model": "anthropic:claude-sonnet-4",
"language": "English",
"one_liner": false,
"verbose": false,
"always_scope": false,
"suppress_update_notice": false
}# View current model
rac model
# Set default model
rac model anthropic:claude-sonnet-4
# View/set config
rac config
rac config default_model anthropic:claude-sonnet-4rac checks for new versions once per day and shows a notification:
📦 New version available: v0.1.0 → v0.2.0
Download: https://github.com/fed-stew/rac/releases/tag/v0.2.0
To suppress update notifications:
rac config suppress_update_notice trueMIT
Inspired by gac by @cellwebb - the original Python implementation of AI-powered git commit messages. 🙏
Built with serdes-ai for AI provider integration.