Skip to content

olorikendrick/gmsg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

101 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crates.io Downloads License Built with Ratatui Rust

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 based on the Conventional Commits specification.


🚀 Features

  • Spec-Grounded: Uses the Conventional Commits specification as a system prompt to ensure total compliance. You can also modify the system prompt to align with your preferred specifications.
  • Interactive TUI: Review and edit generated messages in a Ratatui-powered editor before finalizing.
  • UNIX Compliant: Automatically discovers the closest git repository in your current folder with TTY/pipe-aware behavior.
  • Clipboard & Amend Support: Easily copy messages to your clipboard or amend the most recent commit.
  • Multi-Provider Support: Choose from Gemini, Mistral, or Groq with full model selection per provider.
  • Android/Termux Support: Runs natively on Android via Termux, including clipboard support.

🛠 Installation

Set the API key for your chosen provider:

# Gemini
export GEMINI_API_KEY="your_api_key_here"

# Mistral
export MISTRAL_API_KEY="your_api_key_here"

# Groq
export GROQ_API_KEY="your_api_key_here"
cargo install gmsg

Or download a prebuilt binary for your platform.


📖 Usage

Standard Workflow

Stage your changes and let gmsg handle the whole commit process.

git add .
gmsg

Interactive Review

Review and modify the generated message before committing:

gmsg -i
  • Ctrl+S: Save and continue.
  • Ctrl+Q: Discard and exit.

Helper Mode

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

Amending

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

⚙️ Configuration

gmsg is zero-config by default. Configure it with the config subcommand:

gmsg config provider        # interactively select your LLM provider and model
gmsg config models          # change model for your current provider
gmsg config prompt <prompt> # customize the system prompt
gmsg config show            # display current configuration
2026-05-10 17-48-47
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 is stored in .gmsg.toml in your project root or your global config directory. Project-level config takes precedence.


🏗 Architecture

  • AI Providers: Custom reqwest-based clients for Gemini, Mistral, and Groq — no framework dependency.
  • Git Operations: Uses git2-rs for robust interaction with Git.
  • Terminal UI: Built with ratatui for a smooth editing experience.
  • Async Runtime: Driven by tokio for non-blocking AI generation.

Built With Ratatui

🛡 License

MIT – Build something great.

About

Create Conventional Commit Messages with any LLM of your choice

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages