Configuration Reference
Complete guide to configuring LFG through .lfg/config.yml and environment variables.
Configuration File Location
LFG stores its configuration in .lfg/config.yml
in your repository root.
This file is automatically created when you run lfg --init
.
your-project/
├── .lfg/
│ ├── config.yml # Main configuration
│ ├── .env # API keys (optional)
│ ├── decisions.json # User decisions cache
│ ├── reviewers.json # GitHub reviewers cache
│ ├── pre-run.sh # Pre-commit hook
│ └── post-run.sh # Post-commit hook
└── .gitignore # Should include .lfg/
Basic Configuration
base_branch
Default base branch for pull requests
main
protected_branches
Branches that require confirmation before pushing
["main", "develop"]
AI Configuration
ai.provider
AI provider to use (claude, openai, gemini, system)
claude
ai.method
How to call the AI (cli, api, system)
cli
ai.model
Specific model to use (optional for some providers)
""
ai.timeout
Timeout in seconds for AI requests
30
ai.max_prompt_chars
Maximum characters to send to AI
90000
ai.chunk_size
Size of chunks when splitting large diffs
28000
ai.validate_on_change
Validate AI responses for quality
true
Commit Message Formatting
prompt.bullet_style
Style for bullet points in commit messages
-
prompt.max_bullets
Maximum number of bullet points
10
prompt.subject_limit
Character limit for commit subject line
72
Behavior Settings
behavior.confirm_on_protected
Ask for confirmation when pushing to protected branches
true
behavior.normalize_bullets
Normalize bullet point formatting
true
behavior.normalize_newlines
Normalize newlines in commit messages
true
behavior.require_signed_commits
Enforce signed commits
true
behavior.require_dco
Enforce Developer Certificate of Origin
true
Safety Guards
guards.large_file_bytes
Maximum file size in bytes (10MB default)
10485760
guards.pr_size_warn_lines
Warn when PR exceeds this many lines
800
guards.pr_size_label
Label to apply to large PRs
needs-splitting
Example Configuration
# Basic settings
base_branch: main
protected_branches: [main, develop, production]
# Commit message formatting
prompt:
bullet_style: "-"
max_bullets: 8
subject_limit: 72
# AI configuration
ai:
provider: "claude"
method: "api"
model: "claude-3-sonnet-20240229"
timeout: 45
max_prompt_chars: 90000
chunk_size: 28000
validate_on_change: true
fallbacks:
minimal_diff: true
stats_mode: true
offline_template:
subject: "Update changes"
bullets:
- "Describe behavior change"
- "Note tests/risks"
- "Config/migrations if any"
# GitHub integration
gh:
enabled: true
interactive_reviewers: true
draft_by_default: false
default_assignee: "self"
labels: ["needs-review"]
team_reviewers: ["org/backend", "org/frontend"]
# Hooks
hooks:
pre: .lfg/pre-run.sh
post: .lfg/post-run.sh
# Behavior settings
behavior:
confirm_on_protected: true
normalize_bullets: true
normalize_newlines: true
require_signed_commits: true
require_dco: true
# Safety guards
guards:
large_file_bytes: 10485760 # 10MB
pr_size_warn_lines: 800
pr_size_label: "needs-splitting"
Environment Variables
Store sensitive information like API keys in .lfg/.env
:
# Anthropic Claude
ANTHROPIC_API_KEY=your_claude_api_key_here
# OpenAI
OPENAI_API_KEY=your_openai_api_key_here
# Google Gemini
GEMINI_API_KEY=your_gemini_api_key_here
# GitHub (usually handled by gh CLI)
GITHUB_TOKEN=your_github_token_here
Security Note
The .lfg/.env
file should be kept private and never committed to version control.
Make sure .lfg/
is in your .gitignore
file.
Configuration Tips
Team Configuration
Set up default reviewers and labels for consistent team workflows
gh.team_reviewers: ['org/backend'] and gh.labels: ['needs-review', 'backend']
AI Optimization
Adjust chunk_size and max_prompt_chars based on your typical diff sizes
Larger projects may need chunk_size: 35000 and max_prompt_chars: 120000
Security Settings
Enable signed commits and DCO for compliance requirements
behavior.require_signed_commits: true and behavior.require_dco: true
Branch Protection
Customize protected branches based on your Git flow
protected_branches: [main, develop, staging, production]
File Size Limits
Adjust large file detection based on your project needs
guards.large_file_bytes: 5242880 for 5MB limit