Skip to content

Getting Started

Download

Cloudflare-utils is build for Windows, Mac and Linux and the latest release is available to download from GitHub. Download the tar/zip file for your operating system and then extract the executable.

Deprecated archive naming convention

The archive downloads previously had the version number in the name, for example cloudflare-utils_1.2.3_windows_amd64.zip. This has been deprecated and the new naming convention is just cloudflare-utils_windows_amd64.zip. The old naming convention will be removed in v2.0.0.

There is also a GitHub Action available to install and run cloudflare-utils in your workflows read more: here.

Additional Installation Methods

  1. Docker
    • cyb3rjak3/cloudflare-utils
    • ghcr.io/cyb3r-jak3/cloudflare-utils
  2. Chocolatey: cloudflare-utils
  3. Homebrew: brew install cyb3r-jak3/cyberjake/cloudflare-utils

Authentication

OAuth 2.0

Starting with v1.7.0, you can add --oauth to your command to remove the need for an API token. You will need to have access to a browser for the oauth callback process. This is the recommended way as you don't need to store any auth credentials and the token is revoked after it has been used. All 6 scopes will be always be requested.

Non-interactive runs will need to use either API Token or API Key to run.

API Token

The recommended method to authenticate in CI pipelines is with an API Token. Each command will list the API permissions needed for it to run.

You can use this link to create a token with all the necessary permissions.

To Use

cloudflare-utils --api-token <Token Here>

You can also pass your API Token via an environment variable of CLOUDFLARE_API_TOKEN

API Key

The legacy API Key method is also supported but is not recommended.

To Use

cloudflare-utils --api-token <API Token Here>

Pass your API email and key with environment variables of CLOUDFLARE_API_EMAIL and CLOUDFLARE_API_KEY

Global Flags

  • --account-id Pass your account ID with the --account-id flag or with the environment variable CLOUDFLARE_ACCOUNT_ID

  • --api-email Pass your API email with the --api-email flag or with the environment variable CLOUDFLARE_API_EMAIL. This is only needed if you are using the legacy auth method.

  • --api-key Pass your API key with the --api-key flag or with the environment variable CLOUDFLARE_API_KEY. This is only needed if you are using the legacy auth method.

  • --api-token Pass your API token with the --api-token flag or with the environment variable CLOUDFLARE_API_TOKEN. This is the recommended method of authentication.

  • --rate-limit Pass the rate limit in milliseconds with the --rate-limit flag. This is useful if you are getting rate limited by Cloudflare or want to speed up the rate of requests.

  • --zone-name Pass your zone name with the --zone-name flag or with the environment variable CLOUDFLARE_ZONE_NAME. This is useful if you are running a command that only requires a zone name.

  • --zone-id Pass your zone ID with the --zone-id flag or with the environment variable CLOUDFLARE_ZONE_ID. This is useful if you are running a command that only requires a zone ID.

  • --extra-user-agent Pass an extra user agent string to be added to the default user agent with the --extra-user-agent flag. This is useful if you want to identify requests made by cloudflare-utils in your Cloudflare logs. The final format of the user agent will be cloudflare-utils/<version> (<extra-user-agent>)

  • --oauth Triggers an oauth flow to get credentials rather than using API Token and will override any passed api credentials. Requires a browser on the same machine.