CLI reference
Every durable-sdk verb with its flags, the environment it reads, the credentials file, the exit grammar and what --json prints.
This page lists every durable-sdk verb the platform's CLI carries, with its flags, what it reads and what it answers. It teaches the platform verbs (login, apps, deploy, secrets, logs, db read-string, runs) and names the engine's own verbs (doctor, test, migrate, explain, index, graph) that work on any Durable app, hosted or not.
The CLI is the package durable-sdk; npx durable-sdk <verb> and a project's pnpm durable-sdk <verb> are the same bin. A platform verb is a thin client of one route of the plane API: it sends the request, prints the answer, and reshapes nothing.
The grammar every verb keeps#
- Flags are
--flag valueor--flag=value; a boolean flag takes no value. An unknown flag is refused by name before any request. - Durations are one grammar everywhere:
30s,5m,2h,1d; never a bare number. - Secrets are never an argument. A key reaches
login --with-keyon stdin; a secret's value reachessecrets seton stdin or from--value-file; the read string is printed once through one deliberate channel or written to a file. Nothing a verb prints carries a credential, and every line passes a redactor that replaces any credential the process knows with<secret>. - Progress goes to stderr, the answer to stdout. Under
--jsonstdout is one JSON document: the route's answer verbatim, or a refusal as{ "error": { "code", "message", "remedy", "docs" } }. - Every app-scoped verb takes
--app <slug>; it wins, else the verb reads.durable-sdk/app.jsonin the working directory (written byapps createandapps link), else it refuses withplane.cli.no_appand the remedydurable-sdk apps link <slug>.
Exit codes#
| Code | Meaning |
|---|---|
| 0 | The verb answered: the thing asked stands. |
| 1 | The verb's own red: a deployment failed or cancelled, a red check, a run in limbo, a bad verify. |
| 2 | A refused request (any 4xx: the sentence and the remedy are printed) or a bad flag or argument. |
| 3 | The platform unreachable or a 5xx answer. |
An engine verb (doctor, test, migrate, verify) keeps its own 0/1/2 (1 a finding or a failure, 2 usage or a missing credential).
Environment and the credentials file#
| Variable | Meaning |
|---|---|
DURABLE_API_KEY |
An API key (dsk_live_…). Wins over the credentials file. The variable a CI job or an agent sets. |
DURABLE_PLANE_URL |
The platform's base, https://durablesdk.com by default. Honoured only when it and DURABLE_API_KEY both come from the process environment, never from a project file. https:// alone, plain http:// to localhost excepted; the stored host must match the key's. |
DURABLE_CONFIG_DIR |
Where the credentials file lives. Else $XDG_CONFIG_HOME/durable-sdk, else ~/.config/durable-sdk. |
The credentials file is credentials.json in that directory (mode 0600 in a 0700 directory, written to a temporary name then renamed), keyed by the platform's base URL, holding the key with the tenant, the key's name, scope and expiry beside it. Precedence for a key, highest first: DURABLE_API_KEY in the environment, the file's entry for the base URL, else the refusal "not logged in: run durable-sdk login, or set DURABLE_API_KEY" (exit 2). A key is sent to the base URL it was stored under and to no other (plane.cli.plane_mismatch).
Account#
| Verb | Flags | What |
|---|---|---|
durable-sdk login |
[--with-key] [--scope read|deploy|admin] |
Opens a login on the platform, prints the URL and the code (XXXX-XXXX), opens the browser when one is there, and polls until you approve it at /cli/authorize; writes the key the approval minted (named <client> on <hostname>, ninety days) to the credentials file and prints the tenant and the name, never the value. --with-key reads a key from stdin, proves it with GET /whoami and stores it. --scope asks for a scope; the approval grants at most your role's. |
durable-sdk logout |
Deletes the entry for the base URL. The key stands until revoked. | |
durable-sdk whoami |
[--json] |
GET /whoami: the tenant, the principal, its scope and expiry. |
durable-sdk keys list |
[--owner user:<id>] [--json] |
GET /keys: id, name, prefix, scope, owner, created, expires, last use day, revoked; --owner narrows to the keys one person minted (?owner=). |
durable-sdk keys revoke <id> |
[--json] |
DELETE /keys/:id. The minter or an admin. |
There is no keys create: a key is minted by a person on the dashboard (/dashboard/keys) or by the browser hand-off of login, never by a key, so a leaked key cannot propagate (plane.key.mint_by_person). The verb prints that sentence.
durable-sdk login
# durable-sdk login: open https://durablesdk.com/cli/authorize?code=K7MP-3XQW and confirm the code K7MP-3XQW
# durable-sdk login: acme (acme) · durable-sdk on laptop.local · scope deploy · expires 2027-01-26printf '%s' "$KEY" | durable-sdk login --with-keyApps#
| Verb | Flags | What |
|---|---|---|
durable-sdk apps create <slug> |
[--region <id>] [--json] |
POST /apps: the app provisioned (its database, its project, its hostname, the template's first deployment); writes .durable-sdk/app.json; follows the run and exits 0 on active, 1 on failed with the sentence. Scope admin. |
durable-sdk apps list |
[--q <text>] [--status <status>] [--region <id>] [--sort newest|oldest|name] [--json] |
GET /apps: the first page (see --json); --q narrows to a slug or a name holding the text, --status and --region to one word each, --sort orders (newest unless said). |
durable-sdk apps link <slug> |
Writes .durable-sdk/app.json { app, plane } for an app that exists. Commit it; it holds no secret. |
|
durable-sdk apps rm <slug> --yes |
[--json] |
DELETE /apps/:slug: the hold starts (the tier's delete_hold_days). --yes is required: without it the verb is refused before any request (exit 2, no prompt). Scope admin. |
durable-sdk apps restore <slug> |
[--json] |
POST /apps/:slug/restore within the hold. Scope admin. |
durable-sdk apps set --promotion auto|manual |
[--app <slug>] [--json] |
PATCH /apps/:slug { promotionRule }. Scope admin. |
durable-sdk environments list |
[--app <slug>] [--json] |
GET /apps/:slug/environments: production and every preview with its hostname, its deployment and tick (cron or request-only). |
durable-sdk environments rm <name> |
[--app <slug>] [--json] |
DELETE /apps/:slug/environments/:name: a preview's alias removed; production is refused (plane.environment.production). |
The slug is global: [a-z0-9-], 3 to 40 characters, a letter first, no double hyphen, no trailing hyphen, no reserved word, never -git- inside or -staging at the end. The regions are the words GET /regions lists (Regions).
durable-sdk apps create my-app --region us-east
# durable-sdk apps create: my-app provisioning · run r_01J…
# durable-sdk apps create: my-app active · https://my-app.durablesdk.comDeploy#
durable-sdk deploy [--target production|preview] [--prod] [--branch <name>] [--message <text>]
[--app <slug>] [--dir <path>] [--no-follow] [--json]deploy packs the tree (the working directory or --dir, honouring .gitignore and the tree's ignore files, refusing node_modules, .git, .env* and any file over 10 MB) as a gzipped tarball, uploads it in parts of 4 MiB (POST /apps/:slug/uploads, PUT /uploads/:id/parts/:n with Content-SHA256, POST /uploads/:id/complete; a resume reads GET /uploads/:id), then POST /apps/:slug/deployments with an Idempotency-Key minted per invocation and resent on its retries. It follows the build's lines (GET /deployments/:id/events?since= every five seconds) and the state every fifteen seconds, and exits 0 on ready or promoted, 1 on failed or cancelled with the sentence and the remedy. --prod is --target production; the default target is preview under the current branch. --no-follow returns after the queued answer. Under --json stdout is the final Deployment alone. Deploying has the states and the targets.
| Verb | Flags | What |
|---|---|---|
durable-sdk deployments list |
[--app <slug>] [--target <t>] [--state <s>] [--source <s>] [--json] |
GET /apps/:slug/deployments: the first page (see --json); --target, --state and --source narrow. |
durable-sdk deployments get <id> |
[--json] |
GET /deployments/:id: the Deployment with its error and check. |
durable-sdk deployments events <id> |
[--since <iso|cursor>] [--json] |
GET /deployments/:id/events: the build's lines, redacted and masked. |
durable-sdk deployments promote <id> |
[--json] |
POST /deployments/:id/promote: a ready production deployment under the manual rule. |
durable-sdk deployments cancel <id> |
[--json] |
POST /deployments/:id/cancel while queued or building; plane.deploy.not_cancellable once ready. |
durable-sdk deployments redeploy <id> |
[--json] |
POST /deployments/:id/redeploy: the same files under the project's current variables; a new Deployment. |
durable-sdk rollback <id> |
[--json] |
POST /deployments/:id/rollback: the production hostname points back at once; the row rolled_back. |
durable-sdk deploy --prod --message "orders: the refund step"
# durable-sdk deploy: 2.1 MB in 1 part · sha256 3f9c…
# durable-sdk deploy: d_01J… queued
# durable-sdk deploy: building
# 14:02:11 install: 412 packages
# 14:02:48 durable-sdk migrate: v24 recorded
# 14:03:05 tsc: ok
# durable-sdk deploy: checking · https://my-app-d01j.durablesdk.com
# durable-sdk deploy: promoted · https://my-app.durablesdk.comSecrets, domains, the database#
| Verb | Flags | What |
|---|---|---|
durable-sdk secrets set <NAME> |
[--target production,preview] [--value-file <path>] [--redeploy] [--app <slug>] [--json] |
PUT /apps/:slug/secrets/:name: the value from stdin or --value-file, never an argument; both targets by default; --redeploy makes a build from the current production deployment. A reserved name is refused (plane.secret.reserved). |
durable-sdk secrets list |
[--app <slug>] [--json] |
GET /apps/:slug/secrets: names, targets and stamps, never a value. |
durable-sdk secrets rm <NAME> |
[--app <slug>] [--json] |
DELETE /apps/:slug/secrets/:name. |
durable-sdk domains add <hostname> |
[--app <slug>] [--json] |
POST /apps/:slug/domains: prints the TXT challenge. Pro and up (plane.tier.custom_domain). |
durable-sdk domains list |
[--app <slug>] [--json] |
GET /apps/:slug/domains. |
durable-sdk domains verify <hostname> |
[--app <slug>] [--json] |
POST /apps/:slug/domains/:name/verify. |
durable-sdk domains rm <hostname> |
[--app <slug>] [--json] |
DELETE /apps/:slug/domains/:name. |
durable-sdk db read-string |
[--rotate] [--revoke] [--env-file <path>] [--app <slug>] |
POST /apps/:slug/database/read-string: the read-only connection string, printed once; --env-file writes it as DATABASE_READ_URL= into the file instead and prints nothing; --rotate a new password; --revoke drops the role. Scope admin. |
durable-sdk db status |
[--app <slug>] [--json] |
GET /apps/:slug/database: status, the compute's sizing and state (awake, asleep since), storage, history and the moment today's state stays restorable until, the maintenance window, whether a read string stands; the live half is read once a minute. Scope read. |
durable-sdk db branches |
[--app <slug>] [--json] |
The branches off the same answer: name, kind (production, preview, other for a restore's backup), size, birth. Scope read. |
printf '%s' "$STRIPE_KEY" | durable-sdk secrets set STRIPE_KEY --target production --redeploy
# durable-sdk secrets set: STRIPE_KEY set for production · <hidden: 32 characters> · redeploy d_01J… queuedLogs, usage, runs#
| Verb | Flags | What |
|---|---|---|
durable-sdk logs |
[--env production|preview] [--level info|error] [-q <text>] [--follow] [--app <slug>] [--json] |
GET /apps/:slug/logs: the current deployment's runtime lines for at most 30 s, filtered on the platform, at most 256 a read; --follow keeps reading for up to five minutes. --env preview reads the newest preview environment's current deployment; a preview is not named. |
durable-sdk usage |
[--days <n>] [--app <slug>] [--json] |
GET /apps/:slug/usage?days=: one row per UTC day. |
durable-sdk runs limbo |
[--json] |
GET /runs?state=limbo: the tenant's platform runs a compensation could not finish. |
durable-sdk runs get <runId> |
[--json] |
GET /runs/:runId: the run's steps and its error, never an input or an image. |
durable-sdk runs redrive <runId> |
[--json] |
POST /runs/:runId/redrive; plane.run.not_in_limbo otherwise. Scope deploy. |
These runs are the platform's own (an app's provisioning, a deployment); an app's runs are read in the dashboard's Console tab or through the proxy routes of the API.
Scaffold, explain, the engine's verbs#
| Verb | Flags | What |
|---|---|---|
durable-sdk init <name> |
[--dir <path>] [--plane <url>] [--no-install] [--vendor] [--force] |
Writes the template (@durable-sdk/app) under <name>, judges the name under the slug grammar first, installs unless --no-install, prints the next four commands. A non-empty directory is refused unless --force. |
durable-sdk explain <code> |
[--json] |
The registry row for an error code, a refusal id or a run id, offline: the sentence, the trap, the remedy, the record. The platform's plane.* codes are in the same table; a doctor rule's law is doctor --host --explain. |
durable-sdk explain <subject> |
[--api <url>] [--json] [--all] |
The graph's card for a door's path, a workflow's or a fact's name, Model.column, a module's path, kind.capability or a refusal's slug, offline over the app root's graph-index.json, the file the template writes and durable-sdk index rewrites (the template's build runs it): what the door admits, every step with its writes, the facts and who listens; --all expands a folded list. Vibe coding with the graph. |
durable-sdk graph walk <subject> |
[--direction out|in|both] [--depth 1-4] [--kinds a,b] [--node-kinds a,b] [--json] [--api <url>] |
The closure from a node over the same index, one depth at a time, each primitive's drawback under the edges. |
durable-sdk graph path <from> <to> |
[--direction out|both] [--json] [--api <url>] |
The first chain between two nodes, or none within 6 hops. |
durable-sdk graph impact |
[--changed] [--base <ref>] [--files a.ts,b.ts] [--types] [--all] [--json] |
What a change reaches, offline over the same index: the working tree's change against the base (--changed, the default; --base <ref>, else origin/develop, else HEAD~1) or the files named (--files, never both); each file's bodies and one hop out (the doors, the facts and their listeners, the tables and columns, the providers, the refusals), every list folded at 16 unless --all; with a graph-refs.json beside the index the twins, the importers, the rules, the pages, the ADRs, the tests and what durable-sdk test --changed runs for it. |
durable-sdk graph diff |
[--base <ref>] [--json] |
What the graph gained, lost and changed against a ref (its committed graph-index.json through git show, against the working tree's): +, - and ~ rows, names only, at most 200 with the rest counted, or no change. |
durable-sdk index |
[--check] [--json] [--dir <app>] |
Writes graph-index.json and workflow-index.json at the app's root off the tree (the test kit's walk over durable.guards.ts); --check compares and exits 1 naming a stale file with its fix, so it says whether the committed files are current. The template's build runs it, so a deployed app's graph is current by construction, and test --changed and test --pr run --check first when the root carries the index. |
durable-sdk doctor --host |
[--json] [--explain <rule id>] |
Every guard rule over the tree, no database; a failed rule as one line with its fix. The doctor. |
durable-sdk doctor |
[--strict] [--url <url>] |
The engine's tables as defined on the database --url names (else DATABASE_URL_UNPOOLED, else DATABASE_URL). |
durable-sdk migrate |
[--baseline[=if-missing|always]] [--url <url>] [--dry-run] |
The engine's schema versions applied; the template's build runs migrate --baseline=if-missing. |
durable-sdk verify |
[--url <url>] [--json] |
The boot-time probe as a command: the recorded version against the package's. |
durable-sdk test --changed |
[--base <ref>] |
The tests the diff touches and the guards a changed path can break; durable-sdk index --check first when the root carries graph-index.json. Testing. |
durable-sdk test --pr |
[--base <ref>] [--keep-going] |
The pull-request tier: the index check, the typecheck, the lint, every test tier, the doctor. |
durable-sdk test store --url <url> |
[--schema <name>] |
The store conformance suite against a throwaway database. |
durable-sdk platform check --api <url> |
[--wait 30s] [--json] [--strict] |
Health, the catalogue's version, verify, limits and the instance of a deployed app; what the platform runs against every production deployment before it promotes. |
durable-sdk key <workflow> <input.json|-> |
[--json] |
The intent key a workflow derives from an input, without running it. |
durable-sdk new workflow <name> |
--key <a,b,requestId> [--describe "<sentence>"] [--dry-run] |
A keyed workflow file with its test, refused before any file exists when the doctor would refuse it. |
durable-sdk ci init |
[--provider github] [--branch <name>] [--deploy [--app <slug>]] [--check] [--force] |
The CI workflow file; --check says whether it is current. |
durable-sdk dev |
[--tick 10] [-- <command> ...] |
The app under a local tick. |
durable-sdk mcp is coming (DS-025); MCP and agents says what an agent uses today.
--json#
Under --json a platform verb prints the body of the one route it called, verbatim, as one JSON document on stdout, and every progress line on stderr. The response schema in /openapi.json is therefore the verb's output schema. A list verb prints the first page alone ({ "items": [...], "nextCursor": "..." | null }, the route's default of 50 rows) and takes no --cursor: when nextCursor is not null the verb says so on stderr, and a program reads the rest from the route itself with ?cursor=<nextCursor> (the API). A refusal prints { "error": { "code", "message", "remedy", "docs" } } on stdout and exits 2 (or 3 for a 5xx), so a program reads one document either way.
durable-sdk deployments get d_01JB2X4Q7R --json{
"id": "d_01JB2X4Q7R",
"app": "my-app",
"target": "production",
"branch": null,
"state": "promoted",
"url": "https://my-app-d01jb2x4.durablesdk.com",
"sha256": "3f9c1e…",
"bytes": 2201344,
"message": "orders: the refund step",
"createdBy": "key:k_7f2a",
"createdAt": "2026-10-28T14:02:03Z",
"finishedAt": "2026-10-28T14:03:40Z",
"checkedAt": "2026-10-28T14:03:31Z",
"promotedAt": "2026-10-28T14:03:40Z",
"error": null,
"check": {
"verdict": "ok",
"rows": [{ "name": "health", "verdict": "ok", "detail": "ok" }]
},
"runId": "r_01JB2X4Q8A"
}