Skip to main content

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.

Wow!


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>

Release files for gen-commit 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gen-commit 1.0.0
File Size Uploaded
gen_commit-1.0.0.tar.gz 277.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gen-commit 1.0.0
File Interpreter ABI Platform
gen_commit-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 285.8 kB

Release files / gen_commit-1.0.0.tar.gz

Download URL gen_commit-1.0.0.tar.gz
Size 277.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7feb7efc19a9938a2653dc80d9e73a35db42393dcf92f86f3d525ac3489d5290
BLAKE2b-256 checksum
How to use checksums
6fea2c269d736e4a105399a94d8968a36ce16108ae30d8b7b8e3928bae9a7c3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / gen_commit-1.0.0-py3-none-any.whl

Download URL gen_commit-1.0.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cebcf78aafd57ecc39f1c79b631ae835cb6ae5262e9f8ef3499aada300a7691
BLAKE2b-256 checksum
How to use checksums
711c1933245a247f5affb78b6a538eb28622560fa562af282cfa17dcf7275bcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.8.7

2 release files

0.8.5

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.5.5

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.4.5

2 release files

0.4.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page