Skip to content

Doctor

Run this when something isn’t working and you’re not sure where to start. It’s also the safest first command in a new directory — wd doctor does not require a wrangler-deploy.config.ts, so it can verify your environment before you have a project.

Terminal window
$ wd doctor
wrangler-deploy doctor
wrangler installed: wrangler 4.88.0
wrangler auth: you@example.com (account Your Account)
worker path: workers/api: workers/api exists
worker path: workers/batch-workflow: workers/batch-workflow exists
worker path: workers/event-router: workers/event-router exists
config valid: No config errors

When something is wrong, you’ll see it:

Terminal window
$ wd doctor
wrangler-deploy doctor
wrangler installed: wrangler 4.88.0
wrangler auth: not authenticated
worker path: workers/api: workers/api exists
worker path: workers/events: workers/events not found
config error: Resource "dlq" deadLetterFor references "cache-kv" which is type "kv", not a queue
config error: serviceBindings has unknown target worker "workers/missing"

In an empty directory with no config, doctor surfaces the missing config as a warning rather than failing:

Terminal window
$ wd doctor
wrangler-deploy doctor
wrangler installed: wrangler 4.88.0
wrangler auth: you@example.com (account Your Account)
config valid: No config errors
wrangler-deploy config: no wrangler-deploy.config.ts found in this directory
Run `wd create vite <name>` to scaffold a starter, or `wd init` if you already have wrangler.jsonc files.
CheckWhat it verifies
wrangler installedwrangler is installed and reachable
wrangler authwrangler whoami succeeds — surfaces the logged-in email and account
wrangler-deploy configReports a warning if wrangler-deploy.config.ts is missing
worker pathsEach declared worker has a wrangler.jsonc or wrangler.json on disk
config validationwrangler-deploy.config.ts has no errors — dead-letter refs, unknown workers, invalid bindings
  • --codes — adds a WD_DOC_* code to each check (useful with --json for agents)
  • --strict — exits non-zero if any check is warn or fail
  • --fix — writes safe defaults: accountId from CLOUDFLARE_ACCOUNT_ID, default stage in .wdrc, generated config from existing wrangler files
  • --fix-dry-run — preview what --fix would write without changing the filesystem
  • --json — full check list as a structured envelope