Bunny Launcher commands

Purpose

Bunny Launcher deploys your website to bunny.net in a simple command. Bunny Launcher helps you:

  • Deploy without needing to understand terminology, such as storage zones, pull zones, caching, edge rules, and more
  • Automatically configure your website based on your framework
  • Easily and programmatically deploy or remove your website

If you are unfamiliar with the Bunny Launcher, please read more about its features.

Installation

To use the bunny-launcher and create-bunny-launcher CLIs, you must install the latest LTS version of Node.js.

Installation

npm install -g bunny-launcher@latest create-bunny-launcher@latest

The difference between the CLIs is:

Both commands share the same options. The --interactive flag enables the interactive guide, which will describe options, ask questions to fill in your config.

Configuration

Options can be specified in three ways:

  • The .bunny/launcher.json config file:
    {  "domain": {    "name": "example.com"  }}
  • The environment variables:
    export BUNNY_DOMAIN_NAME="example.com"
  • The command line flags:
    --domain-name "example.com"

If options are specified multiple times, the order of precedence is:

  1. Command line flags
  2. Environment variables
  3. The config file

We recommend storing all configuration in the .bunny/launcher.json config file. Frameworks may update and options may change, but a config file can always be read and migrated to future versions.

The only option that cannot be specified in the config file is the Access Key. This restriction prevents you from publicly committing your private API Access Key inside your config file. Instead, use the --access-key flag or the BUNNY_ACCESS_KEY environment variable. For your convenience, please see the login command and profile option.

Some options may not be changed after deployment due to bunny.net limitations (e.g. --optimize). To change these flags, you must run the remove command to remove the website. Then, you can re-deploy the website with your new option.

Commands

Bunny Launcher includes commands to make managing your website easier:

Bunny Launcher 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 Launcher includes utilities for your convenience:

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

TypeScript API

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

import { deploy, remove } from 'bunny-launcher'// options are equivalent to your command line flags and environment variables// options are optional if you have a `.bunny/launcher.json` config fileawait deploy({  options,})await remove({  options,})