KosmoKrator

cloud

Cloudflare CLI for Shell Scripts

Use the Cloudflare CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.

7 functions 6 read 1 write Bearer token auth

Cloudflare CLI for Shell Scripts

Call integration functions from shell scripts with stable JSON input and output.

Use shell scripts for small local automations that need one or more integration calls. 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 Shell Scripts
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

FunctionTypeParametersDescription
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

Related Cloudflare CLI Pages