Puter Deployer
Use a strict flow: preflight → build/stage → deploy path selection → verify → rollback note.
1) Preflight (always)
Run:
CODEBLOCK0
This checks:
- -
puter CLI exists - INLINECODE1 works
- build directory exists and is non-empty
- INLINECODE2 exists
If any check fails, stop and report exact fix commands.
2) Deployment path selection
Choose one path explicitly:
- 1. Create new Puter app entry (CLI-supported):
-
puter app:create <name> <remoteDir> --description "..." --url "..."
- 2. Update/publish build content:
- Use Puter API fallback guidance in
references/api-fallback.md.
- If API details are unclear for this host/version, inspect active
puter-cli source behavior before pushing.
Important: current public puter-cli command surface is limited. Do not invent non-existent commands.
3) Verify deployment (always)
Run:
CODEBLOCK1
Require:
- - HTTP 200
- expected snippet present (if provided)
If verification fails, mark deployment unsuccessful.
4) Rollback note (always)
Return these fields in final report:
- - source commit
- previous known-good artifact path
- previous known-good URL
- exact rollback command/runbook
Use scripts/deploy_report_template.md as output skeleton.
Guardrails
- - Never print auth tokens.
- Never delete remote app/site without explicit user request.
- Require explicit confirmation before overwriting production targets.
- On failure, classify into one bucket:
1) auth/session
2) missing build artifact
3) wrong app/site target
4) platform/API error
References
- -
references/deploy-checklist.md — end-to-end checklist - INLINECODE9 — API-first fallback logic when CLI is insufficient
- INLINECODE10 — common failure signatures + fixes
Puter 部署器
使用严格流程:预检 → 构建/暂存 → 部署路径选择 → 验证 → 回滚说明。
1) 预检(始终执行)
运行:
bash
bash skills/puter-deployer/scripts/preflight.sh <项目目录> <构建目录>
此项检查:
- - puter CLI 是否存在
- puter whoami 是否可用
- 构建目录是否存在且非空
- index.html 是否存在
若任何检查失败,停止并报告确切的修复命令。
2) 部署路径选择
明确选择以下路径之一:
- 1. 创建新的 Puter 应用条目(CLI 支持):
- puter app:create <名称> <远程目录> --description ... --url ...
- 2. 更新/发布构建内容:
- 使用 references/api-fallback.md 中的 Puter API 回退指南。
- 若当前主机/版本的 API 细节不明确,在推送前检查活跃的 puter-cli 源代码行为。
重要提示:当前公开的 puter-cli 命令集有限。请勿编造不存在的命令。
3) 验证部署(始终执行)
运行:
bash
bash skills/puter-deployer/scripts/verify_url.sh [期望片段]
要求:
- - HTTP 200 状态码
- 若提供期望片段,则必须存在
若验证失败,标记部署为不成功。
4) 回滚说明(始终执行)
在最终报告中返回以下字段:
- - 源提交
- 上一个已知良好的工件路径
- 上一个已知良好的 URL
- 精确的回滚命令/运行手册
使用 scripts/deployreporttemplate.md 作为输出骨架。
防护措施
- - 切勿打印认证令牌。
- 未经用户明确请求,切勿删除远程应用/站点。
- 覆盖生产目标前需明确确认。
- 失败时,归类至以下类别之一:
1) 认证/会话
2) 缺少构建工件
3) 错误的应用/站点目标
4) 平台/API 错误
参考资料
- - references/deploy-checklist.md — 端到端检查清单
- references/api-fallback.md — CLI 不足时的 API 优先回退逻辑
- references/failure-playbook.md — 常见失败特征及修复方法