Cloudflare CLI (cf)
$ cf Official High RiskCloudflare's cf CLI complements Wrangler by targeting the broader Cloudflare public API—DNS records, zones, Zero Trust, R2, D1, and KV—with built-in command discovery (cf cli search), schema inspection (cf schema), and multi-profile auth.
npm install -g @cloudflare/cli cf offers dynamic cf cli search and cf schema discovery so agents only inspect needed endpoints instead of loading hundreds of Cloudflare MCP schemas at once.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Built with agent discovery in mind: cf cli search, cf schema, JSON output support, and companion Cloudflare cf-cli skill guidance reduce flag hallucination.
- Runtime command discovery (
cf cli search) and schema introspection (cf schema) - Paired with official Cloudflare
cf-cliagent skill
Supports named profiles and scoped API tokens, though live DNS/zone/security mutations have immediate production blast radius.
- Named profile isolation and scoped
CLOUDFLARE_API_TOKEN - Direct control-plane mutations require user confirmation
Cross-platform distribution via npm/npx and standard Cloudflare auth flow.
- Installable via
@cloudflare/cli
Covers broad Cloudflare control-plane APIs cleanly while keeping context footprint tiny compared to full OpenAPI/MCP specs.
- On-demand schema lookup avoids context bloat
Official Cloudflare CLI currently in active beta evolution.
- Official Cloudflare tool; marked beta with rapid iteration
Self-documenting CLI commands plus official Cloudflare skill documentation.
- Built-in
cf cli searchandcf schemahelp output
Security, Auth & Guardrails
Named profiles stored in local CLI config or CLOUDFLARE_API_TOKEN environment variable.
CLI is free; API calls operate on your Cloudflare account resources and plan limits.
# Cloudflare cf CLI Agent Rules - Run `cf cli search` and `cf schema` before constructing unfamiliar API calls. - Always pin `--profile` or verify `CLOUDFLARE_ACCOUNT_ID` before write calls. - Require human confirmation for DNS deletions, firewall rule drops, or billing changes.
Agent-Ready Command Recipes
Safe Read-Only Queries
cf cli search "dns"
Lets the agent look up exact subcommands at runtime instead of guessing.
cf schema zones
Prints structured parameter and payload schemas before making API calls.
Controlled Writes & Previews
cf zones list --profile staging
Pins operations to a non-production account profile.
Strengths for Agents
- +
cf cli searchandcf schemadirectly solve agent flag hallucination. - + Cleaner separation of control-plane APIs from Wrangler's Workers build/dev loop.
- + Supports multi-profile auth switching.
Caveats & Pitfalls
- ! Still in beta; command surfaces may evolve between minor versions.
- ! Global DNS/zone operations carry high blast radius if given broad API tokens.