The CLI
The CLI
Section titled “The CLI”pnpm dev # astroid dev — regenerate, then astro devpnpm build # astroid build — regenerate, then astro buildpnpm doctor # astroid doctor — validate config, bindings, generated filespnpm generate # astroid generate — rewrite the generated triowrangler deploy # or: astroid deploy (plan-first provisioning)Generated vs. scaffold-once
Section titled “Generated vs. scaffold-once”This distinction is the one worth internalising:
- Generated—
src/schema.ts,src/worker.ts,src/middleware.ts. A pure function of your config, rewritten on everygenerate, and they carry a do-not-hand-edit banner.doctorfails if one has drifted. - Scaffold-once—
wrangler.jsonc,src/auth.ts,src/queue.ts,src/portal-auth.ts, the service worker, the map embed. Written when absent and never overwritten, because each exists to be edited.wrangler.jsoncis in this set specifically so a provisioned binding id is never clobbered.
Switching a module on later is a config edit plus astroid generate—it writes
whatever scaffold-once files the new module needs and leaves your existing ones
alone.