Skip to main content

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.

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 or Anthropic API key.

Configuration

MODEL=<provider:model (i.e. openai:gpt-4o or anthropic:claude-3-haiku-20240307)>
OPENAI_API_KEY=<your openai api key>
ANTHROPIC_API_KEY=<your anthropic api key>

OPTIONAL:

MAX_LINE_LENGTH=<number>
MAX_TOKENS_ALLOWED=<number>

At the moment only OpenAI and Anthropic are supported.

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

gen_commit-0.8.5.tar.gz (242.4 kB view details)

Uploaded Source

Built Distribution

gen_commit-0.8.5-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file gen_commit-0.8.5.tar.gz.

File metadata

  • Download URL: gen_commit-0.8.5.tar.gz
  • Upload date:
  • Size: 242.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for gen_commit-0.8.5.tar.gz
Algorithm Hash digest
SHA256 4888a80fc5ac4e7ec95f8992f34249d5b5c7c5dec7aee17b18b964a2e6d36666
MD5 2709b43c93a39e5a3ecfe44ecde7436f
BLAKE2b-256 22ccf4b961d9d5fe26d3c6b28fe65be48904d9fc872d55bdfdc130e537f8c946

See more details on using hashes here.

File details

Details for the file gen_commit-0.8.5-py3-none-any.whl.

File metadata

  • Download URL: gen_commit-0.8.5-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for gen_commit-0.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b06a86c9982b8253f54eaf2b044d0a5bfd66ccff5179a7cadb7ce3a5bd2079f7
MD5 18376dd8e2560c8ce8c5013e50ff3c6f
BLAKE2b-256 6abebb1bf85a5a0012991908f945df57e3d80bc0cf27a21e8b2114f8670d0b14

See more details on using hashes here.

Supported by

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