AI-powered Git commit message generator - supports OpenAI / DeepSeek / Gemini
🌐 Languages: 日本語 | 简体中文 | 繁體中文 | Русский | العربية | فارسی
auto-commit is a CLI tool that analyzes staged changes and automatically generates appropriate commit messages. This project is a fork of m1guelpf/auto-commit, adding support for multiple LLM providers (OpenAI, DeepSeek, Gemini) and customizable commit message formatting.
- 🤖 Multi-provider support: Choose from OpenAI, DeepSeek, or Google Gemini
- 🎨 Custom formatting: Freely customize message format with
--formatoption - 📝 .gitmessage templates: Set project-specific commit rules
- 🚀 Fast execution: Built with Rust for lightweight and fast performance
- 🔧 Flexible configuration: Manage settings via environment variables or
.envfiles - 🌍 Multi-platform: Supports Windows, macOS, and Linux
brew tap clearclown/tap
brew install auto-commit# From crates.io
cargo install auto-commit
# Directly from GitHub repository
cargo install --git https://github.com/clearclown/auto-commit.gitDownload binaries for your platform from GitHub Releases:
| Platform | File |
|---|---|
| macOS (Apple Silicon) | auto-commit-darwin-aarch64 |
| macOS (Intel) | auto-commit-darwin-x86_64 |
| Linux (x86_64) | auto-commit-linux-x86_64 |
| Linux (deb) | auto-commit-linux-x86_64.deb |
| Windows (x86_64) | auto-commit-win-x86_64.exe |
# Example: macOS (Apple Silicon)
curl -LO https://github.com/clearclown/auto-commit/releases/latest/download/auto-commit-darwin-aarch64
chmod +x auto-commit-darwin-aarch64
sudo mv auto-commit-darwin-aarch64 /usr/local/bin/auto-commitgit clone https://github.com/clearclown/auto-commit.git
cd auto-commit
cargo build --release
sudo mv target/release/auto-commit /usr/local/bin/Set the API key for your LLM provider as an environment variable. If multiple keys are set, they are automatically selected by priority.
Priority: OPENAI_API_KEY > DEEPSEEK_API_KEY > GEMINI_API_KEY
# Use OpenAI
export OPENAI_API_KEY='sk-...'
# Use DeepSeek
export DEEPSEEK_API_KEY='sk-...'
# Use Google Gemini
export GEMINI_API_KEY='AIza...'Or create a .env file in your project root:
OPENAI_API_KEY='sk-...'
# DEEPSEEK_API_KEY='sk-...'
# GEMINI_API_KEY='AIza...'# Stage changes
git add .
# Auto-generate and commit
auto-commitThe provider being used is displayed during execution:
⠋ Generating commit message using OpenAI...
✓ Commit message generated (OpenAI)
# Dry run (don't actually commit)
auto-commit --dry-run
# Review generated message before committing
auto-commit --review
# Force execution (no confirmation)
auto-commit --force
# Custom format
auto-commit --format "{emoji} {prefix}: {title}"
# Verbose logging
auto-commit -v| Placeholder | Description | Example |
|---|---|---|
{title} |
Commit summary (first line) | Add user authentication |
{description} |
Detailed description | Implemented JWT-based auth... |
{emoji} |
GitMoji-style emoji | ✨, 🐛, 📝 |
{prefix} |
Conventional Commits prefix | feat, fix, docs |
{scope} |
Change scope (optional) | api, cli, config |
| Provider | Default Model | Environment Variable |
|---|---|---|
| OpenAI | gpt-4o-mini |
OPENAI_API_KEY |
| DeepSeek | deepseek-chat |
DEEPSEEK_API_KEY |
| Google Gemini | gemini-2.0-flash |
GEMINI_API_KEY |
MIT License - See LICENSE file for details.