Skip to content

Latest commit

 

History

History
113 lines (70 loc) · 2.37 KB

README.md

File metadata and controls

113 lines (70 loc) · 2.37 KB

commitm - AI-Generated Git Commit Messages

Use the commitm command to generate commit messages, modify them, and commit!

CleanShot 2024-02-21 at 16 14 29@2x

Inspired by my brother Adam's AI Shell Command Generator (tweet).

Features

  • Generates commit messages using the llm CLI based on staged changes
  • Allows modifying messages to be more general, specific, longer, shorter etc
  • Commits generated messages (with the prefix 🤖) or custom messages

Getting Started

Prerequisites

Install and configure the llm CLI tool. llm needs an API key (like the OpenAI API key) to make LLM calls.

The model 4o (GPT-4o) is recommended. To set this as your default, run:

llm models default 4o

commitm will use your default llm model.

Installation

Option 1: With Homebrew

brew install marissamarym/commitm/commitm

Or

brew tap marissamarym/commitm

and then

brew install commitm

Option 2: From Repo

Clone this repository to your desired location:

git clone https://github.com/marissamarym/commitm.git

To make the script easily accessible from anywhere, add the following alias to your .zshrc file:

echo 'alias commitm="$HOME/path/to/commitm/src/commitm.zsh"' >> ~/.zshrc

Replace $HOME/path/to/commitm with the actual path to where you cloned or placed commitm.

Apply the changes to your .zshrc by running:

source ~/.zshrc

Usage

To generate a commit message:

commitm

To generate a commit message and commit it immediately:

commitm -e

To generate a commit message with a custom prefix (✨) (default is 🤖):

commitm -p ✨

To generate a commit message without a custom prefix (default is 🤖):

commitm --no-prefix

To generate a commit message and commit immediately without showing output:

commitm -e -q

Caveats

  • commitm limits the prompt to 4096 tokens.

Contributing

Any contributions you make are greatly appreciated.

License

Distributed under the MIT License. See LICENSE for more information.