此技能需要访问外网资源,可能需要科学上网
运行时依赖
无特殊依赖
安装命令
点击复制官方npx clawhub@latest install github
镜像加速npx clawhub@latest install github --registry https://cn.longxiaskill.com 镜像可用
国内专用无需额外安装
本土化适配说明
需要预先在系统中安装 GitHub 官方的 gh 命令行工具。
技能文档
gh pr checks 55 --repo owner/repoGitHub 技能使用 gh CLI 与 GitHub 交互。当不在 git 仓库目录时,请始终使用
--repo owner/repo指定仓库,或直接使用 URL。Pull Request(合并请求)
检查 PR 的 CI 状态:
gh run list --repo owner/repo --limit 10列出最近的工作流运行:
gh run view --repo owner/repo查看一次运行并了解哪些步骤失败:
gh run view --repo owner/repo --log-failed仅查看失败步骤的日志:
gh api repos/owner/repo/pulls/55 --jq '.title, .state, .user.login'高级查询的 API
gh api命令用于访问其他子命令无法获取的数据。获取带特定字段的 PR:
gh issue list --repo owner/repo --json number,title --jq '.[] | "\(.number): \(.title)"' ```JSON 输出大多数命令支持
--json输出结构化数据。可以使用--jq进行过滤: