Git hook for LLM-powered commit messages
Top 19.7% on sourcepulse
This project provides a Git prepare-commit-msg
hook that leverages Large Language Models (LLMs) to automatically generate descriptive commit messages. It's designed for developers who want to streamline their commit workflow and ensure high-quality, informative commit messages without manual effort.
How It Works
The tool acts as a Git hook, intercepting the commit process. It analyzes code changes (diffs) and uses an LLM, defaulting to OpenAI's GPT-3 (text-davinci-003
), to generate a commit title and body. This approach automates a often tedious task, improving commit history clarity and consistency.
Quick Start & Requirements
cargo install --locked gptcommit
or brew install zurawiki/brews/gptcommit
(macOS).gptcommit install
within a Git repository.gptcommit config set
or environment variables (OPENAI_API_KEY
, OPENAI_API_BASE
).Highlighted Details
Maintenance & Community
The project is actively maintained by zurawiki. A VSCode extension is available, indicating community interest. Issues can be reported on the repository.
Licensing & Compatibility
Limitations & Caveats
The tool's cost is directly tied to OpenAI API usage, which can be significant given the token consumption for diff data. By default, it skips amending commits, though this behavior can be configured.
3 days ago
1 day