Bunny Transfer commands

Purpose

Bunny Transfer has several commands to help manage files. While Bunny Launcher is meant to deploy your website in a simple command, Bunny Transfer is used when:

  • You already have a website configured with bunny.net, but you regularly need to transfer files
  • Your website has a complex configuration that Bunny Launcher does not support
  • You regularly need to transfer files between storage zones and your local machine
  • You need to transfer files across multiple storage zones or bunny.net accounts

The difference between the sync and move commands is that:

  • The sync command will sync files to the destination, and delete files in the destination that do not exist in the source.
  • The move command will move files to the destination, and leave existing files in the destination that do not exist in the source.

Installation

To use the bunny-transfer CLI, you must install the latest LTS version of Node.js.

Installation

npm install -g bunny-transfer@latest

Configuration

For all commands, all flags can also be specified as environment variables. For example, the --access-key flag can also be specified as the BUNNY_ACCESS_KEY environment variable. If both are specified, the command line flag takes precedence.

Commands

Bunny Transfer includes commands to make managing files easier:

  • sync Sync files between storage zones and your local machine.
  • move Move files between storage zones and your local machine.
  • empty Empty the contents of a storage zone or local folder.
  • purge Completely purge the cache of a pull zone.

Bunny Transfer includes commands to manage your account:

  • login Manage your API Access Keys by naming them with profiles and saving them in the Shared Credentials File.
  • logout When you no longer regularly use an API Access Key, remove it. Or, remove all saved credentials at once.
  • who-am-i Print all of your saved credentials in your preferred format.

Bunny Transfer includes utilities for your convenience:

  • help Print the help information for the bunny-transfer package or one of its subcommands.
  • version Print the currently installed version of the bunny-transfer package.

TypeScript API

Some commands have a corresponding TypeScript API. You can import and call these commands programmatically.

import { sync, move, empty, purge } from 'bunny-transfer'await sync({  locations: ['./dist', 'my-storage-zone'],  accessKeys: ['c24347cf-1bc0-4900-8d60-86b1c7701f53'],})await move({  locations: ['./dist', 'my-storage-zone'],  accessKeys: ['c24347cf-1bc0-4900-8d60-86b1c7701f53'],  index: false,})await empty({  locations: ['my-storage-zone'],  accessKeys: ['c24347cf-1bc0-4900-8d60-86b1c7701f53'],})await purge({  locations: ['my-pull-zone'],  accessKeys: ['c24347cf-1bc0-4900-8d60-86b1c7701f53'],})