# Cloudflare CLI
The Cloudflare CLI, `cf`, is [[Cloudflare]]'s new [[Command Line Interface (CLI)|command-line tool]]: one CLI for the entire public Cloudflare API and for Workers projects. Manage zones, DNS, storage and security settings, and create, develop and deploy [[Cloudflare Workers]], from the same binary. Cloudflare calls it "the agentic CLI", and it's built for agents first, humans second. Install with `npm install --global cf`, sign in with `cf auth login`.
It's the successor to [[Wrangler]]. When the beta ends, Cloudflare will ship a final major version of Wrangler that points you (and your agent) to `cf`, then maintain Wrangler for 18 more months.
## Timeline
- **April 13, 2026** (Agents Week): technical preview, "Building a CLI for all of Cloudflare". It covered only a small subset of products and came with Local Explorer, a local UI and API to inspect the simulated KV, R2, D1, Durable Objects and Workflows data behind `wrangler dev`
- **September 8**: Miniflare v5 ships with a configuration shape aligned with `cloudflare.config.ts`, to prepare local dev for `cf`
- **September 28** (Birthday Week): open beta, together with [[Cloudflare Forge]], the open source generation pipeline that produces its commands. The npm package was at `1.0.0-beta.12` a few days later; the source is on GitHub (`cloudflare/cf`, TypeScript, Apache-2.0)
## Why Cloudflare built a new CLI
Agents. Per Cloudflare's own numbers, agents ran a quarter of Wrangler usage in March 2026, up from single digits a year before, and 48% the week before launch. They also use almost twice as many distinct commands per day as humans.
Wrangler couldn't keep up. Its ~280 command paths were hand-built by each product team, with inconsistent verbs (`d1 info`, `hyperdrive get`, `workflows describe`), and many products had no commands at all. `cf` generates its commands from an annotated [[OpenAPI Specification|OpenAPI schema]] through Forge, which takes it to more than 2,900 commands covering 3,000+ API operations. Naming is enforced at the schema level: always `get`, never `info`; always `--force`; always `--json`.
## What's different
- **JSON by default**: most API commands print JSON, pretty-printed for humans and condensed for agents. No more `--json | jq` on some commands and Unicode tables on others
- **Command discovery for agents**: `cf cli search "create D1 database"` runs a small local index (no credentials needed) and returns up to five matching commands as JSON. `cf schema d1 create` then describes the exact API request: method, path, parameters, body fields. Agents learn about `cf cli search` the first time they run `--help`
- **Forms for human input**: for commands with many parameters (buying a domain, say), `cf` can walk you through validated inputs instead of a long command line
- **Typed configuration**: Workers projects use `cloudflare.config.ts` instead of `wrangler.jsonc`/`wrangler.toml`. `defineConfig`, `bindings.*` and `triggers.*` give autocomplete and type-checking to your editor and to agents with LSP plugins ([[Claude Code]], Codex). Environments become [[Vite]] modes (`--mode`) built from one base config instead of copied `env` blocks; Cloudflare says some internal configs shrank 40% from 5,000+ lines. The plan is to grow this file to cover zones, DNS and policies, not just Workers
- **Vite by default**: `cf dev`, `cf build` and `cf deploy` use the Cloudflare Vite plugin (or your framework's command), and delegate to Wrangler for Workers that still need esbuild, and for Rust and Python Workers. Builds produce a deployable Build Output in `.cloudflare/output/v0/`, so you can build once and deploy later from [[Continuous Integration (CI)|CI]]
- **Remote by default**: commands act on remote resources and take IDs, not names (`cf d1 query <DATABASE_ID>`); `--local` only works for supported KV, D1 and R2 commands
## Living with Wrangler during the beta
- `cf` resource commands work anywhere, including inside an unmigrated Wrangler project. They don't read `wrangler.jsonc`, so set `CLOUDFLARE_ACCOUNT_ID` or pick an account. `cf` doesn't reuse your Wrangler login either
- `cf migrate --dry-run`, then `cf migrate`, converts a Wrangler config to `cloudflare.config.ts`. Durable Object migrations, [[Cloudflare Workflows|Workflows]], Containers and package scripts need manual follow-up
- **Trap**: don't run `cf dev`, `cf build` or `cf deploy` in an unmigrated Wrangler project. Auto-configuration can overwrite `package.json` (including the `deploy` script), the lockfile, `.gitignore` and `vite.config.ts`, and in CI it does so without asking. Depending on the project, you end up with a static-assets Worker without your code or bindings
- Still missing in `cf`: streaming live logs (use `npx wrangler tail`) and setting a single secret
- Cloudflare's recommended line for your `AGENTS.md`/`CLAUDE.md`: use `cf` for Cloudflare tasks unless the project has a Wrangler configuration file
## Reception
The launch hit the Hacker News front page (171 points, 88 comments). People liked `cf cli search` and full API coverage; agent-heavy users asked for native Terraform output. The criticism: a CLI written in TypeScript and installed through npm (a compiled single binary was requested back in April), TypeScript as the configuration format, a `cf` name that collides with the Cloud Foundry CLI, and a launch post published while the repo's CI was red and 1.0 wasn't out.
## My take
Generating the CLI from the API schema is the right call, and so is designing for agents explicitly: JSON output, local command search and typed config are exactly what makes an agent reliable with a tool it has never seen. Cloudflare's argument that a brand-new name confuses agents less than a heavily changed Wrangler (which LLMs learned from years of docs) is clever and probably right.
What I'd watch: this is a beta replacing the tool every Workers tutorial uses, the docs still say Wrangler everywhere, and the auto-configuration trap above can wreck a project silently in CI. For now, I'd use `cf` for account and resource tasks Wrangler can't do, and migrate projects deliberately, one at a time, with `--dry-run` first.
## References
- [Introducing cf: the agentic CLI for the entire Cloudflare API](https://blog.cloudflare.com/cloudflare-cf-cli-launch/) (Cloudflare blog, 2026-09-28)
- [Building a CLI for all of Cloudflare](https://blog.cloudflare.com/cf-cli-local-explorer/) (Cloudflare blog, 2026-04-13)
- Cloudflare CLI documentation: https://developers.cloudflare.com/cf/
- cf for Wrangler users: https://developers.cloudflare.com/cf/wrangler/
- Migrate a Wrangler project: https://developers.cloudflare.com/cf/wrangler/migrate/
- Use cf with coding agents: https://developers.cloudflare.com/cf/agents/
- Programmatic configuration (`cloudflare.config.ts`): https://developers.cloudflare.com/cf/projects/cloudflare-config/
- Changelog, Cloudflare CLI beta (2026-09-28): https://developers.cloudflare.com/changelog/post/2026-09-28-cloudflare-cli-beta/
- Changelog, Miniflare v5 prepares local development for the cf CLI (2026-09-08): https://developers.cloudflare.com/changelog/post/2026-09-08-miniflare-v5/
- GitHub: https://github.com/cloudflare/cf
- Hacker News, beta launch: https://news.ycombinator.com/item?id=49879577
- Hacker News, technical preview: https://news.ycombinator.com/item?id=47753689
## Related
- [[Cloudflare]]
- [[Wrangler]]
- [[Cloudflare Forge]]
- [[Cloudflare Workers]]
- [[Command Line Interface (CLI)]]
- [[OpenAPI Specification]]
- [[TypeScript]]
- [[Vite]]
- [[AI Agents]]
- [[Code Mode MCP Pattern]]