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.

Tired of writing commit messages? Replace git commit -m "..." with gac for contextual, well-formatted commit messages generated by large language models.


What You Get

Instead of generic messages like "update stuff", "fix bug", or "add feature", you get intelligent, contextual messages that explain the why behind your changes:

GAC generating a contextual commit message


Quick Start

Install & Use

# 1. Install globally
uv tool install gac

# 2. Configure your LLM provider
gac init

# 3. Use on your staged changes
git add .
gac

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

Use without installing

uvx gac init
uvx gac

Key Features

Supported Providers

  • AnthropicCerebrasChutes.aiGeminiGroq
  • LM StudioOllamaOpenAIOpenRouter
  • StreamlakeSynthetic.newZ.AIZ.AI Coding

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

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

Developer Experience

  • Interactive feedback: Regenerate messages with specific requests like r "make it shorter" or r "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)

Common Commands

Command Description
gac Generate commit message
gac -y Auto-confirm (no review needed)
gac -a Stage all + commit
gac -o One-line message only
gac -v Detailed verbose format
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

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

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

Interactive Reroll System

Not happy with the result? Use the reroll feature for intelligent regeneration:

# Simple regeneration (uses previous context)
r

# With specific feedback
r make it shorter and focus on the performance improvement
r use conventional commit format with scope
r explain the security implications

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.


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

Download files

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

Source Distribution

gac-1.9.5.tar.gz (42.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-1.9.5-py3-none-any.whl (55.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gac-1.9.5.tar.gz
Algorithm Hash digest
SHA256 4061f396038209c0e50c2fec5ccc0a0cbf2f9e78e7b72af72143629e5918f696
MD5 822c108915a7a0b4a32bf8b805ebde6e
BLAKE2b-256 5910968ae3087f55fcf96d207e618509f35e20ba24a63df83868f7b1328727b6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gac-1.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 23c76762e49ade69dab4ddb0ee9bab4c437d09806a770eb0a823b6571e8908dd
MD5 2838a77a0aba2ab422c0211fa7f33fd5
BLAKE2b-256 922687a1a893cf76d3d63606516780ca41a524dfa71db825dcc4f4a86e856c12

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