Cloudflare: One CLI tool for everything
With cf, Cloudflare wants to make all products controllable via a single command-line tool – optimized for developers and AI agents.
(Image: Cloudflare)
Cloudflare has introduced a new, unified command-line tool that is intended to cover all the provider's products and APIs. cf is currently in preview and is intended to resolve the previous fragmentation in the long term: instead of switching between the dashboard, Wrangler CLI, Terraform, and REST API depending on the product, developers will be able to control all services via a single tool in the future. At the same time, Cloudflare is aligning the tool for use by AI agents. Also new is the Local Explorer, which offers direct insight into locally simulated Cloudflare resources for the first time.
Cloudflare's portfolio currently includes more than 100 products with around 3,000 API operations. These include the serverless runtime environment Workers, the D1 database, the R2 object storage, the KV key-value store, and Durable Objects for stateful applications. Until now, developers have managed these services using various tools: the Wrangler CLI for Workers deployment, Miniflare for local emulation of the runtime environment, the web dashboard, and Terraform. None of these tools cover all products.
This is exactly what cf is intended to change. It extends Wrangler and will cover the entire API surface in the future. Developers can already try out the preview via npx cf or install it globally via npm. Cloudflare plans to enable all services to be configured via the new tool according to the Infrastructure-as-Code principle – with a uniform syntax. An example would be cf kv get instead of product-dependent varying commands.
TypeScript schema as a central source
Under the hood is a new, TypeScript-based schema that serves as a central source for all interfaces. OpenAPI only describes REST endpoints; the new schema also captures CLI commands, configuration files, bindings, and local development and testing. From this, Cloudflare automatically generates SDKs, Terraform providers, documentation, and CLI commands. Binding rules at the schema level enforce consistency: commands are always called get, never info; flags like --json are available uniformly.
This consistency is primarily aimed at AI agents, which Cloudflare now considers “primary customers” of its APIs. Agents rely on predictable interfaces; if the syntax of a command deviates from the expected convention, they call non-existent commands. Equally important: the CLI will in the future clearly indicate whether a command affects local or remote resources. Previously, an agent might have been describing a local database while the developer was working with remote bindings.
Local Explorer for local resources
The also introduced Local Explorer enables the inspection and editing of locally simulated Cloudflare resources. The tool integrates with Wrangler and the Cloudflare Vite plugin and displays locally simulated resources such as KV, R2, D1, Durable Objects, and Workflows. Previously, developers had to search the state directory .wrangler/state or use third-party tools. Now, database contents can be checked directly, test data inserted, or tables reset.
Technically, the Local Explorer provides a local mirror of the Cloudflare API at /cdn-cgi/explorer/api. This behaves like the production API but works exclusively with local data. As a result, the same CLI commands work locally as remotely – a flag like --local simply redirects the request to the local endpoint. A D1 query then addresses the local SQLite instance instead of the hosted database, without changing the semantics. Agents can address the local API endpoint directly and will find an OpenAPI specification there.
Videos by heise
The announcements come during Cloudflare's Agents Week, during which the company is focusing more on AI agents for its platform. Further innovations include Durable Object Facets for isolated database instances in dynamically generated applications, persistent sandbox environments for agents (now generally available), and identity-based access control for outgoing connections from sandboxes.
The new CLI currently only supports a portion of Cloudflare's products. Cloudflare plans to cover the full API and integrate existing Wrangler functions in the coming months. The company is calling on developers to provide feedback on further development via the Cloudflare Developers Discord.
(fo)