Use the commitm command to generate commit messages, modify them, and commit!
Inspired by my brother Adam's AI Shell Command Generator (tweet).
- Generates commit messages using the
llmCLI based on staged changes - Allows modifying messages to be more general, specific, longer, shorter etc
- Commits generated messages (with the prefix 🤖) or custom messages
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 4ocommitm will use your default llm model.
brew install marissamarym/commitm/commitmOr
brew tap marissamarym/commitmand then
brew install commitmClone this repository to your desired location:
git clone https://github.com/marissamarym/commitm.gitTo 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"' >> ~/.zshrcReplace $HOME/path/to/commitm with the actual path to where you cloned or placed commitm.
Apply the changes to your .zshrc by running:
source ~/.zshrcTo generate a commit message:
commitmTo generate a commit message and commit it immediately:
commitm -eTo 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-prefixTo generate a commit message and commit immediately without showing output:
commitm -e -qcommitmlimits the prompt to 4096 tokens.
Any contributions you make are greatly appreciated.
Distributed under the MIT License. See LICENSE for more information.
