SuperAPI AI 工具集

gh-cli

通用与其它

查看项目

更新于 10-15 17:29

技能介绍

用途:使用 gh 命令行工具从终端与 GitHub 仓库及服务交互。

主要能力:覆盖仓库、议题(Issue)、拉取请求(PR)、Actions(CI/CD)与发布(Release)五类操作。常用命令包括:gh repo clone owner/repo(克隆)、gh repo create my-repo --public(建库)、gh pr create --fill(建 PR)、gh pr checkout 45(本地检出 PR)、gh pr merge 45 --squash(压缩合并)、gh issue create --title "X"(建议题)、gh run list 与 gh run watch(查看/跟踪工作流运行)、gh release create v1.0(创建发布)。

使用方式:安装后先登录再操作。macOS 用 brew install gh;Linux(Debian/Ubuntu)用资料给出的 curl 与 apt 命令安装,随后执行 sudo apt update && sudo apt install gh。用 gh auth status 检查认证,gh auth login 登录。典型 PR 流程:git checkout -b feature/my-feature,改动后 git add . && git commit -m "Add feature",git push -u origin feature/my-feature,再 gh pr create --fill;审查合并用 gh pr checkout 45、gh pr review --approve、gh pr merge --squash --delete-branch。

适用场景:不想离开终端创建 PR;脚本中自动化建立议题;用 gh pr checks 查看 CI 状态;用 gh pr view 123 --comments 查看评论;用 gh run watch 跟踪运行。

限制:资料未提供版本兼容性、权限范围、速率限制或各命令完整参数,需以官方文档与 COMMANDS.md、API.md、WORKFLOWS.md 为准。