cloud
Cloudflare CLI for Headless Automation
Use the Cloudflare CLI for headless automation with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write Bearer token auth
Cloudflare CLI for Headless Automation
Use KosmoKrator as a non-interactive integration runtime for local automations and wrappers.
Use headless automation when another tool needs a stable local command surface. The Cloudflare CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Cloudflare CLI for Headless Automation
kosmokrator integrations:configure cloudflare --set access_token="$CLOUDFLARE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call cloudflare.cloudflare_list_zones '{"name":"example_name","status":"example_status","page":1,"per_page":1}' --json Discovery Before Execution
Agents and scripts can inspect Cloudflare docs and schemas before choosing a function.
kosmo integrations:docs cloudflare --json
kosmo integrations:docs cloudflare.cloudflare_list_zones --json
kosmo integrations:schema cloudflare.cloudflare_list_zones --json
kosmo integrations:search "Cloudflare" --json
kosmo integrations:list --json Useful Cloudflare CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
cloudflare.cloudflare_list_zones | Read | name, status, page, per_page | List all Cloudflare zones (domains). Returns zone IDs, names, status, and plan info. Use this to discover zone identifiers needed for DNS and analytics operations. |
cloudflare.cloudflare_get_zone | Read | zone_id | Get detailed information about a specific Cloudflare zone, including its ID, name, status, nameservers, and plan. |
cloudflare.cloudflare_list_dns_records | Read | zone_id, type, name, content, page, per_page | List DNS records for a Cloudflare zone. Returns record IDs, types, names, content, TTL, and proxy status. |
cloudflare.cloudflare_create_dns_record | Write | zone_id, type, name, content, ttl, proxied | Create a new DNS record in a Cloudflare zone. Supports A, AAAA, CNAME, MX, TXT, NS, SRV, and other record types. |
cloudflare.cloudflare_list_page_rules | Read | zone_id, status, page, per_page | List page rules for a Cloudflare zone. Returns rule IDs, targets, actions, and priority. |
cloudflare.cloudflare_get_analytics | Read | zone_id, since, until, continuous | Get analytics dashboard data for a Cloudflare zone. Returns HTTP requests, bandwidth, threats, and pageview metrics over a time range. |
cloudflare.cloudflare_get_current_user | Read | none | Get details of the currently authenticated Cloudflare user. Returns user ID, email, username, and account info. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.