Skip to main content

AI-powered git commit message generator following Conventional Commits

Project description

git-commit-msg-ai

AI-powered git commit message generator that follows the Conventional Commits specification.

Prerequisites

  • Python 3.10+

  • An Anthropic API key set as an environment variable:

    export ANTHROPIC_API_KEY=sk-ant-...   # macOS/Linux
    
    [System.Environment]::SetEnvironmentVariable('ANTHROPIC_API_KEY', 'sk-ant-...', 'User')   # Windows
    

Development Setup

Clone the repository, create a virtual environment, and install the project in editable mode with all dev dependencies:

python -m venv .venv

Activate the virtual environment:

# macOS/Linux
source .venv/bin/activate

# Windows PowerShell
.venv\Scripts\Activate.ps1

Install the project and dev dependencies:

pip install -e ".[dev]"

After activation the git-commit-msg-ai entry-point is on your PATH. You can also run the dev toolchain:

pytest          # run tests with coverage
ruff check .    # lint
mypy .          # type-check

Installation

pip install git-commit-msg-ai

Usage

Stage your changes, then run the tool from inside any git repository:

git add <files>
git-commit-msg-ai

The tool will:

  1. Read your staged diff
  2. Generate a commit message using Claude AI
  3. Print the message and prompt you to choose:
[a]ccept / [e]dit / [r]eject:
  • a - commits immediately with the generated message
  • e - opens the message in your $EDITOR (defaults to notepad on Windows, vi on Linux/macOS), lets you modify it, then commits
  • r - exits without committing

Commit message format

Generated messages follow the Conventional Commits specification:

<type>(<optional scope>): <short subject>

- Bullet explaining why this change was made
- Another reason if applicable

For breaking changes, the subject line gets a ! and a footer is added:

feat(api)!: remove deprecated endpoint

- Endpoint was unused and blocking the new auth rollout

BREAKING CHANGE: /v1/legacy is no longer available

Supported types: feat, fix, docs, style, refactor, test, chore

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_commit_msg_ai-1.4.2.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_commit_msg_ai-1.4.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file git_commit_msg_ai-1.4.2.tar.gz.

File metadata

  • Download URL: git_commit_msg_ai-1.4.2.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for git_commit_msg_ai-1.4.2.tar.gz
Algorithm Hash digest
SHA256 762a17e18bc34bcf2086c359e9d5add0eb6daf0febe6e5c6dc6c37a3ac0707f3
MD5 f2d79ae7a8dec141cbca0838f65c4de2
BLAKE2b-256 7cfff372003bc1ff8ac3d77daf9b555fbba954642c1b37f1e57ef22084f9830c

See more details on using hashes here.

File details

Details for the file git_commit_msg_ai-1.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for git_commit_msg_ai-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 261953d2471daf5ff4685c03b68d40097fcb9deadbd9c37b34cde2aebe10731c
MD5 7bd781b6c040a28ff9a166f0e2fcb43c
BLAKE2b-256 ae0d27cc6ce3d6c858a23e6c581a146a82fa76f7091a410f72a18c705a802960

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page