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
synccommand will sync files to the destination, and delete files in the destination that do not exist in the source. - The
movecommand 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:
syncSync files between storage zones and your local machine.moveMove files between storage zones and your local machine.emptyEmpty the contents of a storage zone or local folder.purgeCompletely purge the cache of a pull zone.
Bunny Transfer includes commands to manage your account:
loginManage your API Access Keys by naming them with profiles and saving them in the Shared Credentials File.logoutWhen you no longer regularly use an API Access Key, remove it. Or, remove all saved credentials at once.who-am-iPrint all of your saved credentials in your preferred format.
Bunny Transfer includes utilities for your convenience:
helpPrint the help information for thebunny-transferpackage or one of its subcommands.versionPrint the currently installed version of thebunny-transferpackage.
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'],})