Custom Domains
Both commands need the domain’s zone to already be on the same Cloudflare account. They edit the relevant wrangler.toml and redeploy, and Cloudflare creates the DNS record and route during that deploy. No dashboard step is needed.
API Worker
Section titled “API Worker”pnpm run update -- --domainAdds a [[routes]] entry with custom_domain = true to the root wrangler.toml and redeploys the API. It then asks whether to disable the *.workers.dev URL. The default is no: connect the domain, verify it works, and only then disable the fallback. Then point the auth URL at it:
pnpm run update -- --auth--auth sets BETTER_AUTH_URL, redeploys the API, and rebuilds and redeploys the Admin Worker against the new address. The admin was built against the previous URL until you run it.
Admin Worker
Section titled “Admin Worker”pnpm run update -- --admin-domainDoes the same for apps/admin/wrangler.toml, deploys the Admin Worker, then synchronizes everything on the API side that depends on the Admin app’s own public origin: it refreshes the ADMIN_URL secret (so password-reset and verification links point at the new address) and migrates CORS_ORIGINS in the root wrangler.toml — the old admin origin is replaced in place, every unrelated origin is preserved, and duplicates are never introduced. The API redeploys automatically, but only when CORS_ORIGINS actually changed. No manual CORS_ORIGINS edit needed. It never touches BETTER_AUTH_URL — that’s a separate, API-side concept (see --auth above). Safe to re-run: a second run with the same domain makes no further changes. If the Admin Worker’s own deploy fails, nothing on the API side is touched; if the API-side step fails afterward, the command reports the migration as incomplete rather than claiming success — just run it again once the underlying issue is fixed. See Authentication and CORS.
Moving the admin app to a new domain (e.g. cms.example.com → admin.example.com) frees the old hostname up for something else, but this command never removes the old route on your behalf — it only ever adds the new one. Retiring the old route (e.g. to reuse cms.example.com for a different site) is a separate, deliberate step: remove its [[routes]] block from apps/admin/wrangler.toml and redeploy.
Non-interactive
Section titled “Non-interactive”Add --ci with one category flag and set variables. An unset variable means leave unchanged.
CUSTOM_DOMAIN_NEW=api.example.com DISABLE_WORKERS_DEV=true pnpm run update -- --domain --ciADMIN_CUSTOM_DOMAIN_NEW=admin.example.com pnpm run update -- --admin-domain --ciOnly one category flag can be given per run. To change a Worker’s *.workers.dev name instead, use pnpm run rename-worker; see the CLI reference.