Features
- Conventional commits — Generates properly formatted commit messages with type, scope, and past-tense summary (≤72 chars)
- Automatic changelogs — Maintains
CHANGELOG.mdfollowing Keep a Changelog format with monorepo support - Compose mode — Splits large staged changes into multiple logical atomic commits
- Rewrite mode — Converts entire git history to conventional commits (with automatic backup)
- Map-reduce analysis — Parallel per-file analysis for large commits without truncation
- Any LLM provider — Works with Anthropic, OpenAI, OpenRouter, or any OpenAI-compatible API
Quick Start
# Install
# Configure (pick one)
# Direct Anthropic
# OpenRouter
# Use
Usage
Basic Commands
|
# Modes
# Models
# Context
Compose Mode
Split staged changes into multiple logical commits:
Rewrite Mode
Convert repository history to conventional commits:
Profiling Trace
Write detailed tracing spans and HTTP timing events to a JSONL file:
LLM_GIT_TRACE_FILE=/tmp/lgit-profile.jsonl
Each span close event includes busy/idle timing from tracing-subscriber; API events also record TTFT, total response time, status, and response size.
Automatic Changelog
lgit automatically maintains CHANGELOG.md files when committing:
- Auto-detection — Finds all
CHANGELOG.mdfiles in your repository - Monorepo support — Routes changes to the correct changelog based on file paths
- Deduplication — Skips entries semantically similar to existing ones
- Category mapping — Maps commit types to sections (Added, Fixed, Changed, etc.)
project/
├── 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.
Configuration
Create ~/.config/llm-git/config.toml:
# API
= "http://localhost:4000" # Default: LiteLLM proxy
= "sk-..." # Or use LLM_GIT_API_KEY env var
# Model
= "claude-sonnet-4.5" # Diff analysis / classification
= "claude-haiku-4-5" # Summary line generation
# Commit message limits
= 72 # Target length
= 96 # Triggers retry
= 128 # Absolute max
# Features
= true
= 200 # Auto-use fast mode for small diffs; 0 disables
= true # Parallel analysis for large commits
= true # Disables fsmonitor/untrackedCache for lgit subprocesses
= 0.2 # Structured-output-first, then tools, then JSON content parse
# Commit signing
= false # GPG sign commits by default (-S)
= false # Add Signed-off-by trailer by default (-s)
Provider Examples
Anthropic Direct:
= "https://api.anthropic.com/v1"
= "sk-ant-..."
OpenRouter:
= "https://openrouter.ai/api/v1"
= "sk-or-..."
= "anthropic/claude-sonnet-4.5"
= "anthropic/claude-haiku-4-5"
OpenAI:
= "https://api.openai.com/v1"
= "sk-..."
= "gpt-4o"
= "gpt-4o-mini"
The client now prefers provider-native structured outputs, falls back to tool calling when unsupported, and only then falls back to parsing JSON content from the model response. Anthropic models only use structured outputs on the official Anthropic base URL; routed Anthropic models fall back directly to tool calling.
Commit Types
Customize commit type classification:
[]
= "New public API or user-observable behavior change"
= ["pub fn", "pub struct", "export function"]
[]
= "Fixes incorrect behavior"
= ["unwrap() → ?", "bounds check", "error handling"]
[]
= "Internal restructuring with unchanged behavior"
= "If behavior changes, use feat instead."
Changelog Categories
[[]]
= "Breaking"
= "Breaking Changes"
= ["breaking", "incompatible"]
[[]]
= "Added"
= ["feat"]
[[]]
= "Fixed"
= ["fix"]
[[]]
= "Changed"
= true
Environment Variables
| 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 |
LLM_GIT_TRACE_FILE |
JSONL profiling trace output path | none |
Installation
From crates.io
From source
Prerequisites
- Rust nightly toolchain
- Git
- API access (Anthropic, OpenAI, OpenRouter, or local LiteLLM proxy)
License
MIT