When to Use
- GitHub API operations
- Pull request management
- Workflow triggering
- Issue management
Prerequisites
- GitHub CLI installed and authenticated
- Appropriate repository permissions
Commands
Authentication
# Check auth status
gh auth status
# Login
gh auth login
Repository Operations
# Clone repository
gh repo clone <owner/repo>
# View repository
gh repo view
# Create repository
gh repo create <name> --public --description "Description"
Pull Request Operations
# Create PR
gh pr create --title "Title" --body "Description"
# List PRs
gh pr list
# View PR
gh pr view <number>
# Merge PR
gh pr merge <number> --merge
Workflow Operations
# List workflows
gh workflow list
# Run workflow
gh workflow run <workflow-name>
# View workflow run
gh run view <run-id>
# Watch workflow run
gh run watch <run-id>
Issue Operations
# Create issue
gh issue create --title "Title" --body "Description"
# List issues
gh issue list
# Close issue
gh issue close <number>
Best Practices
- Use gh api for advanced operations
- Set default repository with gh repo set-default
- Use --json flag for scripting
- Authenticate with tokens for CI/CD
Output Format
- Command executed
- Operation result
- URLs for created resources
- Next steps
Integration with Agents
Used by: @devops, @reviewer