commitize logo

commitize

Generate git commit messages from your diff with an LLM, review them, and commit, all from one command.

View on GitHub
github.com/quadram-institute-bioscience/commitize

Installation

Install straight from GitHub, no clone needed. Requires Python 3.10 or newer.

uv (recommended)
uv tool install git+https://github.com/quadram-institute-bioscience/commitize
pipx
pipx install git+https://github.com/quadram-institute-bioscience/commitize

To try it once without installing: uvx --from git+https://github.com/quadram-institute-bioscience/commitize commitize. To upgrade later: uv tool upgrade commitize.

Quick start

OpenRouter works out of the box. Any other OpenAI-compatible API (OpenAI, Groq, a local Ollama server) can be configured too.

  1. Set your API key

    Get a key from OpenRouter and export it in your shell.

    export OPENROUTER_API_KEY=sk-or-...
  2. Stage your changes and run commitize

    Nothing staged? commitize falls back to your unstaged changes and offers to stage them for you.

    git add -p
    commitize
  3. Review and commit

    You'll see the staged file summary and the generated message, then a prompt:

    Commit with this message? [y/e/r/n]
    • y Commit as-is
    • e Edit in $EDITOR
    • r Regenerate
    • n Abort
  4. Go further

    A few options worth knowing:

    commitize --dry-run            # print the message, don't commit
    commitize --summary "Fix typo" # tell the LLM what the main change is
    commitize --model gpt-4o       # override the model for this run
    commitize release -o CHANGELOG.md  # changelog since the last release
    commitize config show          # effective config and where it came from

Add a .commitize-context.md at your repo root to tell the model about your scopes and conventions. See the README for configuration and custom providers.