id = "cloudflare-cli4"
name = "Cloudflare CLI4"
homepage = "https://github.com/cloudflare/python-cloudflare-cli4"
description = "CLI for Cloudflare API v4."
executables = ["cli4"]
[dotfiles]
paths = []
secret = ["~/.cloudflare/cloudflare.cfg"]
[commands]
format = 1
label = "Call the Cloudflare API"
description = "Send a request to the Cloudflare API v4 with cli4. Defaults to GET; pick one method flag for anything else. Binary, dump, openapi and image modes are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.source]]
id = "help"
kind = "manual"
url = "https://github.com/cloudflare/python-cloudflare-cli4#readme"
revision = "2026-10-27"
evidence = """
usage: cli4 [-V|--version] [-h|--help] [-v|--verbose] [-e|--examples] [-q|--quiet] [-j|--json] [-y|--yaml] [-n|--ndjson] [-i|--image] [-r|--raw] [-d|--dump] [-A|--openapi url] [-b|--binary] [-p|--profile profile-name] [-h|--header additional-header] [--get|--patch|--post|--put|--delete] [item=value|item=@filename|@filename ...] /command ...
$ cli4 --profile Work /zones | jq '.[]|.name' | wc -l
$ cli4 -v --header 'X-something:' --header 'X-whatever:whatever' /zones > /tmp/results.json
$ cli4 --post name='foo' type=A content="NOT-A-VALID-IP-ADDRESS" /zones/:example.com/dns_records
This is controled by the --yaml or --json flags (JSON is the default). There is also a --ndjson flag for use with line based JSON data.
"""
[[commands.field]]
id = "endpoint"
label = "API endpoint"
description = "For example /zones or /zones/:example.com/dns_records."
type = "string"
position = 0
min = 1
sources = ["help"]
[[commands.field]]
id = "items"
label = "Items (name=value)"
description = "Request fields as item=value, item=@filename or @filename."
type = "string"
position = 1
multiple = true
sources = ["help"]
[[commands.field]]
id = "get"
label = "GET request"
type = "boolean"
option = ["--get"]
sources = ["help"]
[[commands.field]]
id = "patch"
label = "PATCH request"
type = "boolean"
option = ["--patch"]
effect = "overwrite"
sources = ["help"]
[[commands.field]]
id = "post"
label = "POST request"
type = "boolean"
option = ["--post"]
sources = ["help"]
[[commands.field]]
id = "put"
label = "PUT request"
type = "boolean"
option = ["--put"]
effect = "overwrite"
sources = ["help"]
[[commands.field]]
id = "delete"
label = "DELETE request"
type = "boolean"
option = ["--delete"]
effect = "delete"
sources = ["help"]
[[commands.field]]
id = "profile"
label = "Profile"
type = "string"
option = ["--profile", "-p"]
sources = ["help"]
[[commands.field]]
id = "yaml"
label = "YAML output"
type = "boolean"
option = ["--yaml", "-y"]
sources = ["help"]
[[commands.field]]
id = "ndjson"
label = "NDJSON output"
type = "boolean"
option = ["--ndjson", "-n"]
sources = ["help"]
[[commands.field]]
id = "raw"
label = "Raw output"
type = "boolean"
option = ["--raw", "-r"]
sources = ["help"]
[[commands.field]]
id = "header"
label = "Extra header"
description = "Additional header, e.g. X-whatever:whatever."
type = "string"
option = ["--header"]
multiple = true
sources = ["help"]
[[commands.field]]
id = "verbose"
label = "Verbose"
type = "boolean"
option = ["--verbose", "-v"]
sources = ["help"]
[[commands.constraint]]
kind = "at_most_one"
fields = ["get", "patch", "post", "put", "delete"]
message = "Choose a single HTTP method."
[[commands.task]]
id = "get"
label = "GET a resource"
fields = ["endpoint", "profile", "yaml"]
required = ["endpoint"]
[[commands.task]]
id = "post"
label = "POST (create)"
set = { post = [true] }
lock = ["post"]
fields = ["endpoint", "items", "post", "profile"]
required = ["endpoint"]
[[commands.task]]
id = "delete"
label = "DELETE a resource"
set = { delete = [true] }
lock = ["delete"]
fields = ["endpoint", "delete", "profile"]
required = ["endpoint"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["endpoint", "items", "get", "patch", "post", "put", "delete", "profile"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["yaml", "ndjson", "raw", "header", "verbose"]