一键导入
github-cli
Reference for using the GitHub CLI (gh) to work with pull requests, issues, workflow runs, releases, and the GitHub API from a non-interactive terminal
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reference for using the GitHub CLI (gh) to work with pull requests, issues, workflow runs, releases, and the GitHub API from a non-interactive terminal
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Advanced Jest test modes in the Commons monorepo — /local/ tests, watch mode, live console output, multi-file batching, and test-failure troubleshooting. For routine "run the test for this file" resolution, call the nx-project-for-file tool instead.
Use Graphite CLI (gt) for stacked PRs and branch management. Use when creating branches, committing changes, submitting PRs, syncing with trunk, or managing stacked pull requests.
Investigate data-integrity / "why does this data look wrong" questions in the Commons codebase (mismatched IDs, orphaned rows, cross-entity divergence, unexpected duplicates, values that don't agree across tables). Use when a ticket or user asks WHY a piece of data is in a surprising state and you must trace it to a root cause through code + production data. Pairs with the commons-sql-query skill for the SQL itself.
Advanced lint/format modes in the Commons monorepo — git-affected linting across a stack, auto-fix, and the full-CI lint pipeline. For routine "lint this file's project" resolution, call the nx-project-for-file tool instead.
Build administrative CRUD interfaces in the Commons admin panel following established patterns for list, create, and edit views.
Create job files in the Commons monorepo. Use when the user wants to create a new job, backfill script, cache job, export job, sync job, bulk operation, cron task, or any background task that runs via HTTP POST endpoint.
| name | github-cli |
| description | Reference for using the GitHub CLI (gh) to work with pull requests, issues, workflow runs, releases, and the GitHub API from a non-interactive terminal |
gh) SkillUse gh for all GitHub operations: pull requests, issues, CI checks, releases, and direct API calls.
--title, --body, etc.).--json + --jq when you need to extract specific fields from output. This gives machine-parseable results.gh issue create --title "Title" --body "$(cat <<'EOF'
## Summary
Multi-line body here.
EOF
)"
-R OWNER/REPO targets a different repository. By default gh operates on the repo in the current directory.gh api covers anything not available through built-in commands.--web or -w in automated contexts -- these open a browser and are only useful for humans.gh pr)Do NOT use
gh pr create. Pull requests are created through other tooling (e.g., Graphite CLI). Usegh prsubcommands only for viewing, inspecting, reviewing, merging, and managing existing PRs.
| Command | Synopsis |
|---|---|
gh pr view [<number>|<url>|<branch>] | View PR details. Use --json <fields> --jq <expr> for structured output |
gh pr list | List PRs. Filter with --state, --label, --author, --assignee, --base, --head, --search, --draft, --limit |
gh pr checks [<number>] | Show CI status. Use --watch to poll, --required for required checks only. Exit code 8 = pending |
gh pr diff [<number>] | View the diff of a PR |
gh pr edit <number> | Edit PR metadata: --title, --body, --base, --add-label, --remove-label, --add-reviewer, --add-assignee |
gh pr merge [<number>] | Merge a PR. Flags: --squash, --rebase, --merge, --auto, --delete-branch |
gh pr close [<number>] | Close a PR without merging. Use --delete-branch to clean up |
gh pr review [<number>] | Submit a review: --approve, --request-changes, --comment, --body |
gh pr ready [<number>] | Mark a draft PR as ready for review |
gh pr comment [<number>] | Add a comment: --body |
gh pr checkout [<number>] | Check out a PR branch locally |
gh pr update-branch [<number>] | Update PR branch with base branch changes. Use --rebase for rebase strategy |
gh pr view JSON Fieldsnumber, title, body, state, url, author, assignees, labels, baseRefName, headRefName, isDraft, reviewDecision, statusCheckRollup, mergeStateStatus, mergeable, additions, deletions, changedFiles, comments, reviews, commits, files, createdAt, updatedAt, closedAt, mergedAt, mergedBy
gh pr list JSON Fieldsnumber, title, state, url, author, baseRefName, headRefName, isDraft, labels, reviewDecision, createdAt, updatedAt
gh issue)| Command | Synopsis |
|---|---|
gh issue create | Create an issue. Key flags: --title, --body, --label, --assignee, --milestone, --project |
gh issue list | List issues. Filter with --state, --label, --assignee, --author, --milestone, --search, --limit |
gh issue view <number> | View issue details. Use --json + --jq for structured output |
gh issue close <number> | Close an issue. Use --reason (completed, not_planned) |
gh issue comment <number> | Add a comment: --body |
gh issue edit <number> | Edit issue: --title, --body, --add-label, --remove-label, --add-assignee |
gh issue develop <number> | Create a branch linked to the issue |
gh issue list JSON Fieldsnumber, title, state, url, author, assignees, labels, milestone, body, comments, createdAt, updatedAt, closedAt
gh run)| Command | Synopsis |
|---|---|
gh run list | List recent runs. Filter with --workflow, --branch, --status, --limit |
gh run view <run-id> | View run summary. Use --verbose for step details, --log for full logs, --log-failed for failed step logs |
gh run view --job <job-id> | View a specific job within a run |
gh run watch <run-id> | Watch a run until it completes. Use --exit-status to exit non-zero on failure |
gh run rerun <run-id> | Rerun a workflow. Use --failed to rerun only failed jobs |
gh run cancel <run-id> | Cancel a running workflow |
gh run view JSON FieldsdatabaseId, displayTitle, name, status, conclusion, event, headBranch, headSha, url, jobs, createdAt, updatedAt, attempt, workflowName
gh release)| Command | Synopsis |
|---|---|
gh release create <tag> | Create a release. Flags: --title, --notes, --notes-file, --draft, --prerelease, --generate-notes, --target |
gh release list | List releases. Use --limit |
gh release view <tag> | View release details |
gh release edit <tag> | Edit a release: --title, --notes, --draft, --prerelease |
gh release delete <tag> | Delete a release. Use --yes to skip confirmation |
gh release download <tag> | Download release assets |
gh release upload <tag> <files> | Upload assets to an existing release |
gh repo)| Command | Synopsis |
|---|---|
gh repo view | View repo info. Use --json for structured output |
gh repo clone <repo> | Clone a repository |
gh repo create <name> | Create a new repo. Flags: --public, --private, --description, --clone |
gh repo edit | Edit repo settings: --description, --default-branch, --visibility |
gh repo sync | Sync a fork with upstream |
gh api)Direct REST and GraphQL access with automatic authentication.
gh api <endpoint> [flags]
{owner}, {repo}, {branch} are auto-filled from the current repo-X METHOD sets the HTTP method (default GET, POST if parameters present)-f key=value adds a string parameter-F key=value adds a typed parameter (booleans, ints, file reads with @)--jq <expr> filters JSON output--paginate fetches all pages-H 'key:value' sets custom headersgh api graphql -f query='...' [-F var=value]
-F for GraphQL variables--paginate with $endCursor variable and pageInfo { hasNextPage, endCursor } for paginationgh search)| Command | Synopsis |
|---|---|
gh search code <query> | Search code across repos |
gh search issues <query> | Search issues. Filter with --repo, --state, --label |
gh search prs <query> | Search pull requests. Filter with --repo, --state, --label |
gh search commits <query> | Search commits |
gh search repos <query> | Search repositories. Filter with --language, --topic |
For detailed, copy-paste-ready examples organized by workflow scenario, read EXAMPLES.md in this skill directory.