A command-line tool that uses AI to streamline your git workflow - generate commit messages, view diff and explain changes.
Table of Contents
Features 🔅
- Beautiful & Ergonomic Diff Viewer: Review your code with minimal effort
- Smart Commit Messages: Generate conventional commit messages for your staged changes
- Git History Insights: Understand what changed in any commit, branch, or your current work
- Interactive Search: Find and explore commits using fuzzy search
- Change Analysis: Ask questions about specific changes and their impact
- Multiple AI Providers: Supports OpenAI, Claude, Groq, Ollama, and more
- Flexible: Works with any git workflow and supports multiple AI providers
- Rich Output: Markdown support for readable explanations and diffs (requires: mdcat)
Getting Started 🔅
Prerequisites
Before you begin, ensure you have:
gitinstalled on your system- fzf (optional) - Required for
lumen listcommand - mdcat (optional) - Required for pretty output formatting
Installation
Using Homebrew (MacOS and Linux)
Using Cargo
[!IMPORTANT]
cargois a package manager forrust, and is installed automatically when you installrust. See installation guide
Configuration (for AI features)
If you want to use AI-powered features (explain, draft, list, operate), run the interactive setup:
This will guide you through selecting an AI provider and entering your API key. The configuration is saved to ~/.config/lumen/lumen.config.json.
[!NOTE] The
diffcommand works without any configuration - it's a standalone visual diff viewer.
Usage 🔅
Generate Commit Messages
Create meaningful commit messages for your staged changes:
# Basic usage - generates a commit message based on staged changes
# Output: "feat(button.tsx): Update button color to blue"
# Add context for more meaningful messages
# Output: "feat(button.tsx): Update button color to align with brand identity guidelines"
Generate Git Commands
Ask Lumen to generate Git commands based on a natural language query:
# Output: git reset --soft HEAD~3 && git commit -m "squashed commit" [y/N]
The command will display an explanation of what the generated command does, show any warnings for potentially dangerous operations, and prompt for confirmation before execution.
Visual Diff Viewer
Launch an interactive side-by-side diff viewer in your terminal:
# View uncommitted changes
# View changes for a specific commit
# View changes between branches
# Filter to specific files
# Watch mode - auto-refresh on file changes
Keybindings in the diff viewer:
j/kor arrow keys: Navigate{/}: Jump between hunkstab: Toggle sidebarspace: Mark file as viewede: Open file in editor?: Show all keybindings
Explain Changes
Understand what changed and why:
# Explain current changes in your working directory
# Explain specific commits
# Ask specific questions about changes
Interactive Mode
# Launch interactive fuzzy finder to search through commits (requires: fzf)
Tips & Tricks
# Copy commit message to clipboard
| |
# View the commit message and copy it
|
# Open in your favorite editor
|
# Directly commit using the generated message
|
If you are using lazygit, you can add this to the user config
customCommands:
- key: '<c-l>'
context: 'files'
command: 'lumen draft | tee >(pbcopy)'
loadingText: 'Generating message...'
showOutput: true
- key: '<c-k>'
context: 'files'
command: 'lumen draft -c {{.Form.Context | quote}} | tee >(pbcopy)'
loadingText: 'Generating message...'
showOutput: true
prompts:
- type: 'input'
title: 'Context'
key: 'Context'
AI Providers 🔅
Configure your preferred AI provider:
# Using CLI arguments
# Using environment variables
Supported Providers
| Provider | API Key Required | Models |
|---|---|---|
OpenAI openai (Default) |
Yes | gpt-5.2, gpt-5, gpt-5-mini, gpt-5-nano, gpt-4.1, gpt-4.1-mini, o4-mini (default: gpt-5-mini) |
Claude claude |
Yes | claude-sonnet-4-5-20250930, claude-opus-4-5-20251115, claude-haiku-4-5-20251015 (default: claude-sonnet-4-5-20250930) |
Gemini gemini |
Yes (free tier) | gemini-3-pro, gemini-3-flash, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite (default: gemini-3-flash) |
Groq groq |
Yes (free) | llama-3.3-70b-versatile, llama-3.1-8b-instant, meta-llama/llama-4-maverick-17b-128e-instruct, openai/gpt-oss-120b (default: llama-3.3-70b-versatile) |
DeepSeek deepseek |
Yes | deepseek-chat (V3.2), deepseek-reasoner (default: deepseek-chat) |
xAI xai |
Yes | grok-4, grok-4-mini, grok-4-mini-fast (default: grok-4-mini-fast) |
Ollama ollama |
No (local) | see list (default: llama3.2) |
OpenRouter openrouter |
Yes | see list (default: anthropic/claude-sonnet-4.5) |
Vercel AI Gateway vercel |
Yes | see list (default: anthropic/claude-sonnet-4.5) |
Advanced Configuration 🔅
Configuration File
Lumen supports configuration through a JSON file. You can place the configuration file in one of the following locations:
- Project Root: Create a lumen.config.json file in your project's root directory.
- Custom Path: Specify a custom path using the --config CLI option.
- Global Configuration (Optional): Place a lumen.config.json file in your system's default configuration directory:
- Linux/macOS:
~/.config/lumen/lumen.config.json - Windows:
%USERPROFILE%\.config\lumen\lumen.config.json
- Linux/macOS:
Lumen will load configurations in the following order of priority:
- CLI arguments (highest priority)
- Configuration file specified by --config
- Project root lumen.config.json
- Global configuration file (lowest priority)
Configuration Precedence
Options are applied in the following order (highest to lowest priority):
- CLI Flags
- Configuration File
- Environment Variables
- Default options
Example: Using different providers for different projects:
# Set global defaults in .zshrc/.bashrc
# Override per project using config file
{
}
# Or override using CLI flags