Gh Cli

作者 trailofbits82fe82262526无许可证7.4K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库昨天更新

Enforces authenticated gh CLI workflows over unauthenticated curl, WebFetch, and MCP fetch patterns. Use when working with GitHub URLs, API access, pull requests, or issues.

AI 生成的概览

指导智能体使用已认证的 gh CLI,而非未认证的 curl 或抓取工具访问 GitHub。

功能
该技能提供指导,建议在处理 GitHub 内容时优先使用已认证的 gh CLI,而不是原始 HTTP 抓取。它推荐使用 gh repo view、gh pr view、gh pr list、gh issue view 和 gh api 等命令,并建议克隆仓库后在本地读取文件,而不是直接抓取原始 blob。它还建议不要用 GitHub API 的 contents 端点替代克隆。该技能仅包含说明,不生成任何文件。
适用场景
适用于处理 GitHub 仓库、拉取请求、议题、发布或原始文件 URL 时,或需要访问私有仓库的认证权限或更高 API 速率限制时。也适用于即将对 GitHub 使用 curl、wget、WebFetch 或 MCP 抓取工具的场景。不适用于非 GitHub 目标或已由普通本地 git 操作解决的任务。
运行要求
需要已安装 gh CLI,并为目标 GitHub 账号配置好认证。不附带脚本,仅为说明性内容。

gh-cli

When to Use

  • Working with GitHub repositories, pull requests, issues, releases, or raw file URLs.
  • You need authenticated access to private repositories or higher API rate limits.
  • You are about to use curl, wget, WebFetch, or an MCP fetch tool against GitHub.

When NOT to Use

  • The target is not GitHub.
  • Plain local git operations already solve the task.

Guidance

Prefer the authenticated gh CLI over raw HTTP fetches for GitHub content. In particular:

  • Prefer gh repo view, gh pr view, gh pr list, gh issue view, and gh api over unauthenticated curl or wget.
  • Prefer cloning a repository and reading files locally over fetching raw.githubusercontent.com blobs directly.
  • Avoid using GitHub API /contents/ endpoints as a substitute for cloning and reading repository files.

Examples:

sh
gh repo view owner/repogh pr view 123 --repo owner/repogh api repos/owner/repo/pulls

For the hook implementation, see:

  • plugins/gh-cli/README.md
  • plugins/gh-cli/hooks/

来源与署名

来源:trailofbits/skills位于plugins/gh-cli/skills/gh-cli提交82fe822

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架