本技能介绍如何使用命令行`gh`只读查看GitHub issue正文和评论,支持通过编号或URL定位,也可指定其他仓库,并说明如何提取大量评论。
- 查看issue正文和评论
- 通过URL读取issue
- 查看其他仓库的issue
使用 `gh` 只读搜索和查看 GitHub 的议题、拉取请求、仓库与代码,并了解如何查询 REST 和 GraphQL API、翻页获取结果及筛选或整理输出。
Instructions for using the `gh` command to query and inspect GitHub state safely.
实测评分 未实测
查看安装方法本技能介绍如何使用 gh 搜索和查看 GitHub 上的议题、拉取请求、仓库和代码。内容包括列出结果、查看单个项目及拉取请求差异、检查状态,以及按关键词搜索。标准命令无法获取所需信息时,可以通过 gh api 只读调用 REST 或 GraphQL API。示例还介绍如何获取分页结果,以及使用 --json、--jq 和 --template 筛选或整理输出。
在修改代码之前,先确认现有议题、拉取请求或仓库的状态时,可以使用本技能。需要从命令行查找 GitHub 信息,或只从 API 获取指定字段时也适用。
禁止使用 gh 修改 GitHub 状态;api 请求仅限 GET。使用环境中需要提供 gh。如需更改默认仓库配置,应由人工操作。
本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。
AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。
不计入评分。 由 AI(OpenAI Codex)于 2026年10月26日 评估。仅供参考,安装前请同时查看原文。
安装前可以查看交给 AI 代理的指令内容。
This skill provides instructions for using the GitHub CLI (gh) to query,
inspect, and search GitHub state (issues, pull requests, repositories) for the
Carbon project.
[!IMPORTANT] AI assistants MUST NOT use the
ghtool to modify any GitHub project state. Do NOT run commands that create, edit, delete, label, comment on, or merge issues, pull requests, releases, or any other resources.
listviewsearchstatusapi (Only with GET requests)createeditdeletemergereopenclosecommentlabelThe gh tool interacts with a default repository when run within a local check
out. For this project, the default repository is expected to be
carbon-language/carbon-lang.
To verify the current default repository configuration:
gh repo view
The output should indicate the repository is carbon-language/carbon-lang.
If the default repository is misconfigured (for example, pointing to a personal fork or a different repository), the human operator must correct it.
[!IMPORTANT] AI Assistants MUST NOT attempt to mutate
ghconfiguration or run commands that change the default repository (such asgh repository set-default).
Instruct the human operator to run the following command to select the correct default repository:
gh repo set-default
The operator will be prompted to select the correct repository (e.g.,
carbon-language/carbon-lang) from the available remotes.
gh issue listgh issue view <number>gh issue search "<query>"
gh issue search "crash" --state opengh pr listgh pr view <number>gh pr diff <number>gh pr statusgh search code "<query>"gh search repos "<query>"For queries that are not supported by standard gh commands, you can use the
gh api command to query the GitHub REST or GraphQL APIs.
Query the REST API using paths relative to the API root.
List contributors:
gh api repos/carbon-language/carbon-lang/contributors
List issue comments:
gh api repos/carbon-language/carbon-lang/issues/<issue_number>/comments
For complex queries, use GraphQL to fetch exactly the data needed.
Get repository information:
gh api graphql -f query='
query {
repository(owner: "carbon-language", name: "carbon-lang") {
description
stargazerCount
}
}
'
Use the --paginate flag to automatically fetch all pages of results.
gh api --paginate repos/carbon-language/carbon-lang/issues
Use --json to request JSON output, and --jq or --template to filter or
format the results.
List PR titles and authors:
gh pr list --json title,author --jq '.[] | "\(.title) by \(.author.login)"'
Format with Go templates:
gh issue list --template '{{range .}}{{.number}} - {{.title}}{{"\n"}}{{end}}'
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
本技能介绍如何使用命令行`gh`只读查看GitHub issue正文和评论,支持通过编号或URL定位,也可指定其他仓库,并说明如何提取大量评论。
本技能为在 Carbon 代码库中工作的 AI 助手规定文件查看、搜索和编辑工具,并说明临时文件的存放与清理规则,以及何时可以编写和运行自定义程序。
了解如何在 Carbon 项目中通过 Bazelisk 构建、测试和运行程序,包括指定目标、启用 ASan,以及系统依赖变更后重建缓存。
本技能介绍如何为Carbon编译器添加内置函数,包括类型注册、签名验证、常量求值、运行时LLVM IR生成、Prelude绑定,以及使用最小Prelude编写针对性测试。
了解 Carbon 工具链对 Bazel、C++、Carbon、Markdown 和 Python 文件的格式规范,并查看注释、文档、命名、设计及提交说明的写作要求。
本技能介绍如何在Carbon工具链中添加或修改错误和警告,包括注册诊断类型、用带类型的参数构造消息、为源码位置添加标签和上下文,以及检查措辞规范和测试覆盖。