跳到正文
Skillpedia
部署与云(DevOps)8.0k · #12680

gh-cli

它能做什么

指导 AI 在处理 GitHub 工作时使用 gh 命令行工具,而不是直接抓取网页。适用于处理 GitHub 代码仓库、拉取请求和问题的开发者。

适用场景

  • ✓开发者让 AI 读取 GitHub 拉取请求、问题或代码仓库的时候。
  • ✓开发者需要访问私有 GitHub 代码仓库的时候。
  • ✓AI 即将用 curl 或网页工具抓取 GitHub 内容的时候。

技能链接

https://github.com/trailofbits/skills/blob/main/plugins/gh-cli/skills/gh-cli/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/trailofbits/skills/blob/main/plugins/gh-cli/skills/gh-cli/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请查看我团队 GitHub 仓库中的 123 号拉取请求,并给我做个总结。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能告诉 AI 使用 gh 命令,它以你的账号身份验证运行,而不是普通的网页请求。它还建议把代码仓库克隆到本地来读取文件。

技术内容(原始 SKILL.md)

作者在 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:

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

For the hook implementation, see:

  • plugins/gh-cli/README.md
  • plugins/gh-cli/hooks/
常见问题

为什么不直接用网页链接?

该技能说明,经过身份验证的工具可以访问私有代码仓库,并且有更高的请求频率限制。

它适用于非 GitHub 网站吗?

不适用。它只针对 GitHub 内容。

我需要先登录 gh 吗?

需要。该技能依赖 gh 已完成身份验证,这是它访问私有代码仓库的方式。

详情

作者的原始描述

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.

repo: trailofbits/skills

热度

GitHub 星标
8.0k
排名
#12680
许可证
CC-BY-SA-4.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能