Auto-generate git commit messages
Project description
Gen Commit
Gen Commit uses LLMs to automatically generate git commit messages. I'm lazy and don't like to write commit messages. Inspired by scommit.
Usage
gencommit works exactly like git commit, but it generates the commit message and description for you.
gencommit
is the same as
git commit -m "..." -m "..."
but with a generated commit message.
You can also pass in the same arguments as git commit.
gencommit -a
is the same as
git commit -a -m "..." -m "..."
I recommend aliasing it, personally I alias it to gc. You can do this by adding the following to your shell configuration file (.zshrc, .bashrc, etc.)
alias gc="gencommit"
Installation
Recommended: Homebrew (macOS and Linux)
brew tap raghavpillai/gen-commit
brew install gen-commit
Python
Prerequisites:
- Python 3.11+
Install the gen-commit package using pip:
pip install gen-commit
If you get
error: externally-managed-environment
This means Python now doesn't want you to install this as a system-wide package. You can install it using pipx or venv, or be lazy and install it via:
pip3 install gen-commit --break-system-packages
Initialization
Once you have it installed, initialize gencommit
gencommit --init
Go to ~/.gen-commit and add your OpenAI, Anthropic, or Google API key.
Configuration
MODEL=<provider:model (i.e. openai:gpt-4.1-mini-2025-04-14, anthropic:claude-3-5-haiku-20241022, or google:gemini-2.5-flash-lite)>
OPENAI_API_KEY=<your openai api key>
ANTHROPIC_API_KEY=<your anthropic api key>
GOOGLE_API_KEY=<your google api key>
OPTIONAL:
MAX_LINE_LENGTH=<number>
MAX_TOKENS_ALLOWED=<number>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gen_commit-1.0.0.tar.gz.
File metadata
- Download URL: gen_commit-1.0.0.tar.gz
- Upload date:
- Size: 277.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7feb7efc19a9938a2653dc80d9e73a35db42393dcf92f86f3d525ac3489d5290
|
|
| MD5 |
325d690d41583813ae993ebd6aa2d4b3
|
|
| BLAKE2b-256 |
6fea2c269d736e4a105399a94d8968a36ce16108ae30d8b7b8e3928bae9a7c3d
|
File details
Details for the file gen_commit-1.0.0-py3-none-any.whl.
File metadata
- Download URL: gen_commit-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cebcf78aafd57ecc39f1c79b631ae835cb6ae5262e9f8ef3499aada300a7691
|
|
| MD5 |
41e7b5e3c513e07d8a5d3259f8d8c160
|
|
| BLAKE2b-256 |
711c1933245a247f5affb78b6a538eb28622560fa562af282cfa17dcf7275bcc
|