CLI Reference
Commands
| Command | Description |
|---|---|
tamer bootstrap | Create account-scoped Tamer metadata (D1 state + D1 secrets vault + R2 artifacts) |
tamer sync | Sync local state from Cloudflare (no writes) |
tamer apply | Provision missing resources (creates shard 0 for each resources.shardGroups[] entry) |
tamer migrate | Run D1 migrations per worker (includes stack-level shard groups) |
tamer seed | Run D1 seed SQL per worker (seedDir; idempotent by author convention) |
tamer shard add | Append the next physical D1 to a stack-level shard group; regenerates wrangler + src/shard-bindings.ts |
tamer deploy | Build (if declared) + wrangler deploy per worker, then apply routes |
tamer dev | wrangler dev (use --all for every worker) |
tamer status | Show config vs state |
tamer drift | Compare state vs Cloudflare (read-only) |
tamer plan | Preview what apply+deploy would create (read-only) |
tamer import | Register an existing CF resource into state by logical name |
tamer doctor | Verify CLOUDFLARE_* credentials |
tamer wfp tenant provision/destroy | Create / remove per-service tenant D1s + dispatch scripts + state. Provisions shard 0 for each shardGroups[] entry and one copy per d1[] utility database. Assigns a monotonic tenantNumber and writes the tenant directory row when wfp.tenantDirectory is configured. --namespace selects the product namespace when more than one is declared. Migrations then seed run before script upload (default on; --no-migrate / --no-seed to skip). |
tamer wfp tenant list | List provisioned tenants (product:workspace) and their status |
tamer wfp tenant status | Show one tenant's dispatch scripts (one per service), shards, and provisioning status |
tamer wfp tenant migrate | Run D1 migrations on every physical shard in each tenant shard group + per-tenant utility D1s (--env local: regenerate wrangler pair then miniflare migrate) |
tamer wfp tenant seed | Run D1 seed SQL on every physical shard / utility D1 that declares seedDir (--env local: regenerate wrangler pair then miniflare seed) |
tamer wfp tenant add-shard | Append the next physical D1 to a tenant shard group, migrate + seed it, and re-upload the dispatch script |
tamer wfp tenant reset | Delete + recreate tenant D1(s), migrate, seed, reupload dispatch scripts (greenfield squash loop; --env local regenerates wrangler pair + wipes miniflare sqlite) |
tamer wfp tenant wrangler | --env local only: write gitignored wrangler.json + wrangler.vitest.json from the WFP template (dev → primary; Vitest → sibling) |
tamer destroy | Remove workers + storage + namespaces for an env |
tamer reset | Delete + recreate D1(s), migrate, seed, redeploy bound workers (d1 only; --env local wipes miniflare sqlite only) |
tamer events | Print operation history timeline |
tamer env list | List known envs (rows in tamer-state) |
tamer env gc | Garbage-collect stale ephemeral envs (--max-age, --dry-run, --force) |
tamer types | Generate Wrangler type files for a worker |
tamer wfp put | Upload a single-module Worker to a dispatch namespace |
tamer wfp delete | Delete a Worker from a dispatch namespace |
tamer secrets | Encrypted vault: init, set, load, copy, get, list, rm, verify, push, migrate |
Common flags
| Flag | Used by | Purpose |
|---|---|---|
--env <name> | All commands | Target environment (defaults to local; deploy requires it explicitly — never silently prod) |
--worker <name> | deploy, destroy, shard add, migrate, seed, secrets subcommands | Scope to one worker (secrets: shorthand for --target worker:<name>) |
--config <path> | All commands | Config file path |
--force | destroy, wfp tenant destroy, wfp tenant reset | Skip protected-env gate |
--confirm-env <name> | destroy | Confirm env destruction |
--confirm-tenant <workspace> | wfp tenant destroy, wfp tenant reset | Confirm tenant operation on protected envs |
--namespace <product> | wfp tenant provision, migrate, seed, add-shard, reset | Select product namespace (required when multiple wfp.namespaces declared) |
--group <name> | shard add, wfp tenant add-shard | Shard group logical name |
--service <name> | wfp tenant migrate, seed, add-shard, reset, wrangler | Limit to one worker template (omit = all services) |
--no-migrate | shard add, wfp tenant add-shard / provision / reset | Skip D1 migrations after recreate |
--no-seed | shard add, wfp tenant add-shard / provision / reset | Skip D1 seed after migrate |
--skip-reupload | wfp tenant reset | Skip dispatch script reupload after migrate (no-op for --env local) |
--shards <a,b,c> | wfp tenant provision | Accepted for backward compatibility; no-op under the shard-group model |
--json | drift, plan, doctor, wfp tenant provision | Machine-readable output |
--target <kind>:<logical> | apply, plan, destroy, reset, wfp tenant reset, wfp tenant destroy, import, secrets subcommands | Scope to one resource / owner (destroy + wfp tenant reset also accept shard_group:<name>; wfp tenant destroy accepts d1 / shard_group; not with --plan, --wipe-metadata, --skip-workers. Secrets: <kind>:<owner> = worker:<key> or wfp:<namespace>/<template>) |
--kind <kind> | apply, plan, destroy, reset, wfp tenant reset | Every declared resource of that kind (mutually exclusive with --target; e.g. --kind d1). wfp tenant reset --kind durable_object wipes DO instances + data by deleting and re-uploading the tenant script(s) — requires --confirm-do-delete, touches no D1, remote envs only |
--skip-deploy | reset | Skip redeploy after migrate (workers keep stale D1 UUID bindings) |
--out <file> | plan | Save plan with attestation |
--plan <file> | apply, destroy | Execute saved plan |
--allow-stale | apply, destroy, drift, status, migrate, wfp tenant reset/destroy/migrate/provision/add-shard/status, import | Skip the automatic pre-command sync (and, on apply/destroy --plan, the attestation); operate on local state as-is |
--orphans | destroy, wfp tenant destroy | Destroy only resources flagged as orphaned (in state + Cloudflare but no longer declared in tamer.config.ts) |
--dry-run | destroy --orphans, wfp tenant destroy --orphans | List what would be removed without touching Cloudflare or state |
--rollback-on-failure | apply | Undo partial apply on error |
--detailed-exitcode | plan | Exit 2 when changes pending (CI gate) |
--destroy | plan | Preview destruction instead of creation |
--dispatch-namespace <name> | deploy | WFP namespace override |
--confirm-do-delete | deploy, wfp tenant provision | Required when doMigrations would apply new deleted_classes tags (data wipe) to an existing script. Fresh scripts (definitive 404 — e.g. first provision in an ephemeral env) never gate: no instances exist to wipe. wfp tenant reset / add-shard are rebinding-only and freeze DO migrations at the applied tag, so they never need it — except reset --kind durable_object, where it is mandatory |
--skip-workers | destroy | Skip worker deletion |
--wipe-metadata | destroy | Delete shared state D1 + artifacts R2 |
--strict-namespace-guard | sync | Exit nonzero when tenant entries reference namespaces no longer in config (CI gate against the rename footgun) |
--from <env> | secrets copy | Source env |
--to <env> | secrets copy | Target env |
--file <path> | secrets load | Override .dev.vars.{env} path (requires --target) |
--yes | secrets get, env gc | Skip interactive confirmation |
--all | dev | Run wrangler dev for every worker |
--max-age <duration> | env gc | Max age before an ephemeral env is GC'd (e.g. 72h) |
--dry-run | env gc | Print what would be removed without deleting |
--limit <n> | events | Cap the number of operations printed |
--main <path> | wfp tenant provision | Override the template main entrypoint |
--artifact-key <key> | wfp tenant provision | Deploy from an R2 artifact instead of --main |
--compatibility-date <date> | wfp tenant provision | Override the dispatch script compatibility date |
--module-name <name> | wfp tenant provision | Override the ES module export name |
Flag syntax
Use space-separated form (--env dev), not --env=dev — the argument parser does not support the --flag=value syntax.