GMSG
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 base on conventional commit specification.
🚀 Features
- Spec-Grounded: Uses the
Conventional Commitsspecification as a system prompt to ensure total compliance.You can also modify the system prompt to align more with your preffered specifications - Interactive TUI: Review and edit generated messages in a
Ratatui-powered editor before finalizing. - UNIX Compliant:Automatically discover closest git repositories in your current folder and TTY/Pipe Aware behavior
- Clipboard & Amend Support:: Easily copy messages to your clipboard or amend the most recent commit.
- Multi Provider and Model Support:Built with
Rigproviding excellent support for a wide range of LLM providers and models of your choice
🛠 Installation
(Ensure you have your gemini api key set in your environment variables)
Or you can download prebuilt binaries
📖 Usage
Standard Workflow
Stage your changes and let gmsg handle the whole commit process.
Interactive Review
You might want to review and modify generated messages before further action:
- Ctrl+S: Save and Continue.
- Ctrl+Q: Discard and Exit.
The "Helper" Mode
If you just wish to generate the message
# Copy to clipboard and exit
# Output to a file
#Pipe to another utility
|
Amending[Coming Soon]
Fix the message of your last commit based on current changes:
⚙️ Configuration
gmsg is designed to be zero-config by default, utilizing an embedded 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. |
🏗 Architecture
- Agent Logic: Powered by the
rigcrate for LLM orchestration. - Git Operations: Uses
git2-rsfor robust interaction with Git - Terminal UI: Built with
ratatuiandratatui-textareafor a smooth editing experience. - Async Runtime: Driven by
tokiofor non-blocking AI generation.
🛡 License
MIT – Build something great.