All articles
ArticlesSeptember 30, 20265 min read

Cloudflare cf CLI: the agentic CLI replacing Wrangler

Cloudflare cf CLI covers all 3,000+ API operations with JSON output, command search and typed config. What changes for agents and how to migrate from Wrangler.

cloudflarecf cliwranglercloudflare workersai agentsdeveloper toolsforgebirthday week 2026
Cloudflare cf CLI: the agentic CLI replacing Wrangler

Cloudflare launched cf on September 28, 2026, on the first day of Birthday Week. The Cloudflare cf CLI is a new command-line tool that covers the whole Cloudflare API, over 3,000 operations, and it is designed for AI agents first and humans second. It is in open beta, and Cloudflare plans for it to replace Wrangler.

The number that explains the whole launch is in the first paragraph of Cloudflare's announcement: agents ran 48% of Wrangler usage last week, up from a quarter in March and single digits a year earlier. When half your CLI users are agents, you build the next CLI for them.

Why the Cloudflare cf CLI replaces Wrangler

Wrangler was hand-built. Each product team added its own commands its own way, and you can see it in the naming: d1 info, hyperdrive get, workflows describe, three verbs for the same idea. It reached about 280 operations. The Cloudflare API has thousands.

The fix is Forge, a new pipeline that generates SDKs, CLIs and docs from API definitions. Cloudflare released Forge as open source the same day. Everything at Cloudflare already has an OpenAPI schema. Add a few annotations, and Forge turns it into CLI commands. That is how cf jumps from ~280 operations to the full API surface in one release.

This is the part I find most interesting. Agents need consistency more than humans do. A human learns that d1 info and workflows describe mean the same thing. An agent guesses, burns tokens, and gets it wrong. A generated CLI is consistent by construction.

JSON by default

Agents using Wrangler add --json to every command and then pipe through jq. Only some Wrangler commands supported --json. The rest printed unicode tables, which an agent can parse, slowly and expensively.

cf flips the default. Output is JSON: pretty-printed when a human is at the terminal, condensed when an agent is reading it, to save context. Cloudflare's argument is that you, the human, are now one step removed from the CLI anyway. Your agent reads the JSON and shows you whatever format you asked for.

For the few commands that need real human input, like buying a domain with a long list of required fields, cf can show a validated form instead of a giant chain of flags.

With 3,000 routes, the next problem is finding the right one without stuffing the whole help text into the agent's context. cf cli search takes a natural-language request and returns matching commands from a small index built on the API descriptions and parameters.

The clever bit is how the agent learns about it. The first time it runs --help, cf tells it the search command exists. Cloudflare also notes that a brand-new CLI is easier for agents than a changed old one. Models were trained on years of Wrangler docs, so a different wrangler would fight what they already "know". A new name with an AGENTS.md and built-in hints avoids that.

cloudflare.config.ts: typed config your agent can check

The new configuration file is TypeScript:

import { bindings, defineConfig } from "cf/config";
import * as entrypoint from "./index.js" with { type: "cf-worker" };

export default defineConfig(({ mode }) => ({
  worker: {
    name: "example-worker",
    entrypoint,
    compatibilityDate: "2026-09-27",
    env: {
      Environment: bindings.text(`This is ${mode} environment`),
    },
  },
}));

That example is from the launch post. bindings gives you typed helpers for text, secrets, KV, D1, R2, queues, AI and Vectorize, and triggers puts fetch routes, cron schedules, queues and email in one block.

Why this matters for agents: TOML had no schema an agent could use, and JSONC's linked schema was rarely read. A TypeScript config gets type-checked through the language server, which agents like Claude Code and Codex already use. Wrong binding names show up as errors before deploy. Cloudflare says some internal Wrangler configs shrank by 40% from over 5,000 lines, because environments are built from one base in code instead of copy-pasted env blocks.

cf also defaults to Vite with the Cloudflare Vite plugin, instead of Wrangler's esbuild bundling and custom dev server.

Migrating from Wrangler to cf

The migration path is:

npm i -g cf
cf migrate

Workers that already build with Vite get converted to cloudflare.config.ts. Workers that depend on Wrangler's esbuild build, and Rust or Python Workers, keep delegating to Wrangler for now. When the beta ends, Cloudflare will ship a final major Wrangler version that points you to cf, then maintain Wrangler for 18 more months.

So nothing breaks today. I'd still try cf migrate on one small Worker this week. My delivery platform runs an Elysia API on Workers with D1, KV and R2 bindings, and a typed config for exactly that combination is something I'd have used on day one.

My take

I wrote in August that Cloudflare is turning into an operating system for agents. cf is a piece of that. If an agent can set up a Worker, deploy it, put Access in front of it, buy a domain and configure the WAF from one tool, the agent stops being a code generator and starts being an operator.

That raises the stakes. An agent with the full API can also delete zones. The JSON-first design makes agents faster. It doesn't make them careful. Scope your API tokens tightly, and keep destructive operations behind a human approval in your harness.

The pattern is worth stealing for your own products too. If your API has an OpenAPI schema, you can generate an agent-friendly CLI from it: JSON output, a search command, typed config. It is a small project, and it makes your product much easier for coding agents to use.

FAQ

Is the Cloudflare cf CLI open source?

Yes. Cloudflare says cf is open source, with issues tracked on GitHub. The Forge pipeline that generates it was also released as open source.

Is Wrangler deprecated?

Not yet. cf is in open beta. After the beta, Cloudflare plans a final Wrangler major version pointing to cf and 18 months of maintenance support.

Do I have to rewrite my wrangler.toml?

No. cf migrate converts Vite-based Workers to cloudflare.config.ts for you. Others keep using Wrangler under the hood until they move to Vite.


Sources

Cover image: Cloudflare Blog

Related articles