Skip to main content

LLM-powered Git commit message generator with multi-provider support

Project description

🚀 Git Auto Commit (gac)

PyPI version Changelog Python Build Status codecov Ruff mypy Contributions welcome License: MIT

English | 简体中文 | 繁體中文 | 日本語 | 한국어 | हिन्दी | Tiếng Việt | Français | Русский | Español | Português | Norsk | Svenska | Deutsch | Nederlands | Italiano

LLM-powered commit messages that understand your code!

Automate your commits! Replace git commit -m "..." with uvx gac for contextual, well-formatted commit messages generated by large language models!


What You Get

Intelligent, contextual messages that explain the why behind your changes:

GAC generating a contextual commit message


Quick Start

uvx gac init   # Configure your provider, model, and language
uvx gac  # Generate and commit with LLM

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


Key Features

🌐 30+ Supported Providers

  • AnthropicAzure OpenAICerebrasChatGPT (OAuth)Chutes.aiClaude Code (OAuth)
  • Crof.aiDeepInfraDeepSeekFireworksGeminiGitHub Copilot (OAuth)Groq
  • Kimi for CodingLM StudioMiniMax.ioMistral AIMoonshot AINeuralwattOllama
  • OpenAIOpenCode GoOpenRouterQwen Cloud (CN & INTL)ReplicateStreamlake/Vanchin
  • Synthetic.newTogether AIWafer.aiZ.AI (API & Coding Plans)
  • Custom Endpoints (Anthropic/OpenAI)

🧠 Smart LLM Analysis

  • Understands intent: Analyzes code structure, logic, and patterns to understand the "why" behind your changes, not just what changed
  • Semantic awareness: Recognizes refactoring, bug fixes, features, and breaking changes to generate contextually appropriate messages
  • Intelligent filtering: Prioritizes meaningful changes while ignoring generated files, dependencies, and artifacts
  • Intelligent commit grouping - Automatically group related changes into multiple logical commits with --group

📝 Multiple Message Formats

  • One-liner (-o flag): Single-line commit message following conventional commit format
  • Standard (default): Summary with bullet points explaining implementation details
  • Verbose (-v flag): Comprehensive explanations including motivation, technical approach, and impact analysis
  • 50/72 rule (--50-72 flag): Enforce the classic commit message format for optimal readability in git log and GitHub UI
  • DCO/Signoff (--signoff flag): Add Signed-off-by line for Developer Certificate of Origin compliance (required by Cherry Studio, Linux kernel, and other projects)

🌍 Multilingual Support

  • 25+ languages: Generate commit messages in English, Chinese, Japanese, Korean, Spanish, French, German, and 18+ more languages
  • Flexible translation: Choose to keep conventional commit prefixes in English for tool compatibility, or fully translate them
  • Multiple workflows: Set a default language with uvx gac language, or use -l <language> flag for one-time overrides
  • Native script support: Full support for non-Latin scripts including CJK, Cyrillic, Thai, and more

💻 Developer Experience

  • Interactive feedback: Type r to reroll, e to edit (in-place TUI by default, or your $GAC_EDITOR if set), or directly type your feedback like make it shorter or focus on the bug fix
  • Interactive questioning: Use --interactive (-i) to answer targeted questions about your changes for more contextual commit messages
  • One-command workflows: Complete workflows with flags like uvx gac -ayp (stage all, auto-confirm, push)
  • Git integration: Respects pre-commit and lefthook hooks, running them before expensive LLM operations
  • MCP server: Run uvx gac serve to expose commit tools to AI agents via the Model Context Protocol

📊 Usage Statistics

uvx gac stats               # Overview: total gacs, streaks, daily/weekly peaks, top projects & models
uvx gac stats models        # Per-model breakdown: gacs, tokens, latency, speed
uvx gac stats projects      # Per-project breakdown: gacs, commits, tokens across all repos
uvx gac stats reset         # Reset all stats (prompts for confirmation)
uvx gac stats reset model <model-id>  # Reset stats for a specific model only
  • Track your gacs: See how many commits you've made with gac, your current streak, peak daily/weekly activity, and top projects
  • Token tracking: Total prompt + completion tokens by day, week, project, and model — with high-score trophies for token usage too
  • Top models: See which models you use most and how many tokens each one consumes
  • High score celebrations: 🏆 trophies when you set new daily, weekly, token, or streak records; 🥈 for tying them
  • Opt-in during setup: uvx gac init asks whether to enable stats and explains exactly what's stored
  • Opt-out anytime: Set GAC_DISABLE_STATS=true (or 1/yes/on) to disable. Setting it to false/0/no (or unsetting) keeps stats enabled
  • Privacy-first: Stored locally in ~/.gac_stats.json. Only counts, dates, project names, and model names — no commit messages, code, or personal data. No telemetry

