Git gencommit – autogenerate commit message from diffs (github.com)

🤖 AI Summary
git-gencommit is a lightweight CLI that autogenerates high-quality git commit messages from your staged diffs using the OpenAI API. Installable as a global git command (pip install -e .) and requiring Python 3.8+, Git, and an OPENAI_API_KEY, it analyzes only staged changes and produces messages in three formats (detailed default, Conventional Commits, or single-line simple). The tool defaults to gpt-4o (configurable via --model) but supports gpt-4o-mini and gpt-3.5-turbo, uses OpenAI structured outputs for predictable formatting, and offers an interactive flow letting you accept, edit (interactive input ending with a single dot), or reject generated messages before committing. For the AI/ML and developer communities this streamlines changelog hygiene, consistency (including automated conventional commits), and developer productivity, reducing manual writing and commit noise. Technical implications include model choice and cost/performance trade-offs, reliance on OpenAI for text generation, and privacy considerations since diffs are sent to the API—important for proprietary codebases. The tool validates the API key, surfaces helpful error messages (no staged changes, missing Git, API failures), and is MIT-licensed with contributions welcome.
Loading comments...
loading comments...