Cloudflare cf CLI Open Beta: Agentic Command Line Interface for the Full API
cf CLI gives agents full access to Cloudflare’s 3,000‑plus API operations
Cloudflare’s new cf command‑line interface expands coverage from Wrangler’s ~280 commands to the entire Cloudflare API surface, enabling agents to create workers, deploy code, manage DNS, buy domains, and configure security—all from a single tool. This matters because agents now have a consistent, JSON‑first interface that reduces token usage and eliminates the need for ad‑hoc --json flags or table parsing.
JSON‑first design cuts token costs for LLM‑driven automation
Agents that previously used Wrangler had to append --json to the few commands that supported it and then filter output with jq. Most Wrangler commands emitted human‑oriented tables, forcing agents to spend extra tokens parsing irrelevant formatting. cf makes JSON the default output, pretty‑printed for humans but compact for agents, which directly lowers API‑call costs and speeds up reasoning.
"Agents just need JSON, and if agents are the future primary user of this tool, it should be the default." – Cloudflare blog
Agent‑centric command discovery via cf cli search
With over 3,000 possible routes, agents need a way to locate the right operation without bloating context. The cf cli search command accepts natural‑language queries and returns a ranked list of matching commands based on API descriptions and parameters. The first‑time --help run automatically informs agents about this feature.
TypeScript‑based cloudflare.config.ts enables type‑checked configuration
The new configuration file is written in TypeScript, providing a schema that LSP‑enabled agents (e.g., Claude Code, Codex) can understand and autocomplete. Typed configuration lets agents safely edit environments, bindings, and triggers, reducing errors compared to Wrangler’s TOML or JSONC formats.
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`),
},
},
}));
The configuration also includes helper functions for KV, D1, R2, Queues, AI, and more, all auto‑completed by the editor.
Vite defaults give a modern development experience
Unlike Wrangler, which relied on esbuild and a custom dev server, cf uses Vite as the default bundler and dev server. Vite brings hot‑module replacement, a rich plugin ecosystem, and Rust‑based tree‑shaking via Rolldown. The Cloudflare Vite Plugin and Vitest integration provide a cohesive workflow that mirrors the Workers runtime.
Seamless migration from Wrangler
Existing projects can migrate with a single command:
cf migrate
Workers already using Vite are automatically converted to cloudflare.config.ts. Projects that depend on Wrangler’s esbuild continue to delegate builds to Wrangler, ensuring backward compatibility. New projects can be bootstrapped with cf init or deployed directly with cf deploy for static sites.
Community reactions on Hacker News
- Positive excitement – Users noted that “some of the best product launches nowadays are CLIs” and welcomed a replacement for Wrangler.
- Agent‑first praise – Commenters highlighted the benefit of a JSON‑first interface and the
cf cli searchfeature for reducing token usage. - Critiques and suggestions – Some users questioned the TypeScript choice, suggesting a compiled language for the CLI, and asked for OpenCLI spec support for better discoverability.
- Operational concerns – A few pointed out that token generation still requires manual web navigation, and one user reported CI failures on the pre‑release version.
"It's crazy that some of the best product launches nowadays are CLIs." – @emadabdulrahim
"I don't understand why this is written in TypeScript… Do not force your users to manage the dependencies of your CLI." – @slowin
Outlook: agents as primary Cloudflare operators
Cloudflare frames cf as a foundational tool for the emerging agentic development workflow. By standardizing command naming, providing a searchable index, and delivering type‑checked configuration, the CLI aims to become the default interface for both AI agents and human developers. Future roadmap hints include native Terraform export and broader policy configuration via cloudflare.config.ts.
How to get started
Install the open beta globally:
npm i -g cf
Run cf --help to see the search hint, then explore commands such as cf workers deploy, cf dns create, or cf cli search "buy a domain".
The cf CLI is open source; issues can be reported on the GitHub repository.
Sources
Related
- Project
- Dispatch
- Dispatch
- Project
- Dispatch