creek 0.4.14 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/skills/README.md +75 -0
- package/skills/creek/SKILL.md +185 -0
- package/skills/creek/references/commands.md +79 -0
- package/skills/creek/references/creek-toml.md +82 -0
- package/skills/creek/references/deployment-modes.md +66 -0
- package/skills/creek/references/diagnosis.md +81 -0
- package/skills/creek/references/github-setup.md +19 -0
- package/skills/creek/references/observability.md +56 -0
- package/skills/creek/references/resources.md +47 -0
- package/skills/creek/references/workflows.md +44 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "creek",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "The Creek deployment platform — CLI and runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"react.d.ts",
|
|
31
31
|
"hono.js",
|
|
32
32
|
"hono.d.ts",
|
|
33
|
+
"skills",
|
|
33
34
|
"CHANGELOG.md",
|
|
34
35
|
"LICENSE",
|
|
35
36
|
"README.md"
|
|
@@ -50,7 +51,8 @@
|
|
|
50
51
|
"directory": "packages/creek"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@solcreek/cli": "^0.4.
|
|
54
|
+
"@solcreek/cli": "^0.4.16",
|
|
54
55
|
"@solcreek/runtime": "^0.4.0"
|
|
55
|
-
}
|
|
56
|
+
},
|
|
57
|
+
"scripts": {}
|
|
56
58
|
}
|
package/skills/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Agent Skills for Creek
|
|
2
|
+
|
|
3
|
+
[Agent Skills](https://agentskills.io/) for [Creek](https://creek.dev) —
|
|
4
|
+
the deployment platform that reduces Cloudflare's 200+ API primitives
|
|
5
|
+
to a single command.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx skills add solcreek/creek/skills
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The `skills` CLI supports subpath installation, so the skill ships
|
|
14
|
+
directly from the monorepo. No separate distribution repo to sync.
|
|
15
|
+
|
|
16
|
+
## Available skills
|
|
17
|
+
|
|
18
|
+
| Skill | Description |
|
|
19
|
+
|-------|-------------|
|
|
20
|
+
| [creek](creek/SKILL.md) | Deploy + diagnose + manage Creek projects — CLI, resources, logs, MCP. |
|
|
21
|
+
|
|
22
|
+
## Layout
|
|
23
|
+
|
|
24
|
+
The `creek` skill follows Anthropic's [progressive-disclosure
|
|
25
|
+
guidance](https://code.claude.com/docs/en/skills) — `SKILL.md` stays
|
|
26
|
+
lean (~120 lines with mental model, anti-patterns, quick triage, cheat
|
|
27
|
+
sheet), and topic-focused detail lives in `references/` files that
|
|
28
|
+
Claude loads on demand.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
skills/creek/
|
|
32
|
+
├── SKILL.md entry + index of references
|
|
33
|
+
└── references/
|
|
34
|
+
├── commands.md full command table + JSON output spec
|
|
35
|
+
├── deployment-modes.md authenticated / sandbox / CI / --from-github
|
|
36
|
+
├── workflows.md first-deploy / rollback / domain, frameworks
|
|
37
|
+
├── creek-toml.md creek.toml reference + cron + queue
|
|
38
|
+
├── diagnosis.md failure workflow + CK-code map + troubleshooting
|
|
39
|
+
├── observability.md creek logs + build logs + MCP get_build_log
|
|
40
|
+
├── resources.md creek db + team-owned databases + portable pattern
|
|
41
|
+
└── github-setup.md GitHub App install + connection
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Same content, two surfaces
|
|
45
|
+
|
|
46
|
+
The `.md` files here are the single source of truth for agent-facing
|
|
47
|
+
guidance. They drive:
|
|
48
|
+
|
|
49
|
+
1. **Filesystem skill** — installed via `npx skills add`, loaded by
|
|
50
|
+
Claude Code / Cursor / Codex / OpenCode.
|
|
51
|
+
2. **MCP resources** — `mcp.creek.dev` exposes each reference file
|
|
52
|
+
as `creek://skill/<name>` via `resources/list` + `resources/read`.
|
|
53
|
+
Bundled into the MCP worker at deploy time via wrangler's Text
|
|
54
|
+
module loader. Serves claude.ai users + API agents that can't
|
|
55
|
+
load filesystem skills.
|
|
56
|
+
|
|
57
|
+
Edit the `.md` file once — both surfaces update on next deploy.
|
|
58
|
+
|
|
59
|
+
## Legacy install URL (deprecated)
|
|
60
|
+
|
|
61
|
+
The old URL `npx skills add solcreek/skills` is **deprecated**. The
|
|
62
|
+
standalone [`solcreek/skills`](https://github.com/solcreek/skills)
|
|
63
|
+
repo is frozen at its last pre-consolidation snapshot and will be
|
|
64
|
+
archived. Update any install scripts, docs, or READMEs to the
|
|
65
|
+
`solcreek/creek/skills` form above — the content lives here
|
|
66
|
+
alongside the code it describes, so it stays in sync by construction.
|
|
67
|
+
|
|
68
|
+
## Requires
|
|
69
|
+
|
|
70
|
+
- [Creek CLI](https://www.npmjs.com/package/creek) (`npm install -g creek`)
|
|
71
|
+
- An authenticated account for production deploys (`creek login`)
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
Apache-2.0
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: creek
|
|
3
|
+
description: |
|
|
4
|
+
Deploy and manage apps on Creek — the Cloudflare Workers deployment
|
|
5
|
+
platform. Ship, diagnose failed deploys, read runtime + build logs,
|
|
6
|
+
manage team-owned databases (creek db), handle custom domains, cron,
|
|
7
|
+
queues, GitHub push deploys, and local dev. Skill also corrects the
|
|
8
|
+
CF-native reflexes that look right but break on Creek (do NOT swap
|
|
9
|
+
better-sqlite3 → D1 manually, do NOT hand-edit wrangler.toml, do NOT
|
|
10
|
+
maintain separate sandbox/prod code paths).
|
|
11
|
+
when_to_use: |
|
|
12
|
+
Use when the user mentions creek, creek.dev, creek.toml, creek deploy,
|
|
13
|
+
creek db, creek logs, creek doctor, `npx creek`, deploying to
|
|
14
|
+
Cloudflare, or asks about Workers for Platforms tenancy. Also use
|
|
15
|
+
when a user says "my deploy failed" / "deploy to creek didn't work"
|
|
16
|
+
/ "add a database to my creek project" / "why isn't my push
|
|
17
|
+
deploying" / "can I share a database across projects" / "is my
|
|
18
|
+
cron running". Pre-emptively load when editing creek.toml,
|
|
19
|
+
wrangler.jsonc, or code that imports from @solcreek/*.
|
|
20
|
+
license: Apache-2.0
|
|
21
|
+
compatibility: Requires Creek CLI (npm install -g creek)
|
|
22
|
+
paths:
|
|
23
|
+
- "**/creek.toml"
|
|
24
|
+
- "**/wrangler.{json,jsonc,toml}"
|
|
25
|
+
- "**/examples/vite-react-drizzle/**"
|
|
26
|
+
- "**/server/{local,worker,routes,schema}.ts"
|
|
27
|
+
metadata:
|
|
28
|
+
author: solcreek
|
|
29
|
+
required-binaries: creek
|
|
30
|
+
required-env: CREEK_TOKEN
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# Creek CLI — Agent Skill
|
|
34
|
+
|
|
35
|
+
Creek deploys web apps to Cloudflare Workers with a single command.
|
|
36
|
+
Auto-detects framework, determines render mode (SPA/SSR/Worker),
|
|
37
|
+
provisions infrastructure.
|
|
38
|
+
|
|
39
|
+
## Mental Model
|
|
40
|
+
|
|
41
|
+
Creek runs on Cloudflare Workers, but **it is not raw Cloudflare**. The
|
|
42
|
+
resource model, deploy flow, and runtime are abstracted. An agent
|
|
43
|
+
reaching for CF-native workarounds (wrangler.toml edits, manual D1
|
|
44
|
+
creation, driver rewrites) is almost always wrong on Creek.
|
|
45
|
+
|
|
46
|
+
The rule of thumb: if you're about to write CF-specific glue code, check
|
|
47
|
+
whether the `creek` CLI or `@solcreek/runtime` already covers the concern.
|
|
48
|
+
If yes — use the Creek path.
|
|
49
|
+
|
|
50
|
+
## What you DON'T need to do on Creek
|
|
51
|
+
|
|
52
|
+
Because Creek visibly runs on CF, it's tempting to apply CF reasoning.
|
|
53
|
+
Don't. These five shortcuts are all counterproductive:
|
|
54
|
+
|
|
55
|
+
- **Do NOT swap `better-sqlite3` → D1 manually before deploy.** The
|
|
56
|
+
recommended pattern keeps one shared schema + one shared query/routes
|
|
57
|
+
file, driver-agnostic. Only the thin boot files differ
|
|
58
|
+
(`server/local.ts` uses `better-sqlite3`, `server/worker.ts` uses
|
|
59
|
+
D1). See `references/resources.md` and `examples/vite-react-drizzle`.
|
|
60
|
+
|
|
61
|
+
- **Do NOT maintain separate sandbox/production code paths.** Env var
|
|
62
|
+
behavior is identical. Sandbox just runs without user-set secrets.
|
|
63
|
+
Gate on `env.MY_KEY` being present; deploy to production via
|
|
64
|
+
`creek deploy` when the full env is needed.
|
|
65
|
+
|
|
66
|
+
- **Do NOT hand-edit `wrangler.toml`.** Creek reads `creek.toml` and
|
|
67
|
+
generates wrangler config at build time. Bindings are declared in the
|
|
68
|
+
dashboard or via `creek db attach` — not in wrangler.toml.
|
|
69
|
+
|
|
70
|
+
- **Do NOT create a D1 via `wrangler d1 create`.** Use `creek db create
|
|
71
|
+
<name>` — it creates a team-owned resource that can be renamed, shared
|
|
72
|
+
across projects, and detached without dropping data.
|
|
73
|
+
|
|
74
|
+
- **Do NOT duplicate schema or queries across `db.local.ts` +
|
|
75
|
+
`db.prod.ts` files.** Use the shared-routes + split-boot pattern
|
|
76
|
+
from `references/resources.md`. `creek doctor` flags the split with
|
|
77
|
+
`CK-DB-DUAL-DRIVER-SPLIT`.
|
|
78
|
+
|
|
79
|
+
## Quick Triage
|
|
80
|
+
|
|
81
|
+
Map user phrasing to the right workflow before doing anything else.
|
|
82
|
+
|
|
83
|
+
| User says / implies | First command |
|
|
84
|
+
|---------------------|--------------|
|
|
85
|
+
| "deploy this" (no context) | `creek deploy --dry-run --json` first, then `creek deploy --json` |
|
|
86
|
+
| "deploy failed" / "something broke" | See `references/diagnosis.md` |
|
|
87
|
+
| "can't see logs" | Is it missing because edge-cached? See `references/observability.md` |
|
|
88
|
+
| "add a database" / "need a DB" (no account) | Sandbox auto-provisions: add `[resources] database = true` to creek.toml. See "Sandbox with DB" below. |
|
|
89
|
+
| "add a database" / "need a DB" (signed in) | `creek db create <name>` + `creek db attach` (see `references/resources.md`) |
|
|
90
|
+
| "how do I run this locally" | `creek dev` |
|
|
91
|
+
| "rollback the last deploy" | `creek rollback --json` |
|
|
92
|
+
| "add a domain" | `creek domains add <host>` + DNS CNAME → `creek domains activate` |
|
|
93
|
+
| "why isn't my push deploying" | See `references/github-setup.md` |
|
|
94
|
+
| "what env vars does it see" | `creek env ls --json` (add `--show` for values) |
|
|
95
|
+
| "is my cron running" | `creek status --json` shows cron schedules |
|
|
96
|
+
|
|
97
|
+
If the phrasing doesn't match any row, default to `creek doctor --json`
|
|
98
|
+
— it surfaces the most likely misconfiguration.
|
|
99
|
+
|
|
100
|
+
## Sandbox with DB (no account, 60 min preview)
|
|
101
|
+
|
|
102
|
+
Sandbox mode auto-provisions a D1 database when `creek.toml` declares
|
|
103
|
+
`[resources] database = true` — no `creek login`, no `creek db create`
|
|
104
|
+
required. The binding name is `DB`. This makes it safe to build a
|
|
105
|
+
DB-backed CRUD demo (e.g. TODO list) and ship a live URL in one step.
|
|
106
|
+
|
|
107
|
+
```toml
|
|
108
|
+
# creek.toml
|
|
109
|
+
[project]
|
|
110
|
+
name = "todo-app"
|
|
111
|
+
|
|
112
|
+
[build]
|
|
113
|
+
worker = "worker.ts" # required for API routes
|
|
114
|
+
output = "public" # static assets dir (at minimum: index.html)
|
|
115
|
+
|
|
116
|
+
[resources]
|
|
117
|
+
database = true # NOT d1 = true — doctor flags that as error
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
// worker.ts
|
|
122
|
+
import { define } from "d1-schema";
|
|
123
|
+
|
|
124
|
+
export interface Env { DB: D1Database }
|
|
125
|
+
|
|
126
|
+
export default {
|
|
127
|
+
async fetch(req: Request, env: Env): Promise<Response> {
|
|
128
|
+
await define(env.DB, {
|
|
129
|
+
todos: { id: "text primary key", text: "text not null", completed: "integer default 0" },
|
|
130
|
+
});
|
|
131
|
+
// ...env.DB.prepare("SELECT * FROM todos").all()
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Constraints to know before starting:
|
|
137
|
+
|
|
138
|
+
- **`public/index.html` is required.** Sandbox rejects worker-only
|
|
139
|
+
bundles with `No assets in bundle`. Serve your UI as static + use
|
|
140
|
+
the worker for `/api/*`.
|
|
141
|
+
- **`creek deploy --dry-run --json` first.** It runs the full
|
|
142
|
+
doctor check and surfaces `[resources]` typos (e.g. the `d1/kv/r2`
|
|
143
|
+
vs `database/cache/storage` split) before you burn a deploy.
|
|
144
|
+
- **`creek logs` and `creek doctor --last` need auth**, so runtime
|
|
145
|
+
errors in sandbox are hard to diagnose. Return JSON errors with a
|
|
146
|
+
meaningful `message` from your handlers so failures surface via the
|
|
147
|
+
HTTP response instead.
|
|
148
|
+
|
|
149
|
+
## Agent Rules
|
|
150
|
+
|
|
151
|
+
1. **Always use `--json`** for structured output. Auto-enabled in non-TTY / CI.
|
|
152
|
+
2. **Follow `breadcrumbs`** in JSON responses — they suggest the next command.
|
|
153
|
+
3. **Use `--yes`** to skip confirmation prompts (auto-enabled in non-TTY).
|
|
154
|
+
4. **Check `ok` field** — `true` = success, `false` = error with `error` and `message` fields.
|
|
155
|
+
|
|
156
|
+
## Cheat Sheet
|
|
157
|
+
|
|
158
|
+
Top commands. Full table in `references/commands.md`.
|
|
159
|
+
|
|
160
|
+
| Task | Command |
|
|
161
|
+
|------|---------|
|
|
162
|
+
| Authenticate | `creek login` |
|
|
163
|
+
| Deploy | `creek deploy --json` |
|
|
164
|
+
| Dry-run plan (safe, no side effects) | `creek deploy --dry-run --json` |
|
|
165
|
+
| Check status | `creek status --json` |
|
|
166
|
+
| List deployments | `creek deployments --json` |
|
|
167
|
+
| Read a deployment's build log | `creek deployments logs <ID> --json` |
|
|
168
|
+
| Rollback | `creek rollback --json` |
|
|
169
|
+
| Runtime logs | `creek logs --follow --json` |
|
|
170
|
+
| Pre-deploy diagnostic | `creek doctor --json` |
|
|
171
|
+
| Create team database | `creek db create <NAME> --json` |
|
|
172
|
+
|
|
173
|
+
## Additional Resources
|
|
174
|
+
|
|
175
|
+
Load on demand. These files live in `references/` and are meant to be
|
|
176
|
+
read via `bash cat` when the task needs the detail.
|
|
177
|
+
|
|
178
|
+
- `references/commands.md` — complete command table + JSON output spec
|
|
179
|
+
- `references/deployment-modes.md` — authenticated / sandbox / CI / remote-GitHub
|
|
180
|
+
- `references/workflows.md` — first-deploy / update-rollback / custom-domain, framework matrix, config detection order
|
|
181
|
+
- `references/creek-toml.md` — full `creek.toml` reference, cron + queue details
|
|
182
|
+
- `references/diagnosis.md` — failure diagnosis workflow + CK-code fix table + error-string troubleshooting
|
|
183
|
+
- `references/observability.md` — `creek logs` + `creek deployments logs` + MCP `get_build_log` + edge-cache caveats
|
|
184
|
+
- `references/resources.md` — `creek db` + team-owned resource model + portable pattern
|
|
185
|
+
- `references/github-setup.md` — GitHub App install + repo connection
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Creek CLI — Command Reference
|
|
2
|
+
|
|
3
|
+
Complete command table. Pair with `references/workflows.md` for
|
|
4
|
+
common multi-command flows.
|
|
5
|
+
|
|
6
|
+
| Task | Command |
|
|
7
|
+
|------|---------|
|
|
8
|
+
| Authenticate | `creek login` |
|
|
9
|
+
| Authenticate (CI) | `creek login --token <KEY>` |
|
|
10
|
+
| Check auth | `creek whoami --json` |
|
|
11
|
+
| Init project | `creek init --json` |
|
|
12
|
+
| Deploy | `creek deploy --json` |
|
|
13
|
+
| Deploy directory | `creek deploy ./dist --json` |
|
|
14
|
+
| Deploy from GitHub URL | `creek deploy https://github.com/user/repo --json` |
|
|
15
|
+
| Deploy monorepo subdir | `creek deploy https://github.com/user/repo --path packages/app --json` |
|
|
16
|
+
| Deploy latest commit via GitHub connection | `creek deploy --from-github --json` |
|
|
17
|
+
| Deploy latest (target specific project) | `creek deploy --from-github --project <SLUG> --json` |
|
|
18
|
+
| Deploy demo | `creek deploy --demo --json` |
|
|
19
|
+
| Deploy template | `creek deploy --template vite-react` |
|
|
20
|
+
| Skip build | `creek deploy --skip-build --json` |
|
|
21
|
+
| Check status | `creek status --json` |
|
|
22
|
+
| Check sandbox | `creek status <SANDBOX_ID> --json` |
|
|
23
|
+
| Claim sandbox | `creek claim <SANDBOX_ID> --json` |
|
|
24
|
+
| List projects | `creek projects --json` |
|
|
25
|
+
| List deployments | `creek deployments --json` |
|
|
26
|
+
| List deployments (other) | `creek deployments --project <SLUG> --json` |
|
|
27
|
+
| Rollback | `creek rollback --json` |
|
|
28
|
+
| Rollback to specific | `creek rollback <DEPLOYMENT_ID> --json` |
|
|
29
|
+
| Set env var | `creek env set <KEY> <VALUE> --json` |
|
|
30
|
+
| List env vars | `creek env ls --json` |
|
|
31
|
+
| Show env values | `creek env ls --show --json` |
|
|
32
|
+
| Remove env var | `creek env rm <KEY> --json` |
|
|
33
|
+
| Add domain | `creek domains add <HOSTNAME> --json` |
|
|
34
|
+
| List domains | `creek domains ls --json` |
|
|
35
|
+
| Activate domain | `creek domains activate <HOSTNAME> --json` |
|
|
36
|
+
| Remove domain | `creek domains rm <HOSTNAME> --json` |
|
|
37
|
+
| Send a message to the project queue | `creek queue send '<JSON-BODY>' --json` |
|
|
38
|
+
| Dev server (local) | `creek dev` |
|
|
39
|
+
| Dev server + trigger a cron firing | `creek dev --trigger-cron "*/5 * * * *"` |
|
|
40
|
+
| List team databases | `creek db ls --json` |
|
|
41
|
+
| Create a team database | `creek db create <NAME> --json` |
|
|
42
|
+
| Attach database to project | `creek db attach <NAME> --to <PROJECT> --as DB --json` |
|
|
43
|
+
| Detach database from project | `creek db detach <NAME> --from <PROJECT> --json` |
|
|
44
|
+
| Rename a database | `creek db rename <NAME> --to <NEW-NAME> --json` |
|
|
45
|
+
| Delete a database | `creek db delete <NAME> --json` |
|
|
46
|
+
| Tail runtime logs | `creek logs --json` |
|
|
47
|
+
| Tail runtime logs (live) | `creek logs --follow --json` |
|
|
48
|
+
| Filter runtime logs | `creek logs --outcome exception --since 1h --json` |
|
|
49
|
+
| Read a deployment's build log | `creek deployments logs <DEPLOYMENT_ID> --json` |
|
|
50
|
+
| Read raw build log ndjson | `creek deployments logs <DEPLOYMENT_ID> --raw` |
|
|
51
|
+
| Pre-deploy diagnostic | `creek doctor --json` |
|
|
52
|
+
|
|
53
|
+
## JSON Output Format
|
|
54
|
+
|
|
55
|
+
Every command returns structured JSON with breadcrumbs:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"ok": true,
|
|
60
|
+
"url": "https://my-app-team.bycreek.com",
|
|
61
|
+
"project": "my-app",
|
|
62
|
+
"breadcrumbs": [
|
|
63
|
+
{ "command": "creek status", "description": "Check deployment status" },
|
|
64
|
+
{ "command": "creek deployments --project my-app", "description": "View deployment history" }
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
On error:
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"ok": false,
|
|
73
|
+
"error": "not_authenticated",
|
|
74
|
+
"message": "Not authenticated. Run `creek login` first.",
|
|
75
|
+
"breadcrumbs": [
|
|
76
|
+
{ "command": "creek login", "description": "Authenticate interactively" }
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# `creek.toml` Reference
|
|
2
|
+
|
|
3
|
+
```toml
|
|
4
|
+
[project]
|
|
5
|
+
name = "my-app" # Required. Lowercase alphanumeric + hyphens.
|
|
6
|
+
framework = "nextjs" # Optional. Auto-detected from package.json.
|
|
7
|
+
|
|
8
|
+
[build]
|
|
9
|
+
command = "npm run build" # Build command (default: npm run build)
|
|
10
|
+
output = "dist" # Build output directory
|
|
11
|
+
worker = "worker/index.ts" # Optional: custom Worker entry point
|
|
12
|
+
|
|
13
|
+
[resources]
|
|
14
|
+
database = true # D1 database → env.DB + `import { db } from 'creek'`
|
|
15
|
+
storage = true # R2 bucket → env.BUCKET + `import { storage } from 'creek'`
|
|
16
|
+
cache = true # KV namespace → env.KV + `import { cache } from 'creek'`
|
|
17
|
+
ai = true # Workers AI → env.AI + `import { ai } from 'creek'`
|
|
18
|
+
|
|
19
|
+
[triggers]
|
|
20
|
+
cron = ["0 */6 * * *"] # One or more cron expressions. Standard 5-field format.
|
|
21
|
+
queue = true # Creates a per-project queue + consumer binding.
|
|
22
|
+
# Producer: `import { queue } from 'creek'` inside the Worker.
|
|
23
|
+
# Consumer: export a `queue(batch, env, ctx)` handler.
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Semantic names** (`database` / `storage` / `cache`) are the stable
|
|
27
|
+
Creek names and what you should write in new projects. The legacy
|
|
28
|
+
Cloudflare names (`d1` / `r2` / `kv`) are still accepted for
|
|
29
|
+
backward compatibility but deprecated.
|
|
30
|
+
|
|
31
|
+
**`[resources]` booleans vs `creek db`** — the `[resources]` shorthand
|
|
32
|
+
auto-provisions one resource per project, legacy-compatible with v1.
|
|
33
|
+
For any project needing a renameable database, a database shared
|
|
34
|
+
across projects, or explicit ENV var control, use `creek db create` +
|
|
35
|
+
`creek db attach` (see `references/resources.md`). The two paths can
|
|
36
|
+
coexist during migration.
|
|
37
|
+
|
|
38
|
+
## Cron triggers
|
|
39
|
+
|
|
40
|
+
Creek reads the `cron` array and registers each expression with
|
|
41
|
+
Cloudflare's scheduled event system. The Worker must export a
|
|
42
|
+
`scheduled(event, env, ctx)` handler. Creek generates this handler
|
|
43
|
+
automatically when using a framework; for hand-written Workers, see
|
|
44
|
+
the SSR/Worker examples in the docs.
|
|
45
|
+
|
|
46
|
+
Verify cron is active:
|
|
47
|
+
```bash
|
|
48
|
+
creek status --json # Shows registered cron schedules
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Simulate a firing locally during dev:
|
|
52
|
+
```bash
|
|
53
|
+
creek dev --trigger-cron "0 */6 * * *"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Queue triggers
|
|
57
|
+
|
|
58
|
+
Setting `queue = true` auto-provisions a Cloudflare Queue and binds
|
|
59
|
+
it to the project. Inside the Worker:
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// Producer — in any request handler
|
|
63
|
+
import { queue } from 'creek';
|
|
64
|
+
await queue.send({ userId: 'abc', action: 'welcome-email' });
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
// Consumer — export from the Worker entry
|
|
69
|
+
export default {
|
|
70
|
+
async queue(batch, env, ctx) {
|
|
71
|
+
for (const msg of batch.messages) {
|
|
72
|
+
console.log(msg.body);
|
|
73
|
+
msg.ack();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Send a message from the CLI (useful for testing):
|
|
80
|
+
```bash
|
|
81
|
+
creek queue send '{"userId":"abc"}' --json
|
|
82
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Creek CLI — Deployment Modes
|
|
2
|
+
|
|
3
|
+
Four ways to invoke `creek deploy`. Pick based on where the build runs
|
|
4
|
+
and whether the result persists.
|
|
5
|
+
|
|
6
|
+
## Authenticated (permanent)
|
|
7
|
+
|
|
8
|
+
Requires `creek login`. Deploys persist under the user's account.
|
|
9
|
+
Builds locally, uploads the bundle, deploys to Workers for Platforms.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
creek deploy --json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Sandbox (60-min preview)
|
|
16
|
+
|
|
17
|
+
No auth required. Temporary preview with claimable URL.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
creek deploy --json # auto-sandbox when not logged in
|
|
21
|
+
creek claim <SANDBOX_ID> # convert to permanent project
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Sandbox env vars are restricted — user-set secrets are not injected.
|
|
25
|
+
Code that depends on an LLM API key or similar should gate on the
|
|
26
|
+
env var being present and fall back gracefully, then deploy to
|
|
27
|
+
production for full env access.
|
|
28
|
+
|
|
29
|
+
## CI/CD
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
CREEK_TOKEN=ck_... creek deploy --yes --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`--yes` is auto-enabled in non-TTY environments (no confirmation
|
|
36
|
+
prompts). `--json` output is also auto-enabled in non-TTY.
|
|
37
|
+
|
|
38
|
+
## Remote build via GitHub connection
|
|
39
|
+
|
|
40
|
+
When the project has a GitHub connection (set up via the dashboard's
|
|
41
|
+
`/new` import flow or `/projects/:id/settings`), Creek can deploy the
|
|
42
|
+
latest commit on the project's production branch **without** running
|
|
43
|
+
the build locally. The control-plane fetches the commit, invokes the
|
|
44
|
+
same remote-builder container used by `git push` webhooks, and runs
|
|
45
|
+
the full deploy pipeline server-side.
|
|
46
|
+
|
|
47
|
+
Use this when:
|
|
48
|
+
- You want to redeploy from a machine that doesn't have the source
|
|
49
|
+
checked out (fresh CI runner, different laptop, an agent with a
|
|
50
|
+
narrow workspace).
|
|
51
|
+
- You want to trigger a deploy without pushing a commit.
|
|
52
|
+
- You want CI capability parity with the dashboard "Deploy latest"
|
|
53
|
+
button.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Infer the project from creek.toml in cwd
|
|
57
|
+
creek deploy --from-github --json
|
|
58
|
+
|
|
59
|
+
# Or target an explicit project by slug (or UUID)
|
|
60
|
+
creek deploy --from-github --project my-app --json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The command polls the deployments list until the new row settles on
|
|
64
|
+
`active`, `failed`, or `cancelled`, and prints each status transition.
|
|
65
|
+
Fails fast if the project has no github_connection or the connection's
|
|
66
|
+
production branch has no accessible commit.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Creek CLI — Failure Diagnosis
|
|
2
|
+
|
|
3
|
+
When a user says "my deploy failed" or "creek deploy didn't work",
|
|
4
|
+
follow this sequence. Don't guess — each step returns structured data
|
|
5
|
+
you can act on.
|
|
6
|
+
|
|
7
|
+
## 1. Pre-deploy check (if they haven't run it yet)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
creek doctor --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Returns findings with `CK-*` codes, severities, and concrete fixes.
|
|
14
|
+
Run before any deploy-not-even-attempted scenario. Common fires:
|
|
15
|
+
`CK-NO-CONFIG`, `CK-NOTHING-TO-DEPLOY`, `CK-DB-DUAL-DRIVER-SPLIT`,
|
|
16
|
+
`CK-SYNC-SQLITE`, `CK-PRISMA-SQLITE`.
|
|
17
|
+
|
|
18
|
+
## 2. Find the failed deployment
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
creek deployments --json # list, newest first
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Scan for `status: "failed"` rows; note the `id`.
|
|
25
|
+
|
|
26
|
+
## 3. Read the build log
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
creek deployments logs <id-prefix> --json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Look at `metadata.errorCode` and `metadata.errorStep`. The `entries`
|
|
33
|
+
array is phase-grouped — lines with `level: "error"` or from the
|
|
34
|
+
failing step are the signal.
|
|
35
|
+
|
|
36
|
+
## 4. Apply the fix
|
|
37
|
+
|
|
38
|
+
Match `errorCode` against the CK-* mapping:
|
|
39
|
+
|
|
40
|
+
| Code | Fix |
|
|
41
|
+
|------|-----|
|
|
42
|
+
| `CK-NO-CONFIG` | Run `creek init` or cd to a project root |
|
|
43
|
+
| `CK-NOTHING-TO-DEPLOY` | Run the build, or set `[build].command` in creek.toml |
|
|
44
|
+
| `CK-DB-DUAL-DRIVER-SPLIT` | Consolidate to shared `schema.ts` + `routes.ts` + thin boot split (see `references/resources.md`) |
|
|
45
|
+
| `CK-SYNC-SQLITE` | Move to async ORM (Drizzle/Kysely) with D1 adapter |
|
|
46
|
+
| `CK-PRISMA-SQLITE` | Prisma+SQLite not supported on Workers; switch to Drizzle/Kysely |
|
|
47
|
+
| `CK-RUNTIME-LOCKIN` | Drop the `@solcreek/*` runtime imports for a portable build |
|
|
48
|
+
| `CK-CONFIG-OVERLAP` | Keep either creek.toml or wrangler.*, not both |
|
|
49
|
+
|
|
50
|
+
For an unmapped error code or a generic `build_failed`, the
|
|
51
|
+
`errorStep` tells you the phase (install / build / bundle) and the
|
|
52
|
+
log entries carry the actual stderr.
|
|
53
|
+
|
|
54
|
+
## 5. Redeploy
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
creek deploy --json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If the fix was config-side, `creek doctor --json` should now be clean.
|
|
61
|
+
|
|
62
|
+
## Troubleshooting (error-string table)
|
|
63
|
+
|
|
64
|
+
Quick lookup when the user reports a specific error string verbatim.
|
|
65
|
+
|
|
66
|
+
| Error | Fix |
|
|
67
|
+
|-------|-----|
|
|
68
|
+
| "Not authenticated" | `creek login` or set `CREEK_TOKEN` |
|
|
69
|
+
| "Invalid API key" | `creek login` to re-authenticate |
|
|
70
|
+
| "No creek.toml found" | `creek init` or cd to project root |
|
|
71
|
+
| "No project found" | Deploy from a dir with package.json or index.html |
|
|
72
|
+
| "No supported project found in repo" | Use `--path` for monorepos |
|
|
73
|
+
| "Project has no GitHub connection" (on `--from-github`) | Connect the repo first via the dashboard Settings → GitHub Connection |
|
|
74
|
+
| "Could not determine target project" (on `--from-github`) | Pass `--project <slug>` or run the command from a directory with a `creek.toml` |
|
|
75
|
+
| Sandbox expired | Redeploy — sandboxes last 60 minutes |
|
|
76
|
+
| Domain stuck "pending" | Set CNAME to `cname.creek.dev`, then `creek domains activate` |
|
|
77
|
+
| Build fails | Check `[build] command` in creek.toml |
|
|
78
|
+
| Webhook not firing on push | Verify the repo is connected under project Settings; GitHub App must be installed on the repo's account |
|
|
79
|
+
| `CK-DB-DUAL-DRIVER-SPLIT` from `creek doctor` | Consolidate db.local.ts + db.prod.ts to the shared-routes pattern. See `references/resources.md`. |
|
|
80
|
+
| "Resource has bindings" on `creek db delete` | Detach from every project (`creek db detach <name> --from <project>`) before deletion |
|
|
81
|
+
| "A resource named 'X' already exists" | Team-unique names; pick a different one or `creek db rename` the existing one |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# GitHub Auto-Deploy Setup
|
|
2
|
+
|
|
3
|
+
For push-to-deploy + PR previews, the user installs the **Creek
|
|
4
|
+
Deploy** GitHub App and connects a repository to a Creek project:
|
|
5
|
+
|
|
6
|
+
1. Visit `https://github.com/apps/creek-deploy` and install on the
|
|
7
|
+
account or organization that owns the repo.
|
|
8
|
+
2. GitHub redirects to `https://app.creek.dev/github/setup?installation_id=...`
|
|
9
|
+
which claims the installation for the current team and lists the
|
|
10
|
+
installation's repositories.
|
|
11
|
+
3. Either import a new project from the dashboard's New Project →
|
|
12
|
+
Import Git Repository flow, or connect an existing project from
|
|
13
|
+
its Settings → GitHub Connection section.
|
|
14
|
+
4. Pushes to the project's production branch trigger a full build +
|
|
15
|
+
deploy; pull requests trigger a preview deployment and post a
|
|
16
|
+
commit status with the preview URL.
|
|
17
|
+
5. `creek deploy --from-github [--project <slug>]` can trigger the
|
|
18
|
+
same flow for the latest commit on demand (no push required). See
|
|
19
|
+
`references/deployment-modes.md` for when to reach for this.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Creek CLI — Observability
|
|
2
|
+
|
|
3
|
+
Two distinct log streams, answering different questions:
|
|
4
|
+
|
|
5
|
+
| Question | Tool |
|
|
6
|
+
|----------|------|
|
|
7
|
+
| "What happened during my last deploy?" | `creek deployments logs <ID>` |
|
|
8
|
+
| "What's my worker doing in production?" | `creek logs` |
|
|
9
|
+
| "Why did my deploy fail, and can an agent fix it?" | MCP `get_build_log` |
|
|
10
|
+
|
|
11
|
+
## Runtime logs — `creek logs`
|
|
12
|
+
|
|
13
|
+
Per-project tail of `console.log` / `console.error` / uncaught
|
|
14
|
+
exceptions for every request your Worker served. Tenant-isolated —
|
|
15
|
+
the prefix is derived from the session, not URL params.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
creek logs --json # last hour, all outcomes
|
|
19
|
+
creek logs --follow # live tail via WebSocket
|
|
20
|
+
creek logs --outcome exception # errors only
|
|
21
|
+
creek logs --since 24h --search "order" # free text within a window
|
|
22
|
+
creek logs --deployment <id> # specific deploy
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Note: **edge-cached HTML requests don't appear** — they never invoke
|
|
26
|
+
the worker, so no log event fires. See the Analytics tab in the
|
|
27
|
+
dashboard for total HTTP traffic (including cache hits).
|
|
28
|
+
|
|
29
|
+
## Build logs — `creek deployments logs <id>`
|
|
30
|
+
|
|
31
|
+
Structured transcript of the deploy pipeline: clone / detect / install
|
|
32
|
+
/ build / bundle / upload / provision / activate. Surfaces the
|
|
33
|
+
failing step with a `CK-*` diagnostic code and the subprocess stderr.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
creek deployments logs <deployment-id> --json # agent-safe
|
|
37
|
+
creek deployments logs <deployment-id> --raw # ndjson for piping
|
|
38
|
+
creek deployments logs <short-id> # 8-char prefix works
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Available for `creek deploy` (CLI), GitHub push deploys, and via the
|
|
42
|
+
dashboard's Deployments tab (expandable panel, auto-open on failure).
|
|
43
|
+
Web deploys from `creek.dev/new` render the same transcript inline
|
|
44
|
+
on failure.
|
|
45
|
+
|
|
46
|
+
## MCP tool — `get_build_log`
|
|
47
|
+
|
|
48
|
+
`mcp.creek.dev` exposes `get_build_log` for agents that want to
|
|
49
|
+
diagnose a deploy without going through the CLI. Input: Creek API key
|
|
50
|
+
+ project slug + deployment id (short or full). Output: summary +
|
|
51
|
+
important lines (errors + failing-step lines) + full log.
|
|
52
|
+
|
|
53
|
+
Pattern: user says "my deploy to Creek failed, can you fix it?" → agent
|
|
54
|
+
calls `get_build_log` → reads the `errorCode` + `errorStep` → applies
|
|
55
|
+
the corresponding fix. See `references/diagnosis.md` for the CK-*
|
|
56
|
+
code-to-fix mapping.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Resources v2 — Team-Owned Databases
|
|
2
|
+
|
|
3
|
+
Databases (and other resources) are **team-owned**, not project-owned.
|
|
4
|
+
A resource has a stable UUID and a mutable name; it can be attached
|
|
5
|
+
to one or more projects under different ENV var names. This replaces
|
|
6
|
+
the "one D1 per project, name derived from project id" model.
|
|
7
|
+
|
|
8
|
+
## Workflow
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# 1. Create a team-level database (unattached, not yet provisioned in CF)
|
|
12
|
+
creek db create users --json
|
|
13
|
+
|
|
14
|
+
# 2. Attach it to one project as env.DB
|
|
15
|
+
creek db attach users --to my-api --as DB --json
|
|
16
|
+
|
|
17
|
+
# 3. Optionally share the same database with another project
|
|
18
|
+
creek db attach users --to dashboard --as DB --json
|
|
19
|
+
|
|
20
|
+
# 4. Inspect what's attached
|
|
21
|
+
creek db ls --json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The database name is mutable — `creek db rename users --to prod-users`
|
|
25
|
+
works without recreating the CF resource or breaking bindings.
|
|
26
|
+
|
|
27
|
+
Deletion is blocked while any binding exists — detach from every
|
|
28
|
+
project first, then `creek db delete`.
|
|
29
|
+
|
|
30
|
+
## Portable pattern (required mental model)
|
|
31
|
+
|
|
32
|
+
Share **schema + queries**; split **only the boot**. The
|
|
33
|
+
`examples/vite-react-drizzle` reference:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
server/
|
|
37
|
+
├── schema.ts shared Drizzle schema (one source of truth)
|
|
38
|
+
├── routes.ts shared Hono routes that accept a `() => db` thunk
|
|
39
|
+
├── local.ts Node + better-sqlite3 boot (dev)
|
|
40
|
+
└── worker.ts CF Worker + D1 boot (prod)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The async Drizzle API is the same across both drivers, so
|
|
44
|
+
`routes.ts` runs unchanged in either environment. Migrations run
|
|
45
|
+
against whichever driver the boot file sets up. Don't duplicate
|
|
46
|
+
schema or queries across `db.local.ts` + `db.prod.ts` — `creek doctor`
|
|
47
|
+
flags that with `CK-DB-DUAL-DRIVER-SPLIT`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Creek CLI — Common Workflows
|
|
2
|
+
|
|
3
|
+
## First deploy
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
creek login --json # 1. Authenticate
|
|
7
|
+
creek init --json # 2. Create creek.toml (optional)
|
|
8
|
+
creek deploy --json # 3. Deploy
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Update & rollback
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
creek deploy --json # Deploy new version
|
|
15
|
+
creek deployments --json # View history
|
|
16
|
+
creek rollback --json # Rollback to previous
|
|
17
|
+
creek rollback <ID> --json # Rollback to specific deployment
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Custom domain
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
creek domains add app.example.com --json # Add domain
|
|
24
|
+
# User sets DNS: CNAME app.example.com → cname.creek.dev
|
|
25
|
+
creek domains activate app.example.com --json # Activate after DNS
|
|
26
|
+
creek domains ls --json # Verify status
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Supported Frameworks
|
|
30
|
+
|
|
31
|
+
**SPA**: vite-react, vite-vue, vite-svelte, vite-solid, static HTML, astro
|
|
32
|
+
**SSR**: nextjs, react-router, sveltekit, nuxt, solidstart, tanstack-start
|
|
33
|
+
|
|
34
|
+
Not every SSR framework has equal support yet — check
|
|
35
|
+
[creek.dev/docs/getting-started](https://creek.dev/docs/getting-started)
|
|
36
|
+
for the current compatibility matrix. Next.js in particular requires
|
|
37
|
+
`@solcreek/adapter-creek` or Creek's OpenNextJS workaround.
|
|
38
|
+
|
|
39
|
+
## Config Detection Order
|
|
40
|
+
|
|
41
|
+
1. `creek.toml` — explicit Creek config
|
|
42
|
+
2. `wrangler.jsonc` / `wrangler.json` / `wrangler.toml` — existing CF config
|
|
43
|
+
3. `package.json` — framework auto-detection
|
|
44
|
+
4. `index.html` — static site
|