AI-powered git commit orchestrator that intelligently sequences commits based on dependencies.
- 🧠 Dependency Analysis - Automatically analyzes file dependencies across multiple languages
- 🤖 AI-Powered - Uses Claude or GPT-4 to group related changes and generate commit messages
- 📝 Conventional Commits - Generates proper commit messages following standards
- 🛡️ Safe by Default - Dry-run mode, backups, and rollback support
- ⚡ Fast - Single binary, no runtime dependencies
- Bun >= 1.0.0
git clone https://github.com/dvictor357/lazy-commit.git
cd lazy-commit
bun install
bun run compileThis creates a lazy-commit binary. Move it to your PATH:
sudo mv lazy-commit /usr/local/bin/-
Initialize configuration:
lazy-commit init
-
Set your API key (choose one):
Option A: Edit
~/.config/lazy-commit/settings.json:{ "ai": { "primary": "anthropic", "anthropicApiKey": "sk-ant-..." } }Option B: Set environment variable in
~/.zshrc:export ANTHROPIC_API_KEY="sk-ant-..."
-
Make changes to your code, then:
# Preview what would be committed lazy-commit commit --dry-run # Create intelligent commits lazy-commit commit
lazy-commit commit [options] # Create intelligent commits with AI analysis
lazy-commit plan [options] # Generate commit plan without executing
lazy-commit analyze [options] # Analyze dependencies in current changes
lazy-commit validate # Validate current changes
lazy-commit status # Show git status and config info
lazy-commit init # Initialize configuration
lazy-commit config show # Show current configuration
lazy-commit config reset # Reset to default configuration
lazy-commit cache list # List all cached plans
lazy-commit cache show [id] # Show a cached plan (defaults to latest)
lazy-commit cache execute [id] # Execute a cached plan
lazy-commit cache clear # Clear all cached plans
lazy-commit cache delete <id> # Delete a specific cached plan--dry-run # Preview without executing (no changes made)
-y, --yes # Skip confirmation prompt (auto-confirm)
-i, --interactive # Interactive mode with confirmations
--max-commits <n> # Maximum number of commits to create
-c, --config <path> # Use custom config file
-v, --verbose # Verbose output
-q, --quiet # Suppress output# Preview commit plan (no changes made)
lazy-commit --dry-run commit
# Execute with confirmation prompt (default)
lazy-commit commit
# Skip confirmation prompt
lazy-commit commit -y
# Interactive mode
lazy-commit commit -i
# Limit to 3 commits
lazy-commit commit --max-commits 3
# Save analysis to file
lazy-commit analyze -o analysis.jsonNote: By default,
lazy-commit commitwill show a plan summary and ask for confirmation before executing. Use--yesor-yto skip the prompt, or--dry-runto preview without any changes.
Commit plans are automatically cached after analysis. This allows you to:
- Review plans before executing
- Re-execute a plan without re-analyzing
- Share plans across sessions
# List all cached plans
lazy-commit cache list
# Show the latest cached plan
lazy-commit cache show
# Show a specific plan
lazy-commit cache show plan-1234567890
# Execute the latest cached plan
lazy-commit cache execute
# Execute with dry-run
lazy-commit cache execute --dry-run
# Clear all cached plans
lazy-commit cache clearCache location: ~/.config/lazy-commit/cache/
Config file location: ~/.config/lazy-commit/settings.json
{
"ai": {
"primary": "openai",
"fallback": ["anthropic"],
"maxTokens": 4000,
"temperature": 0.1,
"timeout": 30000,
"retryAttempts": 3,
"anthropic": {
"apiKey": "sk-ant-...",
"baseUrl": null,
"model": "claude-haiku-4-5-20251001"
},
"openai": {
"apiKey": "sk-...",
"baseUrl": null,
"model": "gpt-5-nano-2025-08-07"
}
},
"commit": {
"style": "conventional",
"autoStage": true,
"autoPush": false,
"requireValidation": true,
"maxFilesPerCommit": 10
},
"safety": {
"enableDryRun": true,
"enableRollback": true,
"requireConfirmation": false,
"backupBeforeCommit": true
},
"validation": {
"enablePreCommit": true,
"enableBuildCheck": true,
"enableTestCheck": true,
"enableLintCheck": false
}
}Anthropic (default):
{
"ai": {
"primary": "anthropic",
"anthropic": {
"apiKey": "sk-ant-..."
}
}
}OpenAI:
{
"ai": {
"primary": "openai",
"openai": {
"apiKey": "sk-..."
}
}
}OpenRouter:
{
"ai": {
"primary": "openrouter",
"openrouter": {
"apiKey": "sk-or-v1-...",
"model": "anthropic/claude-sonnet-4-20250514"
}
}
}Or set via environment variable:
export OPENROUTER_API_KEY="sk-or-v1-..."Popular OpenRouter models:
anthropic/claude-sonnet-4-20250514anthropic/claude-3.5-sonnetopenai/gpt-4-turboopenai/gpt-4ogoogle/gemini-pro-1.5meta-llama/llama-3.1-70b-instruct
Custom endpoint (OpenAI-compatible):
Use alternative providers like Azure OpenAI, LiteLLM, Ollama, or any OpenAI-compatible API:
{
"ai": {
"primary": "openai",
"openai": {
"apiKey": "your-api-key",
"baseUrl": "http://localhost:11434/v1",
"model": "llama3"
}
}
}Custom endpoint (Anthropic-compatible):
{
"ai": {
"primary": "anthropic",
"anthropic": {
"apiKey": "your-api-key",
"baseUrl": "https://your-proxy.com/v1",
"model": "claude-3-haiku-20240307"
}
}
}API keys are checked in this order:
- Config file (
settings.json) - Environment variable (
ANTHROPIC_API_KEY/OPENAI_API_KEY)
- TypeScript / JavaScript
- Python
- Rust
- Java
- Go
- CSS / SCSS
- JSON / YAML
# Run directly
bun run start
# Run tests
bun test
# Type check
bun run typecheck
# Build binary
bun run compile
# Clean build artifacts
bun run cleanMIT © Dimas Victor