github
它能做什么
它教你的智能体使用 GitHub 命令行工具查看问题、拉取请求和工作流运行。适合希望让智能体检查代码状态和仓库数据的开发者。
适用场景
- ✓当你想查看某个拉取请求上的 CI 测试是否通过的时候。
- ✓当你需要查看失败的 GitHub Actions 运行日志的时候。
- ✓当你想获取仓库中最近的问题列表或拉取请求详情的时候。
技能链接
https://github.com/HKUDS/nanobot/blob/main/nanobot/skills/github/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能检查一下 55 号拉取请求的测试是否通过,并显示失败的步骤吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体运行 gh 命令,向 GitHub 查询拉取请求、运行记录和问题。它可以只筛选出你需要的字段。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
GitHub Skill
Use the gh CLI to interact with GitHub. Always specify --repo owner/repo when not in a git directory, or use URLs directly.
Pull Requests
Check CI status on a PR:
gh pr checks 55 --repo owner/repo
List recent workflow runs:
gh run list --repo owner/repo --limit 10
View a run and see which steps failed:
gh run view <run-id> --repo owner/repo
View logs for failed steps only:
gh run view <run-id> --repo owner/repo --log-failed
API for Advanced Queries
The gh api command is useful for accessing data not available through other subcommands.
Get PR with specific fields:
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'
JSON Output
Most commands support --json for structured output. You can use --jq to filter:
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"'
常见问题
它需要特殊设置吗?
需要。它使用 gh 命令行工具,因此必须先安装并设置该工具。
它可以修改问题或拉取请求吗?
可以。说明中提到它可以管理问题和拉取请求,而不只是读取它们。
我需要在仓库文件夹中吗?
不需要。该技能说明,当你不在 git 文件夹中时,使用 --repo owner/repo 即可。
详情
作者的原始描述
Manage GitHub issues and pull requests, inspect CI runs, and query repository data.
repo: HKUDS/nanobot
热度
- GitHub 星标
- 50k
- 排名
- #3597
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …