creek 0.4.15 → 0.4.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "creek",
3
- "version": "0.4.15",
3
+ "version": "0.4.17",
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.15",
54
+ "@solcreek/cli": "^0.4.17",
54
55
  "@solcreek/runtime": "^0.4.0"
55
- }
56
+ },
57
+ "scripts": {}
56
58
  }
@@ -0,0 +1,74 @@
1
+ # Agent Skills for Creek
2
+
3
+ [Agent Skills](https://agentskills.io/) for [Creek](https://creek.dev) —
4
+ the deployment platform that ships full-stack apps to the edge with a
5
+ single command and a single semantic resource model.
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. Serves claude.ai users
54
+ + API agents that can't load filesystem skills.
55
+
56
+ Edit the `.md` file once — both surfaces update on next deploy.
57
+
58
+ ## Legacy install URL (deprecated)
59
+
60
+ The old URL `npx skills add solcreek/skills` is **deprecated**. The
61
+ standalone [`solcreek/skills`](https://github.com/solcreek/skills)
62
+ repo is frozen at its last pre-consolidation snapshot and will be
63
+ archived. Update any install scripts, docs, or READMEs to the
64
+ `solcreek/creek/skills` form above — the content lives here
65
+ alongside the code it describes, so it stays in sync by construction.
66
+
67
+ ## Requires
68
+
69
+ - [Creek CLI](https://www.npmjs.com/package/creek) (`npm install -g creek`)
70
+ - An authenticated account for production deploys (`creek login`)
71
+
72
+ ## License
73
+
74
+ Apache-2.0
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: creek
3
+ description: |
4
+ Deploy and manage full-stack apps to the edge with Creek — one
5
+ command from local code to a live URL. Ship, diagnose failed deploys,
6
+ read runtime + build logs, manage team-owned databases (creek db),
7
+ handle custom domains, cron, queues, GitHub push deploys, and local
8
+ dev. Skill covers Creek's conventions (semantic resource keys,
9
+ shared schema + split boot pattern, unified sandbox/production code
10
+ path) plus CK-error code fix hints.
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`, or "deploy to the
14
+ edge". Also use when a user says "my deploy failed" / "deploy to creek
15
+ didn't work" / "add a database to my creek project" / "why isn't my
16
+ push deploying" / "can I share a database across projects" / "is my
17
+ cron running". Pre-emptively load when editing creek.toml or code
18
+ that imports from @solcreek/*.
19
+ license: Apache-2.0
20
+ compatibility: Requires Creek CLI (npm install -g creek)
21
+ paths:
22
+ - "**/creek.toml"
23
+ - "**/examples/vite-react-drizzle/**"
24
+ - "**/server/{local,worker,routes,schema}.ts"
25
+ metadata:
26
+ author: solcreek
27
+ required-binaries: creek
28
+ required-env: CREEK_TOKEN
29
+ ---
30
+
31
+ # Creek CLI — Agent Skill
32
+
33
+ Creek deploys full-stack web apps to the edge with a single command.
34
+ Auto-detects framework, determines render mode (SPA/SSR/Worker),
35
+ provisions infrastructure.
36
+
37
+ ## Mental Model
38
+
39
+ Creek manages the deploy target, bindings, and runtime for you. You
40
+ work with semantic concepts — `database`, `cache`, `storage`, `ai` —
41
+ not infrastructure primitives. The CLI and `@solcreek/runtime` cover
42
+ the concerns you'd normally write glue code for.
43
+
44
+ Rule of thumb: if you're about to write platform-level glue (editing
45
+ generated config, manually provisioning infra, swapping drivers across
46
+ local/production), check whether `creek` or `@solcreek/runtime` already
47
+ handles it. It almost always does.
48
+
49
+ ## Conventions that matter on first pass
50
+
51
+ Creek deviates from common deployment heuristics in a few specific
52
+ ways. Getting these right up front avoids dead-end rewrites.
53
+
54
+ - **Semantic resource keys.** In `creek.toml [resources]`, use
55
+ `database`, `cache`, `storage`, `ai`. These map to infrastructure
56
+ automatically. Other names are silently dropped — `creek doctor`
57
+ flags this with `CK-RESOURCES-KEYS`.
58
+
59
+ - **Provision via `creek db create <name>`, not platform-specific
60
+ tooling.** Creates a team-owned resource with a stable UUID that
61
+ can be renamed, shared across projects, and detached without
62
+ dropping data. Provisioning outside Creek creates orphaned
63
+ infrastructure the platform can't track.
64
+
65
+ - **One code path for sandbox and production.** Env var behavior is
66
+ identical. Sandbox just runs without user-set secrets. Gate on
67
+ `env.MY_KEY` being present; don't fork code paths.
68
+
69
+ - **Shared schema + split boot files for portable DB code.** The
70
+ recommended shape: one `schema.ts` + one `routes.ts` (driver-agnostic)
71
+ + thin boot files (`server/local.ts` for local dev, `server/worker.ts`
72
+ for production) that differ only in driver setup. Never duplicate
73
+ the schema across local and production files — `creek doctor` flags
74
+ this with `CK-DB-DUAL-DRIVER-SPLIT`. See `references/resources.md`
75
+ and `examples/vite-react-drizzle`.
76
+
77
+ - **`creek.toml` is the source of truth for config.** Creek generates
78
+ its deploy-target config at build time. Hand-edits to generated
79
+ files get reverted on next deploy. If an existing project has a
80
+ legacy config file from another tool, `creek doctor` flags it with
81
+ `CK-CONFIG-OVERLAP` and guides the reconciliation.
82
+
83
+ ## Quick Triage
84
+
85
+ Map user phrasing to the right workflow before doing anything else.
86
+
87
+ | User says / implies | First command |
88
+ |---------------------|--------------|
89
+ | "deploy this" (no context) | `creek deploy --dry-run --json` first, then `creek deploy --json` |
90
+ | "deploy failed" / "something broke" | See `references/diagnosis.md` |
91
+ | "can't see logs" | Is it missing because edge-cached? See `references/observability.md` |
92
+ | "add a database" / "need a DB" (no account) | Sandbox auto-provisions: add `[resources] database = true` to creek.toml. See "Sandbox with DB" below. |
93
+ | "add a database" / "need a DB" (signed in) | `creek db create <name>` + `creek db attach` (see `references/resources.md`) |
94
+ | "how do I run this locally" | `creek dev` |
95
+ | "rollback the last deploy" | `creek rollback --json` |
96
+ | "add a domain" | `creek domains add <host>` + DNS CNAME → `creek domains activate` |
97
+ | "why isn't my push deploying" | See `references/github-setup.md` |
98
+ | "what env vars does it see" | `creek env ls --json` (add `--show` for values) |
99
+ | "is my cron running" | `creek status --json` shows cron schedules |
100
+
101
+ If the phrasing doesn't match any row, default to `creek doctor --json`
102
+ — it surfaces the most likely misconfiguration.
103
+
104
+ ## Sandbox with DB (no account, 60 min preview)
105
+
106
+ Sandbox mode auto-provisions a database when `creek.toml` declares
107
+ `[resources] database = true` — no `creek login`, no `creek db create`
108
+ required. The binding name is `DB`. This makes it safe to build a
109
+ DB-backed CRUD demo (e.g. TODO list) and ship a live URL in one step.
110
+
111
+ ```toml
112
+ # creek.toml
113
+ [project]
114
+ name = "todo-app"
115
+
116
+ [build]
117
+ worker = "worker.ts" # required for API routes
118
+ output = "public" # static assets dir (at minimum: index.html)
119
+
120
+ [resources]
121
+ database = true # NOT d1 = true — doctor flags that as error
122
+ ```
123
+
124
+ ```ts
125
+ // worker.ts
126
+ import { define } from "d1-schema";
127
+
128
+ export interface Env { DB: D1Database }
129
+
130
+ export default {
131
+ async fetch(req: Request, env: Env): Promise<Response> {
132
+ await define(env.DB, {
133
+ todos: { id: "text primary key", text: "text not null", completed: "integer default 0" },
134
+ });
135
+ // ...env.DB.prepare("SELECT * FROM todos").all()
136
+ },
137
+ };
138
+ ```
139
+
140
+ Constraints to know before starting:
141
+
142
+ - **`public/index.html` is required.** Sandbox rejects worker-only
143
+ bundles with `No assets in bundle`. Serve your UI as static + use
144
+ the worker for `/api/*`.
145
+ - **`creek deploy --dry-run --json` first.** It runs the full
146
+ doctor check and surfaces `[resources]` typos (e.g. the `d1/kv/r2`
147
+ vs `database/cache/storage` split) before you burn a deploy.
148
+ - **`creek logs` and `creek doctor --last` need auth**, so runtime
149
+ errors in sandbox are hard to diagnose. Return JSON errors with a
150
+ meaningful `message` from your handlers so failures surface via the
151
+ HTTP response instead.
152
+
153
+ ## Agent Rules
154
+
155
+ 1. **Always use `--json`** for structured output. Auto-enabled in non-TTY / CI.
156
+ 2. **Follow `breadcrumbs`** in JSON responses — they suggest the next command.
157
+ 3. **Use `--yes`** to skip confirmation prompts (auto-enabled in non-TTY).
158
+ 4. **Check `ok` field** — `true` = success, `false` = error with `error` and `message` fields.
159
+
160
+ ## Cheat Sheet
161
+
162
+ Top commands. Full table in `references/commands.md`.
163
+
164
+ | Task | Command |
165
+ |------|---------|
166
+ | Authenticate | `creek login` |
167
+ | Deploy | `creek deploy --json` |
168
+ | Dry-run plan (safe, no side effects) | `creek deploy --dry-run --json` |
169
+ | Check status | `creek status --json` |
170
+ | List deployments | `creek deployments --json` |
171
+ | Read a deployment's build log | `creek deployments logs <ID> --json` |
172
+ | Rollback | `creek rollback --json` |
173
+ | Runtime logs | `creek logs --follow --json` |
174
+ | Pre-deploy diagnostic | `creek doctor --json` |
175
+ | Create team database | `creek db create <NAME> --json` |
176
+
177
+ ## Additional Resources
178
+
179
+ Load on demand. These files live in `references/` and are meant to be
180
+ read via `bash cat` when the task needs the detail.
181
+
182
+ - `references/commands.md` — complete command table + JSON output spec
183
+ - `references/deployment-modes.md` — authenticated / sandbox / CI / remote-GitHub
184
+ - `references/workflows.md` — first-deploy / update-rollback / custom-domain, framework matrix, config detection order
185
+ - `references/creek-toml.md` — full `creek.toml` reference, cron + queue details
186
+ - `references/diagnosis.md` — failure diagnosis workflow + CK-code fix table + error-string troubleshooting
187
+ - `references/observability.md` — `creek logs` + `creek deployments logs` + MCP `get_build_log` + edge-cache caveats
188
+ - `references/resources.md` — `creek db` + team-owned resource model + portable pattern
189
+ - `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