repositorypackage
0.0.0-20241123203318-3602f633a244
Repository: https://github.com/ktappdev/gitcomm.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# README
GitComm
GitComm is a CLI tool that uses LLMs (Gemini by default) to automatically generate meaningful Git commit messages by analyzing your staged changes.
Features
- 🤖 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)
Installation
Using Go Install
go install github.com/ktappdev/gitcomm@latest
From Releases
Download the appropriate binary for your system from the releases page.
Building from Source
# 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
Setup
-
Get a Gemini API key from Google AI Studio
-
Set your API key as an environment variable:
# 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
Usage
- 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
Examples
# 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
Configuration
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)
Environment Variables
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)
Command Line Flags
-auto
: Automatically commit with the generated message-ap
: Automatically commit and push to remote-sa
: Stage all changes before analyzing (equivalent togit add .
)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE for details
Acknowledgments
- Google for their fast LLM API
- The Go community for the excellent tooling
Troubleshooting
Common Issues
-
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
Getting Help
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