SuperAPI AI 工具集

GitHub CLI (gh)

编程与开发

查看项目

更新于 10-16 05:03

技能介绍

用途:GitHub CLI(gh)把 GitHub 的常见操作带到终端,可在命令行管理 issue、pull request、仓库、Actions 工作流与代码搜索,适合脚本化执行或供智能体调用。

主要能力:支持 issue 列表与创建(如 gh issue list --json number,title,state、gh issue create --title "Bug" --body "Description")、PR 列表/创建/合并(如 gh pr list --json number,title,headRefName、gh pr create、gh pr merge <number> --squash)、仓库克隆与创建(gh repo clone owner/repo、gh repo create my-repo --public)、Actions 运行查询(gh run list --json status,name,conclusion)、任意 API 调用(gh api repos/owner/repo/releases --jq '.[0].tag_name')以及代码搜索(gh search code "function_name" --json path,repository)。

使用方式:通过 brew install gh 安装后执行 gh auth login 登录;也支持以 GH_TOKEN 或 GITHUB_TOKEN 进行令牌认证。

智能体友好特性:--json 配合 --jq 可精确提取字段,gh api 可调用任意 GitHub API,所有命令支持非交互模式,并提供结构化退出码。

适用场景:需要由智能体或脚本自动创建 issue、发起 PR、管理发布、查询 Actions 状态或在代码库中搜索时。

限制:具体定价、平台支持范围、权限模型与速率限制等细节暂未提供,请以官方仓库与手册为准。