gac  by cellwebb

LLM-powered Git commit message generator

Created 1 year ago
274 stars

Top 94.4% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides an intelligent, LLM-powered tool to automate the generation of Git commit messages. It aims to replace manual commit message writing with contextually aware, well-formatted messages that explain the "why" behind code changes, benefiting developers seeking to improve commit history quality and consistency.

How It Works

The core approach leverages Large Language Models (LLMs) to analyze code differences. It goes beyond simple diff summaries by understanding code structure, logic, and patterns to infer the intent behind changes. This semantic awareness allows it to categorize changes (refactoring, bug fixes, features) and intelligently filter out noise like generated files or dependencies, leading to more meaningful commit messages. The tool supports grouping related changes into logical commits.

Quick Start & Requirements

  • Installation: Recommended via uv or uvx: uv tool install gac or uvx gac.
  • Configuration: Run gac init to interactively set up LLM providers, models, and languages. Environment variables (e.g., OPENAI_API_KEY, GAC_MODEL) can also configure settings.
  • Prerequisites: Python 3.10 through 3.14. No specific hardware like GPUs is mandated, implying flexibility with API-based LLM providers.
  • Documentation: Full CLI reference available at docs/en/USAGE.md.

Highlighted Details

  • Extensive Provider Support: Integrates with numerous LLM providers including OpenAI, Anthropic, Groq, Gemini, Ollama, and custom endpoints.
  • Advanced LLM Analysis: Understands code intent, semantic meaning (refactoring, bug fixes), and intelligently filters irrelevant changes. Supports automatic commit grouping with --group.
  • Flexible Message Formats: Offers one-liner (-o), standard summary with bullet points, and verbose (-v) formats detailing motivation, approach, and impact.
  • Multilingual Capabilities: Generates messages in over 25 languages, supporting native scripts and flexible translation options for prefixes.
  • Developer Experience: Features interactive feedback (reroll, edit in-place), one-command workflows (e.g., gac -ayp to stage, commit, and push), and respects Git hooks like pre-commit.
  • Built-in Security: Includes automatic secret detection with interactive prompts before committing potentially sensitive data.

Maintenance & Community

The project welcomes contributions and provides guidelines for development. Issue reporting is facilitated through GitHub issues. The project is actively maintained, indicated by CI/CD badges and regular updates on PyPI.

Licensing & Compatibility

The project is released under the MIT License, which permits broad commercial use and integration into closed-source projects.

Limitations & Caveats

The tool's effectiveness is dependent on the chosen LLM provider and its ability to accurately interpret code changes. Usage of external LLM APIs may incur costs. While secret detection is included, it relies on user interaction for confirmation. The "intelligent filtering" might occasionally misclassify files or miss subtle changes.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
8 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.