一键导入
gh-cli
GitHub operations via the `gh` CLI: pull requests, issues, repos, Actions, releases, search, and API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
GitHub operations via the `gh` CLI: pull requests, issues, repos, Actions, releases, search, and API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | gh-cli |
| description | GitHub operations via the `gh` CLI: pull requests, issues, repos, Actions, releases, search, and API. |
Verify authentication first:
gh auth status
All gh commands support -R OWNER/REPO to target a specific repo. When omitted, the current directory's repo is used.
gh pr create --fill --reviewer HANDLE
gh pr list [--state open|closed|all] [--label NAME] [--reviewer ME]
gh pr view <NUMBER|URL|BRANCH>
gh pr status # relevant PRs across repos
gh pr review --approve | -r -b "..." | --comment -b "..."
gh pr merge --squash --delete-branch
gh pr checks <NUMBER>
gh pr diff <NUMBER>
gh pr checkout <NUMBER>
Key flags for pr create:
--fill / --fill-first / --fill-verbose — autofill from commits--draft — create as draft--base BRANCH — target branch-r HANDLE — request reviewers (repeatable)-l LABEL — add labels (repeatable)Use Resolves #N in the body for auto-closure.
gh issue create --title "TITLE" --body "BODY"
gh issue list [--state open|closed|all] [--label NAME] [--assignee HANDLE]
gh issue view <NUMBER|URL>
gh issue comment <NUMBER> -b "COMMENT"
gh issue close <NUMBER>
gh issue edit <NUMBER> --title "..." --label "..."
Key flags for issue create:
-l LABEL — add labels (repeatable)-a HANDLE — assign (use @me or @copilot)-T TEMPLATE — use issue templategh repo clone OWNER/REPO
gh repo fork OWNER/REPO
gh repo create [--private|--public]
gh repo list [--visibility public|private|all]
gh run list
gh run view <RUN_ID>
gh run watch <RUN_ID>
gh run cancel <RUN_ID>
gh run rerun <RUN_ID>
gh release create TAG --title "TITLE" --notes "NOTES"
gh release list
gh release view TAG
gh release upload TAG FILE
gh release download TAG --output FILE
For destructive commands (repo delete, release delete, run delete), confirm with the user first.
gh search issues "QUERY"
gh search prs "QUERY"
gh search repos "QUERY"
gh search code "QUERY"
gh search commits "QUERY"
Use -- before queries with hyphens to avoid flag parsing:
gh search issues -- "is:open -label:bug"
For anything not covered by built-in commands:
gh api repos/{owner}/{repo}/releases
gh api repos/{owner}/{repo}/issues --jq '.[].title'
Key flags:
-X METHOD — HTTP method (default GET, auto POST with params)-f key=value — string parameter-F key=value — typed parameter (auto-converts booleans/numbers, @file reads from file)--jq 'QUERY' — filter output with jq--paginate — fetch all pages{owner}, {repo}, {branch} — auto-resolved placeholdersgh api endpoint -F 'key[sub]=val' -F 'arr[]=a' -F 'arr[]=b'
gh api graphql -f query='query { viewer { name } }' -F var='value'
Append to any command producing JSON:
--jq '.field' # jq filter
--json FIELD,FIELD # specific fields as JSON
git push -u origin BRANCHgh pr create --fillgh pr checksgh pr review --approvegh pr merge --squash --delete-branch