gh-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

gh-cli

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
    , or unauthenticated web fetches against GitHub.
  • 处理GitHub仓库、拉取请求、议题、发布版本或原始文件URL时。
  • 需要访问私有仓库的认证权限,或更高的API调用速率限制时。
  • 即将使用
    curl
    wget
    或未认证的网络抓取工具访问GitHub时。

When NOT to Use

不适用场景

  • The target is not GitHub.
  • Plain local git operations already solve the task.
  • 目标并非GitHub时。
  • 普通的本地Git操作已能完成任务时。

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/repo
gh pr view 123 --repo owner/repo
gh api repos/owner/repo/pulls
For the original Claude plugin implementation, see:
  • plugins/gh-cli/README.md
  • plugins/gh-cli/hooks/
对于GitHub内容,优先使用经过身份验证的
gh
CLI而非原始HTTP抓取。具体而言:
  • 优先使用
    gh repo view
    gh pr view
    gh pr list
    gh issue view
    gh api
    ,而非未认证的
    curl
    wget
  • 优先克隆仓库并在本地读取文件,而非直接获取
    raw.githubusercontent.com
    的 blob 文件。
  • 避免将GitHub API的
    /contents/
    端点作为克隆并读取仓库文件的替代方案。
示例:
sh
gh repo view owner/repo
gh pr view 123 --repo owner/repo
gh api repos/owner/repo/pulls
关于原始Claude插件实现,请查看:
  • plugins/gh-cli/README.md
  • plugins/gh-cli/hooks/