Download latest binary from github at
Download the latest release at Cloudflare CLI release
Download one of following release zip file:
https://github.com/epiHATR/cloudflare-cli/releases/download/v0.x.x/darwin-arm64-v0.x.x.tar.gz
https://github.com/epiHATR/cloudflare-cli/releases/download/v0.x.x/linux-amd64-v0.x.x.tar.gz
https://github.com/epiHATR/cloudflare-cli/releases/download/v0.x.x/windows-amd64-v0.x.x.zip
tar -xf linux-amd64-v0.x.x.tar.gz -C /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflare
tar -xf darwin-arm64-v0.x.x.tar.gz -C /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflare
extract windows-amd64-v0.x.x.zip to a folder
.\cloudflare.exe --help
command | descriptions |
---|---|
cloudflare | show cli introductions & starter command |
cloudflare version | display cli version and Cloudflare API version |
cloudflare login | login into Cloudflare API |
cloudflare account | manage Cloudflare accounts/organization |
cloudflare account list | list all Cloudflare accounts/organization |
cloudflare account show | show details of a cloudflare account/organization |
cloudflare account update | update information of a cloudflare account/organization |
cloudflare account role | manage all roles in cloudflare account/organization |
cloudflare account role list | list all roles in cloudflare account/organization |
cloudflare account role show | show information details of a role in cloudflare account/organization |
cloudflare account user | manage users in a Cloudflare account/organization |
cloudflare account user add | add new user to a Cloudflare account/organization |
cloudflare account user list | manage users in a Cloudflare account/organization |
cloudflare account user show | show information details of a user in a Cloudflare account/organization |
cloudflare account user delete | remove an user from a Cloudflare account/organization |
cloudflare zone list | list Cloudflare zone in account |
cloudflare zone show | show Cloudflare zone common information |
cloudflare zone create | create new Cloudflare zone |
cloudflare zone delete | delete a Cloudflare zone |
cloudflare zone setting pause | pause a cloudflare zone |
cloudflare zone setting unpause | unpause a cloudflare zone |
cloudflare zone setting set-type | set Cloudflare zone type (parital, full, delegated) |
cloudflare zone cache purge | control cache behavior on Cloudflare zone |
cloudflare zone plan list | list all Cloudflare plan for zone |
cloudflare zone plan show | show a Cloudflare plan details |
cloudflare zone plan upgrade | upgrade Cloudflare zone to a specified plan |
cloudflare zone dns list | list DNS records on a Cloudflare zone |
cloudflare zone dns add | add a DNS records on a Cloudflare zone |
cloudflare zone dns show | show a DNS records details of a Cloudflare zone |
cloudflare zone dns update | change/update DNS records value on Cloudflare zone |
cloudflare zone dns delete | delete a DNS records on a Cloudflare zone |
show cli introductions & starter command
cloudflare [ --help | -h ]
[ --debug ]
Login into Cloudflare API using API Token (--token | -t) or Email/ApiKey (--email|-e and --key|-k)
cloudflare login [ --token | -t ]
[ --email | -e ]
[ --key | -k ]
#global flags
[ --help | -h ]
[ --debug ]
Show current CLI version and Cloudflare API version
cloudflare version [ --short | -s ]
#global flags
[ --help | -h ]
[ --debug ]
Manage Cloudlare managed accounts/organization
cloudflare account
#global flags
[ --help | -h ]
[ --debug ]
List all Cloudlare managed accounts/organization
cloudflare account list [ --name | -n ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Show details of a Cloudlare managed account/organization
cloudflare account show [ --account-id ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Update information details of a Cloudlare managed account/organization See payload data at https://api.cloudflare.com/#accounts-update-account
cloudflare account update [ --account-id ]
[ --data | -d ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Manage roles in a Cloudlare managed accounts/organization
cloudflare account role
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
List al roles in a Cloudlare managed accounts/organization
cloudflare account role list [ --account-id ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Show information details of a role in a Cloudlare managed accounts/organization
cloudflare account role show [ --account-id ]
[ --role-id ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Manage users in a Cloudlare managed accounts/organization
cloudflare account user
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
List all users in a Cloudlare managed accounts/organization
cloudflare account user list [ --account-id ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Add new user to a Cloudlare managed accounts/organization
cloudflare account user add [ --account-id ]
[ --email ]
[ --status 'accepted', 'pending' ]
[ --role-id '--role-id=role1 --role-id=role2' ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Show information details of a user in a Cloudlare managed accounts/organization
cloudflare account user show [ --account-id ]
[ --user-id ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Show information details of a user in a Cloudlare managed accounts/organization
cloudflare account user delete [ --account-id ]
[ --user-id ]
[ --force]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
List all Cloudflare zone under account
cloudflare zone list [ --account-id ]
[ --account-name | -n ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Create a Cloudflare zone under account
cloudflare zone create [ --name | -n ]
[ --account-id ]
[ --type | -t ]
[ --plan-name ]
[--fetch-existing-dns]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Delete a Cloudflare zone under account
cloudflare zone delete [ --zone-id ]
[ --force | -f ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
List all Cloudflare zone under account
cloudflare zone show [ --id | -i]
[ --name | -n ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
List all DNS records in a Cloudflare zone
cloudflare zone dns list [ --zone-id | -i]
[ --type | -t ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Show details of a Cloudflare DNS record
cloudflare zone dns show [ --id | -i ]
[ --zone-id | -i]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Add a Cloudflare DNS record and return its result
See data payload format at [Cloudflare API documentation - create DNS record](https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record)cloudflare zone dns add [ --zone-id ]
[ --data|-d ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Update a Cloudflare DNS record
See data payload format at [Cloudflare API documentation - create DNS record](https://api.cloudflare.com/#dns-records-for-a-zone-update-dns-record)cloudflare zone dns delete [ --zone-id ]
[ --id | -i ]
[ --data | -d ]
[ --force | -f]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Delete a Cloudflare DNS record
cloudflare zone dns delete [ --zone-id ]
[ --id | -i ]
[ --force | -f]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Pause a Cloudfalre zone
cloudflare zone setting pause [ --zone-id ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
UnPause a Cloudfalre zone
cloudflare zone setting unpause [ --zone-id]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Control cache behaviors on Cloudflare zone
cloudflare zone cache purge [ --zone-id]
[ --purge-everything | -A]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Change Cloudflare zone type (full, partial)
cloudflare zone setting set-type [ --zone-id]
[ --type| -t ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
List all Cloudflare zone's plan
cloudflare zone zone plan list [ --zone-id]
[ --all-available|-a ]
[ --rate-plan-only ]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Show details of a zone's plan
cloudflare zone zone plan show [ --zone-id ]
[ --id | -i]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
Upgrade a Clouddflare zone plan
cloudflare zone zone plan upgrade [ --zone-id ]
[ --plan-id | -i]
[ --plan-name | -n]
#global flags
[ --query | -q ]
[ --output |-o ]
[ --help | -h ]
[ --debug ]
- Install Go 1.18.5
- Install Cobra for GO
- Install Viper
On the root folder (cloudflare-cli), type following command to generate new command
$> cobra add <command name> -p <parent command name> -a <author information>
On the local environment, run following command to start cli
$> go run main.go <sub command> --help
Following command running on MACOS M1 which will create a release version of cloudflare-cli, targeting for: Windows exe
version="v0.x.x"
GOOS=windows GOARCH=amd64 go build -ldflags "-X cloudflare/cmd.version=$version" -o "release/windows-amd64-$version/cloudflare.exe" cloudflare
cd release/windows-amd64-$version
./cloudflare version -s
tar -cvf windows-amd64-$version.zip cloudflare.exe
For Linux 64 binary
version="v0.1.0"
GOOS=linux GOARCH=amd64 go build -ldflags "-X cloudflare/cmd.version=$version" -o "release/linux-amd64-$version/cloudflare" cloudflare
cd release/linux-amd64-$version
./cloudflare version -s
tar -czvf linux-amd64-$version.tar.gz cloudflare
For MacOS binary
version="v0.1.0"
GOOS=darwin GOARCH=arm64 go build -ldflags "-X cloudflare/cmd.version=$version" -o "release/darwin-arm64-$version/cloudflare" cloudflare
cd release/darwin-arm64-$version
./cloudflare version -s
tar -czvf darwin-arm64-$version.tar.gz cloudflare
This repository is sponsored by CloudCLI.io