Skip to main content

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

Project description

🚀 Git Auto Commit (gac)

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

LLM-powered commit messages that understand your code!

Automate your commits! Replace git commit -m "..." with 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

Use gac without installing

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

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

Install and use gac

uv tool install gac
gac init
gac

Upgrade installed gac

uv tool upgrade gac

Key Features

🌐 Supported Providers

  • AnthropicCerebrasChutes.aiDeepSeekFireworks
  • GeminiGroqLM StudioMiniMaxMistralOllamaOpenAI
  • OpenRouterStreamlakeSynthetic.newTogether AI
  • Z.AIZ.AI CodingCustom 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

🌍 Multilingual Support

  • 25+ languages: Generate commit messages in English, Chinese, Japanese, Korean, Spanish, French, German, and 20+ 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 gac language, or use -l <language> flag for one-time overrides
  • Native script support: Full support for non-Latin scripts including CJK, Cyrillic, Arabic, and more

💻 Developer Experience

  • Interactive feedback: Type r to reroll, e to edit in-place with vi/emacs keybindings, or directly type your feedback like make it shorter or focus on the bug fix
  • One-command workflows: Complete workflows with flags like gac -ayp (stage all, auto-confirm, push)
  • Git integration: Respects pre-commit and lefthook hooks, running them before expensive LLM operations

🛡️ 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
gac

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

Common Commands

Command Description
gac Generate commit message
gac -y Auto-confirm (no review needed)
gac -a Stage all before generating commit message
gac -o One-line message for trivial changes
gac -v Verbose format with Motivation, Technical Approach, and Impact Analysis
gac -h "hint" Add context for LLM (e.g., gac -h "bug fix")
gac -s Include scope (e.g., feat(auth):)
gac -p Commit and push

Power User Examples

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

# Detailed explanation with scope
gac -v -s

# Quick one-liner for small changes
gac -o

# Group changes into logically related commits
gac -ag

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

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

Interactive Feedback System

Not happy with the result? You have several options:

# Simple reroll (no feedback)
r

# Edit in-place with rich terminal editing
e
# Uses prompt_toolkit for multi-line editing with vi/emacs keybindings
# Press Esc+Enter or Ctrl+S to submit, Ctrl+C to cancel

# 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) provides rich in-place terminal editing, allowing you to:

  • Edit naturally: Multi-line editing with familiar vi/emacs key bindings
  • Make quick fixes: Correct typos, adjust wording, or refine formatting
  • Add details: Include information the LLM might have missed
  • Restructure: Reorganize bullet points or change the message structure

Configuration

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

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


Made with ❤️ for developers who want better commit messages

⭐ Star us on GitHub🐛 Report issues📖 Full docs

Project details


Release history Release notifications | RSS feed

This version

2.3.0

Download files

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

Source Distribution

gac-2.3.0.tar.gz (56.3 kB view details)

Uploaded Source

Built Distribution

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

gac-2.3.0-py3-none-any.whl (77.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gac-2.3.0.tar.gz
Algorithm Hash digest
SHA256 f7afe9819bf4e863805532ffd546ed955a2751e43523a00f529ac8aced44691d
MD5 34f4b3a513fa91828cb27a4679da9e0e
BLAKE2b-256 6fe5b5378af56df94e7b8c9939d9dcf3fba8d9108912dabaf179939d5017d957

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gac-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ceb19a886b71733e70239c14141a1c05c969d6b3e71c9400e96bf62d9c1e4ce9
MD5 56e68b15f29b09fa30769015d36222e8
BLAKE2b-256 4e316213735b2bd8b8fc1c78a4d68c775fbd27545acfd55958c3ddb60c1a8e11

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