Cloudflare wrangler.toml Builder

Generate a wrangler.toml for a Cloudflare Worker with compatibility date and flags, routes, vars, KV, R2, D1, Durable Object, queue and AI bindings, cron triggers and static assets.

Use the tool

Why this tool exists

A Worker is configured through wrangler.toml, and each binding type has its own table with slightly different field names: binding, bucket_name, database_id, class_name. Copying from documentation and editing ids leads to typos that only show up at deploy time.

List your bindings one per line in a compact form, such as kv:CACHE:namespace-id, r2:UPLOADS:bucket, d1:DB:name:id, do:COUNTER:Counter, queue:JOBS:queue-name, ai:AI, var:KEY=value and cron:*/15 * * * *. The tool writes the correct tables, sets the compatibility date, adds the nodejs_compat flag and observability if you ask, and creates the migration entry that Durable Objects need. Placeholder ids must be replaced with your real ones. Nothing is uploaded.

How to use it

  1. Enter the Worker name, entry point and compatibility date.
  2. Choose options such as nodejs_compat and observability, and a route pattern with its zone if needed.
  3. List bindings one per line using the kv, r2, d1, do, queue, ai, var and cron forms.
  4. Copy the TOML into wrangler.toml and replace example ids with real ones.

Frequently asked questions

What format do bindings use?

Write one binding per line with a type prefix: kv:BINDING:id, r2:BINDING:bucket, d1:BINDING:name:id, do:BINDING:ClassName, queue:BINDING:queue, ai:BINDING, var:KEY=value and cron:expression. Lines are checked and unknown prefixes give an error.

What is the compatibility date?

It pins the Workers runtime behaviour to a date so updates do not change your Worker unexpectedly. The field defaults to today's date in the form YYYY-MM-DD and is validated.

Do Durable Objects need anything else?

Yes, a migration. The tool adds a migrations entry for each Durable Object class, so you can deploy, but you must also export the class from your Worker code.

Does it create the resources?

No. It only writes configuration. Create KV namespaces, buckets and databases with wrangler or the dashboard, then put their real ids into the file.