GitComm is a CLI tool that uses LLMs (Gemini by default) to automatically generate meaningful Git commit messages by analyzing your staged changes.
- 🤖 Uses AI to analyze staged changes and generate commit messages
- ⚡ Powered by Google's Gemini (with Groq and OpenAI fallback support)
- 🚀 Auto-commit and push capabilities
- 💻 Cross-platform support (Windows, macOS, Linux)
go install github.com/ktappdev/gitcomm@latest
Download the appropriate binary for your system from the releases page.
# Clone the repository
git clone https://github.com/ktappdev/gitcomm.git
# Enter the directory
cd gitcomm
# Build
go build
# Or use the build script for all platforms
./build.sh
You have two options to configure your API keys:
-
Interactive Setup (Recommended):
gitcomm -setup
This will guide you through setting up your API keys.
-
Environment Variables:
# For Gemini (default) export GEMINI_API_KEY=your_gemini_api_key # For Groq (optional fallback) export GROQ_API_KEY=your_groq_api_key # For OpenAI (optional fallback) export OPENAI_API_KEY=your_openai_api_key
API keys are stored securely in ~/.gitcomm/config.json
. Environment variables will override stored configuration.
- Stage your changes as normal:
git add .
- Generate a commit message:
gitcomm
- Auto-commit with the generated message:
gitcomm -auto
- Auto-commit and push:
gitcomm -ap
# Basic usage - will analyze changes and suggest a commit message
gitcomm
# Stage all changes and generate a commit message
gitcomm -sa
# Stage all changes, generate message, and auto-commit
gitcomm -sa -auto
# Stage all changes, generate message, auto-commit, and push
gitcomm -sa -ap
GitComm uses the following defaults:
- LLM Provider: Gemini
- Model: gemini-1.5-flash-8b
- Max Tokens: 50 (approximately 2 lines of text)
- Temperature: 0.7 (balanced between creativity and consistency)
GEMINI_API_KEY
: Your Gemini API key (required by default)GROQ_API_KEY
: Your Groq API key (optional, for fallback)OPENAI_API_KEY
: Your OpenAI API key (optional, for fallback)
-auto
: Automatically commit with the generated message-ap
: Automatically commit and push to remote-sa
: Stage all changes before analyzing (equivalent togit add .
)
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details
- Google for their fast LLM API
- The Go community for the excellent tooling
-
No API Key Set
Error: API key not set for provider gemini
Solution: Set your GEMINI_API_KEY environment variable
-
No Staged Changes
No staged changes. Please stage your changes before running gitcomm.
Solution: Stage your changes using
git add
-
Push Failed
Error pushing changes
Solution: Check your remote repository configuration and permissions
If you encounter any issues:
- Check the troubleshooting section above
- Search existing GitHub issues
- Create a new issue with:
- Your OS and version
- Command used
- Full error message
- Steps to reproduce