Documentation Index
Fetch the complete documentation index at: https://docs.deep.space/llms.txt
Use this file to discover all available pages before exploring further.
npx deepspace deploy builds your app and uploads it to Cloudflare Workers for Platforms, returning a live <name>.app.space URL.
What deploy does
The CLI builds your app with Vite (the Cloudflare plugin produces both the client bundle and the worker), validates your binding manifest, and uploads everything to the deploy worker as one request. From there, the platform auto-provisions any binding marked "auto", applies your user secrets from .dev.vars as secret_text bindings, and registers the worker in the dispatch namespace at <name>.app.space.
Deploys are idempotent. Re-running deploy with no source changes reuses provisioned resources and uploads unchanged code as a no-op.
See Build & deploy pipeline for the full step-by-step. Inspect deployed apps, logs, and traffic in the web dashboard at dashboard.deep.space.
Subdomains
Thename field in wrangler.toml is your subdomain:
- Lowercase alphanumeric with optional dashes, up to 63 characters; cannot begin with a dash
- Non-conforming names cause the CLI to fail with a clear error and the suggested canonical form; fix
nameinwrangler.tomland re-run - Renaming
nameafter deploy and re-deploying gives you a new subdomain - the old one becomes orphaned (still accessible until explicitly undeployed)
State preservation
A deploy does not wipe Durable Object state. Your records, conversations, files, and cron history persist across deploys. Survives a deploy:- Durable Object SQLite tables (records, Yjs documents, canvas state, cron history)
- R2 bucket contents
- Auto-provisioned bindings (D1, KV, Vectorize, etc.). Resource IDs are persisted and reused.
- User secrets in
.dev.vars. Re-uploaded each deploy; same values land assecret_textbindings.
- Worker module-level globals
- In-memory caches inside DOs. Every DO restarts; persistent storage stays, in-memory state is rebuilt on the next request.
Schema migrations
The SDK runs additive schema migrations automatically. When a DO cold-starts after a deploy, the per-collection migrator creates any new tables and runsALTER TABLE ADD COLUMN for new fields. Re-running with an unchanged schema is a no-op.
Destructive changes are not handled: dropping a column, changing a column type, renaming a field, or backfilling data into a new shape. You’re responsible for any data migration before deploying a breaking schema change.
Secrets and .dev.vars
The CLI writes SDK-managed keys at the top of .dev.vars, followed by a divider, followed by anything you’ve added:
.dev.vars
- Is preserved verbatim across
dev/test/deployruns - Becomes a
secret_textbinding on deploy (env.STRIPE_SECRET_KEYin worker code) - Never appears in compiled assets or client bundles
Secret constraints
| Limit | Value |
|---|---|
| Name pattern | ^[A-Za-z_][A-Za-z0-9_]*$ |
| Per-value size | 32 KB |
| Total across all secrets | 128 KB |
| Raw deploy payload | 1 MB |
secret_text bindings.
Secret names cannot collide with any reserved binding name, custom binding, or Durable Object binding name. The CLI fails locally with a clear error before any upload.
Custom bindings
Add Vectorize, Workers AI, R2, KV, D1, Queues, Browser Rendering, Hyperdrive, or Analytics Engine bindings by declaring them inwrangler.toml. Set the ID to "auto" to auto-provision:
Undeploy
To take an app down:- R2 buckets with files in them are not auto-deleted. This protects against accidental user-content loss. Empty the bucket manually if you want it gone.
Before your first deploy
Three things to verify before shipping:- Finalize the app name. Renaming
nameinwrangler.tomllater creates a new subdomain and orphans the old one. - Audit
.dev.vars. Every key below the divider ships as asecret_textbinding. Confirm prod credentials, not test keys. - Run
npx deepspace test. Playwright runs your specs against a local build before you deploy them against the live one.
Next steps
- Deploy command reference - flags, environment variables, and edge cases.
- Custom bindings - declare Vectorize, R2, D1, and more.
- Custom domains - buy and attach a real domain from the CLI.
- Testing - run Playwright specs before you ship.