代码托管命令行操作

其他 社区

技能解读

当前原文的自动摘译,尚未人工审校。

何时使用

使用 GitHub 存储库、拉取请求、问题、发布或原始文件 URL。您需要经过身份验证才能访问私有存储库或更高的 API 速率限制。您即将使用curl,wget,或针对 GitHub 进行未经身份验证的 Web 获取。

何时不使用

目标不是 GitHub。简单的本地 git 操作已经解决了这个任务。

指导

优先选择经过认证的ghCLI 通过原始 HTTP 获取 GitHub 内容。特别是: 更喜欢gh repo view,gh pr view,gh pr list,gh issue view, 和gh api过度未经身份验证curl或wget。与获取相比,更喜欢克隆存储库并在本地读取文件raw.githubusercontent.com直接滴。避免使用 GitHub API/contents/端点作为克隆和读取存储库文件的替代品。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
通用
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@trailofbits · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
网络行为
允许外网请求
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# 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.

## 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/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 Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。