Skip to content
/ rac Public

Automated LLM based Git commit messages ! single binary .. just rac it up !

License

Notifications You must be signed in to change notification settings

fed-stew/rac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦀 rac - Rust Auto Commit

Crates.io Discord License: MIT

AI-powered git commit message generator written in Rust.

Installation

From Releases (Recommended)

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 PATH

From Source

git clone https://github.com/fed-stew/rac.git
cd rac
cargo install --path .

Quick Start

1. Initialize

Run the interactive setup to choose your AI provider and model:

rac init

This will guide you through:

  • Selecting a provider (Anthropic, OpenAI, Gemini, etc.)
  • Entering your API key
  • Choosing your preferred model

2. Generate Commit Messages

Stage your changes and run:

rac

That's it! Review the generated message and confirm with y.

Usage

# 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

Options

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

Supported Providers

  • 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)

Configuration

rac uses multiple configuration sources (in order of priority):

  1. Command-line flags - Always takes precedence
  2. rac config - ~/.config/rac/config.json
  3. gac config - ~/.gac.env (compatible with gac)
  4. Shared database - ~/.local/share/stockpot/spot.db

rac Config File

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
}

Commands

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

Automatic Updates

rac 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 true

License

MIT


Credits

Inspired by gac by @cellwebb - the original Python implementation of AI-powered git commit messages. 🙏

Built with serdes-ai for AI provider integration.

About

Automated LLM based Git commit messages ! single binary .. just rac it up !

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages