From gh
Comprehensive reference for the GitHub CLI (gh) command. Use when working with GitHub operations like pull requests, issues, repos, releases, workflows, Actions runs, secrets, labels, gists, or the GitHub API. Covers all gh commands, subcommands, flags, and common patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gh:gh-referenceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You have access to the `gh` CLI for all GitHub operations. This skill provides a comprehensive reference for every command, flag, and common usage pattern.
You have access to the gh CLI for all GitHub operations. This skill provides a comprehensive reference for every command, flag, and common usage pattern.
| Task | Command |
|---|---|
| Create PR | gh pr create --title "..." --body "..." |
| List PRs | gh pr list |
| View PR | gh pr view <number> |
| Merge PR | gh pr merge <number> --squash --delete-branch |
| Checkout PR | gh pr checkout <number> |
| PR diff | gh pr diff <number> |
| PR checks | gh pr checks <number> |
| Create issue | gh issue create --title "..." --body "..." |
| List issues | gh issue list |
| View issue | gh issue view <number> |
| Close issue | gh issue close <number> |
| Create release | gh release create <tag> --generate-notes |
| View repo | gh repo view |
| Clone repo | gh repo clone <owner/repo> |
| Raw API call | gh api <endpoint> |
| Search code | gh search code <query> |
| Search issues | gh search issues <query> |
| List runs | gh run list |
| View run | gh run view <run-id> |
| Trigger workflow | gh workflow run <workflow> |
| List labels | gh label list |
| Create gist | gh gist create <file> |
| Set secret | gh secret set <name> |
| Set variable | gh variable set <name> |
| Auth status | gh auth status |
| API-Only Operations | |
| Create/edit/delete files | gh api repos/{owner}/{repo}/contents/path -X PUT ... |
| Create branch | gh api repos/{owner}/{repo}/git/refs -f ref="refs/heads/name" ... |
| Delete branch | gh api repos/{owner}/{repo}/git/refs/heads/name -X DELETE |
| Create tag | gh api repos/{owner}/{repo}/git/refs -f ref="refs/tags/v1.0" ... |
| Add reaction | gh api repos/{owner}/{repo}/issues/123/reactions -f content="+1" |
| Manage milestones | gh api repos/{owner}/{repo}/milestones ... |
| Manage webhooks | gh api repos/{owner}/{repo}/hooks ... |
| Branch protection | gh api repos/{owner}/{repo}/branches/main/protection ... |
| Manage collaborators | gh api repos/{owner}/{repo}/collaborators/user ... |
| Notifications | gh api notifications ... |
| Compare branches | gh api repos/{owner}/{repo}/compare/main...feature |
| Repo statistics | gh api repos/{owner}/{repo}/stats/contributors |
| Deployments | gh api repos/{owner}/{repo}/deployments ... |
| Star/unstar repo | gh api user/starred/owner/repo -X PUT |
| Repository dispatch | gh api repos/{owner}/{repo}/dispatches -f event_type="..." ... |
| Org management | gh api orgs/{org}/members ... |
--help Show help for command
-R, --repo [HOST/]OWNER/REPO Select another repository
--json <fields> Output JSON with specified fields
-q, --jq <expr> Filter JSON output using jq expression
-t, --template <str> Format JSON output using Go template
For complete flags and parameters for each command group, see:
Always use HEREDOC for multi-line body text to preserve formatting:
gh pr create --title "Title" --body "$(cat <<'EOF'
## Summary
- Change 1
- Change 2
## Test plan
- [ ] Test A
EOF
)"
# Get PR titles
gh pr list --json title -q '.[].title'
# Get issue URLs
gh issue list --json url,number -q '.[] | "\(.number): \(.url)"'
# Get failed workflow runs
gh run list --json conclusion,name -q '.[] | select(.conclusion=="failure")'
# GET endpoint with placeholders
gh api repos/{owner}/{repo}/pulls
# POST with fields
gh api repos/{owner}/{repo}/issues/123/comments -f body='comment text'
# GraphQL queries
gh api graphql -f query='{ viewer { login } }'
# Paginate results
gh api repos/{owner}/{repo}/issues --paginate
# Any command can target a different repo with -R
gh pr list -R owner/other-repo
gh issue view 42 -R owner/other-repo
# View comments on a PR
gh api repos/{owner}/{repo}/pulls/123/comments
# View review comments
gh api repos/{owner}/{repo}/pulls/123/reviews
npx claudepluginhub etdofresh/claude-marketplace --plugin ghGuides GitHub CLI (gh) commands for creating/managing PRs, issues, CI runs, releases, auth, and JSON scripting from terminal.
GitHub CLI operations via `gh` for issues, PRs, Actions, releases, and REST/GraphQL API with `--json`/`--jq` parsing.
Guides usage of gh CLI for common GitHub operations: PRs, issues, CI checks, logs, and repo metadata.