AI & Machine Learning6 min read

The Best Agent Interface Turned Out to Be the Command Line

Cloudflare's cf CLI is being sold as agentic. The real news is that the CLI, not bespoke agent protocols, is where agents and humans do their work.

By Curious Technologist Editorial

Image: Cloudflare Blog

The most useful thing an infrastructure company can do for AI agents in 2026 is ship a good command-line tool. That sounds like a step backwards after two years of new agent protocols, tool registries and custom connectors, but it isn't. Cloudflare calling cf an agentic CLI is partly branding. The reasoning underneath it is sound, and more vendors should be copying it than currently are.

The protocol detour

The first wave of agent tooling assumed models needed a special interface. So we got tool schemas, then the Model Context Protocol, then MCP servers wrapping REST APIs that already had perfectly good documentation. Each layer was a translation: HTTP endpoint to JSON schema to tool description to model context. Every one of those tool descriptions costs tokens on every turn, whether the agent uses the tool or not.

That is fine for a service with a dozen operations. It falls apart for something the size of Cloudflare's API, which covers DNS, WAF rules, Workers, R2, D1, queues, Zero Trust, load balancing and a long tail of other products. There are far more endpoints than any sane context window should list up front. Cloudflare has seemed aware of this for a while. Its engineers have written publicly about having agents write code against a typed API instead of choosing from a flat list of tools, which is the same idea approached from another direction.

A CLI handles that problem almost by accident. Discovery is already built in: --help, subcommands, man pages. An agent that knows how to explore a command tree loads only the branch it needs. Models have also seen decades of shell sessions in their training data, so terminal habits are about as close to native as anything gets. Nobody had to teach Claude or GPT what grep is.

An agent-friendly CLI is just a well-designed CLI that finally has a customer demanding enough to force the discipline.

What 'agentic' actually buys you

Strip away the label and look at what makes a CLI work well for an agent. Output is structured by default, or at least available with one flag. Exit codes mean something. Errors say what went wrong and what to try next, instead of dumping a stack trace. Destructive operations have a dry-run mode. Commands are idempotent where possible, so a retry after a timeout doesn't create a second DNS record. Pagination is explicit, not something you discover when output gets cut off.

None of this is new. It's the checklist good Unix tooling has followed for forty years, and that plenty of vendor CLIs ignored because a human could squint past the gaps. An agent can't squint. It reads a half-formatted table, guesses wrong, and confidently acts on the guess. So the agent becomes a forcing function: an adversarially literal user that exposes every ambiguity a human learned to tolerate. The side effect worth caring about is that humans get the better tool too.

This is why I think the 'agentic' framing undersells the launch. If cf is good, it will be good for the engineer on call at 3am just as much as for Claude Code. If it's only good for agents, meaning it's tuned for machine parsing and unpleasant to read, that's a warning sign.

The strongest objection

The best case for MCP and similar protocols over a plain CLI is about control, not convenience. A protocol server can scope exactly what an agent may call, log each invocation as a structured event, and sit behind an OAuth flow that a security team understands. A shell is the opposite. Once an agent has a terminal and a token, it can pipe cf output into curl, write it to disk, or chain it with anything else on the machine. The blast radius is whatever the shell can reach.

That argument is right, and it's why I'd reject any claim that CLIs make agent protocols obsolete. But look at where the control actually sits. In both designs, the real permission boundary is the API token. An MCP server running with an account-wide token gives no more safety than a CLI with the same token. It just has a tidier audit log. Cloudflare already supports finely scoped API tokens. Whether an agent is safe comes down almost entirely to whether the operator uses them, not to which interface sits on top.

There's also an open question the source doesn't settle, and I won't guess at it: how cf relates to Wrangler, the existing CLI that Workers developers already have in their muscle memory and CI pipelines. Two official CLIs with overlapping scope is a familiar kind of vendor mess. If cf is meant to absorb Wrangler over time, Cloudflare should say so plainly and publish a migration path. If the two are meant to coexist, the boundary between them needs to be sharp.

If you actually run this at work

The practical advice is dull but it matters. Don't hand your coding agent the same Cloudflare token you use yourself. Create one per agent workflow, scoped to specific zones and specific permissions. Read-only is where to start for anything exploratory, and you can widen it only once you've watched what the agent tries to do. Make dry-run your default habit for anything that touches DNS or firewall rules. A wrong A record is a very efficient way to take a site offline, and agents are very efficient.

In practice: treat an agent's cf session like a junior engineer's first week with production access. Give it narrow credentials, review the diffs, and keep changes reversible. The tool may be built for agents. Your change-management process still has to be built for mistakes.

It's also worth checking whether cf changes your workflow at all. If you already run Terraform against Cloudflare, your source of truth lives in HCL, and an agent making imperative changes through a CLI will cause drift your next plan either reverts or chokes on. The honest use for cf in a Terraform shop is investigation and diagnosis: querying analytics, inspecting config, reading logs. Mutations should keep going through the declarative pipeline. For smaller teams without IaC, cf plus an agent may simply become the IaC, which works right up until someone asks what changed last Tuesday.

Who wins

Cloudflare benefits in the obvious way. A capable agent that can configure a whole Cloudflare stack in one conversation lowers the cost of adopting more Cloudflare products, and the company's strategy has long been to sell developers the next product along. Agents that cheerfully chain Workers to R2 to D1 are a very good cross-selling channel.

The less obvious winners are the rest of us, if competitors follow suit. The cloud providers' CLIs vary enormously in consistency, and years of accumulated services have left some of them sprawling. If agent usage pushes vendors to clean up output formats, error messages and idempotency, that's a rare case where AI hype produces boring, durable infrastructure improvements. I'll take that over another protocol.

Sources & further reading

The analysis above is our own. The underlying reporting and primary documents are credited here.