Import an existing dashboard Worker for local dev

setup & auth

// what it does

Downloads an existing Worker's code and configuration from the Cloudflare dashboard into a local project so you can develop and redeploy it from source. Use it to bring a dashboard-created or console-edited Worker under version control.

// shell

$ wrangler init <name> --from-dash <worker-name>

// gotcha

It pulls the deployed code and settings, but secret values never come down — they're write-only — so re-add them with `wrangler secret put` after importing.