gh-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesegh-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, or unauthenticated web fetches against GitHub.wget
- 处理GitHub仓库、拉取请求、议题、发布版本或原始文件URL时。
- 需要访问私有仓库的认证权限,或更高的API调用速率限制时。
- 即将使用、
curl或未认证的网络抓取工具访问GitHub时。wget
When NOT to Use
不适用场景
- The target is not GitHub.
- Plain local git operations already solve the task.
- 目标并非GitHub时。
- 普通的本地Git操作已能完成任务时。
Guidance
指导原则
Prefer the authenticated CLI over raw HTTP fetches for GitHub content. In particular:
gh- Prefer ,
gh repo view,gh pr view,gh pr list, andgh issue viewover unauthenticatedgh apiorcurl.wget - Prefer cloning a repository and reading files locally over fetching blobs directly.
raw.githubusercontent.com - Avoid using GitHub API endpoints as a substitute for cloning and reading repository files.
/contents/
Examples:
sh
gh repo view owner/repo
gh pr view 123 --repo owner/repo
gh api repos/owner/repo/pullsFor the original Claude plugin implementation, see:
plugins/gh-cli/README.mdplugins/gh-cli/hooks/
对于GitHub内容,优先使用经过身份验证的 CLI而非原始HTTP抓取。具体而言:
gh- 优先使用、
gh repo view、gh pr view、gh pr list和gh issue view,而非未认证的gh api或curl。wget - 优先克隆仓库并在本地读取文件,而非直接获取的 blob 文件。
raw.githubusercontent.com - 避免将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.mdplugins/gh-cli/hooks/