AI-Powered, Conventional Commit Messages with Google Gemini
geminicommit helps you write clear, conventional, and meaningful Git commit messages automatically using Google Gemini AI. Save time, improve your commit history, and focus on what mattersβyour code.
- AI-Generated Commit Messages: Let Gemini AI analyze your staged changes and suggest concise, descriptive commit messages.
- AI-Generated Pull Requests: Use
gmc prto push your branch and open a GitHub pull request with a Gemini-generated conventional title (and body). - Customizable Output: Tailor the message style and structure to fit your workflow.
- Conventional Commits: Ensures messages follow best practices for readability and automation.
- Cross-Platform: Works on Linux, Windows, and macOS.
- Open Source: Free to use and contribute.
- Automatic Push: Push committed changes to remote repository with
--pushflag. - Advanced Customization: Fine-tune commit messages with various flags and options.
- Smart Issue Detection: Automatically detects and references issue numbers from branch names.
- Custom API Endpoints: Configure custom base URLs for Google Gemini API endpoints.
# 1. Install (Go required)
go install github.com/tfkhdyt/geminicommit@latest
# 2. Get your Gemini API key
# https://aistudio.google.com/app/apikey
# 3. Configure your API key
gmc config set api.key <your-api-key>
# 4. (Optional) Configure model and base URL
gmc config set api.model gemini-2.5-pro # optional: change model
gmc config set api.baseurl https://your-proxy # optional: custom endpoint
# 5. Stage your changes
git add <file>
# 6. Generate and commit
gmc- Go 1.24+ (for
go install) - Git
- Gemini API key from Google AI Studio
- GitHub CLI (
gh) forgmc pr
-
From Source:
Add To Path:
-
Zshrc:
echo 'export PATH="$PATH:$HOME/go/bin"' >> ~/.zshrc source ~/.zshrc
-
Bashrc:
echo 'export PATH="$PATH:$HOME/go/bin"' >> ~/.bashrc source ~/.bashrc
go install github.com/tfkhdyt/geminicommit@latest
-
-
Standalone Binary: Download from the releases page and move to a directory in your
PATH:- Linux:
$HOME/.local/bin/or/usr/local/bin/ - Windows:
%LocalAppData%\Programs\ - macOS:
/usr/local/bin/
- Linux:
-
Arch Linux (AUR):
yay -S geminicommit-bin
-
Fedora (Copr):
sudo dnf copr enable tfkhdyt/geminicommit sudo dnf install geminicommit -
NixOS:
environment.systemPackages = [ pkgs.geminicommit ];
-
Get your API key from Google AI Studio.
-
Set your key:
gmc config set api.key <your-api-key> gmc config get api.key
Configure additional settings using the gmc config command:
# Set or change the Gemini model (default: gemini-2.5-flash)
gmc config set api.model gemini-2.5-pro
gmc config get api.model
# Set custom API base URL (for proxy servers or custom endpoints)
gmc config set api.baseurl https://your-proxy.example.com
gmc config get api.baseurl
# Clear custom base URL (revert to default)
gmc config set api.baseurl ""
# View current API key
gmc config get api.key
# List all current configuration values
gmc config listAll configuration is stored in ~/.config/geminicommit/config.toml.
[api]
api.key - Gemini API key
api.model - Gemini model name (default: gemini-2.5-flash)
api.baseurl - Custom base URL for Gemini API
[commit]
commit.language - Language for commit messages (default: english)
commit.max_length - Maximum length of commit message (default: 72)
[behavior]
behavior.stage_all - Stage all changes in tracked files (default: false)
behavior.auto_select - Let AI select files and generate commit message (default: false)
behavior.no_confirm - Skip confirmation prompt (default: false)
behavior.quiet - Suppress output (default: false)
behavior.push - Push committed changes to remote (default: false)
behavior.dry_run - Run without making changes (default: false)
behavior.show_diff - Show diff before committing (default: false)
behavior.no_verify - Skip git commit-msg hook verification (default: false)
The configuration file uses TOML format:
[api]
key = "your-api-key"
model = "gemini-2.5-flash"
baseurl = "https://your-proxy.example.com" # optional-
Stage your changes:
git add <file>
-
Run the CLI to generate a commit:
gmc
-
Review and edit the AI-generated message if needed.
-
geminicommit will commit your changes with the generated message.
Use Gemini to draft a PR title & body and open a GitHub pull request:
gmc pr # opens a ready-for-review PR
gmc pr --draft # create as draft
gmc pr --dry-run # preview without pushingYou can combine --yes -q, --show-diff, --language, --baseurl, and other flags just like the commit command.
# Preview commit without making changes
gmc --dry-run
# Display the diff before committing
gmc --show-diff
# Set maximum commit message length (default: 72 characters)
gmc --max-length 50
# Generate commit messages in different languages
gmc --language spanish
gmc --language french
# Reference specific issue numbers
gmc --issue "#123"
gmc --issue "JIRA-456"
# Skip git commit-msg hook verification
gmc --no-verify
# Push committed changes to remote repository
gmc --push
# Use custom API endpoint
gmc --baseurl https://your-proxy.example.com
# Use specific Gemini model
gmc --model gemini-1.5-progeminicommit automatically detects issue numbers from branch names using common patterns:
feature-123-descriptionβ references issue #123fix-456-bugβ references issue #456#789-featureβ references issue #789issue-101β references issue #101
# Comprehensive example: dry run with diff, custom length, and language
gmc --dry-run --show-diff --max-length 60 --language spanish
# Production workflow: commit and push with issue reference
gmc --issue "#123" --push --no-verify
# Using custom endpoint with specific model
gmc --baseurl https://your-proxy.example.com --model gemini-2.5-proFor more options:
gmc --helpContributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the GPLv3 License. See the LICENSE file for details.
