gh
Work with GitHub using the GitHub CLI (`gh`). Use this skill for pull requests, issues, repositories, Actions workflows, releases, search, and GitHub API operations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Work with GitHub using the GitHub CLI (`gh`). Use this skill for pull requests, issues, repositories, Actions workflows, releases, search, and GitHub API operations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Work with Jira and Confluence using the Atlassian CLI (`acli`). Use this skill for authentication, Jira work items, projects, boards, sprints, filters, Confluence spaces, and Atlassian API-oriented CLI workflows.
Deeply explore a repository and explain what it literally is, how users use it, how it works, and what similar popular projects it resembles.
Write, review, and explain C4 architecture diagrams in Structurizr DSL, including system context, container, component, dynamic, and deployment views.
| name | gh |
| description | Work with GitHub using the GitHub CLI (`gh`). Use this skill for pull requests, issues, repositories, Actions workflows, releases, search, and GitHub API operations. |
| compatibility | opencode |
| metadata | {"domain":"github","interface":"cli","tool":"gh"} |
gh)Use this skill when you need to work with GitHub from the command line. Prefer gh for GitHub operations instead of using raw web pages.
gh api for operations not covered by top-level commandsUse this skill when the task involves GitHub and the GitHub CLI is available, especially for:
gh apigh over manual browser workflows for GitHub tasks.--json, --jq, or --template.-R OWNER/REPO when there is any ambiguity.gh api only when a first-class gh subcommand does not cover the task well.Check auth first when GitHub behavior looks surprising.
gh auth login
gh auth status
gh auth logout
Use these commands for common PR tasks:
gh pr view 123
gh pr view 123 --json number,title,state,author,files,reviews
gh pr view 123 --web
gh pr list
gh pr list --state merged
gh pr status
gh pr checks 123
gh pr diff 123
gh pr create
gh pr create --title "Fix login redirect" --body "## Summary\n- Fix redirect loop"
gh pr create --fill
gh pr edit 123
PR actions:
gh pr checkout 123
gh pr review 123 --approve
gh pr review 123 --comment -b "Looks good overall; one small question."
gh pr comment 123 -b "CI is green now."
gh pr ready 123
gh pr merge 123
gh pr close 123
gh issue view 456
gh issue view 456 --json number,title,state,author,labels,assignees
gh issue list
gh issue list --label bug
gh issue status
gh issue create
gh issue create --title "Add retry logic" --body "We should retry transient failures."
gh issue edit 456
gh issue comment 456 -b "I can take this."
gh issue close 456
Additional issue actions:
gh issue reopen 456
gh issue delete 456
gh issue transfer 456 OWNER/REPO
gh repo view OWNER/REPO
gh repo view --web
gh repo list OWNER
gh repo clone OWNER/REPO
gh repo create
gh repo fork OWNER/REPO
gh repo edit
gh repo delete OWNER/REPO
Inspect runs, logs, and workflow definitions:
gh run list
gh run list --workflow ci.yml
gh run view 789
gh run view 789 --log
gh run watch 789
gh run rerun 789
gh run cancel 789
gh run download 789
gh workflow list
gh workflow view ci.yml
gh workflow run ci.yml
Additional workflow controls:
gh workflow enable ci.yml
gh workflow disable ci.yml
gh release list
gh release view v1.2.3
gh release create v1.2.3
gh release delete v1.2.3
gh release download v1.2.3
gh search repos QUERY
gh search issues QUERY
gh search prs QUERY
Use gh api when a GitHub capability is not covered by a higher-level command:
gh api /user
gh api repos/OWNER/REPO/pulls/123/comments
gh api repos/OWNER/REPO/issues/123/comments
gh api graphql -f query='query { viewer { login } }'
Prefer machine-readable output for precise summaries and smaller result sets.
Common flags:
--json
--jq '...'
--template '...'
Examples:
gh pr view 123 --json title,state,author
gh pr list --json number,title --jq '.[] | select(.title | contains("bug"))'
gh issue list --json number,title,labels --template '{{range .}}{{.number}}: {{.title}}{{"\n"}}{{end}}'
When you are not clearly inside the target repository, use:
gh pr list -R OWNER/REPO
Ask only for the fields you need:
gh pr view 123 --json number,title,state,mergeStateStatus
gh issue view 456 --json number,title,state,labels,assignees
gh --help
gh pr --help
gh pr create --help
--jsonExample:
gh pr view 123 --json number,title,state,author,reviewDecision,files
gh pr checks 123
Example:
gh run list --workflow ci.yml
gh run view 789 --log
gh pr create--fill when commit messages are already cleangh pr create --fill
gh pr create --title "Add retry handling" --body "## Summary\n- retry transient API failures"
Before making changes:
gh auth status-Rgh api is the fallback for advanced or less common GitHub operations.