Skip to content

Install, sign in, and deploy a static site from the command line.

Before you start

The CLI binary is behindgate. From any command you can show usage with -h or --help, and you can check the installed version with:

behindgate --version

The CLI reads behindgate.json from the current directory to know which tenant, site, and app you are working with, plus the environment. See Configure behindgate.json below.

Sign in

  1. Run the login command:

    behindgate login [--email <e>] [--password <p>] [--new-password <p>]
  2. On success, the CLI prints:

    Signed in as {...}.

To confirm who you are signed in as at any time, run:

behindgate whoami

If you are not signed in, the CLI prints Not logged in.

To sign out, run:

behindgate logout

On success, the CLI prints Logged out.

Configure behindgate.json

The CLI reads behindgate.json from the current directory. Place this file in the root of your project.

The file supports these fields:

FieldTypeDescription
tenantIdstringYour workspace/tenant.
siteIdstringThe site to deploy to.
appIdstringThe app within the site.
apiBaseUrlstringBase URL the CLI talks to.
auth.regionstringAuth region.
auth.userPoolIdstringAuth user pool ID.
auth.userPoolClientIdstringAuth user pool client ID.

To use a config file in another location, pass --config <path> to deploy, publish, or rollback.

Deploy a build folder

  1. Build your static site so the output lives in a directory.

  2. Deploy that directory:

    behindgate deploy <dir> [--config <path>]

    Replace <dir> with the path to your build output.

When the deploy is live, the CLI prints:

✓ {...}/{...} is live on release {...}.

Note the release ID from this message — you use it to publish or roll back.

Publish a release

To publish a specific release, pass its release ID:

behindgate publish <releaseId> [--config <path>]

If you omit the release ID, the CLI prints {...} needs a <releaseId>.

On success, the CLI prints:

✓ {...} {...}/{...} to {...}.

Roll back a release

To roll back to a specific release, pass its release ID:

behindgate rollback <releaseId> [--config <path>]

As with publishing, if you omit the release ID, the CLI prints {...} needs a <releaseId>.

On success, the CLI prints Rolled back.

Custom domains

Custom domains are not yet supported.