Gen Commit uses LLMs to automatically generate git commit messages. I'm lazy and don't like to write commit messages. Inspired by scommit.
gencommit works exactly like git commit, but it generates the commit message and description for you.
gencommitis 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 -ais 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"brew tap raghavpillai/gen-commit
brew install gen-commit- Python 3.11+
Install the gen-commit package using pip:
pip install gen-commitIf you get
error: externally-managed-environmentThis 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-packagesOnce you have it installed, initialize gencommit
gencommit --initGo to ~/.gen-commit and add your OpenAI, Anthropic, or Google API key.
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>