[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C25EDGXMB3A7PHD3A07TBF":3,"skill-same:01M6C25EDGXMB3A7PHD3A07TBF":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":45,"linkOnly":46,"markdownContent":47,"markdownBody":48,"frontMatter":49,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":13,"ownerHtmlUrl":55,"ownerBlogUrl":13,"ownerDescription":13,"updatedAt":56,"install":57,"resources":70},"01M6C25EDGXMB3A7PHD3A07TBF","github-cli-reference","GitHub CLI（gh）使用参考","Complete reference for GitHub CLI (gh) installation, authentication, and usage in Claude Code environment","GitHub CLI（gh）在 Claude Code 环境中的安装、认证与用法的完整参考。","jleechanorg\u002Fjleechan-skills","jleechanorg","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F221404966?v=4","01M6C1VJ99XG950X1DWPEBCBGX",null,"01M6C1VJDK5YVDNT3362RT5WSB",6,"MIT","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgithub-cli-reference\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考","SCENARIO","使用场景",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",[30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],"cli","github","github cli reference","reference","github cli","cli reference","code","authentication","gh","environment","installation","project","complete","usage","for","2026-11-10 10:12:30",false,"---\nname: github-cli-reference\ndescription: Complete reference for GitHub CLI (gh) installation, authentication, and usage in Claude Code environment\ntype: reference\nscope: project\n---\n\n# GitHub CLI Reference\n\n## Purpose\nReference GitHub CLI installation, authentication, and commands for the current\nauthorized operation. Use the installed binary discovered with `command -v gh`;\nrun Step 0 in the current shell before the examples, which use the resolved `GH` path.\n\n## Activation cues\n- Requests to use GitHub CLI or `gh` commands\n- Questions about GitHub API, PRs, issues, workflows\n- Pull request operations (list, view, create, merge)\n- GitHub repository queries\n- Workflow run checks\n- GitHub API operations\n- Authentication errors or \"command not found\" errors\n\n## Installation (One-Time Setup)\n\n### Step 0: Check if Already Installed\n```bash\nGH=\"$(command -v gh || true)\"\nif [ -z \"$GH\" ] && [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    GH=\"$HOME\u002F.local\u002Fbin\u002Fgh\"\nfi\nif [ -n \"$GH\" ]; then\n    echo \"gh CLI already installed: $GH\"\n    \"$GH\" --version\nelse\n    echo \"gh CLI not found; installation is needed\"\nfi\n```\n\n### Step 1: Install Only When Missing\n\nIf `GH` is empty, inspect the current platform and use its supported installation\nmethod from the [GitHub CLI installation instructions](https:\u002F\u002Fcli.github.com\u002F).\nComplete installation within the task's existing authority, then rerun Step 0.\nPreserve an existing working binary; a missing `~\u002F.local\u002Fbin\u002Fgh` alone does not\nmean GitHub CLI is absent.\n\n### Step 2: Verify Installation\n```bash\n\"$GH\" --version\n```\n**Expected output**: the installed GitHub CLI version.\n\n### Step 3: Test Authentication\n```bash\n\"$GH\" auth status\n```\n**Expected output**: `✓ Logged in to github.com account \u003Cusername> (GITHUB_TOKEN)`\n**Note**: GitHub CLI automatically uses the `GITHUB_TOKEN` environment variable - no prefix needed!\n\n## Critical Usage Rules\n\n### ✅ ALWAYS Do This:\n1. **Use the installed binary**: resolve it with `command -v gh`; use `~\u002F.local\u002Fbin\u002Fgh` when installed there\n2. **GITHUB_TOKEN automatic**: No prefix needed - gh automatically uses environment variable\n3. **Specify repo**: Add `--repo \"$REPO\"` for clarity, with `REPO` set once per shell:\n   `REPO=\"${GITHUB_REPOSITORY:-$(\"$GH\" repo view --json nameWithOwner -q .nameWithOwner)}\"`\n   (`gh repo view` resolves the repository of the current checkout; if `REPO` is empty, set `GITHUB_REPOSITORY=owner\u002Frepo`)\n\n### ❌ NEVER Do This:\n1. **Don't reinstall over a working binary**: inspect the current PATH and platform first\n2. **Don't use \u002Ftmp**: Install to a supported location (system package manager or ~\u002F.local\u002Fbin) to comply with TEMPORARY FILE ISOLATION policy; never install into \u002Ftmp\n3. **Don't add redundant prefix**: `GITHUB_TOKEN=$GITHUB_TOKEN` is unnecessary\n\n## Command Reference\n\n### Authentication & Status\n\n#### Check auth status\n```bash\n\"$GH\" auth status\n```\n\n#### Check API rate limit\n```bash\n\"$GH\" api rate_limit --jq '.rate | {limit: .limit, remaining: .remaining}'\n```\n\n### Repository Operations\n\n#### View repository info\n```bash\n\"$GH\" repo view \"$REPO\"\n```\n\n#### View repository info (JSON)\n```bash\n\"$GH\" repo view \"$REPO\" --json name,owner,isPrivate,defaultBranchRef,description\n```\n\n#### List branches\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fbranches\" --jq '.[0:10] | .[] | {name: .name, protected: .protected}'\n```\n\n### Pull Request Operations\n\n#### List open PRs\n```bash\n\"$GH\" pr list --repo \"$REPO\" --state open --limit 10\n```\n\n#### List all PRs (including closed)\n```bash\n\"$GH\" pr list --repo \"$REPO\" --state all --limit 20\n```\n\n#### View specific PR\n```bash\n\"$GH\" pr view '\u003CPR_NUMBER>' --repo \"$REPO\"\n```\n\n#### View PR with JSON output\n```bash\n\"$GH\" pr view '\u003CPR_NUMBER>' --repo \"$REPO\" --json number,title,state,author,createdAt,body\n```\n\n#### View PR checks\u002Fstatus\n```bash\n\"$GH\" pr checks '\u003CPR_NUMBER>' --repo \"$REPO\"\n```\n\n#### Create PR\n```bash\n\"$GH\" pr create --repo \"$REPO\" --title \"PR Title\" --body \"PR Description\"\n```\n\n#### Create PR (interactive)\n```bash\n\"$GH\" pr create --repo \"$REPO\" --fill\n```\n\n#### Merge PR\n```bash\n\"$GH\" pr merge '\u003CPR_NUMBER>' --repo \"$REPO\" --squash\n```\n\n#### View PR comments\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fpulls\u002F\u003CPR_NUMBER>\u002Fcomments\"\n```\n\n### Issue Operations\n\n#### List issues\n```bash\n\"$GH\" issue list --repo \"$REPO\" --limit 10\n```\n\n#### List open issues with labels\n```bash\n\"$GH\" issue list --repo \"$REPO\" --state open --label bug --limit 10\n```\n\n#### View specific issue\n```bash\n\"$GH\" issue view '\u003CISSUE_NUMBER>' --repo \"$REPO\"\n```\n\n#### Create issue\n```bash\n\"$GH\" issue create --repo \"$REPO\" --title \"Issue Title\" --body \"Issue Description\"\n```\n\n### Workflow Operations\n\n#### List workflows\n```bash\n\"$GH\" workflow list --repo \"$REPO\"\n```\n\n#### List workflow runs\n```bash\n\"$GH\" run list --repo \"$REPO\" --limit 10\n```\n\n#### List workflow runs for specific workflow\n```bash\n\"$GH\" run list --repo \"$REPO\" --workflow \"Workflow Name\" --limit 10\n```\n\n#### View workflow run details\n```bash\n\"$GH\" run view '\u003CRUN_ID>' --repo \"$REPO\"\n```\n\n#### Watch workflow run\n```bash\n\"$GH\" run watch '\u003CRUN_ID>' --repo \"$REPO\"\n```\n\n### Label Operations\n\n#### List labels\n```bash\n\"$GH\" label list --repo \"$REPO\"\n```\n\n#### Create label\n```bash\n\"$GH\" label create \"label-name\" --repo \"$REPO\" --description \"Label description\" --color \"ff0000\"\n```\n\n### GitHub API Direct Access\n\n#### Get user info\n```bash\n\"$GH\" api user --jq '.login'\n```\n\n#### Get latest commit on main\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fcommits\u002Fmain\" --jq '{sha: .sha[0:7], author: .commit.author.name, message: .commit.message | split(\"\\n\")[0]}'\n```\n\n#### Get repository collaborators\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fcollaborators\"\n```\n\n#### Get repository topics\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Ftopics\"\n```\n\n## Troubleshooting\n\n### Error: \"command not found: gh\"\n**Cause**: The binary is absent from the current PATH.\n**Solution**: Inspect `command -v gh` and the known installation path; install for the current platform only if needed.\n\n### Error: \"You are not logged into any GitHub hosts\"\n**Cause**: No usable authentication is available to this invocation.\n**Solution**: Inspect `gh auth status`. For an environment-token setup, check\n`test -n \"${GITHUB_TOKEN:-}\" && echo \"GITHUB_TOKEN is set\"`. Never print the token.\n\n### Error: \"HTTP 404: Not Found\"\n**Cause**: Missing `--repo` flag or incorrect repo name\n**Solution**: Add `--repo \"$REPO\"` to the command and check that `REPO` is the intended `owner\u002Frepo`\n\n### Error: \"Resource not accessible by integration\"\n**Cause**: Token lacks required permissions\n**Solution**: Verify token scopes with `gh auth status`, ensure token has `repo` scope\n\n### Binary not found: \"gh\"\n**Cause**: gh CLI not installed or not on PATH\n**Solution**: Follow Step 0 to discover the binary or install via the platform's supported method (e.g. `brew install gh` on macOS or `~\u002F.local\u002Fbin\u002Fgh` on Linux)\n\n## Advanced Patterns\n\n### Check if gh is installed\n```bash\nif command -v gh >\u002Fdev\u002Fnull 2>&1 || [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    echo \"gh CLI is installed\"\nelse\n    echo \"gh CLI not installed, run installation steps\"\nfi\n```\n\n### Get PR number from current branch\n```bash\nPR_NUMBER=$(\"$GH\" pr list --repo \"$REPO\" --head $(git branch --show-current) --json number --jq '.[0].number')\necho \"Current branch PR: #$PR_NUMBER\"\n```\n\n### Check if PR exists for current branch\n```bash\nPR_EXISTS=$(\"$GH\" pr list --repo \"$REPO\" --head $(git branch --show-current) --json number --jq 'length')\nif [ \"$PR_EXISTS\" -gt 0 ]; then\n    echo \"PR exists for current branch\"\nelse\n    echo \"No PR for current branch\"\nfi\n```\n\n### Get PR status with detailed info\n```bash\n\"$GH\" pr view '\u003CPR_NUMBER>' --repo \"$REPO\" --json number,title,state,isDraft,mergeable,reviewDecision,statusCheckRollup\n```\n\n## Environment Variables\n\n### GITHUB_TOKEN\n- **Purpose**: Authentication token for GitHub API\n- **Set automatically**: Available as environment variable\n- **Usage**: GitHub CLI automatically uses this environment variable (no manual prefix needed)\n- **Scopes**: Inspect the current account's permissions; do not assume administrative access.\n\n## Integration with Other Tools\n\n### Use with jq for JSON parsing\n```bash\n\"$GH\" pr list --repo \"$REPO\" --json number,title --jq '.[] | \"\\(.number): \\(.title)\"'\n```\n\n### Use in scripts\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\n# Define gh command\nGH=\"$(command -v gh || true)\"\nif [ -z \"$GH\" ] && [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    GH=\"$HOME\u002F.local\u002Fbin\u002Fgh\"\nfi\n[ -n \"$GH\" ] || { echo \"Run the installation steps first\" >&2; exit 1; }\nREPO=\"${GITHUB_REPOSITORY:-$(\"$GH\" repo view --json nameWithOwner -q .nameWithOwner 2>\u002Fdev\u002Fnull || true)}\"\n[ -n \"$REPO\" ] || { echo \"GITHUB_REPOSITORY not configured: export GITHUB_REPOSITORY=owner\u002Frepo\" >&2; exit 1; }\n\n# Use in script\n\"$GH\" pr list --repo $REPO --limit 5\n```\n\n### Use with grep for filtering\n```bash\n\"$GH\" pr list --repo \"$REPO\" | grep \"OPEN\"\n```\n\n## Best Practices\n\n1. **Resolve the installed binary**: Prefer `command -v gh`, then the executable `~\u002F.local\u002Fbin\u002Fgh` fallback.\n2. **GITHUB_TOKEN automatic**: gh CLI automatically uses environment variable (no prefix needed)\n3. **Always specify --repo**: Makes commands explicit and prevents errors\n4. **Use --json with --jq**: For parsing specific fields from responses\n5. **Check installation first**: Verify gh binary exists before using\n6. **Use --limit**: Prevent overwhelming output for list commands\n7. **Store in variable**: Define `GH` variable in scripts for reusability\n\n## Quick Copy-Paste Commands\n\n```bash\n# Set up gh command variable for easy reuse\nGH=\"$(command -v gh || true)\"\nif [ -z \"$GH\" ] && [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    GH=\"$HOME\u002F.local\u002Fbin\u002Fgh\"\nfi\n[ -n \"$GH\" ] || { echo \"Run the installation steps first\" >&2; exit 1; }\nREPO=\"${GITHUB_REPOSITORY:-$(\"$GH\" repo view --json nameWithOwner -q .nameWithOwner 2>\u002Fdev\u002Fnull || true)}\"\n[ -n \"$REPO\" ] || { echo \"GITHUB_REPOSITORY not configured: export GITHUB_REPOSITORY=owner\u002Frepo\" >&2; exit 1; }\n\n# Now you can use it like this:\n\"$GH\" pr list --repo $REPO\n\"$GH\" issue list --repo $REPO\n\"$GH\" workflow list --repo $REPO\n```\n\n## Related Skills\n- `pr-workflow-manager.md` - PR creation and management best practices\n- `cloud-ops-credential-guard.md` - Token and credential management\n\n## Reporting Expectations\nWhen using gh CLI, always:\n1. Confirm gh binary exists before running commands\n2. Include the command without expanded credential values or token prefixes\n3. Show relevant actual output with credentials redacted\n4. Report diagnostic errors with credentials redacted\n5. Verify authentication status if commands fail\n\n## Before declaring GitHub\u002FAPI work blocked — source of truth\n\nOrigin: `~\u002F.claude\u002FCLAUDE.md` § GitHub API fallback before blocking\n(compressed there to a pointer 2026-09-06; this section is the full policy).\n\nNever report GitHub\u002FAPI work as blocked without first, independently, trying\n**both** REST and GraphQL where the operation permits either (REST and GraphQL\noperate under separate quota buckets). Independent fallback attempts are permitted\nonly for **read-only or idempotent operations**. When an uncertain response occurs\non a non-idempotent mutation (such as creating a comment, creating a release, or\nmodifying state), the client must read back the current state or check idempotency\nbefore any retry attempt; never retry a mutation blindly to avoid creating duplicate\ncomments, releases, or side effects. Public REST endpoints may be tried **unauthenticated**\nwhen the authenticated quota is exhausted; unauthenticated and authenticated paths can\nhave different read\u002Fwrite permissions and rate limits, so a 403 on one is not proof\nthe other is unavailable. Use bounded probes (a fixed small number of attempts, not an\nopen retry loop) and respect any circuit breaker already in place. Never loop\nindefinitely on a failing call, and never bypass authentication or safety checks to\nforce a call through. Human merge authority and approval gates remain strictly preserved;\nautomated fallbacks must never merge pull requests without explicit authorization.\n","# GitHub CLI Reference\n\n## Purpose\nReference GitHub CLI installation, authentication, and commands for the current\nauthorized operation. Use the installed binary discovered with `command -v gh`;\nrun Step 0 in the current shell before the examples, which use the resolved `GH` path.\n\n## Activation cues\n- Requests to use GitHub CLI or `gh` commands\n- Questions about GitHub API, PRs, issues, workflows\n- Pull request operations (list, view, create, merge)\n- GitHub repository queries\n- Workflow run checks\n- GitHub API operations\n- Authentication errors or \"command not found\" errors\n\n## Installation (One-Time Setup)\n\n### Step 0: Check if Already Installed\n```bash\nGH=\"$(command -v gh || true)\"\nif [ -z \"$GH\" ] && [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    GH=\"$HOME\u002F.local\u002Fbin\u002Fgh\"\nfi\nif [ -n \"$GH\" ]; then\n    echo \"gh CLI already installed: $GH\"\n    \"$GH\" --version\nelse\n    echo \"gh CLI not found; installation is needed\"\nfi\n```\n\n### Step 1: Install Only When Missing\n\nIf `GH` is empty, inspect the current platform and use its supported installation\nmethod from the [GitHub CLI installation instructions](https:\u002F\u002Fcli.github.com\u002F).\nComplete installation within the task's existing authority, then rerun Step 0.\nPreserve an existing working binary; a missing `~\u002F.local\u002Fbin\u002Fgh` alone does not\nmean GitHub CLI is absent.\n\n### Step 2: Verify Installation\n```bash\n\"$GH\" --version\n```\n**Expected output**: the installed GitHub CLI version.\n\n### Step 3: Test Authentication\n```bash\n\"$GH\" auth status\n```\n**Expected output**: `✓ Logged in to github.com account \u003Cusername> (GITHUB_TOKEN)`\n**Note**: GitHub CLI automatically uses the `GITHUB_TOKEN` environment variable - no prefix needed!\n\n## Critical Usage Rules\n\n### ✅ ALWAYS Do This:\n1. **Use the installed binary**: resolve it with `command -v gh`; use `~\u002F.local\u002Fbin\u002Fgh` when installed there\n2. **GITHUB_TOKEN automatic**: No prefix needed - gh automatically uses environment variable\n3. **Specify repo**: Add `--repo \"$REPO\"` for clarity, with `REPO` set once per shell:\n   `REPO=\"${GITHUB_REPOSITORY:-$(\"$GH\" repo view --json nameWithOwner -q .nameWithOwner)}\"`\n   (`gh repo view` resolves the repository of the current checkout; if `REPO` is empty, set `GITHUB_REPOSITORY=owner\u002Frepo`)\n\n### ❌ NEVER Do This:\n1. **Don't reinstall over a working binary**: inspect the current PATH and platform first\n2. **Don't use \u002Ftmp**: Install to a supported location (system package manager or ~\u002F.local\u002Fbin) to comply with TEMPORARY FILE ISOLATION policy; never install into \u002Ftmp\n3. **Don't add redundant prefix**: `GITHUB_TOKEN=$GITHUB_TOKEN` is unnecessary\n\n## Command Reference\n\n### Authentication & Status\n\n#### Check auth status\n```bash\n\"$GH\" auth status\n```\n\n#### Check API rate limit\n```bash\n\"$GH\" api rate_limit --jq '.rate | {limit: .limit, remaining: .remaining}'\n```\n\n### Repository Operations\n\n#### View repository info\n```bash\n\"$GH\" repo view \"$REPO\"\n```\n\n#### View repository info (JSON)\n```bash\n\"$GH\" repo view \"$REPO\" --json name,owner,isPrivate,defaultBranchRef,description\n```\n\n#### List branches\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fbranches\" --jq '.[0:10] | .[] | {name: .name, protected: .protected}'\n```\n\n### Pull Request Operations\n\n#### List open PRs\n```bash\n\"$GH\" pr list --repo \"$REPO\" --state open --limit 10\n```\n\n#### List all PRs (including closed)\n```bash\n\"$GH\" pr list --repo \"$REPO\" --state all --limit 20\n```\n\n#### View specific PR\n```bash\n\"$GH\" pr view '\u003CPR_NUMBER>' --repo \"$REPO\"\n```\n\n#### View PR with JSON output\n```bash\n\"$GH\" pr view '\u003CPR_NUMBER>' --repo \"$REPO\" --json number,title,state,author,createdAt,body\n```\n\n#### View PR checks\u002Fstatus\n```bash\n\"$GH\" pr checks '\u003CPR_NUMBER>' --repo \"$REPO\"\n```\n\n#### Create PR\n```bash\n\"$GH\" pr create --repo \"$REPO\" --title \"PR Title\" --body \"PR Description\"\n```\n\n#### Create PR (interactive)\n```bash\n\"$GH\" pr create --repo \"$REPO\" --fill\n```\n\n#### Merge PR\n```bash\n\"$GH\" pr merge '\u003CPR_NUMBER>' --repo \"$REPO\" --squash\n```\n\n#### View PR comments\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fpulls\u002F\u003CPR_NUMBER>\u002Fcomments\"\n```\n\n### Issue Operations\n\n#### List issues\n```bash\n\"$GH\" issue list --repo \"$REPO\" --limit 10\n```\n\n#### List open issues with labels\n```bash\n\"$GH\" issue list --repo \"$REPO\" --state open --label bug --limit 10\n```\n\n#### View specific issue\n```bash\n\"$GH\" issue view '\u003CISSUE_NUMBER>' --repo \"$REPO\"\n```\n\n#### Create issue\n```bash\n\"$GH\" issue create --repo \"$REPO\" --title \"Issue Title\" --body \"Issue Description\"\n```\n\n### Workflow Operations\n\n#### List workflows\n```bash\n\"$GH\" workflow list --repo \"$REPO\"\n```\n\n#### List workflow runs\n```bash\n\"$GH\" run list --repo \"$REPO\" --limit 10\n```\n\n#### List workflow runs for specific workflow\n```bash\n\"$GH\" run list --repo \"$REPO\" --workflow \"Workflow Name\" --limit 10\n```\n\n#### View workflow run details\n```bash\n\"$GH\" run view '\u003CRUN_ID>' --repo \"$REPO\"\n```\n\n#### Watch workflow run\n```bash\n\"$GH\" run watch '\u003CRUN_ID>' --repo \"$REPO\"\n```\n\n### Label Operations\n\n#### List labels\n```bash\n\"$GH\" label list --repo \"$REPO\"\n```\n\n#### Create label\n```bash\n\"$GH\" label create \"label-name\" --repo \"$REPO\" --description \"Label description\" --color \"ff0000\"\n```\n\n### GitHub API Direct Access\n\n#### Get user info\n```bash\n\"$GH\" api user --jq '.login'\n```\n\n#### Get latest commit on main\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fcommits\u002Fmain\" --jq '{sha: .sha[0:7], author: .commit.author.name, message: .commit.message | split(\"\\n\")[0]}'\n```\n\n#### Get repository collaborators\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Fcollaborators\"\n```\n\n#### Get repository topics\n```bash\n\"$GH\" api \"repos\u002F$REPO\u002Ftopics\"\n```\n\n## Troubleshooting\n\n### Error: \"command not found: gh\"\n**Cause**: The binary is absent from the current PATH.\n**Solution**: Inspect `command -v gh` and the known installation path; install for the current platform only if needed.\n\n### Error: \"You are not logged into any GitHub hosts\"\n**Cause**: No usable authentication is available to this invocation.\n**Solution**: Inspect `gh auth status`. For an environment-token setup, check\n`test -n \"${GITHUB_TOKEN:-}\" && echo \"GITHUB_TOKEN is set\"`. Never print the token.\n\n### Error: \"HTTP 404: Not Found\"\n**Cause**: Missing `--repo` flag or incorrect repo name\n**Solution**: Add `--repo \"$REPO\"` to the command and check that `REPO` is the intended `owner\u002Frepo`\n\n### Error: \"Resource not accessible by integration\"\n**Cause**: Token lacks required permissions\n**Solution**: Verify token scopes with `gh auth status`, ensure token has `repo` scope\n\n### Binary not found: \"gh\"\n**Cause**: gh CLI not installed or not on PATH\n**Solution**: Follow Step 0 to discover the binary or install via the platform's supported method (e.g. `brew install gh` on macOS or `~\u002F.local\u002Fbin\u002Fgh` on Linux)\n\n## Advanced Patterns\n\n### Check if gh is installed\n```bash\nif command -v gh >\u002Fdev\u002Fnull 2>&1 || [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    echo \"gh CLI is installed\"\nelse\n    echo \"gh CLI not installed, run installation steps\"\nfi\n```\n\n### Get PR number from current branch\n```bash\nPR_NUMBER=$(\"$GH\" pr list --repo \"$REPO\" --head $(git branch --show-current) --json number --jq '.[0].number')\necho \"Current branch PR: #$PR_NUMBER\"\n```\n\n### Check if PR exists for current branch\n```bash\nPR_EXISTS=$(\"$GH\" pr list --repo \"$REPO\" --head $(git branch --show-current) --json number --jq 'length')\nif [ \"$PR_EXISTS\" -gt 0 ]; then\n    echo \"PR exists for current branch\"\nelse\n    echo \"No PR for current branch\"\nfi\n```\n\n### Get PR status with detailed info\n```bash\n\"$GH\" pr view '\u003CPR_NUMBER>' --repo \"$REPO\" --json number,title,state,isDraft,mergeable,reviewDecision,statusCheckRollup\n```\n\n## Environment Variables\n\n### GITHUB_TOKEN\n- **Purpose**: Authentication token for GitHub API\n- **Set automatically**: Available as environment variable\n- **Usage**: GitHub CLI automatically uses this environment variable (no manual prefix needed)\n- **Scopes**: Inspect the current account's permissions; do not assume administrative access.\n\n## Integration with Other Tools\n\n### Use with jq for JSON parsing\n```bash\n\"$GH\" pr list --repo \"$REPO\" --json number,title --jq '.[] | \"\\(.number): \\(.title)\"'\n```\n\n### Use in scripts\n```bash\n#!\u002Fbin\u002Fbash\nset -e\n\n# Define gh command\nGH=\"$(command -v gh || true)\"\nif [ -z \"$GH\" ] && [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    GH=\"$HOME\u002F.local\u002Fbin\u002Fgh\"\nfi\n[ -n \"$GH\" ] || { echo \"Run the installation steps first\" >&2; exit 1; }\nREPO=\"${GITHUB_REPOSITORY:-$(\"$GH\" repo view --json nameWithOwner -q .nameWithOwner 2>\u002Fdev\u002Fnull || true)}\"\n[ -n \"$REPO\" ] || { echo \"GITHUB_REPOSITORY not configured: export GITHUB_REPOSITORY=owner\u002Frepo\" >&2; exit 1; }\n\n# Use in script\n\"$GH\" pr list --repo $REPO --limit 5\n```\n\n### Use with grep for filtering\n```bash\n\"$GH\" pr list --repo \"$REPO\" | grep \"OPEN\"\n```\n\n## Best Practices\n\n1. **Resolve the installed binary**: Prefer `command -v gh`, then the executable `~\u002F.local\u002Fbin\u002Fgh` fallback.\n2. **GITHUB_TOKEN automatic**: gh CLI automatically uses environment variable (no prefix needed)\n3. **Always specify --repo**: Makes commands explicit and prevents errors\n4. **Use --json with --jq**: For parsing specific fields from responses\n5. **Check installation first**: Verify gh binary exists before using\n6. **Use --limit**: Prevent overwhelming output for list commands\n7. **Store in variable**: Define `GH` variable in scripts for reusability\n\n## Quick Copy-Paste Commands\n\n```bash\n# Set up gh command variable for easy reuse\nGH=\"$(command -v gh || true)\"\nif [ -z \"$GH\" ] && [ -x \"$HOME\u002F.local\u002Fbin\u002Fgh\" ]; then\n    GH=\"$HOME\u002F.local\u002Fbin\u002Fgh\"\nfi\n[ -n \"$GH\" ] || { echo \"Run the installation steps first\" >&2; exit 1; }\nREPO=\"${GITHUB_REPOSITORY:-$(\"$GH\" repo view --json nameWithOwner -q .nameWithOwner 2>\u002Fdev\u002Fnull || true)}\"\n[ -n \"$REPO\" ] || { echo \"GITHUB_REPOSITORY not configured: export GITHUB_REPOSITORY=owner\u002Frepo\" >&2; exit 1; }\n\n# Now you can use it like this:\n\"$GH\" pr list --repo $REPO\n\"$GH\" issue list --repo $REPO\n\"$GH\" workflow list --repo $REPO\n```\n\n## Related Skills\n- `pr-workflow-manager.md` - PR creation and management best practices\n- `cloud-ops-credential-guard.md` - Token and credential management\n\n## Reporting Expectations\nWhen using gh CLI, always:\n1. Confirm gh binary exists before running commands\n2. Include the command without expanded credential values or token prefixes\n3. Show relevant actual output with credentials redacted\n4. Report diagnostic errors with credentials redacted\n5. Verify authentication status if commands fail\n\n## Before declaring GitHub\u002FAPI work blocked — source of truth\n\nOrigin: `~\u002F.claude\u002FCLAUDE.md` § GitHub API fallback before blocking\n(compressed there to a pointer 2026-09-06; this section is the full policy).\n\nNever report GitHub\u002FAPI work as blocked without first, independently, trying\n**both** REST and GraphQL where the operation permits either (REST and GraphQL\noperate under separate quota buckets). Independent fallback attempts are permitted\nonly for **read-only or idempotent operations**. When an uncertain response occurs\non a non-idempotent mutation (such as creating a comment, creating a release, or\nmodifying state), the client must read back the current state or check idempotency\nbefore any retry attempt; never retry a mutation blindly to avoid creating duplicate\ncomments, releases, or side effects. Public REST endpoints may be tried **unauthenticated**\nwhen the authenticated quota is exhausted; unauthenticated and authenticated paths can\nhave different read\u002Fwrite permissions and rate limits, so a 403 on one is not proof\nthe other is unavailable. Use bounded probes (a fixed small number of attempts, not an\nopen retry loop) and respect any circuit breaker already in place. Never loop\nindefinitely on a failing call, and never bypass authentication or safety checks to\nforce a call through. Human merge authority and approval gates remain strictly preserved;\nautomated fallbacks must never merge pull requests without explicit authorization.\n",{"name":5,"type":33,"scope":41,"description":7},"main","8144f00ebafc4306264c63239e4b9fa42e48a90e",".claude\u002Fskills\u002Fgithub-cli-reference",0,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills","https:\u002F\u002Fgithub.com\u002Fjleechanorg","2026-11-14 14:55:35",{"source":9,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add jleechanorg\u002Fjleechan-skills --skill github-cli-reference",{"tool":63,"command":64},"bunx","bunx skills add jleechanorg\u002Fjleechan-skills --skill github-cli-reference",{"tool":66,"command":67},"pnpm","pnpm dlx skills add jleechanorg\u002Fjleechan-skills --skill github-cli-reference","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fgithub-cli-reference\u002FSKILL.md",true,[],[72,80,87,95,103,112],{"skillNo":73,"name":74,"nameZh":13,"description":75,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":79},"01M7DRVZXXMGY4G81K5GVF4V20","disk-reclaim-playbook","Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdisk-reclaim-playbook\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":81,"name":82,"nameZh":13,"description":83,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":79},"01M7B63PNTT2TY78RFKHD8SP3X","claudea-bench","Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fclaudea-bench\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":13,"description":90,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":94},"01M7622KQJ32AV4K5BXEMVSSEB","pr","Alias for the canonical pr-lifecycle PR workflow skill (\u002Fpr-workflow, \u002Fprw).","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpr\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":96,"name":97,"nameZh":13,"description":98,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":102},"01M7432W92AKC4D1TKJ00VCMMT","whisper","OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwhisper\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":104,"name":105,"nameZh":13,"description":106,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":107,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":102},"01M7432T6BN1A9SHB8RBQR5EMP","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":13,"description":115,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":102},"01M7432NDC7S6C6MX7M6RW8CTT","pr-report","This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, \u002Fpr-report, or wants per-PR summary with delta files\u002Flines. Generates a structured report for one or more open PRs covering purpose, files changed, +\u002F− line counts, \u002Fcode-standards + \u002Fthermo review findings, \u002Fponytail simplification opportunities, file-overlap combination candidates, and \u002Fgreen status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.","https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills_archive\u002F2026-11-09-no-usage-evidence\u002Fpr-report\u002FSKILL.md",[],[]]