CLI usage
The SDK's own verbs: migrate, doctor, verify, test, peer, env, replay, explain, platform check, ledger; the environment and the exit codes.
Generated from the SDK's own source (
packages/durable-cli/README.md) at build; edit there.
The Durable SDK's command line (ADR-0045 §5, the migrate, doctor and
verify verbs; ADR-0043 decision items 2 and 7; ADR-0046 §H's peer verbs,
§M step 7; ADR-0053 decision 1's env verbs). Private, 0.0.0,
Apache-2.0; depends on @durable-sdk/postgres alone (pg is the one
runtime dependency underneath); --vercel shells out to the Vercel CLI
(vercel, on PATH, logged in) and never reimplements it.
durable-sdk migrate [--baseline[=if-missing|always]] [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
[--statement-timeout <seconds>] [--lock-timeout <seconds>]
durable-sdk migrate --dry-run [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
[--statement-timeout <seconds>] [--lock-timeout <seconds>]
durable-sdk migrate plan [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
durable-sdk migrate status [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
durable-sdk migrate restamp [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
durable-sdk migrate down --to <version> [--accept-loss] [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
[--statement-timeout <seconds>] [--lock-timeout <seconds>]
durable-sdk doctor [--strict] [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
[--vercel --project <member>=<project> ... [--file durable.peers.json] [--scope <team>]]
durable-sdk doctor --host [--json] [--explain <rule id>]
durable-sdk doctor --core [--json] [--explain <rule id>]
durable-sdk doctor --stats [--json] [--since <previous --json file>] [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
durable-sdk doctor --plans [--json] [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
durable-sdk doctor --actors <actor> --api <url> [--since <duration>] [--json]
durable-sdk verify [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
durable-sdk test store --url <postgres url> [--naming snake|prisma-legacy] [--schema <name>]
durable-sdk peer sync [--file durable.peers.json] [--vercel --project <member>=<project> ... [--scope <team>]] [--print-secrets]
durable-sdk peer ping <name> --api <url> [--token <ADMIN_TOKEN>] [--timeout <seconds>]
durable-sdk peer backfill <name> --since <iso> [--dry-run] [--url <url>] [--schema <name>] [--naming snake|prisma-legacy]
durable-sdk peer secret rotate <a> <b> --stage | --promote | --finish
[--vercel --project <member>=<project> ... [--scope <team>]] [--print-secrets]
durable-sdk peer secret rotate --preview <member> --stage | --promote | --finish
[--vercel --vercel-project <project> [--scope <team>]] [--print-secrets]
durable-sdk env add <name> [--role production|preview|local] [--publish <glob>] ... [--peers <a>,<b>]
[--url <base url>] [--file durable.peers.json] [--dry-run]
[--vercel --vercel-project <project> [--project <member>=<project> ...] [--scope <team>] [--env-var DURABLE_ENV_NAME]]
durable-sdk env remove <name> [--file durable.peers.json] [--dry-run]
[--vercel [--vercel-project <project>] [--project <member>=<project> ...] [--scope <team>]]
durable-sdk env list [--file durable.peers.json]
durable-sdk env doctor [--file durable.peers.json] [--api <url> [--token <ADMIN_TOKEN>]]
[--vercel --project <member>=<project> ... [--scope <team>]]
durable-sdk env add <member> --preview-secret [--force] [--pull [--env-file .env]] [--dry-run]
[--vercel --vercel-project <project> [--scope <team>]]
durable-sdk dev [--tick 10] [--api http://127.0.0.1:3000] [-- <command> ...]
durable-sdk dev --relay <member> --url <tunnel url> [--tick 10] [--api http://127.0.0.1:3000] [--execute <listener>]
[--publish <glob>] ... [--env-file .env] [--user <name>] [--token <ADMIN_TOKEN>] [-- <command> ...]
durable-sdk dev --reset [--api http://127.0.0.1:3000] [--token <ADMIN_TOKEN>]
durable-sdk replay <runId> --api <url> [--out tests/replays] [--json]
durable-sdk explain <code|signature|runId|subject> [--api <url>] [--plane <url>] [--json] [--all]
durable-sdk graph walk <subject> [--direction out|in|both] [--depth 1-4] [--kinds a,b] [--node-kinds a,b] [--json] [--api <url>]
durable-sdk graph path <from> <to> [--direction out|both] [--json] [--api <url>]
durable-sdk graph diff [--base <ref>] [--json]
durable-sdk graph impact [--changed] [--base <ref>] [--files a.ts,b.ts] [--types] [--all] [--json]
durable-sdk platform check --api <url> [--peer <name>] [--wait 30s] [--json] [--strict]
durable-sdk key <workflow> <input.json|-> [--json]
durable-sdk new workflow <name> --key <a,b,requestId> [--describe "<sentence>"]
[--event <fact> --why "<reason>" [--policy record|execute]] [--schedule "every 10m"|"cron <five fields>"]
[--dir app/workflows] [--dry-run]
durable-sdk index [--check] [--json] [--dir <app>]
durable-sdk test --changed [--base <ref>]
durable-sdk test --pr [--base <ref>] [--keep-going]
durable-sdk login [--with-key] [--scope read|deploy|admin] [--plane <url>] [--json]
durable-sdk logout [--plane <url>]
durable-sdk whoami [--plane <url>] [--json]
durable-sdk keys list [--owner user:<id>]|revoke <id> [--plane <url>] [--json]
durable-sdk apps create <slug> [--region <region>] | list | link <slug> | rm <slug> --yes | restore <slug> | set --promotion auto|manual
durable-sdk deploy [--target production|preview] [--prod] [--branch <name>] [--message <text>] [--app <slug>] [--dir <path>] [--no-follow] [--json]
durable-sdk deployments list [--target production|preview] | get|events|promote|cancel|redeploy <id> [--json]
durable-sdk rollback <id> [--json]
durable-sdk secrets set <NAME> [--target production,preview] [--value-file <file>] [--redeploy] | list | rm <NAME>
durable-sdk domains add|verify|rm <hostname> | list
durable-sdk logs [--env production|preview] [--level info|error] [-q <text>] [--follow] [--json]
durable-sdk db read-string [--rotate] [--revoke] [--env-file <.env>]
durable-sdk usage [--days 30] [--json]
durable-sdk runs limbo | get|redrive <runId> [--json]
durable-sdk environments list | rm <name>
durable-sdk init <name> [--dir <path>] [--plane <url>] [--no-install] [--vendor] [--force] [--dry-run]| Verb | What | Writes |
|---|---|---|
migrate |
Applies the SDK versions above the recorded one, one transaction each (docs/runbook.md), each checked in place inside its transaction, under the migrate lock (ADR-0043 §G as amended 2026-09-27): a version whose objects the host already created (its own migration shipped beside the SDK version) is recorded as a baseline with no DDL run; one with none of them is applied; one partly present, or with an object of another shape, is refused by name, nothing applied or recorded. A database whose framework tables exist with no durable_schema row is refused and told to baseline. |
yes |
migrate --baseline=if-missing |
With no recorded version and framework tables present: the doctor confirms the live objects are a version's (the highest they match), that version and every one below it is recorded (kind baseline, one audit row each), nothing is created or copied; then pending versions are applied as migrate does. With no recorded version and no framework table (a fresh host), or with a recorded version: plain migrate. Some tables but not all: refused, naming what is missing. What scripts/vercel-build.sh runs on production builds. --statement-timeout <s> and --lock-timeout <s> (FW-027) set each transaction's SET LOCAL statement_timeout and lock_timeout in seconds (since FP-006 no statement bound unless given, SET LOCAL statement_timeout = 0, so a version's DDL runs to its end whatever the connecting role's own statement_timeout; the lock bound 10 s unless given; each at most 3600), printed on the verb's first line: a run that wants a statement bound sets one from the shell, never by hand. |
yes |
migrate --baseline=always |
The baseline alone; a no-op when the same version is already recorded, refused when another one is. | yes |
migrate plan |
Prints the pending versions' statements and checksums. | no |
migrate --dry-run |
Takes the migrate lock, reshapes a v1 bookkeeping and applies every pending version's DDL in one transaction with the doctor after each, prints what would be recorded, the catalog checksum after it (the one a real apply then stamps) and the doctor's word, and rolls back; exit 0 when the doctor would be green (ADR-0062 unit 5). On framework tables with no durable_schema row it rehearses migrate --baseline=if-missing (the adoption: line, one would record … as a baseline per version the tables match) where a bare migrate refuses tables_exist. The DDL takes the same table locks a real apply takes (lock_timeout 10 s): for CI and a branch, never a live database at peak; migrate plan is the write-free verb. Takes --statement-timeout and --lock-timeout as migrate does. |
|
migrate status |
Reads and writes nothing: the recorded version, naming, package and who wrote the row; this package's minimum and latest with the pending versions; the bookkeeping's shape (v2 since 0.1.0) and its agreement with durable_migrations; the live catalog checksum against the stamped one (ok | drifted | unverified); who holds or waits for durable:migrate; the deployment marker and the schema version it requires; the newest ten log rows. Exit 0 for ok alone (ADR-0062 unit 5). |
|
migrate restamp |
Records the live catalog's checksum over the recorded version while doctor --strict is green (the remedy for a false drift after a Postgres major re-spelled the catalog, after inspecting it), logged as restamp with <user>@<host>; refused drift_unrecorded otherwise (ADR-0062 unit 5). |
|
migrate down --to <n> |
Takes every version above n down, highest first, one transaction each under the migrate lock and the version row FOR UPDATE (ADR-0062 unit 6): each shipped version's down (packages/durable-postgres/src/migrations/down.ts, the inverse of its delta, its checksum pinned in BASELINES.md) runs after its guards counted zero rows it would lose, the doctor confirms the previous version's definition in the same transaction, the audit row leaves durable_migrations, durable_schema moves down (or leaves, below v1), Instance.schemaVersion is lowered and a down log row lands. Refused before any statement: down_irreversible where a version in the range declares no down renders under the preset (judged over the whole range first; v4 under prisma-legacy, the WAITING enum labels), deployed_ahead while the deployment marker's schemaRequired is above n (promote the previous deployment first and wait one tick) or while the marker records none (a build before ADR-0062 unit 6 ticked last: deploy a build that writes it and wait one tick; promoting an older deployment records none either; no marker is a local database, admitted), down_refused over rows a version would lose (--accept-loss takes it down and records the loss on the log row after <user>@<host>; the ledger's guard is never overridden), version_conflict when the row moved meanwhile or a version in the range has no durable_migrations row (the bookkeeping edited by hand). Each version is its own transaction: a refusal inside a later one (a guard that counts under the lock what the read-only count missed, the row moved, the catalog not as defined, the lock not had) leaves the versions already taken down standing and names them under the refusal, with the version the database is now at (migrate status reads it). An operator's action, never the build's; explain migrate.down_refused says each refusal's trap and remedy. Since FW-027 every table a version's guards count is locked ACCESS EXCLUSIVE before the count under the lock (lock_timeout when not had, nothing dropped), so a row written after the count began waits behind the lock and is counted or met by the shape after the down, never lost between the count and the drop; --statement-timeout and --lock-timeout bound each version's transaction as on migrate. |
yes |
doctor |
Compares the database to the latest version's catalog (columns with type, nullability and default; indexes with method, predicate, validity and uniqueness; foreign keys validated; the sequence's type and owner; the function's body; the trigger's function, WHEN and state; tables logged, no row security); exit 1 on a missing or mismatched object, and prints the fixing SQL (never runs it). Extras on a framework table are listed, not counted. Since FW-047 a warning: line per server setting to change (idle_in_transaction_session_timeout at 0 (off) or above 30 s, the 5 min default of a serverless Postgres among them (ADR-0076 FP-023 as re-landed): the role's ALTER ROLE … = '30s'; since FP-006 the connecting role's statement_timeout and lock_timeout when unset, 0 or above the engine's bounds of 20 s and 5 s, SERVER_BOUNDS, read off the session and pg_roles/pg_db_role_setting, the line spelling the ALTER ROLE … SET statement_timeout = '20s' / … SET lock_timeout = '5s'), moving neither ok nor strict. |
no |
doctor --strict |
doctor, plus a recorded version whose stored checksum equals this package's DDL, one durable_migrations row per version with the same checksums, and no extra column, constraint, index or trigger on a framework table. What CI and the promotion check run. |
no |
doctor --vercel |
doctor, plus the peers' variables: each --project <member>=<project> is listed (vercel env ls production --format json, and its preview environment on a line of its own, FW-057) and a rotation left half done (a DURABLE_PEER_SECRET_<NAME>_ACCEPT variable on either environment, named with its environment and its phase: staged, promoted, or ambiguous when both records carry the same instant; the preview secret's named with its own form, peer secret rotate --preview <member>) or a pair secret missing on a side (with the peers file: --file, else durable.peers.json when present) is reported before the verdict and makes it not ok. |
no |
doctor --host |
The tree doctor (no database, no network), through the host's own vitest (node_modules/vitest/vitest.mjs, found from the working directory upward): the core guard pack of @durable-sdk/testing/guards over the host's durable.guards.ts (ADR-0072 D06: a suite through the host's guard file of its stem where GUARD_FILES marks one core: true, else through a spec written under <tests>/.durable-sdk/guards/<stem>.test.ts and removed after the run; the pack's rows read as text through the host's install, CORE_RULES) and the host's guard files (the guard files); one line per failed rule, severity id file:line message → fix (ADR) (ADR-0060 decision 18), the id from the it title's prefix (<guard file>/<slug>), the evidence from the message's <file>:<line>: <text> lines (the guard's own line when it names none), the fix from its → <fix> (ADR-nnnn) line or the registry's row; --json the findings as data with what ran and the pack as it ran; --explain <id> a rule's law, hazard, drawback, fix and ADR from the guard rules' registry or CORE_RULES and nothing run. The doctor's own rules (doctor/rule-unlisted, rule-misfiled, rule-unused, guard-failed-to-load, registry-unreadable, no-guards-ran) hold both registries and the titles to each other. A tree with no descriptor runs its own guards alone, said once; one with a descriptor and no the guard files the pack alone. Exit 1 on any finding, 2 without a tree to read or vitest. |
no |
doctor --core |
The core guard pack alone (ADR-0072 D06): every suite through the doctor's spec under <tests>/.durable-sdk/guards/, nothing of the host's guards or registry (a host's bindings for a suite, the authoring suite's primitive names and holdouts, ride on the descriptor's authoring, so the spec judges the sites the host's own guard file judges); the same line, --json and --explain. Exit 2 without a descriptor or the kit installed. |
no |
doctor --stats |
The framework tables' own numbers off the catalogs, read-only, under one session opened with default_transaction_read_only=on and a two-second lock_timeout, every statement its own autocommit statement, never a reset or a DDL (FW-103, the performance audit of 2026-10-09 E2): per table the rows, the heap and index MB with the index share, the dead rows against the table's effective autovacuum trigger (the server's threshold and scale factor, the table's own reloptions over them, never a flat percentage), the last (auto)vacuum and (auto)analyze, the sequential and index scans with the tuples each read; per index the MB and the scans with the statistics' age from pg_stat_database.stats_reset, and whether the version defines it; a 1 % block sample (TABLESAMPLE SYSTEM (1)) of the run and the step rows' octet_length per workflow; pg_stat_statements' top forty by total time with the view's own reset when the extension is installed (the normalised texts, constants as $n), else a note naming the owner's step (CREATE EXTENSION IF NOT EXISTS pg_stat_statements on the direct URL, beta first). The findings are advice lines in the doctor's format (`advice stats/ |
index |
doctor --plans |
Every store verb's statements (statementsOf(naming), the snapshot suite's renderer lifted into the package) explained on the live database, EXPLAIN (COSTS OFF) with the recorded parameters bound, inside one READ ONLY transaction per verb that is rolled back (a plan is read, nothing runs; a write's plan reads under read-only too, since EXPLAIN without ANALYZE never starts the executor; a statement the server refuses is kept as the verb's error under a savepoint, the rest of the verb still planned). Prints each statement with its plan, then stats/seq-scan-at-size for a verb planned as a sequential scan over a framework table past ten thousand rows (the switches-off pins of the pg suite prove an index usable; this proves it chosen) and stats/index-unexpected as a note for an index the version does not define (the catalog's own and the bookkeeping's left out); since NP-001 (ADR-0043 amendment 2026-10-30) a statement the store sends named (prepared once per connection, the hot verbs') is printed with its name and its EXPLAIN (GENERIC_PLAN, COSTS OFF) beside the custom plan, read with no value bound (the plan the server runs from the sixth execution), and stats/named-generic-plan is the finding when that plan takes none of the indexes the custom plan takes on a table and reaches it by a sequential scan or a whole index instead (what each plan takes named; a swap onto a partial index the version defines is printed, never a finding; a month partition the custom plan pruned is nothing to judge), the one red of this verb; run it on the direct URL, where the server plans. Exit 0, 1 on that finding or when the read failed. |
no |
doctor --actors <actor> |
The runs one actor started inside a window, read off a console API (SOC-04, ADR-0076 D08: the evidence read of a named actor on every write): one GET <api>/runs?actor=<actor>&since=<iso>&limit=200 under ADMIN_READ_TOKEN, else ADMIN_TOKEN, from the environment alone, --since a duration ending now (24h unless said), the count in words with one line per run (id workflow startedAt; at least 200 on a full page) or, under --json, { actor, since, count, atLeast, runs }. Exit 0 on zero runs, 1 on any (the sample has what it must not: asked under a host's retired anonymous console, user:console on the first host, a deployment that refuses bearer-only writes answers none) or a refused read (401/403: not that app's bearer; another status; an answer that is no runs page), 2 usage. The actor is the command's: the package spells no host's name. |
no |
verify |
The engine's boot-time probe as a command (ADR-0043 §G): the recorded version against this package's minimum and latest and against durable_migrations; exit 0 when the engine would run. |
no |
test store |
The store conformance suite of @durable-sdk/testing/conformance (ADR-0072) against the database --url names, through the host's own vitest: the SDK versions applied to the latest under --naming (the bookkeeping in --schema), every store verb's cases over postgresStores on that database, the ledger's append-only trigger, the catalog's drift verdict (judgeCatalog) and the engine over the store (the kit's testDurable: a run, its step, its fact delivered, the ledger verified); the spec and its config written under .durable-sdk/ (gitignored), the URL handed to the child in the environment and never written; prints the counts and every failed case's title, exit 1 on any, exit 2 without vitest under or above the root. --url is required and never read from the environment: the suite empties the framework tables between cases, so it refuses a database whose ledger or runs carry rows (a throwaway database, never a deployment's). |
the throwaway's framework tables |
peer sync |
Reads the peers file (--file, default durable.peers.json: members[] with name, url, publish) and, for every pair of members, the pair secret on both projects, production environment only. With --vercel, each mapped project's variables are listed, a pair missing on either side gets a fresh 32-byte secret written on both (vercel env add … production --yes --force, the value on stdin; the side that had one is overwritten so the pair agrees), a pair present on both is left alone (its value is never read), a pair with an unmapped member is skipped by name, and the projects to redeploy are printed. Without --vercel, every pair is minted and printed with the values hidden; --print-secrets shows them, for a person pasting them by hand. |
vercel |
peer ping |
POST <api>/environments/<name>/ping with the bearer (--token, else ADMIN_TOKEN; never echoed), then GET <api>/environments until that member's row shows the answer (members[<name>].ping.answeredAt; an older ping's answer never counts) or --timeout (60 s). Exit 0 on the answer, 1 with the member's row printed otherwise (409: the relay is off there; 404: not a configured peer). --api is the app's URL, with or without /admin/api. Since SOC-04 (ADR-0076 D08) the POST is signed as a cli:<os user> session under CONSOLE_SESSION_SECRET from the environment alone, the header and the audience read off the catalogue's api.session first (a bearer alone is refused 401 session required; without the secret the verb is refused by name before any request), so the ping is recorded under that name. |
no |
peer backfill |
Re-marks the facts <name> acknowledged since --since as undelivered to it: one statement, WITH gone AS (DELETE FROM RelayDelivery WHERE peer = <name> AND sentAt >= <since> RETURNING eventId) UPDATE OutboxEvent SET relayedOutAt = NULL WHERE id IN (SELECT eventId FROM gone) AND origin IS NULL AND relayedOutAt IS NOT NULL, the identifiers spelled by the naming preset, printing both counts; a fenced or set-aside row and a row another peer alone acknowledged stay marked (FW-013; the same statement as the store's backfill verb behind the console's Backfill). --dry-run prints the counts and changes nothing. A --since older than the outbox's unsent window (30 days) is refused before any connection: anything older is gone by design (ADR-0046 §H). |
yes |
env add |
One environment joined to the mesh (ADR-0053 decision 1): the member appended to the peers file (name, url, publish, and role when not production; the URL from --url, else the project's production alias read from vercel project ls --format json) and, with --vercel, for every pair with a peer whose --project is named, the pair secret minted and written on both projects through the peer sync path (production environment, the value on stdin, --force so the pair agrees; a pair present on both left alone, a peer without a project skipped by name for peer sync to finish later), DURABLE_ALIAS_URL and the name variable (--env-var, DURABLE_ENV_NAME by default) written on the new project unless present, CRON_SECRET and ADMIN_TOKEN minted --sensitive when the project has neither. Nothing present is overwritten, the file is written last and Prettier-shaped (a refused Vercel write leaves it untouched; a file write the file system refuses names the file and says the same command run again writes the file alone, nothing re-minted), and the plan printed names what was written and what a person still owns (the database URL, the app's own secrets, the file in every other member's repository, the deploys, then peer ping). --dry-run prints the plan and writes nothing. |
vercel, the file |
env remove |
The member dropped from the file and, with --vercel, DURABLE_PEER_SECRET_<NAME> and its _ACCEPT removed on every named peer's project (--project) and each peer's pair removed on its own (--vercel-project); the ledgers keep its rows (every member's peer:<name> chain, its out:<name>/in:<name> rows, the copies it sent). The file is written last here too: a refused vercel env rm leaves the member in it and the same command run again finishes the job. --dry-run prints the plan. |
vercel, the file |
env list |
The file's members with role (production when the file says nothing), URL and publish globs. |
no |
env doctor |
The file, then with --api each member's state through that member's console (GET <api>/environments with the bearer: the last ping, the per-direction sequence and lag, the rows expiring, the heads witnessed there; a member the API does not carry is named as not configured there; a member whose role there differs from the file's, or a host whose policyRole is not the file's role for it, is a role mismatch finding, since nothing refuses two deployments that disagree at boot) and with --vercel the projects' checks of doctor --vercel (a rotation half done, a pair secret missing, named by variable, never by value). Exit 1 on a refusal or a finding. |
no |
peer secret rotate |
The two-phase rotation of one pair's secret (ADR-0046 §H), the pair named by both members because each side holds the other's name (DURABLE_PEER_SECRET_<B> on a's project, DURABLE_PEER_SECRET_<A> on b's). --stage writes a new secret as both _ACCEPT variables; --promote reads both projects (vercel env pull, the file read once and unlinked) and swaps, writing _ACCEPT ← the old current first and the current ← the staged one second; --finish removes _ACCEPT. Each says "deploy both projects now". A stage out of order is refused from the projects' variables: their timestamps tell a staged pair (_ACCEPT newer) from a promoted one (the current newer), so --stage is refused while a rotation is in progress, --promote when nothing is staged or it already ran, --finish while only staged; a side whose two records carry the same instant (a bulk import, a .env upload) is ambiguous and refuses every stage, naming both variables and the instant: re-save the one that is newer in truth. A stage, a promote or a finish that stopped between the two sides (a refused write on the second project) is resumed by running the same stage again: a --stage pulls the staged side's _ACCEPT and writes the other side alone (never re-minting), a --promote checks the values are a stopped promote's and writes the staged side alone (the pair survives meanwhile: each side accepts both secrets), a --finish reads the two currents equal and removes the leftover alone; a state that is none of these is refused naming the variables. Without --vercel the by-hand steps are printed, the staged value hidden unless --print-secrets. --preview <member> (FW-057; ADR-0053 decision 2) rotates the member's preview secret the same three ways: one name, DURABLE_PEER_SECRET_PREVIEW, on its project's production and preview environments, the two environments the rotation's two sides (--vercel-project names the project; env pull --environment reads each), each stage saying which deploys follow (the project, then every open preview) and when a preview or a laptop still on the old value is refused 401 (from the promote's deploy, until it redeploys or pulls with env add <member> --preview-secret --pull); a stage out of order is refused from the two environments' variables as a pair's is. |
vercel |
secret rotate |
A bearer or a signing key rotated with its <NAME>_PREVIOUS window and never a value read back (ADR-0076 D08, unit SOC-14): --project <label>=<project> names the verifiers (the projects that accept <NAME> and, during the rotation, <NAME>_PREVIOUS), --client <label>=<project> the senders. --stage mints a bridge value and writes it as <NAME>_PREVIOUS on every verifier and as <NAME> on every client (every value --sensitive, on stdin; without a client the bridge and a new current together, the project promoted at once); --promote mints the new current and writes it as <NAME> on every verifier and client; --finish removes <NAME>_PREVIOUS. Deploy the verifiers before the clients after each stage; a stage out of order is refused from the verifiers' timestamps (none, bridged, promoted, ambiguous, no-current), a stage that stopped is run again with every project written afresh, and each stage prints the rotation record's line. Without --vercel the by-hand steps, the value hidden unless --print-secrets. |
vercel |
env add --preview-secret |
The one preview pair secret an existing member holds for every preview and laptop that joins it (ADR-0053 decision 2): DURABLE_PEER_SECRET_<NAME> with <NAME> PREVIEW minted and written on that member's project, production and preview environments (the value on stdin, --force so both agree, never sensitive), left alone when present on both unless --force; --pull copies it into the laptop's env file (--env-file, .env by default; a present one is pulled through vercel env pull), never printed; the members file is read for the name and never written; without --vercel the variable is named with the value hidden (and --pull writes the minted value for the person to set on the project). --dry-run prints the plan and writes nothing. |
vercel, the file |
dev |
The laptop's server, ticked (ADR-0063 B14): runs the command after -- (pnpm start by default) and, once /health answers, GETs /jobs/dispatch with the CRON_SECRET bearer every --tick seconds (10 under role local unless said; 0 off; off with a line under another role or without the bearer), one request in flight at a time, a tick due while the last still runs skipped and said once, the loop's phases printed as log lines named dev.tick; a dev started by a dev (a host whose pnpm start routes through this command) finds the mark DURABLE_DEV_SESSION and runs its command alone. With --relay, as an ephemeral member of the mesh (ADR-0053 decision 3): runs the command after -- with DURABLE_EPHEMERAL_NAME=local:<user slug> (--user overriding the OS user), DURABLE_EPHEMERAL_URL (the tunnel --url names: the command prints how to open one and never opens it), DURABLE_EPHEMERAL_PEER (--relay), DURABLE_EPHEMERAL_PUBLISH (--publish globs, nothing by default) and the preview secret read from the env file (--env-file) or the environment, in the child's environment alone and never printed. With a token (--token else ADMIN_TOKEN) and a session signer, CONSOLE_SESSION_SECRET or the key pair DURABLE_SESSION_PRIVATE_KEY with DURABLE_SESSION_KID (SOC-04; the pair since SOC-04 part 2: every policy post is a mutation signed cli:<user>, the header and the audience read once off the catalogue's api.session, --user the person where it fits the session grammar, else the OS user; --execute and --reset refuse by name without a signer, a start with the bearer alone skips the clear and says so) it waits for the server's /health and clears every override an earlier session left (POST <api>/listeners/policy/reset, --execute or not, naming what it cleared); with --execute <listener> it then writes the one override (POST <api>/listeners/<name>/policy { policy: "execute" }), so that listener runs on the peer's copies and no other, and clears it when the child exits or on SIGINT/SIGTERM/SIGHUP (the server runs in a process group of its own, so a terminal's Ctrl-C reaches the command alone and the clear is posted to a server still up, then the server's group is stopped); --reset clears every override and starts nothing, refused (409, exit 1) against a console whose role is not local. Exit: the child's code, 1 on a refusal, 2 without the preview secret, the session secret or the tunnel. |
the file, a tunnel |
replay |
One run's bundle from --api's console (GET <api>/runs/<runId>/bundle, ADR-0051 §8: the run, its stored input, the replay verdict per step, its siblings, its trigger, its limbo verdict, its waits, children and ledger rows; redacted at the source), written as <out>/<workflow>/<runId>.bundle.json beside <runId>.replay.test.ts, a vitest file that seeds the bundle into the test harness (the working directory's @durable-sdk/testing and its …TestDurable export when present, else testDurable of @durable-sdk/testing; when that module also exports a …SeedHost value, declared or re-exported, the file imports it and passes it as replayRun's seedHost, so the bundle's host rows seed the host's doubles, ADR-0051 §8 follow-up; both names are read off the module's text, not evaluated: the first name that spells the pattern wins, a commented-out line included) and redrives the run through the engine with replayRun as two tests (ADR-0063 B12): "reproduces the recorded cause", which opens the harness with every connector a fake (…TestDurable({ fakes: true }), when the harness module's text spells plantFromStep), plants the bundle's failed step (its name, errorCode and sentence, inlined) through t.fakes.plantFromStep and expects the same step to fail with the same code, skipping itself with the reason when no fake carries that step's provider, and written it.skip with the reason when the bundle records no failed step, the harness is the package's or plants nothing; and "completes once the cause is fixed", red until it is; the verb's line says the fakes planted from <step>'s <code> or reproduces skipped: <reason>; a bundle the API's bounds cut where the harness refuses it (truncated.steps, truncated.ledger, or a host.truncated table above zero where the pair would seed the host part, the harness exporting a …SeedHost) is refused with its counts and exit 1 before any file is written (FW-016; as reviewed, the harness's own refusals and no more: replayRun reads the host part only when seedHost is handed in, so a host.truncated cut under a harness with no such export is a note, not a refusal); a cut on truncated.emitted or truncated.downstream alone (the run's facts and the listener runs they started, which a replay never seeds) is a note: line on stderr and the pair is written; --json prints the bundle instead and writes nothing, cut or whole. The bearer is ADMIN_TOKEN, from the environment alone (never an argument, never echoed). Exit 1 when the API refuses (the token is not that app's) or the run is unknown, 2 for the usage or a missing token. |
|
new workflow |
A workflow's files from the recipe blocks of the host's docs/durable/recipes.md (ADR-0060 decision 19; read by the fences' names, never a copy): the definer under --dir (app/workflows) against the host's primitives with describe, example, the field-list key, version: 1 and one ctx.step with its undo and effect over an effects seam the host binds, the manifest thunk in src/workflows/index.ts, the test on the host's harness (found by pattern, as replay finds it), and with --event the on() registration appended to src/listeners.ts with the policy row in ADR-0040's table (--why). A name off the grammar or under a prefix the core keeps, a --key without requestId and no --schedule, a fact the catalog lacks and a file that exists are refused before any file exists (each a row of the refusals registry); then the host's definitions guard loads the definer and judges verifyDefinitions() and the source-text guards read the rendered files through the overlay, in a nested vitest with the request in a private file named by DURABLE_NEW_WORKFLOW_REQUEST, and a finding refuses the write with its line. --dry-run runs the gate and prints the files. Exit 0 written or printed, 1 refused or a finding, 2 usage or a host without the guard files or vitest. |
|
index |
The two indexes of an app root written off its descriptor by the test kit's walk (ADR-0060 decision 14 as amended 2026-10-30, GR-018): workflow-index.json (every definer's names) and graph-index.json (the body literals, the steps and their writes, the doors, the refusals, the facts, the providers) under --dir (the working directory), the descriptor durable.guards.ts read as text, the walk loaded from the host's install (@durable-sdk/testing/graph-walk, its built form), each file rendered as two-space JSON and formatted through the Prettier the app root resolves when it does, left as written otherwise or when the app root's own .prettierignore names the file (GR-019: the template names its two indexes, so a scaffold's committed copies, its format check and the verb agree byte for byte). Without --check a file that differs is rewritten and said so (graph-index.json: rewritten (<n> bodies, …) · workflow-index.json: rewritten (<n> names), current where it stands), then the coverage line; under --check nothing is written and a stale or missing file is one finding line in the doctor's grammar (error graph/index-current <file> <message> → <fix> (ADR-0060)); --json the same as data. new workflow runs it in place after its writes. Exit 0 current or rewritten, 1 a stale or missing file under --check or a walk that refuses (two definers spelling one name, a name it cannot read), 2 no descriptor, a descriptor naming no roots.app, or a kit not installed or not built. |
|
test --changed |
The quick tier (ADR-0072): first, when graph-index.json is at the root, durable-sdk index --check in process (GR-019; a row index --check, red with the finding line and its fix on a commit whose index is stale; no index at the root, no such step), then the host's vitest with --changed <base> on the unit project (vitest's own import graph: the merge base with --base, origin/develop when it resolves, else HEAD~1, plus the index and the working tree), then the guard files a changed path can break by the table the verb prints first (GUARDS_BY_PATH of src/test.ts: app/**, packages/** or durable.config.ts → the nine definition, identity, manifest, key-part, step-body, step-context, refusal, log-catalog and event guards; docs/** → docs-parity; a changed the guard files → itself; vercel.json or app/routes/** → platform), each run through the host's vitest with its summary on the terminal; a guard file the host lacks is named and not run; nothing changed runs nothing. Exit code vitest's (the related run's when it fails, else the guards'), 2 without vitest, outside a checkout or on a --base that does not resolve. No database. |
no |
test --pr |
The proving tier (ADR-0072): in order, durable-sdk index --check when graph-index.json is at the root (GR-019), the host's typecheck:all script when it defines one (every project of the workspace, as CI types them: the SDK packages, the console and the MCP compile under tsconfigs stricter than the root's), else its typecheck script (through the package manager the lockfile names), eslint over the changed files that exist (node_modules/eslint/bin/eslint.js with the lint script's ignore, config, extension and cache flags, --no-error-on-unmatched-pattern; a file an ignore pattern covers is reported, never linted under another config), vitest run --project unit, --project slow, --project postgres when DATABASE_URL is set (else one line, postgres project skipped: no DATABASE_URL), doctor --host in process, and one step per gen:* --check the check script chains; the plan printed first, a table of each step's verdict and duration last (ok, failed (exit n), skipped: <why>, not run). Exit 1 at the first failing step, or after every step with --keep-going; 2 without package.json or vitest at the root. |
when DATABASE_URL is set |
ci init |
The host's .github/workflows/durable.yml (TQ-005b; ADR-0072 D09): two jobs over the composite action, quick on a pull request (test --changed against the pull request's base) and prove on a pull request and on a push to the default branch (--branch, main unless said), a Postgres service on the image the engine's own CI reads, test --pr on that database and then test store; the action by --action <uses>, else the tree's own copy when .github/actions/durable-test/action.yml stands, else the published durable-sdk/test-action@v1. --deploy (ADR-0105 D18, DS-045) adds the tenant's pipeline: preview on a pull request after quick (durable-sdk deploy --branch <the head branch> --app <slug> --json, the hostname commented on the pull request through actions/github-script, one comment found by its marker and updated on every push) and production on the default branch's push after prove (deploy --prod --json; the summary carries the hostname and the state, a failed deployment fails the job with the sentence and the remedy), under the one repository secret DURABLE_API_KEY (a key of scope deploy minted on the dashboard, never printed); the app by --app <slug>, else .durable-sdk/app.json where the verb runs, else refused by name; the template ships that rendering. Idempotent: a file equal to the rendering is left and said unchanged, one that differs is refused by name unless --force writes it again; --check writes nothing and exits 1 when the file is missing or differs (the deploy rendering under --deploy --check). Pinned byte for byte by tests/fixtures/ci-init/durable.yml and durable-deploy.yml. |
no |
platform check |
A deployment proved against the hosted control plane (TQ-006; ADR-0072), what a deploy job runs once the deployment serves the commit: the public GET /health (no bearer: ok, the commit, the environment's name and role), then with the bearer GET <api>/health?hours=1 (the schema probe and the Instance row), GET <api>/verify (the plain read: the full ledger walk from genesis and the append-only trigger's state), GET <api>/limits (the time contract) and GET <api>/environments (the mesh; with --peer <name> one POST <api>/environments/<name>/ping first and the member's row polled for the pong up to --wait, 30 s unless said, the duration grammar, as peer ping does), the X-Durable-Api header read off the answers. Under --peer the ping is signed as peer ping signs it (CONSOLE_SESSION_SECRET in the environment, SOC-04; without it the relay row fails by name and nothing is posted). One row per check (health, api, schema, instance, ledger, limits, relay), ok, warn or fail with its detail, and a closing line: fail on /health not ok, the API's major behind this CLI's (warn when ahead), a schema state behind, missing, drifted or naming_mismatch (the app refuses every run; unverified and ahead warn, the engine runs; error and unprobed fail, run it again), an Instance row naming another environment (absent and unknown warn), a broken chain or a trigger absent or disabled (a walk off a checkpoint warns), and no pong from --peer inside --wait; without --peer the members are listed and facts unsent past the relay's expiring window warn, the relay off being ok; an answer with no time contract (an app behind API 2.37) warns. Every HTTP failure is a row's value (the status and the body's error; a fetch that threw as not reached), never a stack. --json prints { ok, checks }. The bearer is ADMIN_TOKEN, from the environment alone, never an argument and never echoed. Exit 0 with no fail (and under --strict no warn), 1 otherwise, 2 for the usage or a missing token. |
no |
ledger verify |
The ledger's tamper-evidence beyond the database (ADR-0076 D09, SOC-16): the walk over an export file (--file, ledger export's NDJSON) with the core's own chain rule under both epochs (@durable-sdk/core/ledger-hash, the CLI's sixth leaf), every head held to its scope's tail, each day record's signature checked under LEDGER_HEAD_KEY (and LEDGER_HEAD_KEY_PREVIOUS, a rotation's overlap, both from the environment alone and never printed) and its (seq, hash) per scope pinned to the walked rows; one line per scope and per record and a verdict; --public walks the chain and the heads alone with no key and says the records were not checked; --json the verdict as data. Exit 0 ok, 1 broken, 2 no file, a line that is no export line, or no key without --public. |
|
ledger export |
The export the verify walks, read off the connection (--url or DATABASE_URL_UNPOOLED, the naming and the schema as the db verbs take them) through the store's own verbs: every row of --scope (every scope without one) in seq order up to the ledger's bound, the heads and the day records off their settings rows, one JSON line each into --out; nothing written to the database. |
|
login |
The device flow of ADR-0105 D04: POST cli/logins opens a login (no credential), the URL and the code are printed and the browser opened, the token endpoint polled under the poll secret until the person approves on the plane's page, the key stored under the plane's origin with the tenant, its name, scope and expiry, never printed. --with-key takes a key minted on the dashboard on stdin and proves it with GET whoami first. Exit 2 on a denied, expired or consumed login (its code printed), 3 on the plane unreachable. |
the credentials file |
logout |
The stored key for the plane removed. | the credentials file |
whoami |
The tenant and the principal the key names (GET whoami); --json the answer verbatim. |
no |
keys |
list the tenant's keys (id, prefix, name, scope, the stamps; never a value), revoke <id> a key revoked. A key is never minted here: a key never mints a key (plane.key.mint_by_person); the dashboard or durable-sdk login does. |
the plane |
apps |
create <slug> the app made (POST apps, the row provisioning with its run) and followed every 5 s until active (this directory linked by .durable-sdk/app.json) or failed (the sentence, exit 1); list; link <slug> the link written after the app is read; rm <slug> --yes the app into its hold (restore <slug> within it); `set --promotion auto |
manual`. |
deploy |
ADR-0105 D07: the tree (--dir, else the working directory; .gitignore and .vercelignore honoured, node_modules, .git and .env* always out, a file over 10 MB refused by name) packed as a gzipped USTAR tar with its SHA-256, uploaded in parts (POST apps/<slug>/uploads, PUT uploads/<id>/parts/<n> with Content-SHA256, every part but the last the plane's part size, a part that did not land resumed once off GET uploads/<id>, POST uploads/<id>/complete), the deployment made under an Idempotency-Key minted per invocation, and followed: the build's lines every 5 s and the state every 15 s on stderr until ready or promoted (exit 0) or failed or cancelled (the sentence and the remedy, exit 1). A preview unless --prod; a preview's branch is --branch, else the directory's git branch. --json prints the final Deployment alone on stdout. |
the plane |
deployments |
list [--target], get <id> (the state, the hostname, the error row, the check rows), events <id> [--since] (the build's lines, one page), promote <id> (a ready production build under the rule manual), cancel <id> (while queued or building), redeploy <id> (a new deployment from the same files under the project's current variables). |
the plane |
rollback |
Production pointed back at <id> (POST deployments/<id>/rollback); a build whose schema is below the database's is refused plane.deploy.down_pending until DS-008. |
the plane |
secrets |
set <NAME> the value on stdin or in --value-file, never an argument, registered with the redactor as read and shown as its shape alone, set as a sensitive variable for --target (production and preview unless said); --redeploy builds from the current production deployment. list names and stamps (a value is never read back); rm <NAME>. |
the plane |
domains |
add <hostname> a custom domain beside the app's own (Pro and up), the TXT challenge printed; verify <hostname> (exit 1 while the record is not there); list; rm <hostname>. |
the plane |
logs |
The current deployment's runtime lines read on the plane (filtered by --env, --level and -q there, masked, at most 256 a read, the retention said once); --follow asks again for five minutes. |
no |
db read-string |
The app's one read-only database role: minted (the URL once), --rotate a new password and URL, --revoke the role dropped. The URL is printed through reveal alone after a line that says it is shown once, or with --env-file written into that file as DATABASE_READ_URL and never printed; no --json. |
the plane; the env file |
db status |
The app's database as the plane reads it (GET /apps/:slug/database): status, the compute's sizing and whether it is awake or asleep, storage, the history window and the moment today's state stays restorable until, the maintenance window, whether a read string stands; the live facts are read once a minute at the plane. --json the answer as data. |
the plane |
db branches |
The database's branches off the same answer: name, kind (production, preview, other for a restore's backup), size and birth. --json the rows as data. |
the plane |
usage |
An app's usage per UTC day over --days (30; at most 90), a row a day and the sum. |
no |
runs |
limbo the tenant's plane runs a compensation could not finish, get <runId> one run (its steps and its error row), redrive <runId> the redrive every provider-failure remedy names. |
the plane |
environments |
list an app's environments (production and the previews with their tick, cron or request-only), rm <name> a preview removed (production refused). |
the plane |
init |
ADR-0105 D09: a new app from @durable-sdk/app's scaffold(), the name judged under the slug grammar and the reserved list, the tree under --dir (./<name>, refused when it holds files unless --force), the install under pnpm or npm unless --no-install, the next four commands printed; --dry-run renders into a private temporary directory and removes it; --vendor packs the workspace packages as file: specifiers (the engine's own repository alone). |
the tree |
Environment (flags win): DATABASE_URL_UNPOOLED, then DATABASE_URL
(a direct URL: DDL and the migrate lock stay off the pooler; a ?schema=
parameter, Prisma's convention, becomes the connection's search_path);
DURABLE_SCHEMA (the bookkeeping schema, durable by default);
DURABLE_NAMING (snake by default; a host over Prisma's own naming passes prisma-legacy); ADMIN_TOKEN (peer ping's, env doctor's and
dev's bearer when --token is not given, and replay's, explain --api's and platform check's, from the environment alone);
ADMIN_READ_TOKEN (doctor --actors's bearer, ADMIN_TOKEN in its place
when unset: a read); CONSOLE_SESSION_SECRET (the secret undo,
peer ping, platform check --peer and dev's policy posts (--execute,
--reset, the clear of an earlier session's override) sign their cli:<os user>
session under, SOC-04: a mutation under the bearer alone is refused
session required, so each is refused by name before any request
without it). new workflow reads no variable;
it names its request to the host's guards in DURABLE_NEW_WORKFLOW_REQUEST
for the gate's run alone. Exit codes: 0 ok, 1 the command ran
and failed (a refusal, a red doctor, a database error, a peer or env verb
refused, a Vercel CLI call that failed, a replay the API refused or of a
run it does not know), 2 usage, no connection or no
token.
Nothing secret is printed. Every line, stdout and stderr alike, and every
error's text go through the connection-string redaction (the URL, its
credentials, its password; the host stays, a connection error is useless
without it) and a redactor that holds every pair secret the peer verbs
minted or read back, the ping's bearer and the replay's, so a value can only ever appear
as <secret>. A value reaches the Vercel CLI on its stdin, never in an
argument (--value is never used; a project name and a --scope are
checked against Vercel's grammar first, so neither can read as a flag);
vercel env pull writes into a private temporary directory whose file is
opened, unlinked and read from the open descriptor (gone before its first
byte is read), and every value it carried is registered with the redactor
before anything else happens; the linked directories are removed when the
verb ends, and swept on exit and on SIGINT/SIGTERM/SIGHUP too. The one
deliberate exception is --print-secrets (the by-hand mode alone), which
prints through a channel that bypasses the redactor by name. The pair
variables are written --no-sensitive (the Vercel CLI makes a
non-interactive --yes write sensitive by default, and a sensitive value
cannot be pulled), which is what lets --promote swap them; a team whose
policy enforces sensitive variables ignores the flag (the CLI warns
--no-sensitive is ignored), and such a pair, like one set by hand as
sensitive, is promoted by hand (--promote says so, and writes nothing).