/install-github-app
为某个仓库安装 Claude GitHub App,可选包含 GitHub Actions 工作流和 Secrets。
/install-github-app 会以交互方式在某个仓库上安装 Claude GitHub App。该命令首先引导完成仓库选择和应用安装;这需要该仓库的管理员权限,应用会申请对 Contents、Issues 和 Pull Requests 的读写权限。
安装完成后,命令会询问是否继续设置 GitHub Actions 工作流和 API 密钥 secret。自 2.1.187 版起,可以选择“Skip for now”跳过这一步,只安装应用;工作流/secret 的设置可以之后再次通过 /install-github-app 补上。在 2.1.187 版之前,向导会直接进入工作流选择环节。该命令是 CLI 内置功能,可以任意多次重复运行,例如用来补做遗漏的步骤。
根据文档,通过 /install-github-app 进行的快速安装仅适用于直接使用 Claude API 的用户;如果使用 Amazon Bedrock 或 Google Cloud 的 Agent Platform,则需要按对应文档手动设置。
✅ 什么时候用?
配置自动化 PR 检查或 CI 集成
在团队仓库中运行 /install-github-app,为 Claude 启用通过 GitHub Actions 实现的自动化 PR 工作流。
只安装 GitHub App,把工作流设置推迟到以后
运行 /install-github-app,在询问时(2.1.187 版起支持)选择 'Skip for now',以后再次运行 /install-github-app 完成工作流和 secret 的设置。
⛔ 什么时候不该用?
团队使用 Amazon Bedrock 或 Google Cloud 的 Agent Platform,而非直接使用 Claude API
根据文档,通过 /install-github-app 进行的快速安装仅适用于直接使用 Claude API 的用户。
更好的选择: 按照 GitHub Actions 文档中针对 Bedrock/Vertex 的说明手动配置。
只想在本地工作,不需要 GitHub 集成
/install-github-app 会建立与 GitHub 的连接,并可选配置 Actions 和 secrets——如果从不打算通过 GitHub 运行 PR 或 CI,这就是不必要的开销。
更好的选择: 继续在本地使用 Git 工作,不使用 GitHub App。
来源
- Claude Code 文档(官方) ↗ code.claude.com
更多命令 · Claude Code