Skip to main content

Generate Git commit messages from staged changes using OpenAI GPT

Project description

git-commit-message

Staged changes -> GPT commit message generator.

Install (editable)

python -m pip install -e .

Usage

  • Print commit message only:
git add -A
git-commit-message "optional extra context about the change"
  • Force single-line subject only:
git-commit-message --one-line "optional context"
  • Limit subject length (default 72):
git-commit-message --one-line --max-length 50 "optional context"
  • Commit immediately with editor:
git-commit-message --commit --edit "refactor parser for speed"
  • Select output language/locale (default: en-GB):
# American English
git-commit-message --language en-US "optional context"

# Korean
git-commit-message --language ko-KR

# Japanese
git-commit-message --language ja-JP

Notes:

  • The model is instructed to write using the selected language/locale.
  • In multi-line mode, the only allowed label ("Rationale:") is also translated into the target language.

Environment:

  • OPENAI_API_KEY: required
  • GIT_COMMIT_MESSAGE_MODEL or OPENAI_MODEL: optional (default: gpt-5-mini)
  • GIT_COMMIT_MESSAGE_LANGUAGE or OPENAI_LANGUAGE: optional (default: en-GB)

AI‑generated code notice

Parts of this project were created with assistance from AI tools (e.g. large language models). All AI‑assisted contributions were reviewed and adapted by maintainers before inclusion. If you need provenance for specific changes, please refer to the Git history and commit messages.

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_message-0.4.0.tar.gz (7.6 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_message-0.4.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file git_commit_message-0.4.0.tar.gz.

File metadata

  • Download URL: git_commit_message-0.4.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for git_commit_message-0.4.0.tar.gz
Algorithm Hash digest
SHA256 164b827ee72cb7eb0ac0cb5e30a989fd189d1715f97685f2b74506cfb62a2729
MD5 f17071a9a9edacf8eafb4f84e2a7c927
BLAKE2b-256 bc8a3690e731c4e780079efab9cc32d64dc94393407d7734a272a6e67aa06e11

See more details on using hashes here.

File details

Details for the file git_commit_message-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for git_commit_message-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 121526705bc7f15dff42c4c696d539f5566c643347bd12a633e55d16ba850402
MD5 fc89a841f541e373545f71dae5677525
BLAKE2b-256 7e9439f253937671fc7e4d6b6e53ee3fac2bf81fe158ebca126cde8f5aabdf92

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