AI-powered git commits. Stage your changes, let AI write the message.
┌─────────────────────────────────────────────┐
│ lgit — AI-powered commits │
└─────────────────────────────────────────────┘
- AI-generated commit messages — Analyzes your diff and writes conventional commit messages
- Multiple AI providers — Anthropic, OpenAI, Google Gemini, or local Ollama
- GPG signing — Sign commits with your GPG key, or commit unsigned
- Auto push with smart retry — Automatically pulls and retries if remote has new commits
- PR link generation — Get a quick link to create a PR on GitHub/GitLab
# Clone and install
git clone https://github.com/yourusername/lgit.git
cd lgit
cargo install --path .
# First run — interactive setup
lgit
# Or explicitly run setup
lgit --setup
# 1. Stage your changes (required!)
git add -A
# 2. Let lgit do the rest
lgit
Note: lgit only commits staged changes. You must run
git addfirst to stage the files you want to include. Unstaged changes will not be committed.
┌─────────────────────────────────────────────┐
│ lgit — AI-powered commits │
└─────────────────────────────────────────────┘
📁 Staged changes (3 files):
added src/new_feature.rs +142 -0
modified src/main.rs +12 -3
modified Cargo.toml +2 -0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Suggested commit:
feat(core): add user authentication module
- Implement JWT-based auth flow
- Add login/logout endpoints
- Update dependencies for jsonwebtoken crate
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
? What would you like to do?
❯ ✓ Accept and commit
✎ Edit message
↻ Regenerate
✕ Cancel
? Select signing option
❯ 🔐 John Doe (ABCD1234EFGH5678)
🔐 Work Key (WXYZ9876STUV5432)
📝 Commit without signing
✓ Committed successfully (signed)!
ℹ Pushing to remote...
✓ Pushed successfully!
🔗 Create a pull request:
https://github.com/user/repo/compare/feature-branch?expand=1
lgit # Run the commit flow
lgit --setup # Re-run setup wizard
lgit --model # Change AI model
lgit --config # Show current configuration
lgit --gpginfo # Show GPG key setup instructions
Config is stored at ~/.config/lgit/config.toml:
[provider]
name = "anthropic"
model = "claude-sonnet-4-20250514"
api_key = "sk-ant-..."
[git]
auto_push = true
pr_link = true
[ui]
color = true
| Provider | Models | API Key Env Var |
|---|---|---|
| Anthropic | Claude Sonnet 4, Opus 4, Haiku 3 | ANTHROPIC_API_KEY |
| OpenAI | GPT-5.2, GPT-5.1, GPT-5 Mini, GPT-4.1, GPT-4o | OPENAI_API_KEY |
| Google Gemini | Gemini 2.5 Pro, 2.5 Flash, 2.0 Flash | GOOGLE_API_KEY |
| Ollama | Any installed model | — |
If the remote has commits you don’t have locally, lgit automatically:
- Detects the rejection
- Pulls the latest changes
- Retries the push
ℹ Pushing to remote...
ℹ Remote has new changes, pulling...
ℹ Retrying push...
✓ Pushed successfully!
lgit supports GPG-signed commits. On each commit, you choose whether to sign and which key to use:
? Select signing option
❯ 🔐 Personal (ABC123)
🔐 Work (XYZ789)
📝 Commit without signing
If you don’t have GPG keys set up, lgit will offer to create an unsigned commit:
⚠ No GPG keys found. Run `lgit --gpginfo` for setup instructions.
? No GPG keys found. What would you like to do?
❯ 📝 Commit without signing
✕ Cancel
Quick setup:
# Generate a new key
gpg --full-generate-key
# List your keys to get the key ID
gpg --list-secret-keys --keyid-format LONG
For detailed instructions, run:
Or see docs/GPG_SETUP.md for the complete guide.
- Rust 1.70+
- Git
- GPG (optional, for commit signing)
- API key for your chosen provider (or Ollama installed locally)
MIT