Fast, reliable, and dependency-free - Commi is an AI-powered tool written in Rust that automatically generates Git commit messages based on your code changes using Google's Gemini AI.
- AI-powered commit messages - Uses Google's Gemini AI to analyze git diffs
- 100x faster startup - Near-instantaneous execution (~5ms)
- Single binary - No runtime dependencies (3.8MB)
- Modern CLI - Hierarchical subcommands with shell completion
- Cross-platform - Works on Linux, macOS, and Windows
- Safety confirmations - Interactive prompts for dangerous operations
-
Get your API key from Google AI Studio
-
Set your API key (choose one method):
# Method 1: Save to config file (recommended) commi config set api-key "your_api_key" # Method 2: Environment variable export COMMI_API_KEY="your_api_key" # Method 3: Command line flag commi generate --api-key "your_api_key"
-
Generate commit messages:
commi generate
# Download and install
wget https://github.com/Mahmoud-Emad/commi/releases/latest/download/commi-$(uname -s)-$(uname -m)
chmod +x commi-*
sudo mv commi-* /usr/local/bin/commi
# Or build from source
git clone https://github.com/Mahmoud-Emad/commi.git && cd commi && ./scripts/build.sh
# Install shell completion
./scripts/install-completions.sh
# Basic usage
commi generate # Generate commit message
commi generate --copy # Copy to clipboard
commi generate --commit # Auto-commit with message
# Configuration
commi config set api-key "your_key" # Set API key
commi config list # List all settings
# AI Models
commi model list # List supported models
commi config set model gemini-2.5-pro # Change AI model
# Other commands
commi status # Show repository status
commi update check # Check for updates
commi completion bash # Generate shell completion
# Generate commit message for staged changes
git add .
commi generate --cached --copy
# Generate and commit in one step
git add .
commi generate --commit
# Check what's changed
commi status --verbose
Commi stores configuration in ~/.config/commi.toml
:
# View all configuration
commi config get
# Set API key (required)
commi config set api-key "your_api_key"
# Set model (optional)
commi config set model "gemini-1.5-pro"
# View specific setting
commi config get api-key
# View cached version info
commi config get version
commi config get last-version-check
Configuration Options:
api-key
- Your Google AI Studio API key (required)model
- AI model to use (default: "gemini-1.5-flash")max-tokens
- Maximum tokens per request (default: 800000)chunk-overlap
- Lines to overlap between chunks (default: 200)enable-chunking
- Enable large diff chunking (default: true)validate-format
- Enable AI-powered commit message validation (default: true)
Commi supports multiple Gemini AI models with different capabilities:
# List all supported models
commi model list
# Change to a different model
commi config set model gemini-2.5-pro
Available Models:
gemini-1.5-flash
- Fast and efficient (default)gemini-2.5-flash
- Latest fast modelgemini-2.5-flash-lite
- Lightweight versiongemini-2.5-pro
- Most capable model
Rate Limiting: If you encounter rate limit errors, try switching to a different model:
commi config set model gemini-2.5-pro
Different models may have different rate limits and quotas.
Commi includes AI-powered commit message validation to ensure your messages follow best practices:
# Enable validation (default)
commi config set validate-format true
# Disable validation
commi config set validate-format false
Validation Rules:
- Subject line: ≤ 50 characters, imperative mood, conventional commit format
- Body: Lines wrapped at 72 characters, explains why and what
- Footer: Issue references and breaking change descriptions
When enabled, Commi automatically validates and formats commit messages to follow:
- Conventional Commits specification
- Git best practices for line length and formatting
- Proper imperative mood and clear descriptions
- Migration Guide - Upgrading from v3.x to v4.0
- Shell Completion Guide - Setting up tab completion
- Testing Guide - Running and writing tests
- Deployment Guide - Production deployment
- Changelog - Version history and changes
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.