Doctor

pnpm doctor answers one question: is this machine ready to scaffold and deploy? Every failing check includes the exact command that fixes it.

pnpm doctor           # human-readable report
pnpm doctor --json    # machine-readable: {ok, deployReady, checks:[...]}

Check levels

  • required — must pass to scaffold at all: node >= 20, pnpm installed, workspace installed (pnpm install has run), template intact. If any fails, doctor exits 1.
  • deploy — needed for the default deploy path (Convex + Cloudflare): convex CLI available, cloudflare login (wrangler whoami). Scaffolding still works without these.
  • optional — login status for the other providers: vercel, netlify, surge, heroku, github. These only matter if you deploy --to them; deploy launches the login flow automatically anyway.

Reading the output

✓ node >= 20           node 22.11.0
✓ pnpm installed       pnpm 11.3.0
✓ workspace installed  node_modules present
✓ template intact      _template/app + _template/supabase-app
✓ convex CLI           convex 1.x
✖ cloudflare login     wrangler whoami   → npx wrangler login
○ vercel login         not logged in / CLI missing   → npx vercel login

Ready. Scaffolding works; run the fixes above before deploying.

JSON shape

With --json, doctor prints a single object. ok is true when all required checks pass; deployReady is true when the deploy-level checks also pass. Each entry in checks is {name, level, pass, detail} plus a fix command when it fails.

{
  "ok": true,
  "deployReady": false,
  "checks": [
    { "name": "node >= 20", "level": "required", "pass": true, "detail": "node 22.11.0" },
    { "name": "cloudflare login", "level": "deploy", "pass": false,
      "detail": "wrangler whoami", "fix": "npx wrangler login" }
  ]
}

Exit code: 0 when all required checks pass, 1 otherwise. AI agents should run pnpm doctor --json first and execute the fix commands for any failing check they need.