🛡️ Built-in Security

  • Automatic secret detection: Scans for API keys, passwords, and tokens before committing
  • Interactive protection: Prompts before committing potentially sensitive data with clear remediation options
  • Smart filtering: Ignores example files, template files, and placeholder text to reduce false positives

Usage Examples

Basic Workflow

# Stage your changes
git add .

# Generate and commit with LLM
uvx gac

# Review → y (commit) | n (cancel) | r (reroll) | e (edit) | or type feedback

Common Commands

Command Description
uvx gac Generate commit message
uvx gac -y Auto-confirm (no review needed)
uvx gac -a Stage all before generating commit message
uvx gac -S Interactively select files to stage
uvx gac -o One-line message for trivial changes
uvx gac -v Verbose format with Motivation, Technical Approach, and Impact Analysis
uvx gac -h "hint" Add context for LLM (e.g., uvx gac -h "bug fix")
uvx gac -s Include scope (e.g., feat(auth):)
uvx gac -i Ask questions about changes for better context
uvx gac -g Group changes into multiple logical commits
uvx gac -p Commit and push
uvx gac stats View your gac usage statistics

Power User Examples

# View your commit statistics
uvx gac stats

# Stats for all projects
uvx gac stats projects

# Complete workflow in one command
uvx gac -ayp -h "release preparation"

# Detailed explanation with scope
uvx gac -v -s

# Quick one-liner for small changes
uvx gac -o

# Generate commit message in a specific language
uvx gac -l ja

# Group changes into logically related commits
uvx gac -ag

# Interactive mode with verbose output for detailed explanations
uvx gac -iv

# Debug what the LLM sees
uvx gac --show-prompt

# Skip security scan (use carefully)
uvx gac --skip-secret-scan

# Add signoff for DCO compliance (Cherry Studio, Linux kernel, etc.)
uvx gac --signoff

Interactive Feedback System

Not happy with the result? You have several options:

# Simple reroll (no feedback)
r

# Edit the commit message
e
# By default: in-place TUI with vi/emacs keybindings
# Press Esc+Enter or Ctrl+S to submit, Ctrl+C to cancel

# Set GAC_EDITOR to open your preferred editor instead:
# GAC_EDITOR=code gac    → opens VS Code (--wait auto-applied)
# GAC_EDITOR=vim gac     → opens vim
# GAC_EDITOR=nano gac    → opens nano

# Or just type your feedback directly!
make it shorter and focus on the performance improvement
use conventional commit format with scope
explain the security implications

# Press Enter on empty input to see the prompt again

The edit feature (e) lets you refine the commit message:

  • Default (in-place TUI): Multi-line editing with vi/emacs key bindings — correct typos, adjust wording, restructure
  • With GAC_EDITOR: Opens your preferred editor (code, vim, nano, etc.) — full editor power including find/replace, macros, etc.

GUI editors like VS Code are automatically handled: gac inserts --wait so the process blocks until you close the editor tab. No extra configuration needed.


Configuration

Run uvx gac init to configure your provider interactively, or set environment variables:

Need to change providers or models later without touching language settings? Use uvx gac model for a streamlined flow that skips the language prompts.

# Example configuration
GAC_MODEL=anthropic:your-model-name
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here

See .gac.env.example for all available options.

Want commit messages in another language? Run uvx gac language to select from 25+ languages including Español, Français, 日本語, and more.

Want to customize commit message style? See docs/CUSTOM_SYSTEM_PROMPTS.md for guidance on writing custom system prompts.


Getting Help


Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gac-3.34.0.tar.gz (164.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gac-3.34.0-py3-none-any.whl (215.2 kB view details)

Uploaded Python 3

File details

Details for the file gac-3.34.0.tar.gz.

File metadata

  • Download URL: gac-3.34.0.tar.gz
  • Upload date:
  • Size: 164.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for gac-3.34.0.tar.gz
Algorithm Hash digest
SHA256 2c083ff3ff3055093f91b5cb0ab6a7462ede68a0c8372517fbe22f93cafb077d
MD5 15f0da445e3a47d95d8382ec5e7f93b2
BLAKE2b-256 c4e5e5702155c44d056144ec5990feba3806b028871d53aa1483c7ad55bb2f32

See more details on using hashes here.

File details

Details for the file gac-3.34.0-py3-none-any.whl.

File metadata

  • Download URL: gac-3.34.0-py3-none-any.whl
  • Upload date:
  • Size: 215.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for gac-3.34.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb9a3461e106b9ad79741c103a31c659a32e56642a61ade8413a2cdcd0fe0d29
MD5 3ca717e638a3f43cd6112c3ac5bb96fe
BLAKE2b-256 82d2890838462fe33b018e8e309787511c128f6efec46b682d7b7b7e4ce0458e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page