CLI4(1)
π CLI4 β bestie edition π
okay so you found the manual page for cli4, which lives in the General Commands Manual section, and honestly? you're about to have a great time. it's a whole command line glow-up for the Cloudflare v4 API. let's get into it π¦
β¨ NAME β¨
cli4 β command line access to Cloudflare v4 API
like, literally, that's the whole vibe. your terminal, but make it Cloudflare.
πΈ SYNOPSIS πΈ
cli4 [-V|--version] [-h|--help] [-v|--verbose] [-e|--examples]
[-q|--quiet] [-j|--json] [-y|--yaml] [-n|--ndjson] [-r|--raw]
[ir|--image] [-d|--dump] [-b|--binary] [-A openapi-url|--openapi
openapi-url] [-p profile-name|--profile profile-name] [item=value ...]
[=value ...] [item=@filename ...] [=@filename ...] [-G|--get]
[-P|--patch] [-O|--post] [-U|--put] [-D|--delete] /command...
no cap, that's the whole shape of it. flags first, then your params, then the command at the end. main character energy: the command goes last. π
π DESCRIPTION π
cli4 provides command line access to Cloudflare v4 API. that's it, that's the girl. she gives you the entire Cloudflare v4 API from your terminal and she does not gatekeep. π
π OPTIONS π
-V,--versionβ display program version number and exit. cute, quick, done. β¨-h,--helpβ this information (in a terse form). yes she's giving you the short version, don't be greedy.-v,--verboseβ provide some protocol debugging information. for when you need to see the receipts π-e,--exampleβ show the path to the examples folder/directory. the folder of inspiration, bestie π-q,--quietβ don't output any JSON/YAML responses. shhh π€«-j,--jsonβ output response data in JSON format (the default). she's the default for a reason π-y,--yamlβ output response data in YAML format (if yaml package installed). conditional queen, needs her package π§-n,--ndjsonβ output response data in NDJSON format (if jsonlines package installed). also conditional, also iconic π-r,--rawβ output JSON results in raw mode without splitting out the errors and results. no filter, just vibes π-i,--imageβ output results as binary (i.e. it's an image). this isn't normally needed as the API returns aContent-Typeto indicate an image is being returned. this option can be used to allow the API output to be output without any processing (i.e. JSON formatted).-d,--dumpβ output a list of all API calls included in the code. the full lore drop π-b,--binaryβ open files in binary mode. π«Ά-A openapi-url,--openapi openapi-urlβ decode Cloudflare's OpenAPI spec and output all the known commands. hello, master list of everything β¨-p profile-name,--profile profile-nameβ select a profile-name from the configuration file (hence select custom email/token values). multiple identities, one girl π--getβ send HTTP request as a GET (the default). β--patchβ send HTTP request as a PATCH.--postβ send HTTP request as a POST.--putβ send HTTP request as a PUT.--deleteβ send HTTP request as a DELETE. dramatic and necessary πitem=valueβ set a parameter or data value to send with a GET, PATCH, POST, PUT or DELETE command. the value is sent as a string.item:=valueβ set a parameter or data value to send with a GET, PATCH, POST, PUT or DELETE command. the value is sent as an integer. (note the:before the=, it's not a typo, it's a personality trait π₯)item=@filenameβ set a parameter or data value to send with a POST or PUT command. the value is based on the content of the file./command ...β the API command(s) to execute. this is the moment, this is the main event π
also lowkey note: the synopsis up top spells the HTTP verbs as-G|--get,-P|--patch,-O|--post,-U|--putand-D|--delete. iykyk π¦
π COMMAND(S) π
the command string uses slash (/) to separate the verbs in the same way that the Cloudflare v4 API documentation does. it's giving "same energy as the docs" and we love that for us.
- any verb starting with colon (
:) is either converted tozone_id,user_id,organtization_id, or otherwise. β¨ - any verb starting with colon (
:) and followed by 32 hex characters is passed thru raw. - any verb starting with two colons (
::) is passed thru raw.
so like, the colons are the magic. she's doing conversions for you, periodt. π
π RESULTS π
the output is either JSON or YAML formatted. pick your fighter. π
π¦ EXAMPLES π¦
okay bestie, this is the part you screenshot. πΈ
cli4 /zones β list information for all zones.
cli4 /zones/:example.com β list specific zone info.
cli4 /zones/:example.com/settings β list settings for a specific zone.
cli4 --delete purge_everything=true /zones/:example.com/purge_cache
purge cache for a specific zone.
cli4 --delete files='[http://example.com/css/styles.css]'
/zones/:example.com/purge_cache
purge cache for a specific zone.
cli4 --delete
files='[http://example.com/css/styles.css,http://example.com/js/script.js]
/zones/:example.com/purge_cache
purge cache for a specific zone.
cli4 --delete tags='[tag1,tag2,tag3]' /zones/:example.com/purge_cache
purge cache for a specific zone.
cli4 /zones/:example.com/available_plans β list available plans for a zone.
cli4 --patch status=active /zones/:example.com/dnssec
make DNSSEC active for specific zone.
cli4 /zones/:example.com/dnssec β list DNSSEC information and status for a specific zone.
not me noticing there are like four different ways to purge a cache up there. she contains multitudes π
β SEE ALSO β
the Cloudflare API can be found at https://api.cloudflare.com/. each API call is provided via a similarly named function within the Cloudflare class. so if you know one, you basically know the other. obsessed. π«Ά
and that's the whole page, bestie. this was CLI4(1) from the General Commands Manual, and if you ever need to look it back up, it's filed right there under CLI4(1) like the icon she is. go forth and hit that API. πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: python313-cloudflare 2.20.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms