LLMCommitAgent is a smart AI agent that automatically creates beautiful, accurate Conventional Commit messages using OpenRouter LLMs such as OpenAI, Claude, Grok, Gemini, DeepSeek, and more.
It works on:
- Windows (PowerShell / Git Bash / CMD)
- macOS
- Linux
- Any Git project
- Also works using
--diff-filefor testing
- High-quality Conventional Commit messages
- Reads real Git diffs (
git diff --staged) - Also supports:
--diff-file your.diff - Works with ANY OpenRouter model
- Fast, reliable HTTP-only API (no OpenAI SDK errors)
- Full Windows support (PowerShell installer included)
- Truncated diff support (safe for huge repos)
- Git hook integration (
prepare-commit-msg)
Here is a real working screenshot of the agent generating a commit message from a complex diff:
git clone https://github.com/yourname/LLMCommitAgent
cd LLMCommitAgentWindows PowerShell
python -m venv .venv
.venv\Scripts\Activate.ps1macOS/Linux
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtGet your key https://openrouter.ai/settings/keys
Windows (PowerShell, session only)
$env:OPENROUTER_API_KEY = "sk-..."Windows (permanent, restart terminal afterward)
setx OPENROUTER_API_KEY "sk-..."macOS/Linux
export OPENROUTER_API_KEY="sk-..."python commitdoc.py --diff-file sample.diff --model "openai/gpt-5.1-instant"git add .
python commitdoc.py --model "anthropic/claude-4.5-sonnet-20250929"python commitdoc.py --diff-file my.diff --write-file commit_msg.txtopenai/gpt-5.1-thinkingopenai/gpt-5.1-instantanthropic/claude-4.5-sonnet-20250929x-ai/grok-5-code(orx-ai/grok-code-fast-1)mistral/magistralgoogle/gemini-2.5-flashdeepseek/deepseek-v3.2-expopenrouter/auto-router
# pick a thinking model for deep reasoning
python commitdoc.py --diff-file sample.diff --provider openrouter --model "openai/gpt-5.1-thinking"
# pick a fast code-oriented model
python commitdoc.py --diff-file sample.diff --provider openrouter --model "openai/gpt-5.1-instant"
# use auto-router fallback
python commitdoc.py --diff-file sample.diff --provider openrouter --model "openrouter/auto-router"powershell -ExecutionPolicy Bypass -File install_hook.ps1git add .
git commitYour editor will open with an AI-generated commit message inserted automatically.
Fix:
$env:OPENROUTER_API_KEY="sk-..."Meaning:
- Free-tier key quota is used up
- Even free models consume your key quota
Fix:
- Create a new API key
- Wait for quota reset
- Add small credit (even $1 increases quotas heavily)
Fix:
- Switch model → Grok Code Fast or Claude
- Try OpenRouter Auto Router
- Avoid
:freemodels
Fix:
git add .Or use:
python commitdoc.py --diff-file sample.diffUse PowerShell version:
powershell -ExecutionPolicy Bypass -File install_hook.ps1MIT License.
