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 從公開儲存庫中收錄這些內容。

檢舉或申請下架