Wrangler 2.0: Rethinking the Cloudflare Workers Development Loop

Cloudflare Workers has always required developers to make a choice between a full-featured remote environment and the convenience of local development. With the beta release of wrangler 2.0, the company is aiming to remove that trade-off entirely by rewriting the developer experience from the ground up.

The new CLI is designed to get developers running a Worker with a single command and a single file, no configuration required. The tooling now handles bundling automatically, and you can skip even naming your Worker. Running wrangler dev <filename> deploys your code to a development environment and proxies it through localhost, letting you send HTTP requests immediately.

A Debugger That Feels Local

Wrangler 2.0 introduces a redesigned debugging workflow that bridges the gap between the Cloudflare network and your editor. A simple keystroke opens a remote debugger—the same one Chrome uses when you hit "Inspect"—giving you an interactive view of logs, exceptions, and requests. Your Worker executes on Cloudflare's network but behaves as if it were running on your machine.

Several ergonomic improvements accompany this new session:

  • Keyboard shortcuts to quickly toggle features or open windows.
  • Support for --public, which automatically serves static assets.
  • More reliable, faster file-watching.

Starting a session is as simple as running wrangler dev <filename> and pressing the D key.

Local Mode on Demand

For developers who need to work without a network connection or prefer true local execution, wrangler 2.0 adds a "local mode" that runs Workers on your machine via Miniflare. That project—originally created by Brendan Coll to emulate Workers in Node.js—has been integrated directly into the development experience. You can switch between "network" and "local" modes mid-session with a keybind shortcut, making it easy to use the remote environment for integration testing and local mode for unit tests or offline work.

What's Next

The project is still in beta, but Cloudflare has made it available for early testing: npm install wrangler@beta. The source and issue tracker live in the wrangler v2 repository on GitHub, where feature requests and discussions are welcome until the project matures. Developers currently using the stable release should stick with wrangler 1.0 for production deployments; Cloudflare says it will maintain that version until 2.0 achieves backwards compatibility.