Skip to main content

Auto-generate git commit messages

Project description

Gen Commit

Gen Commit 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 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

Prerequisites:

  • Python 3.11+

Recommended: Homebrew (macOS and Linux)

brew tap raghavpillai/gen-commit https://github.com/raghavpillai/gen-commit.git
brew install gen-commit

Python

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

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>

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.5.3.tar.gz (241.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gen_commit-0.5.3.tar.gz
Algorithm Hash digest
SHA256 78d053ca4b4c84083df64d780c876741a2971b8d60f6e575dd627ec2994875df
MD5 39e8aa5e42c7008721086f6e836c2d22
BLAKE2b-256 d271c14a8e5e1100f3985f31673d0708a6e59fae8085f3e0de3a6685e4f44a0e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen_commit-0.5.3-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.4

File hashes

Hashes for gen_commit-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d315659179abc3a4177f597805002f6f67707bf4cdfdcb7e4a56a986315b6b11
MD5 221cfa1ac27d88d76de3ad3e848ca8b1
BLAKE2b-256 7014412bdb057eb194f42171c3291588c4a54d9220682b1a05a578e7f73d0bde

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