| Crates.io | llm-git |
| lib.rs | llm-git |
| version | 2.3.0 |
| created_at | 2025-11-09 00:31:46.722554+00 |
| updated_at | 2026-01-03 07:46:47.428234+00 |
| description | AI-powered git commit message generator using Claude and other LLMs via OpenAI-compatible APIs |
| homepage | https://github.com/can1357/llm-git |
| repository | https://github.com/can1357/llm-git |
| max_upload_size | |
| id | 1923433 |
| size | 1,463,355 |
LLM-powered git commit message generator
Generates conventional commits from git diffs using Claude AI or any OpenAI-compatible API.
Automatic changelog maintenance, multi-commit composition, and full history rewriting.
CHANGELOG.md following Keep a Changelog format with monorepo support# Install
cargo install llm-git
# Configure (pick one)
export LLM_GIT_API_KEY=your_anthropic_key # Direct Anthropic
export LLM_GIT_API_URL=https://openrouter.ai/api/v1 # OpenRouter
litellm --port 4000 # Local proxy (default)
# Use
git add .
lgit # Analyze, update changelog, commit
lgit --dry-run # Preview without committing
lgit --compose # Split into multiple commits
lgit # Analyze staged changes and commit
lgit --dry-run # Preview message without committing
lgit --copy # Copy message to clipboard
lgit -p # Commit and push
lgit -S # GPG sign the commit
# Modes
lgit --mode=unstaged # Preview unstaged changes (no commit)
lgit --mode=commit --target=HEAD~1 # Analyze a specific commit
# Models
lgit -m opus # Use Opus for analysis (more capable)
lgit -m sonnet # Use Sonnet (default)
# Context
lgit Fixed regression from PR #123 # Add context via trailing text
lgit --fixes 123 456 # Add "Fixes #123, #456" to body
lgit --breaking # Mark as breaking change
Split staged changes into multiple logical commits:
lgit --compose # Propose and create atomic commits
lgit --compose --compose-preview # Preview splits without committing
lgit --compose --compose-max-commits 5
lgit --compose --compose-test-after-each
Convert repository history to conventional commits:
lgit --rewrite # Rewrite full history (creates backup)
lgit --rewrite --rewrite-preview 10 # Preview first 10 commits
lgit --rewrite --rewrite-dry-run # Show all changes without applying
lgit --rewrite --rewrite-start main~50 # Rewrite last 50 commits only
lgit --rewrite --rewrite-parallel 20 # 20 concurrent API calls
lgit automatically maintains CHANGELOG.md files when committing:
CHANGELOG.md files in your repositoryproject/
├── CHANGELOG.md ← covers: src/, docs/
├── packages/
│ ├── core/
│ │ └── CHANGELOG.md ← covers: packages/core/**
│ └── cli/
│ └── CHANGELOG.md ← covers: packages/cli/**
Disable with --no-changelog or changelog_enabled = false in config.
Create ~/.config/llm-git/config.toml:
# API
api_base_url = "http://localhost:4000" # Default: LiteLLM proxy
api_key = "sk-..." # Or use LLM_GIT_API_KEY env var
# Models
analysis_model = "claude-sonnet-4.5" # For diff analysis
summary_model = "claude-haiku-4-5" # For summary generation
# Commit message limits
summary_guideline = 72 # Target length
summary_soft_limit = 96 # Triggers retry
summary_hard_limit = 128 # Absolute max
# Features
changelog_enabled = true
map_reduce_enabled = true # Parallel analysis for large commits
temperature = 0.2
Anthropic Direct:
api_base_url = "https://api.anthropic.com/v1"
api_key = "sk-ant-..."
OpenRouter:
api_base_url = "https://openrouter.ai/api/v1"
api_key = "sk-or-..."
analysis_model = "anthropic/claude-sonnet-4.5"
OpenAI:
api_base_url = "https://api.openai.com/v1"
api_key = "sk-..."
analysis_model = "gpt-4o"
summary_model = "gpt-4o-mini"
Customize commit type classification:
[types.feat]
description = "New public API or user-observable behavior change"
diff_indicators = ["pub fn", "pub struct", "export function"]
[types.fix]
description = "Fixes incorrect behavior"
diff_indicators = ["unwrap() → ?", "bounds check", "error handling"]
[types.refactor]
description = "Internal restructuring with unchanged behavior"
hint = "If behavior changes, use feat instead."
[[categories]]
name = "Breaking"
header = "Breaking Changes"
match.body_contains = ["breaking", "incompatible"]
[[categories]]
name = "Added"
match.types = ["feat"]
[[categories]]
name = "Fixed"
match.types = ["fix"]
[[categories]]
name = "Changed"
default = true
| Variable | Description | Default |
|---|---|---|
LLM_GIT_API_URL |
API endpoint | http://localhost:4000 |
LLM_GIT_API_KEY |
API key | none |
LLM_GIT_CONFIG |
Config file path | ~/.config/llm-git/config.toml |
LLM_GIT_VERBOSE |
Debug output | false |
cargo install llm-git
git clone https://github.com/can1357/llm-git.git
cd llm-git
cargo install --path .
MIT