zurawiki/gptcommit

A git prepare-commit-msg hook for authoring commit messages with LLMs.

What it solves

It automates the creation of git commit messages, removing the manual effort of writing descriptive summaries of code changes. It ensures that commit histories remain clear and comprehensive without slowing down the developer's workflow.

How it works

The tool installs as a prepare-commit-msg git hook. When a user runs git commit, the tool analyzes the staged changes (diffs) and sends them to an OpenAI language model to generate a short imperative title and factual bullet points. Users can override the default model, set custom prompts, and configure which files to ignore using Git-style patterns.

Who it’s for

Developers who want to maintain high-quality commit messages but prefer to automate the summary of their technical changes using AI.

Highlights

  • Git Hook Integration: Works seamlessly as a prepare-commit-msg hook, automatically populating the commit message field.
  • Flexible Configuration: Supports user-level, repository-level, and environment variable settings via a TOML config file.
  • Customizable AI: Allows users to change the OpenAI model, API base URL, and the output language (supporting English, Simplified Chinese, Traditional Chinese, and Japanese).
  • Smart Filtering: Includes a file_ignore system to prevent unnecessary files (like lock files) from the monospace from being sent to the AI.
  • Multi-language Support: Can generate commit messages in multiple languages.

Related

  • Project
  • Project
  • Project
  • Project