LFG Documentation

Complete guide to using LFG - the AI-powered Git workflow tool that handles add, commit, push, and PR creation in one command.

Quick Start

1. Installation

Install LFG
$
curl -sSL https://lfg.sh/install | sh
✓ LFG installed successfully

2. Initialize in Your Repository

Initialize LFG
$
cd your-project
$
lfg --init
Choose AI provider (claude|openai|gemini|system): claude
Choose call method (cli|api|system): cli
✓ Provider set to: claude (cli)
✨ .lfg scaffolded. Set model via: lfg --model <id>

3. Basic Usage

Basic LFG Usage
$
lfg
Analyzing changes...
✓ Commit message: 'feat: implement user authentication with JWT tokens'
✓ Committed on feature/auth and pushed.

4. Create Pull Request

LFG with PR Creation
$
lfg --pr --review "zephyr-dev,pixel-ninja" --labels "feature,backend"
Analyzing changes...
✓ Commit message: 'feat: add user profile management'
✓ Committed on feature/profiles and pushed.
✓ PR created with reviewers and labels
🔗 https://github.com/user/repo/pull/42

Key Features

One Command Workflow

lfg handles git add, commit with AI-generated message, push, and optional PR creation

AI-Powered Messages

Supports Claude, OpenAI, Gemini, and system AI for intelligent commit messages

Safety First

Protected branch confirmation, signed commits, DCO support, and large file detection

GitHub Integration

Automatic PR creation with reviewers, labels, team assignments, and draft support

Highly Configurable

Extensive YAML configuration for AI, GitHub, hooks, guards, and behavior

Offline Mode

Template-based commits when AI is unavailable or disabled

Common Workflows

Standard Development

Make changes, commit, and push in one command

lfg

Feature Branch with PR

Complete feature development workflow with pull request

lfg --pr --review 'team-lead' --labels 'feature'

Hotfix to Production

Quick fix with confirmation for protected branch

lfg --force --base main

Draft PR for Review

Create draft PR for early feedback

lfg --pr --draft --review 'senior-dev'

Offline Development

Work without AI when internet is unavailable

lfg --offline

Amend Last Commit

Fix the last commit with additional changes

lfg --amend --no-push

Troubleshooting

Problem: AI provider not working

Solution: Check your API keys in .lfg/.env or re-authenticate CLI tools. Use --offline as fallback.

Problem: Large file warnings

Solution: Use Git LFS for large files or adjust guards.large_file_bytes in config.yml

Problem: GitHub CLI not authenticated

Solution: Run 'gh auth login' to authenticate with GitHub CLI for PR features

Problem: Protected branch push blocked

Solution: Use --force flag or adjust protected_branches in config.yml

Problem: Commit signing issues

Solution: Set up GPG key with 'git config commit.gpgsign true' or disable with behavior.require_signed_commits: false

Problem: Hook script failures

Solution: Check .lfg/pre-run.sh and .lfg/post-run.sh permissions and syntax