CLI

CLI for bunny.net 🐰

GitHub Release

Installation

The Bunny SDK CLI supports:

  • Linux arm64
  • Linux x86_64
  • MacOS arm64
  • MacOS x86_64
  • Windows arm64
  • Windows x86_64
  • Windows x86

To install the CLI on MacOS and Linux:

  1. Download the version matching your OS and architecture from GitHub releases
  2. Gunzip the file and rename it to bunny-sdk
  3. Move the binary to /usr/local/bin or add it to PATH
  4. Ensure the binary is executable with chmod +x bunny-sdk
  5. Run the binary with bunny-sdk --version
  6. Ensure the binary has system permissions to run

To install the CLI on Windows:

  1. Download the version matching your OS and architecture from GitHub releases
  2. Gunzip the file and rename it to bunny-sdk.exe
  3. Optionally move the binary to your install location of choice (such as %LOCALAPPDATA%/Programs/bunny-sdk/)
  4. Add the install location to PATH
  5. Run the binary with bunny-sdk.exe --version

Prerequisites

  • Please read the authentication guide to learn more about where to find your AccessKey and which AccessKey should be used for each client.
  • Please read the limitations guide to learn more about known limitations and bugs.
  • Please read the supported endpoints guide to learn more about which endpoints are supported.

Quickstart

Create the client

Set the Access Key using environment variables:

export BUNNY_ACCESS_KEY=""

Or, set the Access Key for each command using CLI flags. Ensure the --access-key flag is set immediately after bunny-sdk, not at the end of your command:

bunny-sdk --access-key="" [api] [command] [subcommand...]

Most responses are returned in the json format.

Call a simple endpoint

countries

bunny-sdk bunny-api country get

Call a complex endpoint

The List Storage Zones endpoint is a more complex example that has required parameters.

storage zones

bunny-sdk bunny-api storagezone list --include-deleted true --page 1 --per-page 1000

All required parameters from the documentation are also required in the Bunny SDK. In this example, the required parameters are:

  • --include-deleted
  • --page
  • --per-page

Despite the documentation setting the default --page parameter to 0, the default value fails the validation, where the minimum page is 1.

If you receive a 400 Bad Request error, please double-check your parameters.

Another common use case of the Bunny CLI is to print Edge Rules for the --edge-rule flag:

bunny-sdk bunny-api storagezone get --id <id>