Catalyst CLI

Pre-release

The Catalyst CLI and Native Hosting are currently in closed alpha. There may be breaking changes as we finalize the API. To express interest in gaining access, fill out the Native Hosting Closed Alpha Interest Form.

Make sure to read the Overview documentation to understand the purpose of the CLI, how configuration variables work, etc. The Catalyst CLI supports the following commands:

version

Display detailed version information (CLI version, Node version, and platform).

Parameters

This command does not accept any parameters.

Example

$pnpm catalyst version

auth login

Authenticate with BigCommerce via your browser. Uses an OAuth device code flow. The CLI displays a one-time code, opens your browser to the BigCommerce login page, and waits for you to authorize. After logging in, your credentials are stored in .bigcommerce/project.json.

If you are already logged in, the CLI will display your current credentials and suggest running catalyst auth logout to re-authenticate.

Parameters

ParameterRequiredDescription

Example

$# Login via browser (recommended)
$pnpm catalyst auth login
$# Login with existing credentials (skips browser flow)
$pnpm catalyst auth login --store-hash <STORE_HASH> --access-token <ACCESS_TOKEN>

auth logout

Remove stored credentials for the current project.

Parameters

This command does not accept any parameters.

Example

$pnpm catalyst auth logout

auth whoami

Verify your stored credentials and display information about the authenticated store and linked project.

Parameters

ParameterRequiredDescription
--store-hash <hash>NoThe BigCommerce store hash (found in the URL of your store’s Control Panel). The value is required but can also be set via an environment variable named CATALYST_STORE_HASH or the .bigcommerce/project.json file.
--access-token <token>NoYour BigCommerce access token. The value is required but can also be set via an environment variable named CATALYST_ACCESS_TOKEN or the .bigcommerce/project.json file.

Example

$pnpm catalyst auth whoami

Example output:

Logged in to My Store (abc123), connected to project my-project (43eba682-0c48-11f1-9bd5-827a48b0ce1e)

If no credentials are found, the command exits with a “not logged in” message.


start

Start a local preview of your Catalyst storefront using OpenNext/Cloudflare. Requires a successful catalyst build first.

Parameters

This command does not accept any parameters.

Example

$pnpm catalyst start

build

Build your Catalyst project. Runs either the Next.js build or the Catalyst (OpenNext/Cloudflare) build pipeline depending on the configured framework. For the Catalyst framework, also runs a Wrangler dry-run to generate deployment artifacts.

Parameters

ParameterRequiredDescription
--project-uuidNoThe uuid of the project to be included in the deployment configuration. The value is required when using catalyst as the framework but can be set via an environment variable named CATALYST_PROJECT_UUID or the .bigcommerce/project.json file.
--frameworkNoThe framework to use: catalyst or nextjs. Can be set via an environment variable named CATALYST_FRAMEWORK or the .bigcommerce/project.json file.
--env-fileNoThe local path to an environment variables file to load variables from
[next-build-options...]NoNext.js build options when using the Next.js framework. See Next.js build options.

Example

$pnpm catalyst build
$# Include framework and project UUID
$pnpm catalyst build --framework catalyst --project-uuid <UUID>

deploy

Deploy your application to Cloudflare. By default, this also runs a build before deploying which can be skipped with the --prebuilt flag. Generates a bundle from .bigcommerce/dist, uploads it to BigCommerce, and creates a deployment. Requires a previous link if not passing --project-uuid.

Parameters

ParameterRequiredDescription
--store-hash <hash>NoThe BigCommerce store hash (found in the URL of your store’s Control Panel). The value is required but can also be set via an environment variable named CATALYST_STORE_HASH or the .bigcommerce/project.json file.
--access-token <token>NoYour BigCommerce access token. The value is required but can also be set via an environment variable named CATALYST_ACCESS_TOKEN or the .bigcommerce/project.json file.
--project-uuid <uuid>NoThe uuid of the project to be included in the deployment configuration. The value is required but can also be set via an environment variable named CATALYST_PROJECT_UUID or the .bigcommerce/project.json file.
--secret <KEY=VALUE>NoA single secret configuration variable that is used to run your deployed Catalyst project. When deploying, you’ll need to either pass your runtime variables using --secret or have them already set as environment variables
--prebuiltNoSkips the build
--env-fileNoThe local path to an environment variables file to load variables from
--dry-runNoGenerate the bundle without uploading or deploying.

Example

$pnpm catalyst deploy --secret BIGCOMMERCE_STORE_HASH=<YOUR_STORE_HASH> --secret BIGCOMMERCE_STOREFRONT_TOKEN=<YOUR_STOREFRONT_TOKEN>

project create

Create a BigCommerce infrastructure project.

Parameters

ParameterRequiredDescription
--store-hash <hash>NoThe BigCommerce store hash (found in the URL of your store’s Control Panel). The value is required but can also be set via an environment variable named CATALYST_STORE_HASH or the .bigcommerce/project.json file.
--access-token <token>NoYour BigCommerce access token. The value is required but can also be set via an environment variable named CATALYST_ACCESS_TOKEN or the .bigcommerce/project.json file.
--env-fileNoThe local path to an environment variables file to load variables from

Example

$# Create a project
$pnpm catalyst project create
$# Create a project and pass store hash and access token
$pnpm catalyst project create --store-hash <STORE_HASH> --access-token <ACCESS_TOKEN>

Link your local Catalyst project to a BigCommerce infrastructure project. You can provide a project UUID directly, or use store credentials to fetch and select from available projects (or create a new one).

Parameters

ParameterRequiredDescription
--store-hash <hash>NoBigCommerce store hash (found in the URL of your store Control Panel). The value is required if not passing --project-uuid but can also be set via CATALYST_STORE_HASH env var or the .bigcommerce/project.json file.
--access-token <token>NoBigCommerce access token (from a store-level API account). The value is required if not passing --project-uuid but can also be set via CATALYST_ACCESS_TOKEN env var.
--project-uuid <uuid>NoBigCommerce infrastructure project UUID (from GET /v3/infrastructure/projects). Use this to link directly without fetching projects. Either this or both --store-hash and --access-token must be provided.
--env-fileNoThe local path to an environment variables file to load variables from

Example

$# Link using a project UUID directly
$pnpm catalyst link --project-uuid <uuid>
$# Link by fetching projects (prompts to select or create)
$pnpm catalyst link --store-hash <STORE_HASH> --access-token <ACCESS_TOKEN>

project list

List BigCommerce infrastructure projects for your store.

Parameters

ParameterRequiredDescription
--store-hash <hash>NoBigCommerce store hash (found in the URL of your store Control Panel). The value is required but can also be set via CATALYST_STORE_HASH env var or the .bigcommerce/project.json file.
--access-token <token>NoBigCommerce access token (from a store-level API account). The value is required but can also be set via CATALYST_ACCESS_TOKEN env var or the .bigcommerce/project.json file.

Example

$# List your projects
$pnpm catalyst project list
$# List projects by passing store hash and access token
$pnpm catalyst project list --store-hash <STORE_HASH> --access-token <ACCESS_TOKEN>

telemetry

View or change CLI telemetry collection status (enable, disable, or show current status).

Parameters

ParameterRequiredDescription
[arg]NoSubcommand. Choices: disable, enable, status. Can also be omitted to show status.
--enableNoEnables CLI telemetry collection. Conflicts with --disable.
--disableNoDisables CLI telemetry collection.

Example

$# Show telemetry status
$pnpm catalyst telemetry
$# Enable telemetry collection
$pnpm catalyst telemetry enable
$# Disable telemetry collection
$pnpm catalyst telemetry --disable