GitHub Integration
Complete guide to GitHub CLI integration, automated PR creation, reviewer assignment, and team workflows.
GitHub CLI Setup
Installation
Authentication
Verify Setup
GitHub Configuration
Basic GitHub Settings
gh.enabled
Enable GitHub CLI integration
true
gh.interactive_reviewers
Use interactive reviewer selection
true
gh.draft_by_default
Create draft PRs by default
false
gh.default_assignee
Default assignee for PRs (self or username)
self
PR Automation
gh.labels
Default labels to apply to PRs
[]
gh.team_reviewers
Default team reviewers (e.g., org/team)
[]
Pull Request Creation
Basic PR Creation
PR with Reviewers and Labels
Team Reviewers and Draft PR
Interactive Reviewer Selection
When gh.interactive_reviewers
is enabled, LFG will prompt you to select reviewers:
Advanced GitHub Features
PR Size Warnings
LFG automatically detects large PRs and applies warning labels:
Reviewer Cache Management
LFG caches repository collaborators for faster reviewer selection:
Default Configuration
Set up default reviewers, labels, and assignees in your configuration:
gh:
enabled: true
interactive_reviewers: true
draft_by_default: false
default_assignee: "self" # or specific username
labels:
- "needs-review"
- "backend"
team_reviewers:
- "org/backend-team"
- "org/security-team"
GitHub Workflow Examples
Feature Development
Standard feature branch with team review
lfg --pr --review 'tech-lead' --team-review 'org/backend' --labels 'feature,needs-testing'
Bug Fix
Quick bug fix with automatic assignment
lfg --pr --assign 'self' --labels 'bugfix,urgent' --base main
Draft for Review
Work-in-progress PR for early feedback
lfg --pr --draft --review 'mentor,senior-dev' --labels 'wip,feedback-needed'
Security Review
Security-sensitive changes requiring special review
lfg --pr --team-review 'org/security' --labels 'security,needs-audit' --draft
Release Preparation
Release branch with comprehensive review
lfg --pr --base main --team-review 'org/leads' --labels 'release,critical' --assign 'release-manager'
Documentation Update
Documentation changes with appropriate reviewers
lfg --pr --review 'tech-writer' --labels 'documentation,low-priority'
GitHub Troubleshooting
Problem: GitHub CLI not authenticated
Solution: Run 'gh auth login' to authenticate. Check 'gh auth status' to verify authentication.
Problem: PR creation failed
Solution: Ensure you have push permissions to the repository and the base branch exists. Check GitHub CLI permissions.
Problem: Reviewer not found
Solution: Verify the username is correct and the user has access to the repository. Use --reset-reviewers to refresh the cache.
Problem: Team reviewer access denied
Solution: Ensure the team exists and you have permission to request reviews from that team. Check team visibility settings.
Problem: Labels not applied
Solution: Verify the labels exist in the repository. Repository admins can create missing labels in GitHub settings.
Problem: Interactive reviewer selection not working
Solution: Install 'fzf' for better interactive selection, or disable with gh.interactive_reviewers: false in config.