5 分钟快速上手
前置条件
- OpenClaw 已部署并运行
- GitHub 仓库的 Settings 权限
- 一个 Anthropic API Key(Claude)或其他支持的 LLM API Key
步骤 1:部署 PR 审查官 Agent
将 configs/ 目录下的配置文件复制到 OpenClaw 实例:
1 | # 假设 OpenClaw 安装在 ~/openclaw |
步骤 2:配置环境变量
1 | # 在 OpenClaw 环境变量中配置 |
步骤 3:配置 GitHub Webhook
- 进入 GitHub 仓库 → Settings → Webhooks → Add webhook
- Payload URL:
https://your-openclaw-domain/webhook/pr-review - Content type:
application/json - Events:选择 “Pull requests”
- Secret:填入你设置的 WEBHOOK_SECRET
步骤 4:测试
创建一个测试 PR,观察:
- Webhook 是否被触发(GitHub webhook 设置页可以看到交付记录)
- OpenClaw 是否收到请求(查看日志)
- PR Comment 是否被回写
步骤 5:自定义 Prompt
根据团队的代码规范调整审查 Prompt:
1 | # 编辑架构审查 Prompt |
完整部署文档
参见 deployment.md。自定义指南参见 prompt-customization.md。