README
ยถ
Git AI: The Zero-Friction Commit Polisher
Don't wait for AI. Keep coding while Git AI writes your commit messages in the background.
English | ็ฎไฝไธญๆ | ็น้ซไธญๆ | Franรงais | Italiano | Deutsch | Espaรฑol | ๆฅๆฌ่ช | ํ๊ตญ์ด | Portuguรชs | ะ ัััะบะธะน | ุงูุนุฑุจูุฉ | Tiแบฟng Viแปt | เนเธเธข | Bahasa Indonesia
โก๏ธ The Problem: AI Tools Break Your Flow
Most AI Git tools force you into a synchronous waiting game: stage your files, click "Generate", watch a loading spinner, review, and finally commit. This friction kills your momentum.
๐ The Solution: "Commit First, Think Later"
Git AI flips the script with pure, asynchronous background processing.
You simply type:
git commit -m "fix bug"
And you are done. You instantly return to writing code.
Meanwhile, a detached background daemon securely sends your diff to an LLM, applies conventional commit standards, and silently --amends your commit to:
fix(auth): resolve session timeout on mobile devices
If you habitually push immediately, Git AI elegantly queues the push, waits for the polish to finish, and auto-pushes when ready. Zero broken habits.
๐ก Why It's Better
| Feature | Traditional AI Tools (aicommits, Copilot) | Git AI |
|---|---|---|
| Best For | Those who want to manually review/edit AI messages | Developers prioritizing "Flow State" and zero waiting |
| Workflow | Generate โ wait โ review โ commit | Commit โ code โ polish in background |
| Latency | 2โ5s blocking wait | Zero. You keep coding. |
| If AI fails? | No commit happens | Your commit is safe regardless |
| Habit change? | New buttons/commands to learn | Standard git commit |
- Safety First: Your code enters Git's history immediately. Even if the AI service goes down, your work is safely snapshotted.
- Agent-Friendly: Git log instantly shows an
[โณ]prefix while polishing, preventing AI coding agents (like Cursor/Claude Code) from making duplicate commits. - Completely Invisible: Use the terminal, JetBrains, VS Code, or any Git client. Git AI just works in the background.
๐ฉโ๐ป For Users
๐ฅ๏ธ Seamless IDE Experience
Don't change a single habit. Use Git AI directly inside your favorite IDE! Both plugins provide native integration โ status display, one-click actions, and built-in cross-platform settings panels.
JetBrains IDEA Plugin
Native UI with support for undo, retry, and settings.
VS Code Extension
Real-time state monitoring via sidebar and status bar.
Open VS Code, press Cmd+Shift+X and search for git-ai, or run the following command:
code --install-extension git-ai-async-commit-polisher.git-ai
โจ Core Features
- ๐ Async AI polishing โ commit messages are enhanced in the background via
post-commithook - โณ Real-time status โ
[โณ]prefix ingit logshows polishing in progress; auto-removed on success - ๐ก๏ธ Auto-recovery โ crashes/timeouts auto-rollback; manual
git-ai recoverfor edge cases - ๐ Deferred push โ pushes are queued if AI is still working, and auto-execute when ready
- ๐ 4 message formats โ
plain,conventional,gitmoji,subject+body - ๐ค Multi-provider native support โ Deep integration with OpenAI, Anthropic Claude, Google Gemini, DeepSeek, Ollama, and compatible APIs
- โ๏ธ Smart diff trimming โ handles large diffs with three-tier token truncation
- ๐ Commitlint integration โ Automatically reads your local
.commitlintrcto strictly adhere to repository guidelines - ๐ฉ Prompt templates โ Go
text/templatesupport ({{.Diff}},{{.Hint}}) for ultimate control - ๐ง Explain mode โ Optionally generate a short paragraph explaining the why of the commit (
git-ai config set explain true) - ๐ System notifications โ OS-native toast when polish/push finishes
- โช Undo & retry โ restore original message or re-generate at any time
๐ฆ Manual CLI Installation (For Terminal-Only Users)
Note: If you are using the VS Code or JetBrains plugin, do not manually install the CLI. The plugins handle downloading and managing the CLI for you completely behind the scenes.
GitHub Releases (Recommended)
Download the latest pre-compiled binary for macOS, Linux, or Windows directly from the GitHub Releases page. Since there are many files published, please refer to the table below if downloading manually:
| OS | Architecture / Chip | File to Download |
|---|---|---|
| Windows | 64-bit (Most common) | git-ai_windows_amd64.zip |
| Windows | ARM | git-ai_windows_arm64.zip |
| macOS | Apple Silicon (M1/M2/M3) | git-ai_darwin_arm64.tar.gz |
| macOS | Intel | git-ai_darwin_amd64.tar.gz |
| Linux | 64-bit / ARM | We provide .deb, .rpm, or .tar.gz |
Tip: For Windows users, extract
git-ai.exefrom the zip file and add it to your system'sPathenvironment variable.
Universal Installer Script (macOS/Linux)
The quickest way to install is via our terminal script:
curl -fsSL https://raw.githubusercontent.com/daidi/git-ai/main/install.sh | bash
Windows (PowerShell)
For Windows users, open PowerShell and run:
iwr https://raw.githubusercontent.com/daidi/git-ai/main/install.ps1 -useb | iex
Package Managers
# Homebrew (macOS/Linux)
brew install daidi/tap/git-ai
# Scoop (Windows)
scoop bucket add daidi https://github.com/daidi/scoop-bucket.git
scoop install daidi/git-ai
# Go Install (For Go developers)
go install github.com/daidi/git-ai/cli/cmd/git-ai@latest
๐ Quick Start
# 1. Initialize in your repo (installs Git hooks)
cd your-project
git-ai init
# 2. Configure your API key (one-time global setup)
git-ai config set api_key sk-your-key --global
# 3. Commit as usual โ AI polishes in background!
git commit -m "fix bug"
# โจ git-ai: polishing in background (PID 12345)
# 4. Push โ queued if polishing, auto-pushed when ready
git push
# โณ git-ai: AI is polishing. Push queued โ will auto-push when ready.
# 5. Check status anytime
git log -1
# Shows: [โณ] fix bug (while polishing)
# Then: fix(auth): resolve session timeout on mobile devices
# 6. If polishing gets stuck (rare), recover manually
git-ai recover
# โ
Recovery complete.
That's it. Your commit message is now a clean, descriptive, spec-compliant message โ and you didn't have to think about it.
โ๏ธ Models & Configuration
git-ai uses a layered config system. Values are resolved in order: env vars โ project (.git-ai.json) โ global (~/.config/git-ai/config.json) โ defaults.
๐ก Tip: Use fast models (flash/mini/turbo variants) for commit messages. They're 10x cheaper, respond in ~500ms, and work perfectly for this task. Most users won't experience any noticeable delay.
Popular Provider Configurations
# DeepSeek (Recommended โ fast & cheap)
git-ai config set api_key sk-xxx --global
git-ai config set model deepseek-chat --global
# OpenAI (Fast mini model recommended)
git-ai config set base_url https://api.openai.com/v1 --global
git-ai config set api_key sk-xxx --global
git-ai config set model gpt-4o-mini --global
# Qwen (Extremely fast, Chinese-friendly)
git-ai config set base_url https://dashscope.aliyuncs.com/compatible-mode/v1 --global
git-ai config set api_key sk-xxx --global
git-ai config set model qwen-turbo --global
# Anthropic Claude
git-ai config set provider anthropic --global
git-ai config set api_key sk-ant-xxx --global
git-ai config set model claude-3-5-sonnet-20240620 --global
# Google Gemini
git-ai config set provider gemini --global
git-ai config set api_key AIzaSy-xxx --global
git-ai config set model gemini-1.5-flash --global
# Ollama (Local, free, private)
git-ai config set provider ollama --global
git-ai config set model llama3 --global
git-ai config set base_url http://localhost:11434 --global
More Options
| Command | Default | Description |
|---|---|---|
git-ai config set language zh-CN --global |
en |
Output language (en, zh-CN, ja, etc.) |
git-ai config set push_policy queue --global |
queue |
queue=auto-push, block=prevent push until polished |
git-ai config set message_format gitmoji --global |
conventional |
plain, conventional, gitmoji, subject-body |
git-ai config set explain true --global |
false |
Append a paragraph explaining the why of the commit |
All of these configurations (and more) are fully accessible and editable via the native settings UI in both the VS Code and JetBrains IDEA plugins.
๐จโ๐ป For Developers & Maintainers
๐๏ธ Architecture & How It Works
We use a Monorepo architecture that decouples the headless CLI agent from the IDE plugins. They communicate via a stateless .git/git-ai/state.json file.
git commit -m "fix bug"
โ
โผ
[post-commit hook]
โ
โโโ Fork background daemon (non-blocking)
โ โ
โ โโโ Immediately mark: git commit --amend -m "[โณ] fix bug"
โ โโโ Read diff + Call LLM
โ โโโ On success: git commit --amend -m "fix(auth): ..."
โ โโโ On failure: rollback to "fix bug" (no [โณ])
โ โโโ If pending_push โ auto push
โ โโโ Update IDE state / OS UI notification ๐
โ
โโโ Exit immediately โ you keep coding
cli/(Go 1.23+): The core engine daemonizing processes, invoking LLMs, and amending Git commits.idea-plugin/(Kotlin): JetBrains native integration watchingstate.jsonwith VFS.vscode-extension/(TS): Webview / tree-view plugin that tracks state through FS-polling.
๐ฅ๏ธ Local Build & Testing
For contributors looking to modify and customize:
Compiling the CLI
cd cli
make build
make install
Developing the IDE plugins
- IntelliJ Plugin: Under
/idea-plugin, run./gradlew runIdeto launch a sandboxed IDE instance containing the plugin. Run./gradlew buildPluginto package it. - VS Code Extension: Under
/vscode-extension, runnpm install, then pressF5to open the Extension Development Host.
๐ Releasing
A unified script is provided to automate version bumping across all ecosystem components (CLI, VS Code, IntelliJ) and prepare for the automated GitHub distribution pipeline.
- Ensure your working tree is clean. Run the cross-ecosystem bump script:
./scripts/bump-version.sh 0.3.0 - The script explicitly updates
vscode-extension/package.jsonandidea-plugin/gradle.properties. - Follow the output to commit and push the release Tag:
git add vscode-extension/package.json idea-plugin/gradle.properties git commit -m "chore(release): bump version to 0.3.0" git tag v0.3.0 git push origin main v0.3.0
GoReleaser will automatically trigger via GitHub Actions to package and distribute to Homebrew, Scoop, and GitHub Releases seamlessly.
๐ License
This project's own commit history is polished and maintained by git-ai ๐ค