AgentSkillsCN

cli-gh

当用户需要协助使用 gh CLI 命令时,可使用此技能,涵盖 agent-task、alias、attestation(下载并验证制品证明)、auth(使用 GitHub 认证 gh 与 Git)、cache(处理 GitHub Actions 缓存)、codespace(连接并管理 Codespaces)、config(显示或更改 gh 的配置设置)、extension、gist(处理 GitHub Gist)、gpg-key、issue(处理 GitHub Issues)、label(处理 GitHub Labels)、org(处理 GitHub Organizations)、pr(处理 GitHub Pull Requests)、preview(预览命令用于测试)、project(处理 GitHub Projects)、release(管理发布)、repo(处理 GitHub Repositories)、ruleset、run(列出)、search(在 GitHub 全局范围内搜索)、secret(可在仓库级别设置密钥)、ssh-key、variable(可在仓库级别设置变量)、workflow(列出)、api、browse、completion、copilot、status。全面覆盖 30 条 gh 命令的标志、子命令、使用模式以及故障排除方法。

SKILL.md
--- frontmatter
name: cli-gh
description: >-
  This skill should be used when the user needs help with gh CLI commands, including agent-task, alias, attestation (download and verify artifact attestations), auth (authenticate gh and git with github), cache (work with github actions caches), codespace (connect to and manage codespaces), config (display or change configuration settings for gh), extension, gist (work with github gists), gpg-key, issue (work with github issues), label (work with github labels), org (work with github organizations), pr (work with github pull requests), preview (preview commands are for testing), project (work with github projects), release (manage releases), repo (work with github repositories), ruleset, run (list), search (search across all of github), secret (secrets can be set at the repository), ssh-key, variable (variables can be set at the repository), workflow (list), api, browse, completion, copilot, status. Covers flags, subcommands, usage patterns, and troubleshooting for all 30 gh commands.

gh CLI Reference

Expert command reference for gh v2.86.0.

  • 212 commands (30 with subcommands)
  • 1095 command flags + 2 global flags
  • 166 usage examples
  • Max nesting depth: 2

When to Use

This skill applies when:

  • Constructing or validating gh commands
  • Looking up flags, options, or subcommands
  • Troubleshooting gh invocations or errors
  • Needing correct syntax for gh operations

Prerequisites

Ensure gh is installed and available on PATH.

Quick Reference

CommandDescription
gh agent-taskWorking with agent tasks in the GitHub CLI is in preview and
gh aliasAliases can be used to make shortcuts for gh commands or to compose multiple commands.
gh apiaccepts 1 arg(s), received 0
gh attestationDownload and verify artifact attestations.
gh authAuthenticate gh and git with GitHub
gh browseTransition from the terminal to the web browser to view and interact with:
gh cacheWork with GitHub Actions caches.
gh codespaceConnect to and manage codespaces
gh completionGenerate shell completion scripts for GitHub CLI commands.
gh configDisplay or change configuration settings for gh.
gh copilotRuns the GitHub Copilot CLI.
gh extensionGitHub CLI extensions are repositories that provide additional gh commands.
gh gistWork with GitHub gists.
gh gpg-keyManage GPG keys registered with your GitHub account.
gh issueWork with GitHub issues.
gh labelWork with GitHub labels.
gh orgWork with GitHub organizations.
gh prWork with GitHub pull requests.
gh previewPreview commands are for testing, demonstrative, and development purposes only.
gh projectWork with GitHub Projects.
gh releaseManage releases
gh repoWork with GitHub repositories.
gh rulesetRepository rulesets are a way to define a set of rules that apply to a repository.
gh runList, view, and watch recent workflow runs from GitHub Actions.
gh searchSearch across all of GitHub.
gh secretSecrets can be set at the repository, or organization level for use in
gh ssh-keyManage SSH keys registered with your GitHub account.
gh statusThe status command prints information about your work on GitHub across all the repositories you're subscribed to, including:
gh variableVariables can be set at the repository, environment or organization level for use in
gh workflowList, view, and run workflows in GitHub Actions.

Global Flags

FlagShortTypeDescription
--help``boolShow help for command
--version``boolShow gh version

Command Overview

Command Groups

agent-task, alias, attestation, auth, cache, codespace, config, extension, gist, gpg-key, issue, label, org, pr, preview, project, release, repo, ruleset, run, search, secret, ssh-key, variable, workflow

Commands

api, browse, completion, copilot, status

Common Usage Patterns

bash
gh agent-task list

gh agent-task create "Improve the performance of the data processing pipeline"

bash
gh agent-task view 123

gh agent-task view 12345abc-12345-12345-12345-12345abc

bash
gh agent-task create "build me a new app"

gh agent-task create "build me a new app" --follow

bash
gh agent-task create -F task-desc.md

echo "build me a new app" | gh agent-task create -F -

bash
gh agent-task create

gh agent-task create -F task-desc.md

bash
gh agent-task create "fix errors" --base branch

gh agent-task create "build me a new app" --custom-agent my-agent

bash
gh agent-task view e2fa49d2-f164-4a56-ab99-498090b8fcdf

gh agent-task view 12345

bash
gh agent-task view --repo OWNER/REPO 12345

gh agent-task view OWNER/REPO#12345

Detailed References

For complete command documentation including all flags and subcommands:

  • Full command tree: see references/commands.md
  • All usage examples: see references/examples.md

Troubleshooting

  • Use gh --help or gh <command> --help for inline help
  • Add --verbose for detailed output during debugging

Re-scanning

To update this plugin after a CLI version change, run the /scan-cli command or manually execute the crawler and generator.