CLI Commands Reference
Complete reference for all LFG command line options, flags, and parameters.
Basic Commands
lfg
Run the complete workflow: add, commit with AI message, and push
lfg
lfg --init
Initialize LFG in the current repository
lfg --init
lfg --version
Show LFG version information
lfg --version
Workflow Options
--pr
Create a pull request after pushing
lfg --pr
--offline
Use offline mode without AI (uses template)
lfg --offline
--dry-run
Preview what would happen without making changes
lfg --dry-run
--skip-hooks
Skip pre-run and post-run hooks
lfg --skip-hooks
AI Configuration
--provider <name>
Set AI provider (claude, openai, gemini, system)
lfg --provider claude
--model <id>
Set specific AI model to use
lfg --model claude-3-5-sonnet-20241022
--method <type>
Set AI call method (cli, api, system)
lfg --method api
--timeout <seconds>
Set AI request timeout
lfg --timeout 60
Diff Options
--diff-mode <mode>
Set diff mode (full, minimal, stats)
lfg --diff-mode minimal
--max-chars <num>
Maximum characters to send to AI
lfg --max-chars 50000
--chunk-size <num>
Size of chunks when splitting large diffs
lfg --chunk-size 20000
GitHub Options
--draft
Create PR as draft
lfg --pr --draft
--assignee <user>
Assign PR to specific user
lfg --pr --assignee username
--label <label>
Add label to PR (can be used multiple times)
lfg --pr --label bug --label urgent
--reviewer <user>
Request review from specific user
lfg --pr --reviewer teammate
Debug & Utility
--verbose
Enable verbose output for debugging
lfg --verbose
--skip-validate
Skip validation checks
lfg --skip-validate
--force
Force operation even on protected branches
lfg --force
Common Usage Patterns
Quick Commit & Push
Basic workflow with AI-generated commit message
lfg
Create Pull Request
Commit, push, and create a PR with reviewers
lfg --pr --reviewer teammate --label feature
Offline Mode
Use template-based commit message without AI
lfg --offline
Preview Changes
See what would happen without making changes
lfg --dry-run --verbose
Custom AI Setup
Use specific provider and model
lfg --provider openai --model gpt-4o --method api
Draft PR with Labels
Create a draft PR with multiple labels
lfg --pr --draft --label wip --label needs-review
Tips & Best Practices
Use --dry-run for Testing
Always test with --dry-run first when trying new configurations or on important branches.
lfg --dry-run --verbose
Configure Default Settings
Set up your preferred AI provider and model in .lfg/config.yml to avoid repeating flags.
Use Offline Mode for Simple Changes
For minor changes or when AI is unavailable, --offline mode uses a template-based approach.
lfg --offline
Combine Flags for Complex Workflows
Most flags can be combined to create sophisticated workflows in a single command.
lfg --pr --draft --reviewer team --label feature --verbose