agent-cloudflare
Cloudflare ops triage CLI for AI agents
- Language
- Go
- Version
- 0.12.3
- License
- PolyForm Perimeter 1.0.0
- Category
- CLI Tool
A read-first, secret-safe Cloudflare operations CLI. Accounts, zones and DNS, SSL/TLS, rulesets and WAF, cache, Workers, KV, R2, Waiting Rooms, audit logs and analytics — with named investigations that answer a question rather than dumping an endpoint, and snapshots you can diff against a baseline. It fills the gap between raw API calls and Wrangler's Worker-focused developer loop.
Features
Read-first and secret-safe by default — tokens are stored outside model-visible output, and mutations need explicit opt-in
Named investigations — zone-health, traffic-spike, cache-miss, waf-block, ssl-breakage, dns-change and worker-error, each returning evidence and findings rather than raw endpoint output
Snapshots and baselines — capture a zone's configuration, then diff it against a baseline to see what actually changed
Broad read surface — accounts, zones, zone settings, DNS, SSL, rulesets, cache, analytics, audit logs, Workers, KV namespaces, R2 buckets and Waiting Rooms
Every mutation is gated — cache purge and friends require --dry-run or --confirm, and --reason records why
Multi-id gets — get <id>... returns one NDJSON line per id, or an @unresolved control line for a miss, so one bad id does not lose the batch
Profiles discover their own defaults — profiles discover fills in account and zone ids for you, so they stop being something to look up
Structured errors on stderr, classified so an agent can tell a bad parameter from a permissions problem
Tested against a local fixture Cloudflare server, so the surface is exercised without an account
Install
Homebrew
$ brew install shhac/tap/agent-cloudflare AI Agent Skill
$ npx skills add shhac/agent-skills --skill agent-cloudflare --global GitHub Release (macOS)
$ curl -L https://github.com/shhac/agent-cloudflare/releases/latest/download/agent-cloudflare-darwin-arm64.tar.gz | tar xz Go Install
$ go install github.com/shhac/agent-cloudflare/cmd/agent-cloudflare@latest Build from Source
$ git clone https://github.com/shhac/agent-cloudflare.git && cd agent-cloudflare && make build Getting Started
agent-cloudflare is built around named profiles. A profile holds the token reference plus non-secret defaults such as account and zone ids — and it can work those defaults out for itself.
01 · Add a profile without the token in view
$ agent-cloudflare profiles add prod --form --account-id <account_id> --form takes the API token outside the LLM's context. profiles is the canonical group; auth remains a hidden compatibility alias.
02 · Let it find the rest
$ agent-cloudflare profiles discover prod --zone example.com Fills in the account and zone ids the profile needs, so they stop being something you look up by hand.
03 · Check the credential
$ agent-cloudflare profiles check prod 04 · Ask a question, not an endpoint
$ agent-cloudflare investigate zone-health example.com Investigations return evidence and findings. Mutations always need --dry-run or --confirm.
Usage
$ agent-cloudflare investigate zone-health example.com $ agent-cloudflare investigate traffic-spike example.com --since 1h $ agent-cloudflare investigate waf-block example.com --since 1h $ agent-cloudflare investigate cache-miss example.com --since 1h $ agent-cloudflare dns list example.com $ agent-cloudflare snapshot zone example.com $ agent-cloudflare snapshot diff example.com $ agent-cloudflare cache purge example.com --url https://example.com/a --confirm --reason "incident mitigation"