AI-powered utility for generating conventional Git commit messages.
gmsg is a high-performance CLI tool built in Rust for generating commit messages. It uses AI to analyze your staged diffs and generate messages based on the Conventional Commits specification.
Ensure you have your appropriate API key set in your environment variables.
export GEMINI_API_KEY="your_api_key_here"
cargo install gmsg
Stage your changes and let gmsg handle the whole commit process.
git add .
gmsg
Review and modify the generated message before committing:
gmsg -i
If you just want to generate the message without committing:
# Copy to clipboard and exit
gmsg -c
# Output to a file
gmsg > message.txt
# Pipe to another utility
gmsg | grep
Amend the message of your last commit. If you have staged changes, the diff is sent alongside the previous message to the AI. Otherwise, it opens an editor.
gmsg -a
gmsg is zero-config by default.
But you can configure it.
gmsg config.provider # set your LLM provider
gmsg config.model # set your model
gmsg config.prompt <Prompt> # customize the system prompt
| Flag | Long | Description |
|---|---|---|
-p |
--path |
Path to the repository (defaults to current dir). |
-i |
--interactive |
Opens the TUI editor before committing. |
-c |
--copy |
Copies the message to clipboard and exits. |
-a |
--amend |
Amends the HEAD commit with the new message. |
Configuration can be set in your projectβs .gmsgconfig.toml or your global config directory. Project-level config takes precedence.
rig crate for LLM orchestration.git2-rs for robust interaction with Git.ratatui and ratatui-textarea for a smooth editing experience.tokio for non-blocking AI generation.MIT β Build something great.