{
  "schemaVersion": "1.0",
  "item": {
    "slug": "github-cli",
    "name": "Github Cli",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/tag-assistant/github-cli",
    "canonicalUrl": "https://clawhub.ai/tag-assistant/github-cli",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/github-cli",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=github-cli",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/github-cli"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/github-cli",
    "agentPageUrl": "https://openagent3.xyz/skills/github-cli/agent",
    "manifestUrl": "https://openagent3.xyz/skills/github-cli/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/github-cli/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "GitHub CLI (gh) — Comprehensive Skill",
        "body": "Version: gh 2.66.1+\nAuth: gh auth login or set GH_TOKEN env var\nAlways use --repo OWNER/REPO (or -R) when not inside a git repo directory."
      },
      {
        "title": "Table of Contents",
        "body": "Authentication & Config\nRepositories\nIssues\nPull Requests\nGitHub Actions (Runs & Workflows)\nReleases\nGists\nSearch\nLabels\nSecrets & Variables\nCaches\nProjects V2\nAPI (REST & GraphQL)\nExtensions\nCodespaces\nCopilot\nOther Commands\nJSON Output & Formatting\nEnvironment Variables\nAdvanced Patterns\nTips & Gotchas"
      },
      {
        "title": "Auth",
        "body": "# Interactive login (browser-based OAuth)\ngh auth login\n\n# Login with a PAT from stdin\necho \"$MY_TOKEN\" | gh auth login --with-token\n\n# Login to GitHub Enterprise\ngh auth login --hostname enterprise.example.com\n\n# Add extra scopes (e.g., project scope for Projects V2)\ngh auth refresh -s project\n\n# Add delete_repo scope\ngh auth refresh -s delete_repo\n\n# Check auth status (shows active account, scopes, token validity)\ngh auth status\ngh auth status --show-token\n\n# Switch active account (when multiple accounts configured)\ngh auth switch\n\n# Print the active token (useful for piping to other tools)\ngh auth token\n\n# Logout\ngh auth logout\n\nRequired scopes by feature:\n\nFeatureScope neededBasic repo/PR/issue opsrepoGistsgistRead org membershipread:orgProjects V2projectDelete reposdelete_repoActions workflowsworkflowRead user profileuser"
      },
      {
        "title": "Config",
        "body": "# List all config\ngh config list\n\n# Get/set individual values\ngh config get git_protocol        # https or ssh\ngh config set git_protocol ssh\ngh config set editor \"code --wait\"\ngh config set pager \"less -R\"\ngh config set prompt disabled     # disable interactive prompts (good for scripts)\ngh config set browser \"firefox\"\n\n# Clear CLI cache\ngh config clear-cache"
      },
      {
        "title": "Git credential setup",
        "body": "# Configure git to use gh for HTTPS auth\ngh auth setup-git"
      },
      {
        "title": "Create",
        "body": "# Interactive\ngh repo create\n\n# Public repo, clone locally\ngh repo create my-project --public --clone\n\n# In an org\ngh repo create my-org/my-project --private\n\n# From local directory\ngh repo create my-project --private --source=. --remote=upstream --push\n\n# From template\ngh repo create my-project --template owner/template-repo --clone\n\n# With options\ngh repo create my-project --public --description \"My project\" \\\n  --license mit --gitignore Node --add-readme"
      },
      {
        "title": "Clone",
        "body": "gh repo clone owner/repo\ngh repo clone owner/repo my-dir\ngh repo clone owner/repo -- --depth=1    # shallow clone\n\n# Clone your own repo (owner defaults to you)\ngh repo clone my-repo"
      },
      {
        "title": "Fork",
        "body": "# Fork current repo\ngh repo fork\n\n# Fork and clone\ngh repo fork owner/repo --clone\n\n# Fork into an org\ngh repo fork owner/repo --org my-org --fork-name new-name\n\n# Fork default branch only\ngh repo fork owner/repo --default-branch-only"
      },
      {
        "title": "View",
        "body": "# View current repo (README + description)\ngh repo view\ngh repo view owner/repo\n\n# Open in browser\ngh repo view --web\n\n# JSON output\ngh repo view --json name,description,stargazerCount,url\ngh repo view --json name,stargazerCount --jq '.stargazerCount'\n\nJSON fields for repo: archivedAt, assignableUsers, codeOfConduct, createdAt, defaultBranchRef, deleteBranchOnMerge, description, diskUsage, forkCount, hasDiscussionsEnabled, hasIssuesEnabled, hasProjectsEnabled, hasWikiEnabled, homepageUrl, id, isArchived, isEmpty, isFork, isPrivate, isTemplate, languages, latestRelease, licenseInfo, name, nameWithOwner, owner, parent, primaryLanguage, pullRequests, pushedAt, sshUrl, stargazerCount, updatedAt, url, visibility, watchers"
      },
      {
        "title": "List",
        "body": "# Your repos\ngh repo list\ngh repo list --limit 100\n\n# Another user/org's repos\ngh repo list my-org\n\n# Filter\ngh repo list --language go --visibility public\ngh repo list --topic cli --no-archived\ngh repo list --fork        # only forks\ngh repo list --source      # only non-forks\n\n# JSON output\ngh repo list --json name,stargazerCount --jq '.[] | \"\\(.name): \\(.stargazerCount) stars\"'"
      },
      {
        "title": "Edit",
        "body": "# Edit settings\ngh repo edit --description \"New description\"\ngh repo edit --homepage \"https://example.com\"\ngh repo edit --enable-issues --enable-wiki\ngh repo edit --enable-projects=false\ngh repo edit --default-branch main\ngh repo edit --enable-auto-merge\ngh repo edit --delete-branch-on-merge\ngh repo edit --add-topic \"cli,automation\"\ngh repo edit --remove-topic \"old-topic\"\ngh repo edit --template    # make it a template repo\n\n# Change visibility (DANGEROUS — requires acknowledgment)\ngh repo edit --visibility public --accept-visibility-change-consequences"
      },
      {
        "title": "Delete / Archive",
        "body": "gh repo delete owner/repo --yes          # requires delete_repo scope\ngh repo archive owner/repo --yes\ngh repo unarchive owner/repo --yes"
      },
      {
        "title": "Rename",
        "body": "gh repo rename new-name                  # renames current repo\ngh repo rename new-name -R owner/repo"
      },
      {
        "title": "Set Default",
        "body": "# Set which remote is used for gh commands in this local clone\ngh repo set-default owner/repo\ngh repo set-default --view     # see current default\ngh repo set-default --unset"
      },
      {
        "title": "Sync (Fork ↔ Upstream)",
        "body": "# Sync local repo from remote parent\ngh repo sync\n\n# Sync specific branch\ngh repo sync --branch v1\n\n# Sync remote fork from its parent\ngh repo sync owner/my-fork\n\n# Sync from a specific source\ngh repo sync owner/repo --source owner2/repo2\n\n# Force sync (hard reset)\ngh repo sync --force"
      },
      {
        "title": "Create",
        "body": "gh issue create --title \"Bug report\" --body \"Description here\"\ngh issue create --title \"Bug\" --label \"bug,urgent\" --assignee \"@me\"\ngh issue create --title \"Feature\" --project \"Roadmap\" --milestone \"v2.0\"\ngh issue create --template \"Bug Report\"       # use issue template\ngh issue create --body-file description.md    # body from file\ngh issue create -R owner/repo --title \"Bug\"   # different repo"
      },
      {
        "title": "List",
        "body": "gh issue list\ngh issue list --state closed\ngh issue list --state all --limit 100\ngh issue list --label \"bug\" --assignee \"@me\"\ngh issue list --author monalisa\ngh issue list --milestone \"v2.0\"\ngh issue list --search \"error no:assignee sort:created-asc\"\n\n# JSON output\ngh issue list --json number,title,labels,state --jq '.[] | \"#\\(.number) \\(.title)\"'\n\nJSON fields for issues: assignees, author, body, closed, closedAt, comments, createdAt, id, isPinned, labels, milestone, number, projectCards, projectItems, reactionGroups, state, stateReason, title, updatedAt, url"
      },
      {
        "title": "View",
        "body": "gh issue view 123\ngh issue view 123 --web           # open in browser\ngh issue view 123 --comments      # include comments\ngh issue view 123 --json title,body,labels,assignees\n\n# View by URL\ngh issue view https://github.com/owner/repo/issues/123"
      },
      {
        "title": "Edit",
        "body": "gh issue edit 123 --title \"New title\" --body \"New body\"\ngh issue edit 123 --add-label \"bug,help wanted\" --remove-label \"core\"\ngh issue edit 123 --add-assignee \"@me\" --remove-assignee monalisa\ngh issue edit 123 --add-project \"Roadmap\" --remove-project \"v1\"\ngh issue edit 123 --milestone \"v2.0\"\ngh issue edit 123 --remove-milestone\ngh issue edit 123 --body-file body.md\n\n# Bulk edit multiple issues\ngh issue edit 123 456 789 --add-label \"help wanted\""
      },
      {
        "title": "Close / Reopen",
        "body": "gh issue close 123\ngh issue close 123 --comment \"Fixed in PR #456\"\ngh issue close 123 --reason \"not planned\"     # completed | not planned\ngh issue reopen 123"
      },
      {
        "title": "Comment",
        "body": "gh issue comment 123 --body \"Hello from CLI\"\ngh issue comment 123 --body-file comment.md\ngh issue comment 123 --edit-last              # edit your last comment"
      },
      {
        "title": "Pin / Unpin",
        "body": "gh issue pin 123\ngh issue unpin 123"
      },
      {
        "title": "Transfer",
        "body": "gh issue transfer 123 owner/other-repo"
      },
      {
        "title": "Lock / Unlock",
        "body": "gh issue lock 123\ngh issue unlock 123"
      },
      {
        "title": "Develop (linked branches)",
        "body": "# Create a branch linked to issue\ngh issue develop 123 --checkout\ngh issue develop 123 --name \"fix-bug-123\" --base develop\n\n# List linked branches\ngh issue develop 123 --list"
      },
      {
        "title": "Delete",
        "body": "gh issue delete 123 --yes"
      },
      {
        "title": "Create",
        "body": "gh pr create --title \"Fix bug\" --body \"Description\"\ngh pr create --fill                    # auto-fill title/body from commits\ngh pr create --fill-first              # use first commit only\ngh pr create --fill-verbose            # use commit messages + bodies\ngh pr create --draft                   # create as draft\ngh pr create --base develop            # target branch\ngh pr create --head owner:feature-branch\ngh pr create --reviewer monalisa,hubot --reviewer myorg/team-name\ngh pr create --label \"bug\" --assignee \"@me\"\ngh pr create --project \"Roadmap\"\ngh pr create --milestone \"v2.0\"\ngh pr create --template \"pull_request_template.md\"\ngh pr create --no-maintainer-edit      # prevent maintainers from pushing\ngh pr create --dry-run                 # preview without creating"
      },
      {
        "title": "List",
        "body": "gh pr list\ngh pr list --state merged --limit 50\ngh pr list --state all\ngh pr list --author \"@me\"\ngh pr list --assignee monalisa\ngh pr list --label \"bug\" --label \"priority\"\ngh pr list --base main\ngh pr list --head feature-branch\ngh pr list --draft                     # only drafts\ngh pr list --search \"status:success review:required\"\ngh pr list --search \"<SHA>\" --state merged   # find PR for a commit\n\n# JSON output\ngh pr list --json number,title,author,state --jq '.[].title'\n\nJSON fields for PRs: additions, assignees, author, autoMergeRequest, baseRefName, body, changedFiles, closed, closedAt, comments, commits, createdAt, deletions, files, headRefName, headRefOid, id, isDraft, labels, latestReviews, maintainerCanModify, mergeCommit, mergeStateStatus, mergeable, mergedAt, mergedBy, milestone, number, projectItems, reviewDecision, reviewRequests, reviews, state, statusCheckRollup, title, updatedAt, url"
      },
      {
        "title": "View",
        "body": "gh pr view 123\ngh pr view 123 --web\ngh pr view 123 --comments\ngh pr view 123 --json title,body,reviews,mergeable\ngh pr view feature-branch              # by branch name"
      },
      {
        "title": "Checkout",
        "body": "gh pr checkout 123\ngh pr checkout 123 --branch local-name\ngh pr checkout 123 --force             # reset existing local branch\ngh pr checkout 123 --recurse-submodules\ngh co 123                              # alias"
      },
      {
        "title": "Diff",
        "body": "gh pr diff 123\ngh pr diff 123 --name-only             # list changed files\ngh pr diff 123 --patch                 # patch format"
      },
      {
        "title": "Merge",
        "body": "gh pr merge 123 --merge                # merge commit\ngh pr merge 123 --squash               # squash merge\ngh pr merge 123 --rebase               # rebase merge\ngh pr merge 123 --squash --delete-branch\ngh pr merge 123 --auto --squash        # enable auto-merge\ngh pr merge 123 --disable-auto         # disable auto-merge\ngh pr merge 123 --admin                # bypass merge queue / requirements\ngh pr merge 123 --squash --subject \"feat: new feature\" --body \"Details\""
      },
      {
        "title": "Review",
        "body": "gh pr review 123 --approve\ngh pr review 123 --comment --body \"LGTM\"\ngh pr review 123 --request-changes --body \"Please fix the tests\"\ngh pr review                           # review current branch's PR"
      },
      {
        "title": "Checks (CI Status)",
        "body": "gh pr checks 123\ngh pr checks 123 --watch               # live-update until done\ngh pr checks 123 --watch --fail-fast   # stop on first failure\ngh pr checks 123 --required            # only required checks\ngh pr checks 123 --json name,state,bucket\ngh pr checks 123 --web\n\n# Exit codes: 0=pass, 1=fail, 8=pending\n\nJSON fields for checks: bucket, completedAt, description, event, link, name, startedAt, state, workflow"
      },
      {
        "title": "Edit",
        "body": "gh pr edit 123 --title \"New title\" --body \"New body\"\ngh pr edit 123 --add-label \"bug\" --remove-label \"wip\"\ngh pr edit 123 --add-reviewer monalisa --remove-reviewer hubot\ngh pr edit 123 --add-assignee \"@me\"\ngh pr edit 123 --add-project \"Roadmap\"\ngh pr edit 123 --base develop          # change target branch\ngh pr edit 123 --milestone \"v2.0\""
      },
      {
        "title": "Close / Reopen",
        "body": "gh pr close 123\ngh pr close 123 --comment \"Superseded by #456\" --delete-branch\ngh pr reopen 123"
      },
      {
        "title": "Ready / Draft",
        "body": "gh pr ready 123           # mark ready for review\ngh pr ready 123 --undo    # convert back to draft (requires plan support)"
      },
      {
        "title": "Update Branch",
        "body": "gh pr update-branch 123              # merge base into head\ngh pr update-branch 123 --rebase    # rebase head onto base"
      },
      {
        "title": "Comment",
        "body": "gh pr comment 123 --body \"Comment text\"\ngh pr comment 123 --body-file comment.md"
      },
      {
        "title": "Lock / Unlock",
        "body": "gh pr lock 123\ngh pr unlock 123"
      },
      {
        "title": "Workflow Runs",
        "body": "# List runs\ngh run list\ngh run list --limit 50\ngh run list --workflow build.yml\ngh run list --branch main\ngh run list --status failure\ngh run list --user monalisa\ngh run list --event push\ngh run list --commit abc123\ngh run list --json name,status,conclusion,url\n\n# View a run\ngh run view 12345\ngh run view 12345 --verbose            # show job steps\ngh run view 12345 --log                # full log output\ngh run view 12345 --log-failed         # only failed step logs\ngh run view 12345 --job 456789         # specific job\ngh run view 12345 --job 456789 --log   # specific job logs\ngh run view 12345 --attempt 3          # specific attempt\ngh run view 12345 --web\n\n# Watch a run (live progress)\ngh run watch 12345\ngh run watch 12345 --exit-status       # exit non-zero on failure\n\n# Rerun\ngh run rerun 12345                     # rerun entire run\ngh run rerun 12345 --failed            # rerun only failed jobs\ngh run rerun 12345 --debug             # rerun with debug logging\ngh run rerun 12345 --job 456789        # rerun specific job\n\n# ⚠️ GOTCHA: --job needs databaseId, NOT the number from the URL!\n# Get the right ID:\ngh run view 12345 --json jobs --jq '.jobs[] | {name, databaseId}'\n\n# Cancel\ngh run cancel 12345\n\n# Delete\ngh run delete 12345\n\n# Download artifacts\ngh run download 12345                  # all artifacts\ngh run download 12345 --name \"build-output\"\ngh run download 12345 --dir ./artifacts\ngh run download --name \"coverage\" --pattern \"*.xml\"\n\nJSON fields for runs: attempt, conclusion, createdAt, databaseId, displayTitle, event, headBranch, headSha, name, number, startedAt, status, updatedAt, url, workflowDatabaseId, workflowName"
      },
      {
        "title": "Workflows",
        "body": "# List workflows\ngh workflow list\ngh workflow list --all                  # include disabled\n\n# View a workflow\ngh workflow view build.yml\ngh workflow view build.yml --web\n\n# Run a workflow (workflow_dispatch)\ngh workflow run build.yml\ngh workflow run build.yml --ref my-branch\ngh workflow run build.yml -f name=value -f env=prod\necho '{\"name\":\"value\"}' | gh workflow run build.yml --json\n\n# Enable / disable\ngh workflow enable build.yml\ngh workflow disable build.yml"
      },
      {
        "title": "Create",
        "body": "# Interactive\ngh release create\n\n# With tag + notes\ngh release create v1.2.3 --notes \"Bug fix release\"\ngh release create v1.2.3 --generate-notes            # auto-generated notes\ngh release create v1.2.3 --notes-from-tag             # from annotated tag\ngh release create v1.2.3 -F CHANGELOG.md              # notes from file\ngh release create v1.2.3 --draft                      # save as draft\ngh release create v1.2.3 --prerelease\ngh release create v1.2.3 --latest=false               # don't mark as latest\ngh release create v1.2.3 --target release-branch      # tag from specific branch\ngh release create v1.2.3 --verify-tag                 # abort if tag doesn't exist\ngh release create v1.2.3 --discussion-category \"General\"\n\n# With assets\ngh release create v1.2.3 ./dist/*.tar.gz\ngh release create v1.2.3 'binary.zip#Linux Build'     # with display label"
      },
      {
        "title": "List / View",
        "body": "gh release list\ngh release list --limit 50\ngh release view v1.2.3\ngh release view v1.2.3 --web\ngh release view --json tagName,publishedAt,assets"
      },
      {
        "title": "Download",
        "body": "gh release download v1.2.3                    # all assets\ngh release download v1.2.3 --pattern '*.deb'\ngh release download v1.2.3 -p '*.deb' -p '*.rpm'\ngh release download v1.2.3 --archive zip      # source code archive\ngh release download v1.2.3 --dir ./downloads\ngh release download v1.2.3 --output single-file.tar.gz\ngh release download --pattern '*.AppImage'    # latest release (no tag arg)"
      },
      {
        "title": "Edit / Upload / Delete",
        "body": "gh release edit v1.2.3 --title \"New Title\" --notes \"Updated notes\"\ngh release edit v1.2.3 --draft=false          # publish a draft\ngh release edit v1.2.3 --prerelease=false\ngh release upload v1.2.3 ./new-asset.zip\ngh release upload v1.2.3 'asset.tar.gz#Display Label'\ngh release delete v1.2.3 --yes\ngh release delete-asset v1.2.3 asset-name"
      },
      {
        "title": "7. Gists",
        "body": "# Create\ngh gist create file.py                        # secret gist\ngh gist create --public file.py               # public gist\ngh gist create file.py -d \"My Python snippet\"\ngh gist create file1.py file2.js              # multi-file gist\necho \"hello\" | gh gist create -               # from stdin\ncat data.json | gh gist create --filename data.json\n\n# List\ngh gist list\ngh gist list --public\ngh gist list --secret\ngh gist list --limit 50\n\n# View\ngh gist view GIST_ID\ngh gist view GIST_ID --raw                    # raw content\ngh gist view GIST_ID --filename file.py       # specific file\n\n# Edit\ngh gist edit GIST_ID\ngh gist edit GIST_ID --add newfile.txt\ngh gist edit GIST_ID --filename file.py       # edit specific file\n\n# Rename\ngh gist rename GIST_ID old-name.py new-name.py\n\n# Clone\ngh gist clone GIST_ID\n\n# Delete\ngh gist delete GIST_ID"
      },
      {
        "title": "Repos",
        "body": "gh search repos \"vim plugin\"\ngh search repos --owner=microsoft --visibility=public\ngh search repos --language=go --stars=\">1000\"\ngh search repos --topic=cli,automation\ngh search repos --good-first-issues=\">=10\"\ngh search repos --archived=false\ngh search repos cli shell --sort stars --limit 10\ngh search repos --json fullName,stargazersCount,description"
      },
      {
        "title": "Issues",
        "body": "gh search issues \"memory leak\"\ngh search issues --assignee=@me --state=open\ngh search issues --owner=cli --label=\"bug\"\ngh search issues --comments=\">100\"\ngh search issues --repo owner/repo \"error\"\ngh search issues -- -label:bug                # exclude label\ngh search issues --json number,title,repository,state"
      },
      {
        "title": "Pull Requests",
        "body": "gh search prs \"fix bug\"\ngh search prs --repo=cli/cli --draft\ngh search prs --review-requested=@me --state=open\ngh search prs --assignee=@me --merged\ngh search prs --checks=success --review=approved\ngh search prs --json number,title,repository,state"
      },
      {
        "title": "Commits",
        "body": "gh search commits \"bug fix\"\ngh search commits --author=monalisa\ngh search commits --committer-date=\"<2024-01-01\"\ngh search commits --repo=cli/cli --hash=abc123\ngh search commits --json sha,commit,repository"
      },
      {
        "title": "Code",
        "body": "gh search code \"TODO\" --repo=owner/repo\ngh search code \"import React\" --language=typescript\ngh search code \"api_key\" --filename=\".env\"\ngh search code panic --owner=cli --extension=go\ngh search code --json path,repository,textMatches"
      },
      {
        "title": "9. Labels",
        "body": "# List\ngh label list\ngh label list -R owner/repo\ngh label list --json name,color,description\n\n# Create\ngh label create \"priority:high\" --color FF0000 --description \"High priority\"\n\n# Edit\ngh label edit \"bug\" --name \"bug 🐛\" --color 00FF00 --description \"Something broken\"\n\n# Delete\ngh label delete \"old-label\" --yes\n\n# Clone labels from one repo to another\ngh label clone source-owner/source-repo --repo dest-owner/dest-repo"
      },
      {
        "title": "Secrets (encrypted)",
        "body": "# Set (repo-level, for Actions)\ngh secret set MY_SECRET --body \"secret-value\"\ngh secret set MY_SECRET < secret-file.txt\necho \"value\" | gh secret set MY_SECRET\n\n# Set for specific app\ngh secret set MY_SECRET --app dependabot --body \"value\"\ngh secret set MY_SECRET --app codespaces --body \"value\"\n\n# Set environment secret\ngh secret set MY_SECRET --env production --body \"value\"\n\n# Set org-level secret\ngh secret set MY_SECRET --org my-org --visibility all --body \"value\"\ngh secret set MY_SECRET --org my-org --visibility selected --repos repo1,repo2\n\n# Set user secret (for Codespaces)\ngh secret set MY_SECRET --user --body \"value\"\n\n# Bulk set from .env file\ngh secret set -f .env\n\n# List\ngh secret list\ngh secret list --env production\ngh secret list --org my-org\n\n# Delete\ngh secret delete MY_SECRET\ngh secret delete MY_SECRET --env production\ngh secret delete MY_SECRET --org my-org"
      },
      {
        "title": "Variables (plaintext)",
        "body": "# Set\ngh variable set MY_VAR --body \"value\"\ngh variable set MY_VAR --env staging --body \"value\"\ngh variable set MY_VAR --org my-org --visibility all --body \"value\"\n\n# Bulk set from .env file\ngh variable set -f .env\n\n# Get\ngh variable get MY_VAR\n\n# List\ngh variable list\ngh variable list --env production\ngh variable list --org my-org\n\n# Delete\ngh variable delete MY_VAR\ngh variable delete MY_VAR --env production"
      },
      {
        "title": "11. Caches",
        "body": "# List Actions caches\ngh cache list\ngh cache list --limit 100\ngh cache list --sort size --order desc\n\n# Delete\ngh cache delete CACHE_KEY\ngh cache delete --all"
      },
      {
        "title": "12. Projects V2",
        "body": "⚠️ Requires project scope: gh auth refresh -s project\n\nProjects V2 uses the GraphQL-based ProjectsV2 API. The CLI provides commands for most operations, but some advanced field mutations require direct GraphQL via gh api graphql."
      },
      {
        "title": "List Projects",
        "body": "gh project list                           # your projects\ngh project list --owner my-org            # org projects\ngh project list --owner my-org --closed   # include closed\ngh project list --format json             # JSON output"
      },
      {
        "title": "Create",
        "body": "gh project create --owner \"@me\" --title \"My Roadmap\"\ngh project create --owner my-org --title \"Sprint Board\""
      },
      {
        "title": "View",
        "body": "gh project view 1                         # by number\ngh project view 1 --owner my-org\ngh project view 1 --web                   # open in browser\ngh project view 1 --format json"
      },
      {
        "title": "Edit",
        "body": "gh project edit 1 --owner \"@me\" --title \"New Title\"\ngh project edit 1 --description \"Updated description\"\ngh project edit 1 --readme \"Project README content\"\ngh project edit 1 --visibility PUBLIC     # PUBLIC or PRIVATE"
      },
      {
        "title": "Close / Reopen / Delete",
        "body": "gh project close 1 --owner \"@me\"\ngh project close 1 --owner \"@me\" --undo   # reopen\ngh project delete 1 --owner \"@me\""
      },
      {
        "title": "Copy",
        "body": "gh project copy 1 --source-owner monalisa --target-owner my-org --title \"Copied Project\"\ngh project copy 1 --source-owner monalisa --target-owner my-org --drafts  # include drafts"
      },
      {
        "title": "Link / Unlink to Repository or Team",
        "body": "gh project link 1 --owner monalisa --repo my-repo\ngh project link 1 --owner my-org --team my-team\ngh project unlink 1 --owner monalisa --repo my-repo"
      },
      {
        "title": "Mark as Template",
        "body": "gh project mark-template 1 --owner my-org\ngh project mark-template 1 --owner my-org --undo"
      },
      {
        "title": "Fields",
        "body": "# List fields (shows IDs needed for item-edit)\ngh project field-list 1 --owner \"@me\"\ngh project field-list 1 --owner \"@me\" --format json\n\n# Create field\ngh project field-create 1 --owner \"@me\" --name \"Priority\" --data-type \"SINGLE_SELECT\" \\\n  --single-select-options \"Low,Medium,High,Critical\"\ngh project field-create 1 --owner \"@me\" --name \"Points\" --data-type \"NUMBER\"\ngh project field-create 1 --owner \"@me\" --name \"Notes\" --data-type \"TEXT\"\ngh project field-create 1 --owner \"@me\" --name \"Due Date\" --data-type \"DATE\"\n\n# Delete field\ngh project field-delete --id FIELD_NODE_ID\n\nField data types: TEXT, SINGLE_SELECT, DATE, NUMBER\n(Iteration fields must be created via the web UI or GraphQL)"
      },
      {
        "title": "Items",
        "body": "# List items\ngh project item-list 1 --owner \"@me\"\ngh project item-list 1 --owner \"@me\" --limit 100\ngh project item-list 1 --owner \"@me\" --format json\n\n# Add an existing issue/PR to project\ngh project item-add 1 --owner \"@me\" --url https://github.com/owner/repo/issues/123\n\n# Create a draft issue in project\ngh project item-create 1 --owner \"@me\" --title \"Draft task\" --body \"Details\"\n\n# Edit a draft issue (title/body)\ngh project item-edit --id ITEM_NODE_ID --title \"Updated title\" --body \"Updated body\"\n\n# Edit a field value on an item\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --text \"some value\"\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --number 5\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --date \"2024-12-31\"\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --single-select-option-id OPTION_ID\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --iteration-id ITERATION_ID\n\n# Clear a field value\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID --clear\n\n# Archive / unarchive item\ngh project item-archive 1 --owner \"@me\" --id ITEM_NODE_ID\ngh project item-archive 1 --owner \"@me\" --id ITEM_NODE_ID --undo\n\n# Delete item from project\ngh project item-delete 1 --owner \"@me\" --id ITEM_NODE_ID"
      },
      {
        "title": "Getting Node IDs (Essential for item-edit)",
        "body": "The item-edit command requires node IDs for the item, field, project, and option. Here's how to get them:\n\n# Get project ID and item IDs\ngh project item-list 1 --owner \"@me\" --format json | jq '.'\n\n# Get field IDs and single-select option IDs\ngh project field-list 1 --owner \"@me\" --format json | jq '.'\n\n# Via GraphQL (more control)\ngh api graphql -f query='\n  query {\n    user(login: \"USERNAME\") {\n      projectV2(number: 1) {\n        id\n        fields(first: 50) {\n          nodes {\n            ... on ProjectV2SingleSelectField {\n              id\n              name\n              options { id name }\n            }\n            ... on ProjectV2IterationField {\n              id\n              name\n              configuration {\n                iterations { id title startDate duration }\n              }\n            }\n            ... on ProjectV2Field {\n              id\n              name\n              dataType\n            }\n          }\n        }\n      }\n    }\n  }\n'"
      },
      {
        "title": "Projects V2 via GraphQL (for what the CLI can't do)",
        "body": "Some operations require direct GraphQL:\n\n# Update a field value (equivalent to item-edit but more flexible)\ngh api graphql -f query='\n  mutation {\n    updateProjectV2ItemFieldValue(input: {\n      projectId: \"PVT_xxxx\"\n      itemId: \"PVTI_xxxx\"\n      fieldId: \"PVTF_xxxx\"\n      value: { singleSelectOptionId: \"option_id\" }\n    }) {\n      projectV2Item { id }\n    }\n  }\n'\n\n# Add issue/PR to project via GraphQL\ngh api graphql -f query='\n  mutation {\n    addProjectV2ItemById(input: {\n      projectId: \"PVT_xxxx\"\n      contentId: \"I_xxxx\"\n    }) {\n      item { id }\n    }\n  }\n'\n\n# Update draft issue\ngh api graphql -f query='\n  mutation {\n    updateProjectV2DraftIssue(input: {\n      draftIssueId: \"DI_xxxx\"\n      title: \"New Title\"\n      body: \"New body\"\n    }) {\n      draftIssue { id title }\n    }\n  }\n'\n\n# Convert draft to real issue\ngh api graphql -f query='\n  mutation {\n    convertProjectV2DraftIssueItemToIssue(input: {\n      projectId: \"PVT_xxxx\"\n      itemId: \"PVTI_xxxx\"\n      repositoryId: \"R_xxxx\"\n    }) {\n      item {\n        id\n        content {\n          ... on Issue { id number url }\n        }\n      }\n    }\n  }\n'\n\n# Get all items with field values\ngh api graphql -f query='\n  query {\n    user(login: \"USERNAME\") {\n      projectV2(number: 1) {\n        items(first: 100) {\n          nodes {\n            id\n            content {\n              ... on Issue { title number url }\n              ... on PullRequest { title number url }\n              ... on DraftIssue { title body }\n            }\n            fieldValues(first: 20) {\n              nodes {\n                ... on ProjectV2ItemFieldTextValue { text field { ... on ProjectV2Field { name } } }\n                ... on ProjectV2ItemFieldNumberValue { number field { ... on ProjectV2Field { name } } }\n                ... on ProjectV2ItemFieldDateValue { date field { ... on ProjectV2Field { name } } }\n                ... on ProjectV2ItemFieldSingleSelectValue { name field { ... on ProjectV2SingleSelectField { name } } }\n                ... on ProjectV2ItemFieldIterationValue { title field { ... on ProjectV2IterationField { name } } }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n'"
      },
      {
        "title": "Projects V2 Workflow (Complete Example)",
        "body": "# 1. Create a project\ngh project create --owner \"@me\" --title \"Sprint 1\"\n\n# 2. Add fields\ngh project field-create 1 --owner \"@me\" --name \"Status\" \\\n  --data-type SINGLE_SELECT --single-select-options \"Todo,In Progress,Done\"\ngh project field-create 1 --owner \"@me\" --name \"Priority\" \\\n  --data-type SINGLE_SELECT --single-select-options \"Low,Medium,High\"\ngh project field-create 1 --owner \"@me\" --name \"Points\" --data-type NUMBER\n\n# 3. Get field IDs\nFIELDS=$(gh project field-list 1 --owner \"@me\" --format json)\necho \"$FIELDS\" | jq '.'\n\n# 4. Add issues to project\ngh project item-add 1 --owner \"@me\" --url https://github.com/owner/repo/issues/1\ngh project item-add 1 --owner \"@me\" --url https://github.com/owner/repo/issues/2\n\n# 5. Create draft issues\ngh project item-create 1 --owner \"@me\" --title \"Research task\" --body \"Investigate X\"\n\n# 6. Set field values on items (need IDs from steps 3-5)\ngh project item-edit --id ITEM_ID --field-id STATUS_FIELD_ID \\\n  --project-id PROJECT_ID --single-select-option-id TODO_OPTION_ID\n\n# 7. Link project to repo\ngh project link 1 --owner \"@me\" --repo my-repo"
      },
      {
        "title": "REST API",
        "body": "# GET request (default)\ngh api repos/{owner}/{repo}\ngh api repos/cli/cli/releases --jq '.[].tag_name'\n\n# With query parameters\ngh api -X GET search/issues -f q='repo:cli/cli is:open label:bug'\n\n# POST request\ngh api repos/{owner}/{repo}/issues -f title=\"New Issue\" -f body=\"Description\"\ngh api repos/{owner}/{repo}/issues/123/comments -f body='Comment text'\n\n# PATCH / PUT / DELETE\ngh api -X PATCH repos/{owner}/{repo} -f description=\"Updated\"\ngh api -X DELETE repos/{owner}/{repo}/issues/123/labels/bug\n\n# With typed fields (-F for auto-type-conversion, -f for raw strings)\ngh api repos/{owner}/{repo}/issues -f title=\"Bug\" -F private=true -F number:=42\n\n# Request body from file\ngh api repos/{owner}/{repo}/issues --input issue.json\n\n# Custom headers\ngh api -H 'Accept: application/vnd.github.v3.raw+json' repos/{owner}/{repo}/readme\n\n# Include response headers\ngh api -i repos/{owner}/{repo}\n\n# Verbose output (shows full HTTP request/response)\ngh api --verbose repos/{owner}/{repo}\n\n# Silent (no output)\ngh api --silent repos/{owner}/{repo}/issues/123/labels -f labels[]=bug\n\n# Caching\ngh api --cache 3600s repos/{owner}/{repo}/releases"
      },
      {
        "title": "Placeholders",
        "body": "The special placeholders {owner}, {repo}, and {branch} are auto-populated from the current git directory or GH_REPO."
      },
      {
        "title": "Pagination",
        "body": "# Auto-paginate REST results\ngh api --paginate repos/{owner}/{repo}/issues --jq '.[].title'\n\n# Slurp all pages into single array\ngh api --paginate --slurp repos/{owner}/{repo}/issues | jq 'flatten | length'"
      },
      {
        "title": "GraphQL API",
        "body": "# Basic query\ngh api graphql -f query='{ viewer { login } }'\n\n# With variables\ngh api graphql -F owner='{owner}' -F name='{repo}' -f query='\n  query($owner: String!, $name: String!) {\n    repository(owner: $owner, name: $name) {\n      releases(last: 5) {\n        nodes { tagName publishedAt }\n      }\n    }\n  }\n'\n\n# Mutation\ngh api graphql -f query='\n  mutation {\n    addStar(input: {starrableId: \"MDEwOlJlcG9zaXRvcnkxMjM=\"}) {\n      starrable { stargazerCount }\n    }\n  }\n'\n\n# Paginated GraphQL (requires $endCursor variable and pageInfo)\ngh api graphql --paginate -f query='\n  query($endCursor: String) {\n    viewer {\n      repositories(first: 100, after: $endCursor) {\n        nodes { nameWithOwner }\n        pageInfo { hasNextPage endCursor }\n      }\n    }\n  }\n'\n\n# GraphQL with JQ filtering\ngh api graphql -f query='{ viewer { repositories(first: 10) { nodes { nameWithOwner stargazerCount } } } }' \\\n  --jq '.data.viewer.repositories.nodes[] | \"\\(.nameWithOwner): \\(.stargazerCount) ⭐\"'"
      },
      {
        "title": "Common GraphQL Patterns",
        "body": "# Get repository ID (needed for many mutations)\ngh api graphql -f query='query { repository(owner: \"OWNER\", name: \"REPO\") { id } }' \\\n  --jq '.data.repository.id'\n\n# Get issue/PR node ID\ngh api graphql -f query='\n  query {\n    repository(owner: \"OWNER\", name: \"REPO\") {\n      issue(number: 123) { id }\n    }\n  }\n' --jq '.data.repository.issue.id'\n\n# Get user/org ID\ngh api graphql -f query='query { user(login: \"USERNAME\") { id } }' --jq '.data.user.id'\n\n# Check rate limit\ngh api graphql -f query='{ rateLimit { limit remaining resetAt } }'\ngh api rate_limit --jq '.rate'"
      },
      {
        "title": "14. Extensions",
        "body": "# Search for extensions\ngh extension search \"copilot\"\ngh extension search --limit 30\n\n# Browse extensions in TUI\ngh extension browse\n\n# Install\ngh extension install owner/gh-extension-name\ngh extension install https://github.com/owner/gh-extension-name\n\n# List installed\ngh extension list\n\n# Upgrade\ngh extension upgrade extension-name\ngh extension upgrade --all\n\n# Remove\ngh extension remove extension-name\n\n# Execute (useful if name conflicts with core command)\ngh extension exec extension-name\n\n# Create a new extension\ngh extension create my-extension\ngh extension create my-extension --precompiled=go"
      },
      {
        "title": "15. Codespaces",
        "body": "# List\ngh codespace list\n\n# Create\ngh codespace create --repo owner/repo\ngh codespace create --repo owner/repo --branch feature --machine largePremiumLinux\n\n# SSH into codespace\ngh codespace ssh\n\n# Open in VS Code\ngh codespace code\n\n# Copy files\ngh codespace cp local-file.txt remote:~/path/\ngh codespace cp remote:~/path/file.txt ./local/\n\n# View details\ngh codespace view\n\n# Port forwarding\ngh codespace ports\n\n# Rebuild\ngh codespace rebuild\n\n# Stop / Delete\ngh codespace stop\ngh codespace delete"
      },
      {
        "title": "16. Copilot",
        "body": "(Requires gh-copilot extension)\n\n# Suggest a command\ngh copilot suggest \"find large files in current directory\"\n\n# Explain a command\ngh copilot explain \"find . -type f -size +100M -exec ls -lh {} +\"\n\n# Configure\ngh copilot config"
      },
      {
        "title": "Browse (open in browser)",
        "body": "gh browse                          # repo home\ngh browse 123                      # issue or PR #123\ngh browse src/main.go              # specific file\ngh browse src/main.go:42           # file at line\ngh browse --settings               # repo settings\ngh browse --projects                # repo projects\ngh browse --releases                # repo releases\ngh browse --branch feature src/    # specific branch\ngh browse --commit abc123          # specific commit\ngh browse -n                       # print URL instead of opening"
      },
      {
        "title": "Status (cross-repo overview)",
        "body": "gh status                          # assigned issues, PRs, review requests, mentions\ngh status --org my-org             # limit to org\ngh status -e owner/repo            # exclude repo"
      },
      {
        "title": "Aliases",
        "body": "gh alias set pv 'pr view'\ngh alias set bugs 'issue list --label=bug'\ngh alias set --shell igrep 'gh issue list --label=\"$1\" | grep \"$2\"'\ngh alias list\ngh alias delete pv\ngh alias import aliases.yml"
      },
      {
        "title": "SSH Keys / GPG Keys",
        "body": "gh ssh-key list\ngh ssh-key add ~/.ssh/id_ed25519.pub --title \"My Laptop\"\ngh ssh-key delete KEY_ID\n\ngh gpg-key list\ngh gpg-key add pubkey.gpg\ngh gpg-key delete KEY_ID"
      },
      {
        "title": "Rulesets",
        "body": "gh ruleset list\ngh ruleset view RULESET_ID\ngh ruleset check branch-name      # what rules apply to this branch"
      },
      {
        "title": "Attestations",
        "body": "gh attestation verify artifact.tar.gz --owner owner\ngh attestation download --owner owner artifact.tar.gz"
      },
      {
        "title": "Org",
        "body": "gh org list"
      },
      {
        "title": "18. JSON Output & Formatting",
        "body": "Most listing/view commands support --json, --jq, and --template flags."
      },
      {
        "title": "Basic JSON",
        "body": "# Discover available fields (pass --json with no value)\ngh pr list --json\n\n# Select specific fields\ngh pr list --json number,title,author\n\n# JQ filtering\ngh pr list --json number,title,author --jq '.[].author.login'\ngh issue list --json number,title,labels --jq '\n  map(select(.labels | length > 0))\n  | map(.labels = (.labels | map(.name)))\n  | .[:5]\n'"
      },
      {
        "title": "Go Template Formatting",
        "body": "# Table output\ngh pr list --json number,title,headRefName,updatedAt --template \\\n  '{{range .}}{{tablerow (printf \"#%v\" .number | autocolor \"green\") .title .headRefName (timeago .updatedAt)}}{{end}}'\n\n# Hyperlinks\ngh issue list --json title,url --template \\\n  '{{range .}}{{hyperlink .url .title}}{{\"\\n\"}}{{end}}'\n\n# Color\ngh pr list --json title,state --template \\\n  '{{range .}}{{.title}} ({{.state | color \"green\"}}){{\"\\n\"}}{{end}}'"
      },
      {
        "title": "Template Functions",
        "body": "FunctionDescriptionautocolor <style> <input>Color (terminal-aware)color <style> <input>Force colorjoin <sep> <list>Join list valuespluck <field> <list>Extract field from list itemstablerow <fields>...Aligned table columnstablerenderRender accumulated tablerowstimeago <time>Relative timestamptimefmt <format> <time>Formatted timestamptruncate <length> <input>Truncate texthyperlink <url> <text>Terminal hyperlink"
      },
      {
        "title": "19. Environment Variables",
        "body": "VariablePurposeGH_TOKEN / GITHUB_TOKENAuth token for github.com (takes precedence over stored creds)GH_ENTERPRISE_TOKEN / GITHUB_ENTERPRISE_TOKENAuth token for GHESGH_HOSTDefault GitHub hostnameGH_REPODefault repository in [HOST/]OWNER/REPO formatGH_EDITOREditor for authoring textGH_BROWSER / BROWSERWeb browser for opening linksGH_PAGER / PAGERTerminal pager (e.g., less)GH_DEBUGEnable verbose output (1 or api for HTTP traffic)GH_FORCE_TTYForce terminal output (value = column count or percentage)GH_PROMPT_DISABLEDDisable interactive promptsGH_NO_UPDATE_NOTIFIERDisable update notificationsGH_CONFIG_DIRCustom config directoryNO_COLORDisable colored outputGLAMOUR_STYLEMarkdown rendering style"
      },
      {
        "title": "Scripting Best Practices",
        "body": "# Disable prompts for non-interactive use\nGH_PROMPT_DISABLED=1 gh pr create --fill\n\n# Use GH_TOKEN for CI/automation\nGH_TOKEN=${{ github.token }} gh pr list\n\n# Use GH_REPO to avoid -R everywhere\nexport GH_REPO=owner/repo\ngh issue list   # targets owner/repo"
      },
      {
        "title": "Batch Operations",
        "body": "# Close all issues with a label\ngh issue list --label \"wontfix\" --json number --jq '.[].number' | \\\n  xargs -I{} gh issue close {} --reason \"not planned\"\n\n# Add label to all open PRs\ngh pr list --json number --jq '.[].number' | \\\n  xargs -I{} gh pr edit {} --add-label \"needs-review\"\n\n# Download all artifacts from recent failed runs\ngh run list --status failure --json databaseId --jq '.[].databaseId' | \\\n  xargs -I{} gh run download {}"
      },
      {
        "title": "Working with Multiple Accounts",
        "body": "# List configured accounts\ngh auth status\n\n# Switch active account\ngh auth switch\n\n# Use a specific token for one command\nGH_TOKEN=ghp_xxx gh api user --jq '.login'\n\n# Login to multiple hosts\ngh auth login --hostname github.com\ngh auth login --hostname github.enterprise.com"
      },
      {
        "title": "Rate Limiting",
        "body": "# Check current rate limit\ngh api rate_limit --jq '.rate | \"\\(.remaining)/\\(.limit) (resets \\(.reset | strftime(\"%H:%M:%S\")))\"'\n\n# GraphQL rate limit (separate pool)\ngh api graphql -f query='{ rateLimit { limit remaining resetAt } }'\n\n# Use caching to reduce API calls\ngh api --cache 3600s repos/{owner}/{repo}/releases"
      },
      {
        "title": "Complex API Patterns",
        "body": "# Nested parameters\ngh api gists -F 'files[myfile.txt][content]=@myfile.txt'\n\n# Array parameters\ngh api -X PATCH /orgs/{org}/properties/schema \\\n  -F 'properties[][property_name]=env' \\\n  -F 'properties[][allowed_values][]=staging' \\\n  -F 'properties[][allowed_values][]=production'\n\n# Combine REST pagination with JQ\ngh api --paginate repos/{owner}/{repo}/issues --jq '[.[] | select(.labels | length > 0)] | length'\n\n# GraphQL with slurp for aggregation\ngh api graphql --paginate --slurp -f query='\n  query($endCursor: String) {\n    viewer {\n      repositories(first: 100, after: $endCursor) {\n        nodes { isFork stargazerCount }\n        pageInfo { hasNextPage endCursor }\n      }\n    }\n  }\n' | jq '[.[].data.viewer.repositories.nodes[]] | map(.stargazerCount) | add'"
      },
      {
        "title": "Common Mistakes",
        "body": "--json field names differ from API field names. For example, PR files use files (not changed_files), author uses author.login (not user.login). Always run gh <cmd> --json without arguments to see available fields.\n\n\ngh run rerun --job needs databaseId, not the URL number. Get it with:\ngh run view RUN_ID --json jobs --jq '.jobs[] | {name, databaseId}'\n\n\n\nProjects V2 require the project scope. If you get permission errors:\ngh auth refresh -s project\n\n\n\ngh repo delete requires delete_repo scope:\ngh auth refresh -s delete_repo\n\n\n\nSubcommand quoting in shells: PowerShell and some shells need {owner} escaped. Use quotes: \"{owner}\"."
      },
      {
        "title": "When to Use gh api vs Specific Commands",
        "body": "Use specific commands when...Use gh api when...The command exists and does what you needNo CLI command covers the endpointYou want interactive promptsYou need fine-grained controlYou want pretty-printed outputYou want raw JSON responseYou're doing simple CRUDYou need GraphQL queriesYou need to set custom headersYou need pagination control"
      },
      {
        "title": "Performance Tips",
        "body": "Use --limit to fetch only what you need\nUse --json with specific fields (fetches less data)\nUse --cache with gh api for frequently accessed, slowly changing data\nUse --paginate --slurp for aggregations across all pages\nSet GH_PAGER=cat to disable paging in scripts"
      },
      {
        "title": "Exit Codes",
        "body": "CodeMeaning0Success1Error / failure2Usage error4Command cancelled8Checks pending (for gh pr checks)"
      },
      {
        "title": "Authentication Precedence",
        "body": "GH_TOKEN / GITHUB_TOKEN environment variable\nGH_ENTERPRISE_TOKEN (for GHES hosts)\nStored credentials from gh auth login\n.env file in repo (only if configured)"
      },
      {
        "title": "Useful One-Liners",
        "body": "# My open PRs across all repos\ngh search prs --author=@me --state=open --json repository,number,title\n\n# Repos I starred recently\ngh api --paginate user/starred --jq '.[].full_name' | head -20\n\n# Who's the top contributor to a repo\ngh api --paginate repos/owner/repo/contributors --jq '.[] | \"\\(.login): \\(.contributions)\"' | head -10\n\n# Create issue from clipboard\npbpaste | gh issue create --title \"From clipboard\" --body-file -\n\n# Get latest release tag\ngh release view --json tagName --jq '.tagName'\n\n# Watch CI and notify on completion\ngh run watch && notify-send \"CI done!\"\n\n# Export all issues as JSON\ngh issue list --state all --limit 9999 --json number,title,state,labels,assignees > issues.json\n\n# Find which PR merged a commit\ngh pr list --search \"SHA_HERE\" --state merged --json number,title,url"
      }
    ],
    "body": "GitHub CLI (gh) — Comprehensive Skill\n\nVersion: gh 2.66.1+\nAuth: gh auth login or set GH_TOKEN env var\nAlways use --repo OWNER/REPO (or -R) when not inside a git repo directory.\n\nTable of Contents\nAuthentication & Config\nRepositories\nIssues\nPull Requests\nGitHub Actions (Runs & Workflows)\nReleases\nGists\nSearch\nLabels\nSecrets & Variables\nCaches\nProjects V2\nAPI (REST & GraphQL)\nExtensions\nCodespaces\nCopilot\nOther Commands\nJSON Output & Formatting\nEnvironment Variables\nAdvanced Patterns\nTips & Gotchas\n1. Authentication & Config\nAuth\n# Interactive login (browser-based OAuth)\ngh auth login\n\n# Login with a PAT from stdin\necho \"$MY_TOKEN\" | gh auth login --with-token\n\n# Login to GitHub Enterprise\ngh auth login --hostname enterprise.example.com\n\n# Add extra scopes (e.g., project scope for Projects V2)\ngh auth refresh -s project\n\n# Add delete_repo scope\ngh auth refresh -s delete_repo\n\n# Check auth status (shows active account, scopes, token validity)\ngh auth status\ngh auth status --show-token\n\n# Switch active account (when multiple accounts configured)\ngh auth switch\n\n# Print the active token (useful for piping to other tools)\ngh auth token\n\n# Logout\ngh auth logout\n\n\nRequired scopes by feature:\n\nFeature\tScope needed\nBasic repo/PR/issue ops\trepo\nGists\tgist\nRead org membership\tread:org\nProjects V2\tproject\nDelete repos\tdelete_repo\nActions workflows\tworkflow\nRead user profile\tuser\nConfig\n# List all config\ngh config list\n\n# Get/set individual values\ngh config get git_protocol        # https or ssh\ngh config set git_protocol ssh\ngh config set editor \"code --wait\"\ngh config set pager \"less -R\"\ngh config set prompt disabled     # disable interactive prompts (good for scripts)\ngh config set browser \"firefox\"\n\n# Clear CLI cache\ngh config clear-cache\n\nGit credential setup\n# Configure git to use gh for HTTPS auth\ngh auth setup-git\n\n2. Repositories\nCreate\n# Interactive\ngh repo create\n\n# Public repo, clone locally\ngh repo create my-project --public --clone\n\n# In an org\ngh repo create my-org/my-project --private\n\n# From local directory\ngh repo create my-project --private --source=. --remote=upstream --push\n\n# From template\ngh repo create my-project --template owner/template-repo --clone\n\n# With options\ngh repo create my-project --public --description \"My project\" \\\n  --license mit --gitignore Node --add-readme\n\nClone\ngh repo clone owner/repo\ngh repo clone owner/repo my-dir\ngh repo clone owner/repo -- --depth=1    # shallow clone\n\n# Clone your own repo (owner defaults to you)\ngh repo clone my-repo\n\nFork\n# Fork current repo\ngh repo fork\n\n# Fork and clone\ngh repo fork owner/repo --clone\n\n# Fork into an org\ngh repo fork owner/repo --org my-org --fork-name new-name\n\n# Fork default branch only\ngh repo fork owner/repo --default-branch-only\n\nView\n# View current repo (README + description)\ngh repo view\ngh repo view owner/repo\n\n# Open in browser\ngh repo view --web\n\n# JSON output\ngh repo view --json name,description,stargazerCount,url\ngh repo view --json name,stargazerCount --jq '.stargazerCount'\n\n\nJSON fields for repo: archivedAt, assignableUsers, codeOfConduct, createdAt, defaultBranchRef, deleteBranchOnMerge, description, diskUsage, forkCount, hasDiscussionsEnabled, hasIssuesEnabled, hasProjectsEnabled, hasWikiEnabled, homepageUrl, id, isArchived, isEmpty, isFork, isPrivate, isTemplate, languages, latestRelease, licenseInfo, name, nameWithOwner, owner, parent, primaryLanguage, pullRequests, pushedAt, sshUrl, stargazerCount, updatedAt, url, visibility, watchers\n\nList\n# Your repos\ngh repo list\ngh repo list --limit 100\n\n# Another user/org's repos\ngh repo list my-org\n\n# Filter\ngh repo list --language go --visibility public\ngh repo list --topic cli --no-archived\ngh repo list --fork        # only forks\ngh repo list --source      # only non-forks\n\n# JSON output\ngh repo list --json name,stargazerCount --jq '.[] | \"\\(.name): \\(.stargazerCount) stars\"'\n\nEdit\n# Edit settings\ngh repo edit --description \"New description\"\ngh repo edit --homepage \"https://example.com\"\ngh repo edit --enable-issues --enable-wiki\ngh repo edit --enable-projects=false\ngh repo edit --default-branch main\ngh repo edit --enable-auto-merge\ngh repo edit --delete-branch-on-merge\ngh repo edit --add-topic \"cli,automation\"\ngh repo edit --remove-topic \"old-topic\"\ngh repo edit --template    # make it a template repo\n\n# Change visibility (DANGEROUS — requires acknowledgment)\ngh repo edit --visibility public --accept-visibility-change-consequences\n\nDelete / Archive\ngh repo delete owner/repo --yes          # requires delete_repo scope\ngh repo archive owner/repo --yes\ngh repo unarchive owner/repo --yes\n\nRename\ngh repo rename new-name                  # renames current repo\ngh repo rename new-name -R owner/repo\n\nSet Default\n# Set which remote is used for gh commands in this local clone\ngh repo set-default owner/repo\ngh repo set-default --view     # see current default\ngh repo set-default --unset\n\nSync (Fork ↔ Upstream)\n# Sync local repo from remote parent\ngh repo sync\n\n# Sync specific branch\ngh repo sync --branch v1\n\n# Sync remote fork from its parent\ngh repo sync owner/my-fork\n\n# Sync from a specific source\ngh repo sync owner/repo --source owner2/repo2\n\n# Force sync (hard reset)\ngh repo sync --force\n\n3. Issues\nCreate\ngh issue create --title \"Bug report\" --body \"Description here\"\ngh issue create --title \"Bug\" --label \"bug,urgent\" --assignee \"@me\"\ngh issue create --title \"Feature\" --project \"Roadmap\" --milestone \"v2.0\"\ngh issue create --template \"Bug Report\"       # use issue template\ngh issue create --body-file description.md    # body from file\ngh issue create -R owner/repo --title \"Bug\"   # different repo\n\nList\ngh issue list\ngh issue list --state closed\ngh issue list --state all --limit 100\ngh issue list --label \"bug\" --assignee \"@me\"\ngh issue list --author monalisa\ngh issue list --milestone \"v2.0\"\ngh issue list --search \"error no:assignee sort:created-asc\"\n\n# JSON output\ngh issue list --json number,title,labels,state --jq '.[] | \"#\\(.number) \\(.title)\"'\n\n\nJSON fields for issues: assignees, author, body, closed, closedAt, comments, createdAt, id, isPinned, labels, milestone, number, projectCards, projectItems, reactionGroups, state, stateReason, title, updatedAt, url\n\nView\ngh issue view 123\ngh issue view 123 --web           # open in browser\ngh issue view 123 --comments      # include comments\ngh issue view 123 --json title,body,labels,assignees\n\n# View by URL\ngh issue view https://github.com/owner/repo/issues/123\n\nEdit\ngh issue edit 123 --title \"New title\" --body \"New body\"\ngh issue edit 123 --add-label \"bug,help wanted\" --remove-label \"core\"\ngh issue edit 123 --add-assignee \"@me\" --remove-assignee monalisa\ngh issue edit 123 --add-project \"Roadmap\" --remove-project \"v1\"\ngh issue edit 123 --milestone \"v2.0\"\ngh issue edit 123 --remove-milestone\ngh issue edit 123 --body-file body.md\n\n# Bulk edit multiple issues\ngh issue edit 123 456 789 --add-label \"help wanted\"\n\nClose / Reopen\ngh issue close 123\ngh issue close 123 --comment \"Fixed in PR #456\"\ngh issue close 123 --reason \"not planned\"     # completed | not planned\ngh issue reopen 123\n\nComment\ngh issue comment 123 --body \"Hello from CLI\"\ngh issue comment 123 --body-file comment.md\ngh issue comment 123 --edit-last              # edit your last comment\n\nPin / Unpin\ngh issue pin 123\ngh issue unpin 123\n\nTransfer\ngh issue transfer 123 owner/other-repo\n\nLock / Unlock\ngh issue lock 123\ngh issue unlock 123\n\nDevelop (linked branches)\n# Create a branch linked to issue\ngh issue develop 123 --checkout\ngh issue develop 123 --name \"fix-bug-123\" --base develop\n\n# List linked branches\ngh issue develop 123 --list\n\nDelete\ngh issue delete 123 --yes\n\n4. Pull Requests\nCreate\ngh pr create --title \"Fix bug\" --body \"Description\"\ngh pr create --fill                    # auto-fill title/body from commits\ngh pr create --fill-first              # use first commit only\ngh pr create --fill-verbose            # use commit messages + bodies\ngh pr create --draft                   # create as draft\ngh pr create --base develop            # target branch\ngh pr create --head owner:feature-branch\ngh pr create --reviewer monalisa,hubot --reviewer myorg/team-name\ngh pr create --label \"bug\" --assignee \"@me\"\ngh pr create --project \"Roadmap\"\ngh pr create --milestone \"v2.0\"\ngh pr create --template \"pull_request_template.md\"\ngh pr create --no-maintainer-edit      # prevent maintainers from pushing\ngh pr create --dry-run                 # preview without creating\n\nList\ngh pr list\ngh pr list --state merged --limit 50\ngh pr list --state all\ngh pr list --author \"@me\"\ngh pr list --assignee monalisa\ngh pr list --label \"bug\" --label \"priority\"\ngh pr list --base main\ngh pr list --head feature-branch\ngh pr list --draft                     # only drafts\ngh pr list --search \"status:success review:required\"\ngh pr list --search \"<SHA>\" --state merged   # find PR for a commit\n\n# JSON output\ngh pr list --json number,title,author,state --jq '.[].title'\n\n\nJSON fields for PRs: additions, assignees, author, autoMergeRequest, baseRefName, body, changedFiles, closed, closedAt, comments, commits, createdAt, deletions, files, headRefName, headRefOid, id, isDraft, labels, latestReviews, maintainerCanModify, mergeCommit, mergeStateStatus, mergeable, mergedAt, mergedBy, milestone, number, projectItems, reviewDecision, reviewRequests, reviews, state, statusCheckRollup, title, updatedAt, url\n\nView\ngh pr view 123\ngh pr view 123 --web\ngh pr view 123 --comments\ngh pr view 123 --json title,body,reviews,mergeable\ngh pr view feature-branch              # by branch name\n\nCheckout\ngh pr checkout 123\ngh pr checkout 123 --branch local-name\ngh pr checkout 123 --force             # reset existing local branch\ngh pr checkout 123 --recurse-submodules\ngh co 123                              # alias\n\nDiff\ngh pr diff 123\ngh pr diff 123 --name-only             # list changed files\ngh pr diff 123 --patch                 # patch format\n\nMerge\ngh pr merge 123 --merge                # merge commit\ngh pr merge 123 --squash               # squash merge\ngh pr merge 123 --rebase               # rebase merge\ngh pr merge 123 --squash --delete-branch\ngh pr merge 123 --auto --squash        # enable auto-merge\ngh pr merge 123 --disable-auto         # disable auto-merge\ngh pr merge 123 --admin                # bypass merge queue / requirements\ngh pr merge 123 --squash --subject \"feat: new feature\" --body \"Details\"\n\nReview\ngh pr review 123 --approve\ngh pr review 123 --comment --body \"LGTM\"\ngh pr review 123 --request-changes --body \"Please fix the tests\"\ngh pr review                           # review current branch's PR\n\nChecks (CI Status)\ngh pr checks 123\ngh pr checks 123 --watch               # live-update until done\ngh pr checks 123 --watch --fail-fast   # stop on first failure\ngh pr checks 123 --required            # only required checks\ngh pr checks 123 --json name,state,bucket\ngh pr checks 123 --web\n\n# Exit codes: 0=pass, 1=fail, 8=pending\n\n\nJSON fields for checks: bucket, completedAt, description, event, link, name, startedAt, state, workflow\n\nEdit\ngh pr edit 123 --title \"New title\" --body \"New body\"\ngh pr edit 123 --add-label \"bug\" --remove-label \"wip\"\ngh pr edit 123 --add-reviewer monalisa --remove-reviewer hubot\ngh pr edit 123 --add-assignee \"@me\"\ngh pr edit 123 --add-project \"Roadmap\"\ngh pr edit 123 --base develop          # change target branch\ngh pr edit 123 --milestone \"v2.0\"\n\nClose / Reopen\ngh pr close 123\ngh pr close 123 --comment \"Superseded by #456\" --delete-branch\ngh pr reopen 123\n\nReady / Draft\ngh pr ready 123           # mark ready for review\ngh pr ready 123 --undo    # convert back to draft (requires plan support)\n\nUpdate Branch\ngh pr update-branch 123              # merge base into head\ngh pr update-branch 123 --rebase    # rebase head onto base\n\nComment\ngh pr comment 123 --body \"Comment text\"\ngh pr comment 123 --body-file comment.md\n\nLock / Unlock\ngh pr lock 123\ngh pr unlock 123\n\n5. GitHub Actions (Runs & Workflows)\nWorkflow Runs\n# List runs\ngh run list\ngh run list --limit 50\ngh run list --workflow build.yml\ngh run list --branch main\ngh run list --status failure\ngh run list --user monalisa\ngh run list --event push\ngh run list --commit abc123\ngh run list --json name,status,conclusion,url\n\n# View a run\ngh run view 12345\ngh run view 12345 --verbose            # show job steps\ngh run view 12345 --log                # full log output\ngh run view 12345 --log-failed         # only failed step logs\ngh run view 12345 --job 456789         # specific job\ngh run view 12345 --job 456789 --log   # specific job logs\ngh run view 12345 --attempt 3          # specific attempt\ngh run view 12345 --web\n\n# Watch a run (live progress)\ngh run watch 12345\ngh run watch 12345 --exit-status       # exit non-zero on failure\n\n# Rerun\ngh run rerun 12345                     # rerun entire run\ngh run rerun 12345 --failed            # rerun only failed jobs\ngh run rerun 12345 --debug             # rerun with debug logging\ngh run rerun 12345 --job 456789        # rerun specific job\n\n# ⚠️ GOTCHA: --job needs databaseId, NOT the number from the URL!\n# Get the right ID:\ngh run view 12345 --json jobs --jq '.jobs[] | {name, databaseId}'\n\n# Cancel\ngh run cancel 12345\n\n# Delete\ngh run delete 12345\n\n# Download artifacts\ngh run download 12345                  # all artifacts\ngh run download 12345 --name \"build-output\"\ngh run download 12345 --dir ./artifacts\ngh run download --name \"coverage\" --pattern \"*.xml\"\n\n\nJSON fields for runs: attempt, conclusion, createdAt, databaseId, displayTitle, event, headBranch, headSha, name, number, startedAt, status, updatedAt, url, workflowDatabaseId, workflowName\n\nWorkflows\n# List workflows\ngh workflow list\ngh workflow list --all                  # include disabled\n\n# View a workflow\ngh workflow view build.yml\ngh workflow view build.yml --web\n\n# Run a workflow (workflow_dispatch)\ngh workflow run build.yml\ngh workflow run build.yml --ref my-branch\ngh workflow run build.yml -f name=value -f env=prod\necho '{\"name\":\"value\"}' | gh workflow run build.yml --json\n\n# Enable / disable\ngh workflow enable build.yml\ngh workflow disable build.yml\n\n6. Releases\nCreate\n# Interactive\ngh release create\n\n# With tag + notes\ngh release create v1.2.3 --notes \"Bug fix release\"\ngh release create v1.2.3 --generate-notes            # auto-generated notes\ngh release create v1.2.3 --notes-from-tag             # from annotated tag\ngh release create v1.2.3 -F CHANGELOG.md              # notes from file\ngh release create v1.2.3 --draft                      # save as draft\ngh release create v1.2.3 --prerelease\ngh release create v1.2.3 --latest=false               # don't mark as latest\ngh release create v1.2.3 --target release-branch      # tag from specific branch\ngh release create v1.2.3 --verify-tag                 # abort if tag doesn't exist\ngh release create v1.2.3 --discussion-category \"General\"\n\n# With assets\ngh release create v1.2.3 ./dist/*.tar.gz\ngh release create v1.2.3 'binary.zip#Linux Build'     # with display label\n\nList / View\ngh release list\ngh release list --limit 50\ngh release view v1.2.3\ngh release view v1.2.3 --web\ngh release view --json tagName,publishedAt,assets\n\nDownload\ngh release download v1.2.3                    # all assets\ngh release download v1.2.3 --pattern '*.deb'\ngh release download v1.2.3 -p '*.deb' -p '*.rpm'\ngh release download v1.2.3 --archive zip      # source code archive\ngh release download v1.2.3 --dir ./downloads\ngh release download v1.2.3 --output single-file.tar.gz\ngh release download --pattern '*.AppImage'    # latest release (no tag arg)\n\nEdit / Upload / Delete\ngh release edit v1.2.3 --title \"New Title\" --notes \"Updated notes\"\ngh release edit v1.2.3 --draft=false          # publish a draft\ngh release edit v1.2.3 --prerelease=false\ngh release upload v1.2.3 ./new-asset.zip\ngh release upload v1.2.3 'asset.tar.gz#Display Label'\ngh release delete v1.2.3 --yes\ngh release delete-asset v1.2.3 asset-name\n\n7. Gists\n# Create\ngh gist create file.py                        # secret gist\ngh gist create --public file.py               # public gist\ngh gist create file.py -d \"My Python snippet\"\ngh gist create file1.py file2.js              # multi-file gist\necho \"hello\" | gh gist create -               # from stdin\ncat data.json | gh gist create --filename data.json\n\n# List\ngh gist list\ngh gist list --public\ngh gist list --secret\ngh gist list --limit 50\n\n# View\ngh gist view GIST_ID\ngh gist view GIST_ID --raw                    # raw content\ngh gist view GIST_ID --filename file.py       # specific file\n\n# Edit\ngh gist edit GIST_ID\ngh gist edit GIST_ID --add newfile.txt\ngh gist edit GIST_ID --filename file.py       # edit specific file\n\n# Rename\ngh gist rename GIST_ID old-name.py new-name.py\n\n# Clone\ngh gist clone GIST_ID\n\n# Delete\ngh gist delete GIST_ID\n\n8. Search\nRepos\ngh search repos \"vim plugin\"\ngh search repos --owner=microsoft --visibility=public\ngh search repos --language=go --stars=\">1000\"\ngh search repos --topic=cli,automation\ngh search repos --good-first-issues=\">=10\"\ngh search repos --archived=false\ngh search repos cli shell --sort stars --limit 10\ngh search repos --json fullName,stargazersCount,description\n\nIssues\ngh search issues \"memory leak\"\ngh search issues --assignee=@me --state=open\ngh search issues --owner=cli --label=\"bug\"\ngh search issues --comments=\">100\"\ngh search issues --repo owner/repo \"error\"\ngh search issues -- -label:bug                # exclude label\ngh search issues --json number,title,repository,state\n\nPull Requests\ngh search prs \"fix bug\"\ngh search prs --repo=cli/cli --draft\ngh search prs --review-requested=@me --state=open\ngh search prs --assignee=@me --merged\ngh search prs --checks=success --review=approved\ngh search prs --json number,title,repository,state\n\nCommits\ngh search commits \"bug fix\"\ngh search commits --author=monalisa\ngh search commits --committer-date=\"<2024-01-01\"\ngh search commits --repo=cli/cli --hash=abc123\ngh search commits --json sha,commit,repository\n\nCode\ngh search code \"TODO\" --repo=owner/repo\ngh search code \"import React\" --language=typescript\ngh search code \"api_key\" --filename=\".env\"\ngh search code panic --owner=cli --extension=go\ngh search code --json path,repository,textMatches\n\n9. Labels\n# List\ngh label list\ngh label list -R owner/repo\ngh label list --json name,color,description\n\n# Create\ngh label create \"priority:high\" --color FF0000 --description \"High priority\"\n\n# Edit\ngh label edit \"bug\" --name \"bug 🐛\" --color 00FF00 --description \"Something broken\"\n\n# Delete\ngh label delete \"old-label\" --yes\n\n# Clone labels from one repo to another\ngh label clone source-owner/source-repo --repo dest-owner/dest-repo\n\n10. Secrets & Variables\nSecrets (encrypted)\n# Set (repo-level, for Actions)\ngh secret set MY_SECRET --body \"secret-value\"\ngh secret set MY_SECRET < secret-file.txt\necho \"value\" | gh secret set MY_SECRET\n\n# Set for specific app\ngh secret set MY_SECRET --app dependabot --body \"value\"\ngh secret set MY_SECRET --app codespaces --body \"value\"\n\n# Set environment secret\ngh secret set MY_SECRET --env production --body \"value\"\n\n# Set org-level secret\ngh secret set MY_SECRET --org my-org --visibility all --body \"value\"\ngh secret set MY_SECRET --org my-org --visibility selected --repos repo1,repo2\n\n# Set user secret (for Codespaces)\ngh secret set MY_SECRET --user --body \"value\"\n\n# Bulk set from .env file\ngh secret set -f .env\n\n# List\ngh secret list\ngh secret list --env production\ngh secret list --org my-org\n\n# Delete\ngh secret delete MY_SECRET\ngh secret delete MY_SECRET --env production\ngh secret delete MY_SECRET --org my-org\n\nVariables (plaintext)\n# Set\ngh variable set MY_VAR --body \"value\"\ngh variable set MY_VAR --env staging --body \"value\"\ngh variable set MY_VAR --org my-org --visibility all --body \"value\"\n\n# Bulk set from .env file\ngh variable set -f .env\n\n# Get\ngh variable get MY_VAR\n\n# List\ngh variable list\ngh variable list --env production\ngh variable list --org my-org\n\n# Delete\ngh variable delete MY_VAR\ngh variable delete MY_VAR --env production\n\n11. Caches\n# List Actions caches\ngh cache list\ngh cache list --limit 100\ngh cache list --sort size --order desc\n\n# Delete\ngh cache delete CACHE_KEY\ngh cache delete --all\n\n12. Projects V2\n\n⚠️ Requires project scope: gh auth refresh -s project\n\nProjects V2 uses the GraphQL-based ProjectsV2 API. The CLI provides commands for most operations, but some advanced field mutations require direct GraphQL via gh api graphql.\n\nList Projects\ngh project list                           # your projects\ngh project list --owner my-org            # org projects\ngh project list --owner my-org --closed   # include closed\ngh project list --format json             # JSON output\n\nCreate\ngh project create --owner \"@me\" --title \"My Roadmap\"\ngh project create --owner my-org --title \"Sprint Board\"\n\nView\ngh project view 1                         # by number\ngh project view 1 --owner my-org\ngh project view 1 --web                   # open in browser\ngh project view 1 --format json\n\nEdit\ngh project edit 1 --owner \"@me\" --title \"New Title\"\ngh project edit 1 --description \"Updated description\"\ngh project edit 1 --readme \"Project README content\"\ngh project edit 1 --visibility PUBLIC     # PUBLIC or PRIVATE\n\nClose / Reopen / Delete\ngh project close 1 --owner \"@me\"\ngh project close 1 --owner \"@me\" --undo   # reopen\ngh project delete 1 --owner \"@me\"\n\nCopy\ngh project copy 1 --source-owner monalisa --target-owner my-org --title \"Copied Project\"\ngh project copy 1 --source-owner monalisa --target-owner my-org --drafts  # include drafts\n\nLink / Unlink to Repository or Team\ngh project link 1 --owner monalisa --repo my-repo\ngh project link 1 --owner my-org --team my-team\ngh project unlink 1 --owner monalisa --repo my-repo\n\nMark as Template\ngh project mark-template 1 --owner my-org\ngh project mark-template 1 --owner my-org --undo\n\nFields\n# List fields (shows IDs needed for item-edit)\ngh project field-list 1 --owner \"@me\"\ngh project field-list 1 --owner \"@me\" --format json\n\n# Create field\ngh project field-create 1 --owner \"@me\" --name \"Priority\" --data-type \"SINGLE_SELECT\" \\\n  --single-select-options \"Low,Medium,High,Critical\"\ngh project field-create 1 --owner \"@me\" --name \"Points\" --data-type \"NUMBER\"\ngh project field-create 1 --owner \"@me\" --name \"Notes\" --data-type \"TEXT\"\ngh project field-create 1 --owner \"@me\" --name \"Due Date\" --data-type \"DATE\"\n\n# Delete field\ngh project field-delete --id FIELD_NODE_ID\n\n\nField data types: TEXT, SINGLE_SELECT, DATE, NUMBER\n(Iteration fields must be created via the web UI or GraphQL)\n\nItems\n# List items\ngh project item-list 1 --owner \"@me\"\ngh project item-list 1 --owner \"@me\" --limit 100\ngh project item-list 1 --owner \"@me\" --format json\n\n# Add an existing issue/PR to project\ngh project item-add 1 --owner \"@me\" --url https://github.com/owner/repo/issues/123\n\n# Create a draft issue in project\ngh project item-create 1 --owner \"@me\" --title \"Draft task\" --body \"Details\"\n\n# Edit a draft issue (title/body)\ngh project item-edit --id ITEM_NODE_ID --title \"Updated title\" --body \"Updated body\"\n\n# Edit a field value on an item\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --text \"some value\"\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --number 5\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --date \"2024-12-31\"\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --single-select-option-id OPTION_ID\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID \\\n  --iteration-id ITERATION_ID\n\n# Clear a field value\ngh project item-edit --id ITEM_NODE_ID --field-id FIELD_ID --project-id PROJECT_ID --clear\n\n# Archive / unarchive item\ngh project item-archive 1 --owner \"@me\" --id ITEM_NODE_ID\ngh project item-archive 1 --owner \"@me\" --id ITEM_NODE_ID --undo\n\n# Delete item from project\ngh project item-delete 1 --owner \"@me\" --id ITEM_NODE_ID\n\nGetting Node IDs (Essential for item-edit)\n\nThe item-edit command requires node IDs for the item, field, project, and option. Here's how to get them:\n\n# Get project ID and item IDs\ngh project item-list 1 --owner \"@me\" --format json | jq '.'\n\n# Get field IDs and single-select option IDs\ngh project field-list 1 --owner \"@me\" --format json | jq '.'\n\n# Via GraphQL (more control)\ngh api graphql -f query='\n  query {\n    user(login: \"USERNAME\") {\n      projectV2(number: 1) {\n        id\n        fields(first: 50) {\n          nodes {\n            ... on ProjectV2SingleSelectField {\n              id\n              name\n              options { id name }\n            }\n            ... on ProjectV2IterationField {\n              id\n              name\n              configuration {\n                iterations { id title startDate duration }\n              }\n            }\n            ... on ProjectV2Field {\n              id\n              name\n              dataType\n            }\n          }\n        }\n      }\n    }\n  }\n'\n\nProjects V2 via GraphQL (for what the CLI can't do)\n\nSome operations require direct GraphQL:\n\n# Update a field value (equivalent to item-edit but more flexible)\ngh api graphql -f query='\n  mutation {\n    updateProjectV2ItemFieldValue(input: {\n      projectId: \"PVT_xxxx\"\n      itemId: \"PVTI_xxxx\"\n      fieldId: \"PVTF_xxxx\"\n      value: { singleSelectOptionId: \"option_id\" }\n    }) {\n      projectV2Item { id }\n    }\n  }\n'\n\n# Add issue/PR to project via GraphQL\ngh api graphql -f query='\n  mutation {\n    addProjectV2ItemById(input: {\n      projectId: \"PVT_xxxx\"\n      contentId: \"I_xxxx\"\n    }) {\n      item { id }\n    }\n  }\n'\n\n# Update draft issue\ngh api graphql -f query='\n  mutation {\n    updateProjectV2DraftIssue(input: {\n      draftIssueId: \"DI_xxxx\"\n      title: \"New Title\"\n      body: \"New body\"\n    }) {\n      draftIssue { id title }\n    }\n  }\n'\n\n# Convert draft to real issue\ngh api graphql -f query='\n  mutation {\n    convertProjectV2DraftIssueItemToIssue(input: {\n      projectId: \"PVT_xxxx\"\n      itemId: \"PVTI_xxxx\"\n      repositoryId: \"R_xxxx\"\n    }) {\n      item {\n        id\n        content {\n          ... on Issue { id number url }\n        }\n      }\n    }\n  }\n'\n\n# Get all items with field values\ngh api graphql -f query='\n  query {\n    user(login: \"USERNAME\") {\n      projectV2(number: 1) {\n        items(first: 100) {\n          nodes {\n            id\n            content {\n              ... on Issue { title number url }\n              ... on PullRequest { title number url }\n              ... on DraftIssue { title body }\n            }\n            fieldValues(first: 20) {\n              nodes {\n                ... on ProjectV2ItemFieldTextValue { text field { ... on ProjectV2Field { name } } }\n                ... on ProjectV2ItemFieldNumberValue { number field { ... on ProjectV2Field { name } } }\n                ... on ProjectV2ItemFieldDateValue { date field { ... on ProjectV2Field { name } } }\n                ... on ProjectV2ItemFieldSingleSelectValue { name field { ... on ProjectV2SingleSelectField { name } } }\n                ... on ProjectV2ItemFieldIterationValue { title field { ... on ProjectV2IterationField { name } } }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n'\n\nProjects V2 Workflow (Complete Example)\n# 1. Create a project\ngh project create --owner \"@me\" --title \"Sprint 1\"\n\n# 2. Add fields\ngh project field-create 1 --owner \"@me\" --name \"Status\" \\\n  --data-type SINGLE_SELECT --single-select-options \"Todo,In Progress,Done\"\ngh project field-create 1 --owner \"@me\" --name \"Priority\" \\\n  --data-type SINGLE_SELECT --single-select-options \"Low,Medium,High\"\ngh project field-create 1 --owner \"@me\" --name \"Points\" --data-type NUMBER\n\n# 3. Get field IDs\nFIELDS=$(gh project field-list 1 --owner \"@me\" --format json)\necho \"$FIELDS\" | jq '.'\n\n# 4. Add issues to project\ngh project item-add 1 --owner \"@me\" --url https://github.com/owner/repo/issues/1\ngh project item-add 1 --owner \"@me\" --url https://github.com/owner/repo/issues/2\n\n# 5. Create draft issues\ngh project item-create 1 --owner \"@me\" --title \"Research task\" --body \"Investigate X\"\n\n# 6. Set field values on items (need IDs from steps 3-5)\ngh project item-edit --id ITEM_ID --field-id STATUS_FIELD_ID \\\n  --project-id PROJECT_ID --single-select-option-id TODO_OPTION_ID\n\n# 7. Link project to repo\ngh project link 1 --owner \"@me\" --repo my-repo\n\n13. API (REST & GraphQL)\nREST API\n# GET request (default)\ngh api repos/{owner}/{repo}\ngh api repos/cli/cli/releases --jq '.[].tag_name'\n\n# With query parameters\ngh api -X GET search/issues -f q='repo:cli/cli is:open label:bug'\n\n# POST request\ngh api repos/{owner}/{repo}/issues -f title=\"New Issue\" -f body=\"Description\"\ngh api repos/{owner}/{repo}/issues/123/comments -f body='Comment text'\n\n# PATCH / PUT / DELETE\ngh api -X PATCH repos/{owner}/{repo} -f description=\"Updated\"\ngh api -X DELETE repos/{owner}/{repo}/issues/123/labels/bug\n\n# With typed fields (-F for auto-type-conversion, -f for raw strings)\ngh api repos/{owner}/{repo}/issues -f title=\"Bug\" -F private=true -F number:=42\n\n# Request body from file\ngh api repos/{owner}/{repo}/issues --input issue.json\n\n# Custom headers\ngh api -H 'Accept: application/vnd.github.v3.raw+json' repos/{owner}/{repo}/readme\n\n# Include response headers\ngh api -i repos/{owner}/{repo}\n\n# Verbose output (shows full HTTP request/response)\ngh api --verbose repos/{owner}/{repo}\n\n# Silent (no output)\ngh api --silent repos/{owner}/{repo}/issues/123/labels -f labels[]=bug\n\n# Caching\ngh api --cache 3600s repos/{owner}/{repo}/releases\n\nPlaceholders\n\nThe special placeholders {owner}, {repo}, and {branch} are auto-populated from the current git directory or GH_REPO.\n\nPagination\n# Auto-paginate REST results\ngh api --paginate repos/{owner}/{repo}/issues --jq '.[].title'\n\n# Slurp all pages into single array\ngh api --paginate --slurp repos/{owner}/{repo}/issues | jq 'flatten | length'\n\nGraphQL API\n# Basic query\ngh api graphql -f query='{ viewer { login } }'\n\n# With variables\ngh api graphql -F owner='{owner}' -F name='{repo}' -f query='\n  query($owner: String!, $name: String!) {\n    repository(owner: $owner, name: $name) {\n      releases(last: 5) {\n        nodes { tagName publishedAt }\n      }\n    }\n  }\n'\n\n# Mutation\ngh api graphql -f query='\n  mutation {\n    addStar(input: {starrableId: \"MDEwOlJlcG9zaXRvcnkxMjM=\"}) {\n      starrable { stargazerCount }\n    }\n  }\n'\n\n# Paginated GraphQL (requires $endCursor variable and pageInfo)\ngh api graphql --paginate -f query='\n  query($endCursor: String) {\n    viewer {\n      repositories(first: 100, after: $endCursor) {\n        nodes { nameWithOwner }\n        pageInfo { hasNextPage endCursor }\n      }\n    }\n  }\n'\n\n# GraphQL with JQ filtering\ngh api graphql -f query='{ viewer { repositories(first: 10) { nodes { nameWithOwner stargazerCount } } } }' \\\n  --jq '.data.viewer.repositories.nodes[] | \"\\(.nameWithOwner): \\(.stargazerCount) ⭐\"'\n\nCommon GraphQL Patterns\n# Get repository ID (needed for many mutations)\ngh api graphql -f query='query { repository(owner: \"OWNER\", name: \"REPO\") { id } }' \\\n  --jq '.data.repository.id'\n\n# Get issue/PR node ID\ngh api graphql -f query='\n  query {\n    repository(owner: \"OWNER\", name: \"REPO\") {\n      issue(number: 123) { id }\n    }\n  }\n' --jq '.data.repository.issue.id'\n\n# Get user/org ID\ngh api graphql -f query='query { user(login: \"USERNAME\") { id } }' --jq '.data.user.id'\n\n# Check rate limit\ngh api graphql -f query='{ rateLimit { limit remaining resetAt } }'\ngh api rate_limit --jq '.rate'\n\n14. Extensions\n# Search for extensions\ngh extension search \"copilot\"\ngh extension search --limit 30\n\n# Browse extensions in TUI\ngh extension browse\n\n# Install\ngh extension install owner/gh-extension-name\ngh extension install https://github.com/owner/gh-extension-name\n\n# List installed\ngh extension list\n\n# Upgrade\ngh extension upgrade extension-name\ngh extension upgrade --all\n\n# Remove\ngh extension remove extension-name\n\n# Execute (useful if name conflicts with core command)\ngh extension exec extension-name\n\n# Create a new extension\ngh extension create my-extension\ngh extension create my-extension --precompiled=go\n\n15. Codespaces\n# List\ngh codespace list\n\n# Create\ngh codespace create --repo owner/repo\ngh codespace create --repo owner/repo --branch feature --machine largePremiumLinux\n\n# SSH into codespace\ngh codespace ssh\n\n# Open in VS Code\ngh codespace code\n\n# Copy files\ngh codespace cp local-file.txt remote:~/path/\ngh codespace cp remote:~/path/file.txt ./local/\n\n# View details\ngh codespace view\n\n# Port forwarding\ngh codespace ports\n\n# Rebuild\ngh codespace rebuild\n\n# Stop / Delete\ngh codespace stop\ngh codespace delete\n\n16. Copilot\n\n(Requires gh-copilot extension)\n\n# Suggest a command\ngh copilot suggest \"find large files in current directory\"\n\n# Explain a command\ngh copilot explain \"find . -type f -size +100M -exec ls -lh {} +\"\n\n# Configure\ngh copilot config\n\n17. Other Commands\nBrowse (open in browser)\ngh browse                          # repo home\ngh browse 123                      # issue or PR #123\ngh browse src/main.go              # specific file\ngh browse src/main.go:42           # file at line\ngh browse --settings               # repo settings\ngh browse --projects                # repo projects\ngh browse --releases                # repo releases\ngh browse --branch feature src/    # specific branch\ngh browse --commit abc123          # specific commit\ngh browse -n                       # print URL instead of opening\n\nStatus (cross-repo overview)\ngh status                          # assigned issues, PRs, review requests, mentions\ngh status --org my-org             # limit to org\ngh status -e owner/repo            # exclude repo\n\nAliases\ngh alias set pv 'pr view'\ngh alias set bugs 'issue list --label=bug'\ngh alias set --shell igrep 'gh issue list --label=\"$1\" | grep \"$2\"'\ngh alias list\ngh alias delete pv\ngh alias import aliases.yml\n\nSSH Keys / GPG Keys\ngh ssh-key list\ngh ssh-key add ~/.ssh/id_ed25519.pub --title \"My Laptop\"\ngh ssh-key delete KEY_ID\n\ngh gpg-key list\ngh gpg-key add pubkey.gpg\ngh gpg-key delete KEY_ID\n\nRulesets\ngh ruleset list\ngh ruleset view RULESET_ID\ngh ruleset check branch-name      # what rules apply to this branch\n\nAttestations\ngh attestation verify artifact.tar.gz --owner owner\ngh attestation download --owner owner artifact.tar.gz\n\nOrg\ngh org list\n\n18. JSON Output & Formatting\n\nMost listing/view commands support --json, --jq, and --template flags.\n\nBasic JSON\n# Discover available fields (pass --json with no value)\ngh pr list --json\n\n# Select specific fields\ngh pr list --json number,title,author\n\n# JQ filtering\ngh pr list --json number,title,author --jq '.[].author.login'\ngh issue list --json number,title,labels --jq '\n  map(select(.labels | length > 0))\n  | map(.labels = (.labels | map(.name)))\n  | .[:5]\n'\n\nGo Template Formatting\n# Table output\ngh pr list --json number,title,headRefName,updatedAt --template \\\n  '{{range .}}{{tablerow (printf \"#%v\" .number | autocolor \"green\") .title .headRefName (timeago .updatedAt)}}{{end}}'\n\n# Hyperlinks\ngh issue list --json title,url --template \\\n  '{{range .}}{{hyperlink .url .title}}{{\"\\n\"}}{{end}}'\n\n# Color\ngh pr list --json title,state --template \\\n  '{{range .}}{{.title}} ({{.state | color \"green\"}}){{\"\\n\"}}{{end}}'\n\nTemplate Functions\nFunction\tDescription\nautocolor <style> <input>\tColor (terminal-aware)\ncolor <style> <input>\tForce color\njoin <sep> <list>\tJoin list values\npluck <field> <list>\tExtract field from list items\ntablerow <fields>...\tAligned table columns\ntablerender\tRender accumulated tablerows\ntimeago <time>\tRelative timestamp\ntimefmt <format> <time>\tFormatted timestamp\ntruncate <length> <input>\tTruncate text\nhyperlink <url> <text>\tTerminal hyperlink\n19. Environment Variables\nVariable\tPurpose\nGH_TOKEN / GITHUB_TOKEN\tAuth token for github.com (takes precedence over stored creds)\nGH_ENTERPRISE_TOKEN / GITHUB_ENTERPRISE_TOKEN\tAuth token for GHES\nGH_HOST\tDefault GitHub hostname\nGH_REPO\tDefault repository in [HOST/]OWNER/REPO format\nGH_EDITOR\tEditor for authoring text\nGH_BROWSER / BROWSER\tWeb browser for opening links\nGH_PAGER / PAGER\tTerminal pager (e.g., less)\nGH_DEBUG\tEnable verbose output (1 or api for HTTP traffic)\nGH_FORCE_TTY\tForce terminal output (value = column count or percentage)\nGH_PROMPT_DISABLED\tDisable interactive prompts\nGH_NO_UPDATE_NOTIFIER\tDisable update notifications\nGH_CONFIG_DIR\tCustom config directory\nNO_COLOR\tDisable colored output\nGLAMOUR_STYLE\tMarkdown rendering style\n20. Advanced Patterns\nScripting Best Practices\n# Disable prompts for non-interactive use\nGH_PROMPT_DISABLED=1 gh pr create --fill\n\n# Use GH_TOKEN for CI/automation\nGH_TOKEN=${{ github.token }} gh pr list\n\n# Use GH_REPO to avoid -R everywhere\nexport GH_REPO=owner/repo\ngh issue list   # targets owner/repo\n\nBatch Operations\n# Close all issues with a label\ngh issue list --label \"wontfix\" --json number --jq '.[].number' | \\\n  xargs -I{} gh issue close {} --reason \"not planned\"\n\n# Add label to all open PRs\ngh pr list --json number --jq '.[].number' | \\\n  xargs -I{} gh pr edit {} --add-label \"needs-review\"\n\n# Download all artifacts from recent failed runs\ngh run list --status failure --json databaseId --jq '.[].databaseId' | \\\n  xargs -I{} gh run download {}\n\nWorking with Multiple Accounts\n# List configured accounts\ngh auth status\n\n# Switch active account\ngh auth switch\n\n# Use a specific token for one command\nGH_TOKEN=ghp_xxx gh api user --jq '.login'\n\n# Login to multiple hosts\ngh auth login --hostname github.com\ngh auth login --hostname github.enterprise.com\n\nRate Limiting\n# Check current rate limit\ngh api rate_limit --jq '.rate | \"\\(.remaining)/\\(.limit) (resets \\(.reset | strftime(\"%H:%M:%S\")))\"'\n\n# GraphQL rate limit (separate pool)\ngh api graphql -f query='{ rateLimit { limit remaining resetAt } }'\n\n# Use caching to reduce API calls\ngh api --cache 3600s repos/{owner}/{repo}/releases\n\nComplex API Patterns\n# Nested parameters\ngh api gists -F 'files[myfile.txt][content]=@myfile.txt'\n\n# Array parameters\ngh api -X PATCH /orgs/{org}/properties/schema \\\n  -F 'properties[][property_name]=env' \\\n  -F 'properties[][allowed_values][]=staging' \\\n  -F 'properties[][allowed_values][]=production'\n\n# Combine REST pagination with JQ\ngh api --paginate repos/{owner}/{repo}/issues --jq '[.[] | select(.labels | length > 0)] | length'\n\n# GraphQL with slurp for aggregation\ngh api graphql --paginate --slurp -f query='\n  query($endCursor: String) {\n    viewer {\n      repositories(first: 100, after: $endCursor) {\n        nodes { isFork stargazerCount }\n        pageInfo { hasNextPage endCursor }\n      }\n    }\n  }\n' | jq '[.[].data.viewer.repositories.nodes[]] | map(.stargazerCount) | add'\n\n21. Tips & Gotchas\nCommon Mistakes\n\n--json field names differ from API field names. For example, PR files use files (not changed_files), author uses author.login (not user.login). Always run gh <cmd> --json without arguments to see available fields.\n\ngh run rerun --job needs databaseId, not the URL number. Get it with:\n\ngh run view RUN_ID --json jobs --jq '.jobs[] | {name, databaseId}'\n\n\nProjects V2 require the project scope. If you get permission errors:\n\ngh auth refresh -s project\n\n\ngh repo delete requires delete_repo scope:\n\ngh auth refresh -s delete_repo\n\n\nSubcommand quoting in shells: PowerShell and some shells need {owner} escaped. Use quotes: \"{owner}\".\n\nWhen to Use gh api vs Specific Commands\nUse specific commands when...\tUse gh api when...\nThe command exists and does what you need\tNo CLI command covers the endpoint\nYou want interactive prompts\tYou need fine-grained control\nYou want pretty-printed output\tYou want raw JSON response\nYou're doing simple CRUD\tYou need GraphQL queries\n\tYou need to set custom headers\n\tYou need pagination control\nPerformance Tips\nUse --limit to fetch only what you need\nUse --json with specific fields (fetches less data)\nUse --cache with gh api for frequently accessed, slowly changing data\nUse --paginate --slurp for aggregations across all pages\nSet GH_PAGER=cat to disable paging in scripts\nExit Codes\nCode\tMeaning\n0\tSuccess\n1\tError / failure\n2\tUsage error\n4\tCommand cancelled\n8\tChecks pending (for gh pr checks)\nAuthentication Precedence\nGH_TOKEN / GITHUB_TOKEN environment variable\nGH_ENTERPRISE_TOKEN (for GHES hosts)\nStored credentials from gh auth login\n.env file in repo (only if configured)\nUseful One-Liners\n# My open PRs across all repos\ngh search prs --author=@me --state=open --json repository,number,title\n\n# Repos I starred recently\ngh api --paginate user/starred --jq '.[].full_name' | head -20\n\n# Who's the top contributor to a repo\ngh api --paginate repos/owner/repo/contributors --jq '.[] | \"\\(.login): \\(.contributions)\"' | head -10\n\n# Create issue from clipboard\npbpaste | gh issue create --title \"From clipboard\" --body-file -\n\n# Get latest release tag\ngh release view --json tagName --jq '.tagName'\n\n# Watch CI and notify on completion\ngh run watch && notify-send \"CI done!\"\n\n# Export all issues as JSON\ngh issue list --state all --limit 9999 --json number,title,state,labels,assignees > issues.json\n\n# Find which PR merged a commit\ngh pr list --search \"SHA_HERE\" --state merged --json number,title,url"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/tag-assistant/github-cli",
    "publisherUrl": "https://clawhub.ai/tag-assistant/github-cli",
    "owner": "tag-assistant",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/github-cli",
    "downloadUrl": "https://openagent3.xyz/downloads/github-cli",
    "agentUrl": "https://openagent3.xyz/skills/github-cli/agent",
    "manifestUrl": "https://openagent3.xyz/skills/github-cli/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/github-cli/agent.md"
  }
}