手动执行模式(兼容过渡)
如果你不想用自动化脚本,或想理解每一步在做什么,可以按以下步骤手动操作。
提示:新项目推荐直接使用
bash pipeline.sh -p my-project,无需逐个手动执行。
从手动 7 步迁移到一键脚本
如果你已经习惯 master 分支的「7 步手动操作」流程,以下是迁移指南:
| 旧习惯 | 新做法 |
|---|---|
手动修改 SKILL.md 中的 {项目名} 占位符 | 修改 pipeline.config.yml 的 project.name |
手动 curl 创建仓库 | pipeline.sh 自动创建 |
手动 curl 开 Issue | pipeline.sh 自动开 Issue + 派 NPC |
| 手动等待 NPC 完成 | pipeline.sh 自动轮询 + 重试 |
手动 curl transfer | pipeline.sh 自动合并 PR + 转移 |
| 手动管理组织保护 | lib/transfer.sh 自动开关保护 |
| 手动验收 checklist | verify-stage.sh 自动跑 30+ 项检查 |
快速上手
bash
# 1. 设置 Token
export CNB_TOKEN="your_token"
# 2. 编辑配置文件
# 修改 pipeline.config.yml 中的 project.name
vim pipeline.config.yml
# 3. 一键运行
bash pipeline.sh -p my-project回退到手动模式
任何时候都可以回到手动模式——pipeline.sh 只是帮你省掉重复的 curl 调用,不改变仓库状态。
bash
# 查看当前流水线进度
cat /tmp/ai-pipeline/my-project-state.json
# 手动继续:参考 docs/manual-pipeline.md手动流水线概览
Step 0: 创建仓库 + 推 NPC 配置
Step 1: 开 PRD Issue → 等 NPC 完成 → 合并 PR → 验收
Step 2: 仓库转移 → 开 UI Issue → 等 NPC 完成 → 合并 PR → 验收
Step 3: 仓库转移 → 开前端 Issue → 等 NPC 完成 → 合并 PR → 验收
Step 4: 仓库转移 → 开后端 Issue → 等 NPC 完成 → 合并 PR → 验收
Step 5: 仓库转移 → 开管理后台 Issue → 等 NPC 完成 → 合并 PR → 验收
Step 6: 仓库转移 → 开集成 Issue → 等 NPC 完成 → 合并 PR → 验收
Step 7: CloudBase 部署 + EdgeOne Pages 部署详见各工位的详细 curl 命令。pipeline.sh 的 pipeline.config.yml 中定义了各工位的组织/NPC/模型参数,手动操作时参照配置即可。
手动操作核心命令
组织保护管理
bash
# 关闭保护
curl -X PUT "https://api.cnb.cool/$org/-/settings" \
-H "Authorization: Bearer $CNB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"group_protection":0}'创建 Issue
bash
curl -X POST "https://api.cnb.cool/$org/$repo/-/issues" \
-H "Authorization: Bearer $CNB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"...","body":"...", "work_mode":true}'查看 NPC 进度
bash
curl -s "https://api.cnb.cool/$org/$repo/-/issues/$num/comments" \
-H "Authorization: Bearer $CNB_TOKEN" \
-H "Accept: application/vnd.cnb.api+json"合并 PR
bash
curl -X PUT "https://api.cnb.cool/$org/$repo/-/pulls/$num/merge" \
-H "Authorization: Bearer $CNB_TOKEN" \
-H "Content-Type: application/json" \
-d '{"merge_style":"squash"}'