Creek CLI — Agent Skill
Creek deploys web apps to Cloudflare Workers with a single command. Auto-detects framework, determines render mode (SPA/SSR/Worker), provisions infrastructure.
Agent Rules
- 1. Always use
--json for structured output. Auto-enabled in non-TTY / CI. - Follow
breadcrumbs in JSON responses — they suggest the next command. - Use
--yes to skip confirmation prompts (auto-enabled in non-TTY). - Check
ok field — true = success, false = error with error and message fields.
Command Reference
| Task | Command |
|---|
| Authenticate | INLINECODE8 |
| Authenticate (CI) |
creek login --token <KEY> |
| Check auth |
creek whoami --json |
| Init project |
creek init --json |
| Deploy |
creek deploy --json |
| Deploy directory |
creek deploy ./dist --json |
| Deploy from GitHub |
creek deploy https://github.com/user/repo --json |
| Deploy monorepo subdir |
creek deploy https://github.com/user/repo --path packages/app --json |
| Deploy demo |
creek deploy --demo --json |
| Deploy template |
creek deploy --template vite-react |
| Skip build |
creek deploy --skip-build --json |
| Check status |
creek status --json |
| Check sandbox |
creek status <SANDBOX_ID> --json |
| Claim sandbox |
creek claim <SANDBOX_ID> --json |
| List projects |
creek projects --json |
| List deployments |
creek deployments --json |
| List deployments (other) |
creek deployments --project <SLUG> --json |
| Rollback |
creek rollback --json |
| Rollback to specific |
creek rollback <DEPLOYMENT_ID> --json |
| Set env var |
creek env set <KEY> <VALUE> --json |
| List env vars |
creek env ls --json |
| Show env values |
creek env ls --show --json |
| Remove env var |
creek env rm <KEY> --json |
| Add domain |
creek domains add <HOSTNAME> --json |
| List domains |
creek domains ls --json |
| Activate domain |
creek domains activate <HOSTNAME> --json |
| Remove domain |
creek domains rm <HOSTNAME> --json |
| Dev server |
creek dev |
Deployment Modes
Authenticated (permanent)
Requires
creek login. Deploys persist under the user's account.
CODEBLOCK0
Sandbox (60-min preview)
No auth required. Temporary preview with claimable URL.
CODEBLOCK1
CI/CD
CODEBLOCK2
JSON Output Format
Every command returns structured JSON with breadcrumbs:
CODEBLOCK3
On error:
CODEBLOCK4
Workflow: First Deploy
CODEBLOCK5
Workflow: Update & Rollback
CODEBLOCK6
Workflow: Custom Domain
CODEBLOCK7
creek.toml Reference
CODEBLOCK8
Supported Frameworks
SPA: vite-react, vite-vue, vite-svelte, vite-solid, static HTML
SSR: nextjs, react-router, sveltekit, nuxt, solidstart, tanstack-start
Config Detection Order
- 1.
creek.toml — explicit Creek config - INLINECODE38 /
wrangler.json / wrangler.toml — existing CF config - INLINECODE41 — framework auto-detection
- INLINECODE42 — static site
Troubleshooting
| Error | Fix |
|---|
| "Not authenticated" | INLINECODE43 or set INLINECODE44 |
| "Invalid API key" |
creek login to re-authenticate |
| "No creek.toml found" |
creek init or cd to project root |
| "No project found" | Deploy from a dir with package.json or index.html |
| "No supported project found in repo" | Use
--path for monorepos |
| Sandbox expired | Redeploy — sandboxes last 60 minutes |
| Domain stuck "pending" | Set CNAME to
cname.creek.dev, then
creek domains activate |
| Build fails | Check
[build] command in creek.toml |
Creek CLI — 代理技能
Creek 通过单个命令将 Web 应用部署到 Cloudflare Workers。自动检测框架,确定渲染模式(SPA/SSR/Worker),配置基础设施。
代理规则
- 1. 始终使用 --json 获取结构化输出。在非 TTY/CI 环境中自动启用。
- 遵循 JSON 响应中的 breadcrumbs — 它们建议下一步命令。
- 使用 --yes 跳过确认提示(在非 TTY 环境中自动启用)。
- 检查 ok 字段 — true 表示成功,false 表示错误,包含 error 和 message 字段。
命令参考
| 任务 | 命令 |
|---|
| 身份验证 | creek login |
| 身份验证(CI) |
creek login --token
|
| 检查身份验证 | creek whoami --json |
| 初始化项目 | creek init --json |
| 部署 | creek deploy --json |
| 部署目录 | creek deploy ./dist --json |
| 从 GitHub 部署 | creek deploy https://github.com/user/repo --json |
| 部署单体仓库子目录 | creek deploy https://github.com/user/repo --path packages/app --json |
| 部署演示 | creek deploy --demo --json |
| 部署模板 | creek deploy --template vite-react |
| 跳过构建 | creek deploy --skip-build --json |
| 检查状态 | creek status --json |
| 检查沙箱 | creek status --json |
| 认领沙箱 | creek claim --json |
| 列出项目 | creek projects --json |
| 列出部署 | creek deployments --json |
| 列出部署(其他) | creek deployments --project --json |
| 回滚 | creek rollback --json |
| 回滚到指定版本 | creek rollback --json |
| 设置环境变量 | creek env set --json |
| 列出环境变量 | creek env ls --json |
| 显示环境变量值 | creek env ls --show --json |
| 删除环境变量 | creek env rm --json |
| 添加域名 | creek domains add --json |
| 列出域名 | creek domains ls --json |
| 激活域名 | creek domains activate --json |
| 删除域名 | creek domains rm --json |
| 开发服务器 | creek dev |
部署模式
已认证(永久)
需要 creek login。部署内容会持久保存在用户账户下。
bash
creek deploy --json
沙箱(60 分钟预览)
无需身份验证。临时预览,提供可认领的 URL。
bash
creek deploy --json # 未登录时自动使用沙箱
creek claim # 转换为永久项目
CI/CD
bash
CREEKTOKEN=ck... creek deploy --yes --json
JSON 输出格式
每个命令返回包含面包屑的结构化 JSON:
json
{
ok: true,
url: https://my-app-team.bycreek.com,
project: my-app,
breadcrumbs: [
{ command: creek status, description: 检查部署状态 },
{ command: creek deployments --project my-app, description: 查看部署历史 }
]
}
错误时:
json
{
ok: false,
error: not_authenticated,
message: 未认证。请先运行 creek login。,
breadcrumbs: [
{ command: creek login, description: 交互式身份验证 }
]
}
工作流程:首次部署
bash
creek login --json # 1. 身份验证
creek init --json # 2. 创建 creek.toml(可选)
creek deploy --json # 3. 部署
工作流程:更新与回滚
bash
creek deploy --json # 部署新版本
creek deployments --json # 查看历史
creek rollback --json # 回滚到上一版本
creek rollback --json # 回滚到指定部署
工作流程:自定义域名
bash
creek domains add app.example.com --json # 添加域名
用户设置 DNS:CNAME app.example.com → cname.creek.dev
creek domains activate app.example.com --json # DNS 设置后激活
creek domains ls --json # 验证状态
creek.toml 参考
toml
[project]
name = my-app # 必填。小写字母数字加连字符。
framework = nextjs # 可选。从 package.json 自动检测。
[build]
command = npm run build # 构建命令(默认:npm run build)
output = dist # 构建输出目录
worker = worker/index.ts # 可选:自定义 Worker 入口点
[resources]
d1 = true # Cloudflare D1 数据库 → env.DB
kv = true # Cloudflare KV 命名空间 → env.KV
r2 = true # Cloudflare R2 存储 → env.BUCKET
ai = true # Cloudflare Workers AI → env.AI
支持的框架
SPA:vite-react、vite-vue、vite-svelte、vite-solid、静态 HTML
SSR:nextjs、react-router、sveltekit、nuxt、solidstart、tanstack-start
配置检测顺序
- 1. creek.toml — 显式 Creek 配置
- wrangler.jsonc / wrangler.json / wrangler.toml — 现有 CF 配置
- package.json — 框架自动检测
- index.html — 静态站点
故障排除
| 错误 | 修复方法 |
|---|
| 未认证 | creek login 或设置 CREEK_TOKEN |
| 无效的 API 密钥 |
creek login 重新认证 |
| 未找到 creek.toml | creek init 或切换到项目根目录 |
| 未找到项目 | 从包含 package.json 或 index.html 的目录部署 |
| 仓库中未找到支持的项目 | 单体仓库使用 --path |
| 沙箱已过期 | 重新部署 — 沙箱持续 60 分钟 |
| 域名卡在待处理状态 | 设置 CNAME 为 cname.creek.dev,然后运行 creek domains activate |
| 构建失败 | 检查 creek.toml 中的 [build] command |