Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

github-cliGitHub CLI

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

1,212

周安装

50

GitHub Stars

10

下载量

396
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:github-cli(GitHub CLI)
来源仓库:https://github.com/oakoss/agent-skills
仓库路径:skills/github-cli
安装命令:
npx skills add https://github.com/oakoss/agent-skills --skill github-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oakoss/agent-skills --skill github-cli

简介

github-cli 用于围绕 GitHub 仓库、Issue、PR 和协作流程提供辅助能力。

  • 它适合查询项目状态、整理变更或辅助创建协作事项。
  • 使用时需区分只读查询和写入操作。
  • 涉及创建 PR 或推送分支时,应确认 token 权限和仓库范围。
  • github-cli 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

GitHub CLI Skill

Provides patterns for the gh CLI to interact with GitHub repositories, services, and APIs directly from the terminal. Covers authentication, repository management, issues, pull requests, actions, releases, projects, search, and the REST/GraphQL API. Git workflow patterns (branching, commits, CI/CD) are handled by a separate skill.

Quick Reference

AreaKey Commands
Authgh auth status, gh auth login, gh auth token
Reposgh repo clone, gh repo create, gh repo fork, gh repo sync
Browsegh browse, gh browse --settings, gh browse file.ts:42
Issuesgh issue list, gh issue create, gh issue edit, gh issue close
Pull Requestsgh pr create, gh pr review, gh pr merge, gh pr checkout
Actionsgh run list, gh run view, gh workflow run, gh cache list
Releasesgh release create, gh release list, gh release verify
Projectsgh project list, gh project create, gh project item-add
Searchgh search repos, gh search issues, gh search code
APIgh api repos/{owner}/{repo}, gh api graphql
Securitygh attestation verify, gh ruleset list, gh secret set
Statusgh status, gh pr checks, gh pr status
Codespacesgh codespace create, gh codespace ssh, gh codespace code

Common Workflows

WorkflowCommands
Quick PRgit push -u origin feat then gh pr create --fill
Draft PRgh pr create --draft --fill then gh pr ready when done
Review and mergegh pr checkout 45 then gh pr review --approve then gh pr merge --squash --delete-branch
Auto-merge PRgh pr merge --auto --squash (waits for required checks to pass)
Check CIgh pr checks then gh run watch
Rerun failed CIgh run rerun <run-id> --failed
Create releasegh release create v1.0.0 --generate-notes
Search codegh search code "handleAuth" --repo owner/repo
Add issue to projectgh project item-add 1 --owner @me --url <issue-url>
Verify artifactgh attestation verify artifact.tar.gz --owner owner
Trigger workflowgh workflow run deploy.yml -f environment=production
Revert merged PRgh pr revert 45
Sync forkgh repo sync to update fork from upstream

Output Formatting

Most gh list and view commands support structured output for scripting and automation.

FlagPurpose
--jsonOutput specified fields as JSON
--jqFilter JSON with jq expressions
-tFormat JSON with Go templates
--webOpen the resource in a browser
--commentsInclude comments (issues and PRs)

Scoping: Repo, Env, Org

Secrets and variables can be scoped to different levels.

ScopeFlag Example
Repositorygh secret set KEY (default)
Environmentgh secret set KEY --env production
Organizationgh secret set KEY --org name --visibility

Project commands always require --owner @me or --owner org-name.

Authentication Prerequisites

The gh CLI requires authentication before most commands work. Run gh auth status to verify the current session. Missing scopes cause silent failures -- use gh auth refresh -s scope to add scopes without re-authenticating. For CI environments, set the GITHUB_TOKEN or GH_TOKEN environment variable instead of interactive login.

Common Mistakes

MistakeCorrect Pattern
Running gh pr create without pushing the branch firstPush with git push -u origin branch before creating a PR
Using gh pr merge without checking CI statusRun gh pr checks first or use gh pr merge --auto to wait for checks
Forgetting --fill when creating PRs from well-written commitsUse gh pr create --fill to auto-populate title and body from commits
Using REST API when GraphQL is more efficient for nested dataUse gh api graphql for queries needing related objects in one call
Not authenticating with correct scopesRun gh auth status to verify scopes, gh auth refresh -s scope to add
Using gh project commands without specifying --ownerAlways pass --owner @me or --owner org-name for project commands
Manually downloading CI artifactsUse gh run download <run-id> to download artifacts programmatically
Not using --json for scriptingAdd --json field1,field2 and --jq for machine-readable output
Merging without --delete-branchUse gh pr merge --squash --delete-branch to clean up after merge
Running gh api POST without -f fieldsUse -f key=value for string fields, -F for typed fields

Delegation

  • Search across repositories for code patterns or issues: Use Explore agent with gh search code and gh search issues
  • Automate multi-step release workflows: Use Task agent to coordinate branch creation, PR merge, and release publishing
  • Plan repository structure and access controls: Use Plan agent to design team permissions, branch protection, and workflow architecture

References

  • Repos & Auth -- Authentication, repository management, configuration, extensions, aliases
  • Issues -- Issue CRUD, labels, assignments, pinning, transferring, development branches
  • Pull Requests -- PR creation, review, merge, checkout, checks, diff, auto-merge
  • Actions -- Workflow runs, manual triggers, secrets, variables, caches, artifact downloads
  • Releases & Search -- Releases, attestation verification, search, gists, SSH/GPG keys
  • Projects & API -- Projects v2 management, REST API, GraphQL API, rulesets, status

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.14%
按下载量换算131

Claude

30.54%
按下载量换算121

Cursor

19.66%
按下载量换算78

Gemini CLI

10.61%
按下载量换算42

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills