GitHub CLI (gh) expert for repository management. Use when users need to manage repos, issues, PRs, Actions, secrets, or interact with GitHub.
/plugin marketplace add leobrival/topographic-studio-plugins/plugin install dev@topographic-plugins-officialThis skill inherits all available tools. When active, it can use any tool Claude has access to.
reference/commands-reference.mdreference/common-patterns.mdreference/troubleshooting.mdGitHub CLI (gh) enables command-line management of repositories, issues, pull requests, and GitHub workflows. This guide provides essential workflows and quick references for common GitHub operations.
# Authenticate with GitHub
gh auth login
# Check authentication status
gh auth status
# View current repository
gh repo view
# List open issues
gh issue list
# List open pull requests
gh pr list
# Fork repository
gh repo fork owner/repo
# Clone your fork
gh repo clone your-username/repo
# Create feature branch
cd repo
git checkout -b feature/my-feature
# Make changes, then create PR
gh pr create --title "Add feature" --body "Description of changes"
# Push to GitHub
git push origin feature/my-feature
# Create issue
gh issue create --title "Bug: Login fails" --body "Steps to reproduce..."
# List assigned to you
gh issue list --assignee @me
# View issue details
gh issue view 123
# Close issue with comment
gh issue close 123 --comment "Fixed in PR #456"
# Create PR (draft for review)
gh pr create --draft --title "Work in progress"
# List open PRs
gh pr list
# View PR with diff
gh pr view 123
gh pr diff 123
# Checkout PR branch locally
gh pr checkout 123
# Merge when ready
gh pr merge 123 --squash
# List recent workflow runs
gh run list
# View run details and logs
gh run view 123456 --log
# Rerun failed jobs
gh run rerun 123456 --failed
# Cancel running workflow
gh run cancel 123456
# Trigger workflow manually
gh workflow run ci.yml --field environment=production
# Create release
gh release create v1.0.0 --title "Version 1.0.0" --notes "Release notes here"
# List releases
gh release list
# View release details
gh release view v1.0.0
# Upload assets to release
gh release upload v1.0.0 ./build/app.tar.gz
When to use which command:
gh repo (create, clone, fork, view)gh issue (create, list, view, close)gh pr (create, list, view, checkout, merge)gh run and gh workflow (list, view, rerun, trigger)gh release (create, list, view, upload)gh secret (set, list)gh variable (set, list)# View repository details
gh repo view --web # Open in browser
# Fork and setup
gh repo fork owner/repo --clone
# List your repositories
gh repo list --limit 20
# List organization repos
gh repo list myorg --visibility public
# Create issue with labels and assignees
gh issue create \
--title "Bug report" \
--body "Description" \
--label "bug,needs-triage" \
--assignee @me
# Filter issues
gh issue list --state all --assignee @me
gh issue list --label "bug" --state open
# Create PR with options
gh pr create \
--title "Fix: Critical bug" \
--body "Fixes #123" \
--label "bug,fix" \
--reviewer reviewer1,reviewer2
# Merge strategies
gh pr merge 123 --squash # Squash commits
gh pr merge 123 --rebase # Rebase merge
gh pr merge 123 # Merge commit (default)
# List workflows
gh workflow list
# Enable/disable workflow
gh workflow enable ci.yml
gh workflow disable ci.yml
# Monitor runs
gh run list --workflow=ci.yml --status failure
Common Issues:
Authentication failed
gh auth login and follow promptsCan't push to remote
gh auth statusPR merge fails
gh repo viewWorkflow doesn't trigger
gh workflow listRate limit errors
gh api rate-limitFor detailed troubleshooting steps, see the Troubleshooting Guide.
Load as needed for detailed information:
Commands Reference - Complete CLI command documentation with all flags and options. Use when you need exact syntax or flag details for any gh command.
Common Patterns - Real-world patterns and workflows for repository management, issue/PR workflows, CI/CD integration, team collaboration, and release management. Use for implementing specific workflows or integrations.
Troubleshooting Guide - Detailed error messages, diagnosis steps, and resolution strategies for authentication, SSH, API, network, and workflow issues. Use when encountering errors or unexpected behavior.
When to use each reference:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.