Generate New Cloudflare Workers Projects with Wrangler's generate Command

Share this video with your friends

Send Tweet

Wranglers generate command, wrangler generate, allows you to create new Cloudflare Workers projects. Using the URL parameter, you can also generate new projects based on Cloudflare's starter templates, or open-source projects created by other developers, but for now, you will just use the default. To do this you'll only need to give it a name, for example, wrangler generate my-worker, this will create a new project called my-worker.

~ 3 years ago

In case the login doesn't work for someone, please try these steps instead.

  1. Use wrangler login to open login link.

  2. Press F12, then switch it to network tab.

  3. Press "Authorize Wrangler", then wait it success.

  4. Check the lastest request, find a request like https://dash.cloudflare.com/api/v4/user/tokens/SOME_HEX_STRING_HERE/value , then find your API token in the response.

  5. Run command wrangler config, paste the API token into it and press Enter, then you will get "Successfully configured. You can find your configuration file at: ..."

https://github.com/cloudflare/wrangler/issues/1703