# Wrangler
Wrangler is the [[Cloudflare]] Developer Platform CLI — the canonical tool for developing, deploying, and managing [[Cloudflare Workers]], [[Cloudflare Pages]], [[Cloudflare R2]], [[Cloudflare D1]], [[Cloudflare KV]], [[Cloudflare Vectorize]], [[Cloudflare Queues]], [[Cloudflare Hyperdrive]], [[Cloudflare Pipelines]], [[Cloudflare Workers AI]], [[Cloudflare Containers]], [[Cloudflare Workflows|Workflows]], and Secrets Store.
Installed via `npm install -g wrangler` (or run ad-hoc via `npx wrangler`). Configuration lives in `wrangler.jsonc` or `wrangler.toml` at the project root, declaring bindings, routes, compatibility dates, and environment variables.
## Why It Matters
Everything on the Workers platform — local dev, deployments, tail logs, secrets, resource provisioning — flows through Wrangler. There is no UI-equivalent for most operations. If you build on Cloudflare, you live in this CLI.
## Core Commands
- `wrangler dev` — local Workers runtime with hot reload (uses `workerd`)
- `wrangler deploy` — publish to Cloudflare
- `wrangler tail` — stream live logs from a deployed Worker
- `wrangler secret put/list/delete` — manage encrypted env vars
- `wrangler kv key`, `wrangler r2`, `wrangler d1`: resource-specific subcommands (the old `kv:key` colon syntax is deprecated since Wrangler 3.60.0)
- `wrangler tunnel`: create and run [[Cloudflare Tunnel|Cloudflare Tunnels]] without installing `cloudflared` yourself (March 2026)
- `wrangler login`: OAuth-based auth (or `CLOUDFLARE_API_TOKEN` env var for CI). Since July 2026, auth profiles bind a login to a directory, so Wrangler switches accounts based on where you are. Handy when you juggle several Cloudflare accounts. Since June 2026 you can also keep the OAuth credentials encrypted with a key in your OS keychain instead of a plaintext TOML file (opt-in)
## `wrangler.jsonc` Highlights
- `name` — Worker name (becomes part of the deployed URL)
- `main` — entry script
- `compatibility_date` — pins runtime behavior; bump deliberately
- `bindings` — KV, R2, D1, DO classes, Queues, AI, Vectorize, secrets
- `routes` — custom domain routing
- `triggers` — cron schedules
## Common Pitfalls
- **Compatibility flags**: navigator userAgent and friends require explicit opt-in. Node.js compatibility is the exception now: it's on by default for compatibility dates from 2026-08-04
- **Local vs remote bindings** — `wrangler dev` defaults to local resources; pass `--remote` for production data
- **Secrets in `wrangler.jsonc`** — never commit secrets; use `wrangler secret put` instead
## What's next: the `cf` CLI
On September 28, 2026, Cloudflare put `cf` ([[Cloudflare CLI]]) in beta: one CLI for the whole Cloudflare API (more than 2,900 commands, JSON output by default) and for Workers projects (`cf init`, `cf dev`, `cf build`, `cf deploy`). It's generated by [[Cloudflare Forge]] from the OpenAPI spec, while Wrangler's commands covered around 280 API operations by hand. `cf migrate` converts a Wrangler config to a typed `cloudflare.config.ts`, and `cf` resource commands also work inside an unmigrated Wrangler project. For now, the Workers docs still use Wrangler everywhere. When the beta ends, Cloudflare plans a final major Wrangler release that points users to `cf`, followed by 18 months of maintenance support.
## References
- Wrangler home: https://developers.cloudflare.com/workers/wrangler/
- KV commands (and the `kv:` syntax deprecation): https://developers.cloudflare.com/workers/wrangler/commands/kv/
- Changelog, manage tunnels with Wrangler (2026-03-19): https://developers.cloudflare.com/changelog/post/2026-03-19-wrangler-tunnel-commands/
- Changelog, OAuth credentials in the OS keychain (2026-06-03): https://developers.cloudflare.com/changelog/post/2026-06-03-wrangler-keyring-credential-storage/
- Changelog, Wrangler auth profiles (2026-07-02): https://developers.cloudflare.com/changelog/post/2026-07-02-wrangler-auth-profiles/
- Changelog, Node.js compatibility on by default (2026-08-04): https://developers.cloudflare.com/changelog/post/2026-08-04-nodejs-compat-default/
- Changelog, Cloudflare CLI beta (2026-09-28): https://developers.cloudflare.com/changelog/post/2026-09-28-cloudflare-cli-beta/
- Introducing cf, the agentic CLI for the entire Cloudflare API (Cloudflare blog, 2026-09-28): https://blog.cloudflare.com/cloudflare-cf-cli-launch/
- GitHub: https://github.com/cloudflare/workers-sdk
## Related
- [[Cloudflare]]
- [[Cloudflare Workers]]
- [[Cloudflare Pages]]
- [[Cloudflare Durable Objects]]
- [[Cloudflare R2]]
- [[Cloudflare D1]]
- [[Cloudflare KV]]
- [[Cloudflare Vectorize]]
- [[Cloudflare Queues]]
- [[Cloudflare Workers AI]]
- [[Cloudflare Tunnel]]
- [[Cloudflare Flagship]]
- [[Cloudflare Forge]]
- [[Cloudflare CLI]]
- [[TypeScript]]
- [[Cloudflare Temporary Accounts]] — `wrangler deploy --temporary` for agents