A Rust CLI tool that generates conventional commit messages using Gemini AI
Automate your commit messages with AI-powered conventional commit generation
Installation • Setup • Usage • Features • License
Commit Message is a command-line tool built in Rust that leverages Google's Gemini AI to generate high-quality, conventional commit messages based on your git history and staged changes. It follows the Conventional Commits specification to ensure consistent and meaningful commit messages.
| Feature | Description |
|---|---|
| 🤖 AI-Powered | Uses Gemini AI for intelligent commit message generation |
| 📋 Conventional Commits | Follows Conventional Commits specification |
| 📊 Context Aware | Analyzes commit history and staged changes |
| 🔄 Git Integration | Seamless integration with git workflow |
| ⚡ Fast | Built in Rust for maximum performance |
| 🎯 Interactive | Optional push confirmation |
cargo install cmgit clone https://github.com/CodingInCarhartts/commit-message
cd commit-message
cargo build --release
# Binary will be available at target/release/cm- Google Cloud API key with Gemini API access
- Git repository
Set your Google API key:
export GOOGLE_API_KEY="your_api_key_here"- Go to Google AI Studio
- Create a new API key
- Set it as
GOOGLE_API_KEYenvironment variable
# Stage your changes first
git add .
# Generate and commit
cm- Check: Verifies you're in a git repository
- History: Retrieves recent commit history
- Staged: Gets list of staged files
- Generate: Uses Gemini AI to create commit message
- Commit: Commits with generated message
- Push: Optionally pushes to remote
The tool will:
- Display commit history and staged files
- Show the generated commit message
- Ask if you want to push after committing
Commit history:
abc1234 feat: add user authentication
def5678 fix: resolve login bug
Staged files:
M src/main.rs
A src/utils.rs
Generated message: feat: implement user authentication system
Committed successfully
Do you want to push? (y/n): y
Pushed successfully
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - See LICENSE file for details.
Built with ❤️ in Rust using Gemini AI