Install AI Tools

B2C Commerce tools, documentation, and skills for your assistant.

Claude

Install the plugin Recommended

bash
claude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
claude plugin install b2c-dx-mcp@b2c-developer-tooling --scope project

Start a new Claude Code session in your project. Use --scope user instead for all projects.

Manual MCP setup

From your project directory:

bash
claude mcp add --transport stdio --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. Use --scope user instead for all projects. See Claude Code MCP setup.

Claude Desktop setup

Codex

Install the plugin Recommended

bash
codex plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
codex plugin add b2c-dx-mcp@b2c-developer-tooling

Start a new Codex session in your project. This setup also works with the Codex IDE extension and the ChatGPT Work desktop app.

Manual MCP setup
bash
codex mcp add b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Or add this to ~/.codex/config.toml (or $CODEX_HOME/config.toml if customized):

toml
[mcp_servers.b2c-dx-mcp]
command = "npx"
args = ["-y", "@salesforce/b2c-dx-mcp@latest"]

Start a new session. See Codex MCP configuration.

ChatGPT online setup

VS Code

Install the plugin Recommended

  1. Open the Command Palette (Cmd/Ctrl+Shift+P) and run Chat: Install Plugin from Source.
  2. Enter SalesforceCommerceCloud/b2c-developer-tooling.
  3. Select b2c-dx-mcp and follow the installation prompts.
  4. Start a new chat in GitHub Copilot.
Manual MCP setup

Add this to .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "b2c-dx-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

See VS Code MCP setup.

Copilot CLI setup

Cursor

Reload the MCP server in Cursor after installation.

Manual MCP setup

Add this to .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "b2c-dx-mcp": {
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

For all projects, use ~/.cursor/mcp.json instead.

See Cursor's MCP documentation.

OpenCode

Add this to opencode.json in your project:

json
{
  "mcp": {
    "b2c-dx-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@salesforce/b2c-dx-mcp@latest"],
      "enabled": true
    }
  }
}

Restart OpenCode. For all projects, use ~/.config/opencode/opencode.json. See OpenCode MCP setup.

Gemini

From your project directory, run:

bash
gemini mcp add --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new Gemini CLI session. Use --scope user instead for all projects. See Gemini CLI MCP setup.

No separate skills plugins needed.

Other clients and manual setup →
Skip to content
View as Markdown
View as Markdown

MRT Commands

Commands for managing Managed Runtime (MRT) projects, environments, and bundles for PWA Kit storefronts.

Command Overview

TopicCommandsDescription
mrt orglist, b2cList organizations and B2C connections
mrt projectlist, create, get, update, deleteManage MRT projects
mrt project memberlist, add, get, update, removeManage project members
mrt project notificationlist, create, get, update, deleteManage deployment notifications
mrt envlist, create, get, update, delete, invalidate, b2cManage environments
mrt env varlist, set, push, deleteManage environment variables
mrt env redirectlist, create, delete, cloneManage URL redirects
mrt env access-controllistManage access control headers
mrt bundledeploy, list, history, downloadManage bundles and deployments
mrt tail-logsTail real-time application logs
mrt save-credentialsSave MRT credentials to ~/.mobify
mrt userprofile, api-key, email-prefsManage user settings

storefront alias: mrt storefront is an alias for mrt project (including the member and notification subtopics). For example, b2c mrt storefront get my-storefront is identical to b2c mrt project get my-storefront. The alias matches the terminology used by the SCAPI MRT API; mrt project continues to work unchanged.

Global MRT Flags

These flags are available on all MRT commands:

FlagEnvironment VariableDescription
--api-keyMRT_API_KEYMRT API key (legacy MRT Cloud API)
--project, -pMRT_PROJECTMRT project slug — the SCAPI storefront ID (the same value). Aliases: --storefront, -s (interchangeable on every mrt command). MRT_STOREFRONT / SFCC_MRT_STOREFRONT also supported. On mrt project create, this flag sets the new project's slug.
--environment, -eMRT_ENVIRONMENTTarget environment (e.g., staging, production). MRT_TARGET also supported.
--mrt-backendMRT_BACKENDBackend to use: auto (default), legacy, or scapi. SFCC_MRT_BACKEND also supported. See MRT Backends.

The SCAPI backend also honors the standard OAuth flags (--client-id, --client-secret, --short-code, --tenant-id, and the JWT flags). See MRT Backends.

Configuration Sources

MRT commands resolve configuration in the following order of precedence:

  1. Command-line flags (--project / --storefront)
  2. Environment variables (MRT_PROJECT, then SFCC_MRT_PROJECT, then MRT_STOREFRONT / SFCC_MRT_STOREFRONT as fallbacks; also MRT_BACKEND / SFCC_MRT_BACKEND)
  3. dw.json file (mrtProject, mrtEnvironment, mrtBackend fields)
  4. ~/.mobify config file (for api_key)

Authentication

MRT commands use API key authentication against the legacy MRT Cloud API. The API key is configured in the Managed Runtime dashboard.

Two commands — mrt bundle history and mrt bundle deploy <bundleId> — can also run over the SCAPI MRT backend with OAuth instead of an API key. See MRT Backends for how the backend is selected and what it requires.

Getting an API Key

  1. Log in to the Managed Runtime dashboard
  2. Navigate to Account Settings > API Keys
  3. Copy your API key (or generate one if you haven't already)

Configuration

Provide the API key via one of these methods:

  1. Save credentials (recommended): b2c mrt save-credentials --user you@example.com --api-key your-api-key
  2. Command-line flag: --api-key your-api-key
  3. Environment variable: export MRT_API_KEY=your-api-key

For complete setup instructions, see the Authentication Guide.


MRT Backends

MRT is served by two backends:

  • legacy — the MRT Cloud API (cloud.mobify.com), authenticated with a per-user API key (--api-key / ~/.mobify). This is the backend for every MRT command.
  • scapi — the SCAPI MRT backend, authenticated with a stateless OAuth flow (client-credentials or JWT Bearer) via Account Manager, reusing the same --short-code / --tenant-id setup as other SCAPI commands. Each supported command requires the SCAPI scopes for the API it maps to — today the deployment commands (bundle history / deploy) need sfcc.storefront.deployments / sfcc.storefront.deployments.rw.

Select the backend with --mrt-backend (or MRT_BACKEND / SFCC_MRT_BACKEND, or mrtBackend in dw.json):

ValueBehavior
auto (default)Prefer SCAPI when its prerequisites are detected, otherwise use legacy. If a SCAPI request fails on a safe pre-execution error, auto falls back to legacy automatically (never for a 409 conflict, 429, 5xx, or network error).
legacyAlways use the legacy MRT Cloud API.
scapiAlways use SCAPI. Errors if the SCAPI prerequisites are missing — never silently falls back to legacy.

SCAPI-supported commands

Only two commands implement the SCAPI backend today:

  • b2c mrt bundle history — list deployments
  • b2c mrt bundle deploy <bundleId> — deploy an existing bundle

Every other MRT command — and mrt bundle deploy without a bundle ID (the local-build push path) — runs on the legacy MRT Cloud API. On those, --mrt-backend scapi errors with an actionable message, and --mrt-backend auto warns (only when SCAPI is actually configured) before using legacy.

Auto-detection criteria

auto selects SCAPI only when all of the following are configured:

  • --short-code (SFCC_SHORTCODE)
  • --tenant-id (SFCC_TENANT_ID)
  • A SCAPI-capable OAuth flow — client-credentials (--client-id + --client-secret), JWT Bearer (--client-id + --jwt-cert + --jwt-key), or a stored b2c auth client session. Browser user auth (--user-auth) is not accepted by the SCAPI Admin APIs.

Otherwise auto uses legacy. Run a supported command with -D / --debug to see which prerequisites were satisfied and which backend was chosen.

JSON output is backend-specific

Under --json, the supported commands return the serving backend's native response verbatim:

  • legacy — the raw MRT Cloud API shape (e.g. history returns {count, next, previous, deployments}).
  • scapi — the serving SCAPI API's native shape (e.g. history returns {limit, offset, total, data} from Storefront Deployments).

The human-readable table is normalized across both backends, but --json is not. Under --mrt-backend auto the --json shape therefore depends on which backend actually served the request — pin --mrt-backend legacy or --mrt-backend scapi if a script needs a stable shape.

Legacy-only flags are ignored on SCAPI

--api-key, --cloud-origin / -u, and --credentials-file / -c configure only the legacy MRT Cloud API. When the SCAPI backend serves a request — explicit --mrt-backend scapi, or auto resolving to SCAPI — passing any of these flags prints a warning that they were ignored and suggests --mrt-backend legacy if you meant to use them.


Maintenance (Read-Only) Mode

Managed Runtime occasionally enters a read-only maintenance window during which write operations are temporarily disabled. The CLI detects this automatically:

  • Read commands (e.g. list, get) keep working and print a non-blocking warning:

    › Warning: Managed Runtime is in maintenance mode. Write operations are disabled; read operations (like this one) are unaffected.
    Status: https://status.salesforce.com/instances/MANAGEDRUNTIMEADMIN
  • Write commands (e.g. deploys, bundle uploads, environment changes) are blocked with a clear error instead of a raw API response, and the command does not run:

    ✖ Error: Managed Runtime is in maintenance mode. This command was not run.
    mrt bundle deploy requires write access, which is temporarily disabled. Read commands (list, get) still work.
    Check status and ETA: https://status.salesforce.com/instances/MANAGEDRUNTIMEADMIN

Check the Managed Runtime Admin status page for current status and the estimated end of the maintenance window, then re-run your write command once maintenance completes.


Organization Commands

b2c mrt org list

List organizations you have access to.

bash
b2c mrt org list
b2c mrt org list --json

b2c mrt org b2c

Get B2C Commerce instances connected to an organization.

bash
b2c mrt org b2c my-organization
b2c mrt org b2c my-organization --json

Project Commands

b2c mrt project list

List MRT projects.

bash
b2c mrt project list
b2c mrt project list --limit 10 --offset 0
b2c mrt project list --json

b2c mrt project create

Create a new MRT project. The name is a positional argument; the organization is required via --organization / -o. To choose the new project's slug, pass --project / --storefront (-p / -s) — when omitted, MRT auto-generates the slug from the name.

bash
b2c mrt project create "My Storefront" --organization my-org
b2c mrt project create "My Storefront" -o my-org --storefront my-storefront
b2c mrt project create "My Storefront" -o my-org -s my-storefront
b2c mrt project create "My Storefront" -o my-org --region us-east-1

b2c mrt project get

Get details of an MRT project. Provide the project slug as a positional argument or via --project / --storefront (-p / -s; MRT_PROJECT and dw.json also work).

bash
b2c mrt project get my-storefront
b2c mrt project get --project my-storefront
b2c mrt project get --storefront my-storefront --json

b2c mrt project update

Update an MRT project. Provide the project slug as a positional argument or via --project / --storefront (-p / -s); at least one of --name, --url, or --region must be supplied.

bash
b2c mrt project update my-storefront --name "Updated Name"
b2c mrt project update --project my-storefront --region us-east-1
b2c mrt project update my-storefront --url https://www.example.com

b2c mrt project delete

Delete an MRT project. Provide the project slug as a positional argument or via --project / --storefront (-p / -s).

bash
b2c mrt project delete my-storefront
b2c mrt project delete --project my-storefront --force

Project Member Commands

b2c mrt project member list

List members of an MRT project.

bash
b2c mrt project member list --project my-storefront
b2c mrt project member list -p my-storefront --json

b2c mrt project member add

Add a member to an MRT project. The role is provided as an integer.

bash
b2c mrt project member add user@example.com --project my-storefront --role 0
b2c mrt project member add user@example.com -p my-storefront --role 1

Roles:

ValueRole
0Admin
1Developer
2Marketer
3Read Only

b2c mrt project member get

Get details of a project member.

bash
b2c mrt project member get user@example.com --project my-storefront

b2c mrt project member update

Update a project member's role. See the role table under b2c mrt project member add.

bash
b2c mrt project member update user@example.com --project my-storefront --role 3

b2c mrt project member remove

Remove a member from an MRT project.

bash
b2c mrt project member remove user@example.com --project my-storefront
b2c mrt project member remove user@example.com -p my-storefront --force

Project Notification Commands

Configure email notifications for deployment events.

b2c mrt project notification list

List notifications for an MRT project.

bash
b2c mrt project notification list --project my-storefront

b2c mrt project notification create

Create a deployment notification. The target environment(s) are given with --target (repeatable); --environment / -e are accepted as aliases (a notification's target is an environment). These commands do not take the single-value --environment flag that other MRT commands do.

bash
# Notify on deployment failures
b2c mrt project notification create -p my-storefront \
  --target staging --target production \
  --recipient ops@example.com \
  --on-failed

# Notify on all deployment events
b2c mrt project notification create -p my-storefront \
  --target production \
  --recipient team@example.com \
  --on-start --on-success --on-failed

b2c mrt project notification get

Get details of a notification.

bash
b2c mrt project notification get abc-123 --project my-storefront

b2c mrt project notification update

Update a notification.

bash
b2c mrt project notification update abc-123 -p my-storefront --on-start --no-on-failed

b2c mrt project notification delete

Delete a notification.

bash
b2c mrt project notification delete abc-123 --project my-storefront
b2c mrt project notification delete abc-123 -p my-storefront --force

Environment Commands

b2c mrt env list

List environments in an MRT project.

bash
b2c mrt env list --project my-storefront
b2c mrt env list -p my-storefront --json

b2c mrt env create

Create a new environment. Provide the new environment's slug as a positional argument or via --environment / -e (MRT_ENVIRONMENT and dw.json also work). An explicit positional wins if both are given.

bash
# Create a staging environment
b2c mrt env create staging --project my-storefront --name "Staging Environment"

# Slug via the --environment / -e flag instead of the positional
b2c mrt env create -p my-storefront -e staging --name "Staging Environment"

# Create a production environment in a specific region
b2c mrt env create production -p my-storefront --name "Production" \
  --production --region eu-west-1

# Create with external hostname
b2c mrt env create prod -p my-storefront --name "Production" \
  --production \
  --external-hostname www.example.com \
  --external-domain example.com

Flags:

FlagDescription
--name, -nDisplay name (required)
--region, -rAWS region for SSR
--productionMark as production
--hostnameHostname pattern for V8 Tag
--external-hostnameFull external hostname
--external-domainExternal domain for SSR
--allow-cookiesForward HTTP cookies
--enable-source-mapsEnable source maps
--proxyProxy configuration in format path=host (repeatable)
--wait, -wWait for the environment to be ready before returning
--poll-intervalPolling interval in seconds when using --wait
--timeoutMaximum time to wait in seconds when using --wait (0 for no timeout)

b2c mrt env get

Get environment details.

bash
b2c mrt env get --project my-storefront --environment staging
b2c mrt env get -p my-storefront -e production --json

b2c mrt env update

Update an environment.

bash
b2c mrt env update -p my-storefront -e staging --name "Updated Staging"
b2c mrt env update -p my-storefront -e production --allow-cookies

Flags:

FlagDescription
--name, -nDisplay name for the environment
--productionMark as a production environment
--hostnameHostname pattern for V8 Tag loading (use empty string to clear)
--external-hostnameFull external hostname (use empty string to clear)
--external-domainExternal domain for Universal PWA SSR (use empty string to clear)
--allow-cookiesForward HTTP cookies to origin
--enable-source-mapsEnable source map support in the environment
--log-levelLog level for the environment (DEBUG, INFO, WARN, ERROR, TRACE, FATAL)
--whitelisted-ipsIP whitelist (CIDR blocks, space-separated; use empty string to clear)
--proxyProxy configuration in format path=host (repeatable)

b2c mrt env delete

Delete an environment. Provide the environment slug as a positional argument or via --environment / -e (MRT_ENVIRONMENT and dw.json also work). An explicit positional wins if both are given.

bash
b2c mrt env delete staging --project my-storefront
b2c mrt env delete old-env -p my-storefront --force

# Slug via the --environment / -e flag instead of the positional
b2c mrt env delete -p my-storefront -e old-env --force

b2c mrt env clone

Clone an environment from an existing source environment. The new target receives the source's configuration (excluding proxies and the production flag) and is automatically deployed with the source target's current bundle (if any). Optionally clones redirects, environment variables, and B2C target info.

The source environment is the one selected by --environment / -e (or MRT_ENVIRONMENT / mrtEnvironment in dw.json). The positional argument is the new environment's slug.

bash
# Clone the configured environment into a new slug
b2c mrt env clone staging-copy -p my-storefront -e staging

# Clone with redirects and environment variables
b2c mrt env clone qa -p my-storefront -e staging --clone-redirects --clone-env-vars

# Clone using a custom domain certificate
b2c mrt env clone qa -p my-storefront -e staging \
  --external-hostname qa.example.com --certificate-id 123 --wait
FlagDescription
--environment, -eSource environment slug (defaults to mrtEnvironment / MRT_ENVIRONMENT)
--external-hostnameFull external hostname (required for non-MRT-managed certificates)
--external-domainExternal domain for Universal PWA SSR
--certificate-idCertificate ID for custom domain (use b2c mrt org cert list to find)
--clone-redirectsClone redirects from the source environment
--clone-env-varsClone environment variables from the source environment
--clone-b2c-infoClone B2C target info from the source environment
--wait, -wWait for the new environment to reach a terminal state

b2c mrt env invalidate

Invalidate CDN cache for an environment. The --pattern flag is required and accepts a path pattern (use /* to invalidate everything).

bash
# Invalidate all cached content
b2c mrt env invalidate -p my-storefront -e production --pattern "/*"

# Invalidate a specific path
b2c mrt env invalidate -p my-storefront -e production --pattern "/products/*"

b2c mrt env b2c

Get or update B2C Commerce connection for an environment.

bash
# Get current B2C configuration
b2c mrt env b2c -p my-storefront -e production

# Set B2C instance connection
b2c mrt env b2c -p my-storefront -e production --instance-id aaaa_prd

# Set B2C instance with specific sites
b2c mrt env b2c -p my-storefront -e production --instance-id aaaa_prd --sites RefArch,SiteGenesis

Environment Variable Commands

b2c mrt env var list

List environment variables.

bash
b2c mrt env var list --project my-storefront --environment production
b2c mrt env var list -p my-storefront -e staging --json

b2c mrt env var set

Set environment variables.

bash
# Set a single variable
b2c mrt env var set MY_VAR=value -p my-storefront -e production

# Set multiple variables
b2c mrt env var set API_KEY=secret DEBUG=true -p my-storefront -e staging

# Set value with spaces
b2c mrt env var set "MESSAGE=hello world" -p my-storefront -e production

b2c mrt env var push

Push variables from a local .env file to the environment. Diffs the local file against the remote state, prints a summary (added / updated / unchanged / remote-only), and prompts for confirmation before applying. Remote-only variables are not deleted.

FlagDescriptionDefault
--file, -fPath to the .env file to push.env
--exclude-prefixExclude variables whose keys start with this prefix (repeatable)MRT_
--yes, -ySkip confirmation promptfalse
bash
# Push variables from ./.env, with confirmation prompt
b2c mrt env var push -p my-storefront -e production

# Push from a custom file, skipping the confirmation prompt
b2c mrt env var push -p my-storefront -e staging --file config/.env --yes

# Exclude additional prefixes (MRT_ is always excluded by default)
b2c mrt env var push -p my-storefront -e staging --exclude-prefix INTERNAL_

TIP

The MRT_ prefix is excluded by default because those variables (MRT_PROJECT, MRT_ENVIRONMENT, MRT_API_KEY) configure the CLI itself rather than the environment.

b2c mrt env var delete

Delete an environment variable.

bash
b2c mrt env var delete MY_VAR -p my-storefront -e production

URL Redirect Commands

b2c mrt env redirect list

List URL redirects for an environment.

bash
b2c mrt env redirect list -p my-storefront -e production
b2c mrt env redirect list -p my-storefront -e production --limit 50

b2c mrt env redirect create

Create a URL redirect.

FlagDescriptionDefault
--fromSource path (required)
--toDestination path (required)
--statusHTTP status code (301 or 302)301
--forward-querystringForward query string parametersfalse
--forward-wildcardForward the wildcard portion of the pathfalse
bash
# Permanent redirect (default — 301)
b2c mrt env redirect create -p my-storefront -e production \
  --from "/old-path" --to "/new-path"

# Temporary redirect
b2c mrt env redirect create -p my-storefront -e production \
  --from "/legacy/*" --to "/modern/$1" --status 302 --forward-wildcard

b2c mrt env redirect delete

Delete a URL redirect by its source path.

bash
b2c mrt env redirect delete "/old-path" -p my-storefront -e production
b2c mrt env redirect delete "/old-path" -p my-storefront -e production --force

b2c mrt env redirect clone

Clone redirects from one environment to another within the same project.

bash
b2c mrt env redirect clone -p my-storefront --from staging --to production
b2c mrt env redirect clone -p my-storefront --from staging --to production --force

Access Control Commands

b2c mrt env access-control list

List access control headers for an environment.

bash
b2c mrt env access-control list -p my-storefront -e staging
b2c mrt env access-control list -p my-storefront -e staging --json

Bundle Commands

b2c mrt bundle deploy

Push a local build or deploy an existing bundle.

Deploying an existing bundle (with a bundle ID) is backend-aware — it honors --mrt-backend. Pushing a local build (no bundle ID) is legacy-pinned: bundle upload is not part of the SCAPI MRT surface, so --mrt-backend scapi errors on that path and auto uses legacy.

When pushing a local build, the SSR configuration is read from config.server.ts in the project directory (--project-directory, default the current directory), and the project's package.json dependencies (dependencies + devDependencies) are recorded as the bundle's bundle_metadata — both best-effort.

bash
# Push local build to project
b2c mrt bundle deploy --project my-storefront

# Push and deploy to staging
b2c mrt bundle deploy -p my-storefront -e staging

# Push with release message
b2c mrt bundle deploy -p my-storefront -e production --message "Release v1.0.0"

# Push from custom build directory
b2c mrt bundle deploy -p my-storefront --build-dir ./dist

# Deploy existing bundle by ID
b2c mrt bundle deploy 12345 -p my-storefront -e production

# Deploy and wait for completion
b2c mrt bundle deploy -p my-storefront -e staging --wait

# Deploy an existing bundle via the SCAPI backend and wait for completion
b2c mrt bundle deploy 12345 -p my-storefront -e production --mrt-backend scapi --wait

Flags:

FlagDescriptionDefault
--message, -mBundle message/description
--build-dir, -bPath to build directorybuild
--ssr-onlyServer-only file patternsssr.js,ssr.mjs,server/**/*
--ssr-sharedShared file patternsstatic/**/*,client/**/*
--node-version, -nNode.js version for SSR24.x
--ssr-paramSSR parameters (key=value)
--wait, -wWait for the deployment to complete before returningfalse
--poll-intervalPolling interval in seconds when using --wait30
--timeoutMaximum time to wait in seconds when using --wait (0 for no timeout)600

b2c mrt bundle upload-v2

Build and upload a v2-format bundle to Managed Runtime. This is upload only — it does not deploy the bundle. Deploy it separately with b2c mrt bundle deploy <bundleId> --environment <env>.

The v2 format differs from the default (v1) deploy upload: the archive is a gzip tar whose files sit under a root directory (default bld/), and the SSR configuration (ssr-only, ssr-shared, SSR parameters, and bundle metadata) is written inside the archive at {root-dir}/{config-path} (default bld/.mrt/config.json) rather than sent as request fields. It is uploaded as multipart/form-data to the v2 endpoint.

Config resolution: the SSR configuration is read from the build's on-disk v2 config file at {build-dir}/{config-path} (e.g. build/.mrt/config.json) when it exists. If there is no v2 config file, the command reads config.server.ts from the project directory (--project-directory, default the current directory — a compiled config.server.js/config.server.mjs, or the legacy build/config.server.js, is also accepted), and then falls back to built-in defaults. Command flags (--ssr-only, --ssr-shared, --ssr-param, --node-version, --dependencies, --cc-override) override the resolved values per key. When the build already emits the v2 config file, it is excluded from the archive and replaced by the resolved config so there is exactly one copy.

config.server.ts is evaluated from source (via jiti), so keep any type-only imports as import type — they are erased and need not resolve. A config.server.ts that exists but fails to import causes the command to error rather than silently falling back to defaults.

Dependency metadata: the project's package.json dependencies (merged dependencies + devDependencies) are recorded in the bundle config's bundleMetadata.dependencies, matching pwa-kit/storefront-next. An explicit --dependencies value, or dependencies already present in the v2 config file, take precedence. Collection is best-effort — a missing or unreadable package.json never blocks the upload.

bash
# Build and upload from ./build
b2c mrt bundle upload-v2 --project my-storefront

# Upload from a custom build directory
b2c mrt bundle upload-v2 -p my-storefront --build-dir ./dist

# Allow SSR patterns that match no files
b2c mrt bundle upload-v2 -p my-storefront --match-mode ignore_missing

# Provide SSR parameters and bundle metadata
b2c mrt bundle upload-v2 -p my-storefront --ssr-param EnvBasePath=/mobify --node-version 20.x
b2c mrt bundle upload-v2 -p my-storefront --dependencies @./deps.json --cc-override plugin-a

# Target a non-default MRT control plane
b2c mrt bundle upload-v2 -p my-storefront --cloud-origin https://cloud.mobify.com

Flags:

FlagDescriptionDefault
--message, -mBundle message/description
--build-dir, -bPath to build directorybuild
--root-dirArchive path prefix for built files and the config filebld
--config-pathIn-archive config file path, relative to --root-dir.mrt/config.json
--match-modeHow ssr-only/ssr-shared patterns matching no files are handled (strict or ignore_missing)strict
--ssr-onlyServer-only file patternsssr.js,ssr.mjs,server/**/*
--ssr-sharedShared file patternsstatic/**/*,client/**/*
--node-version, -nNode.js version for SSR24.x
--ssr-paramSSR parameters (key=value, repeatable)
--dependenciesBundle dependencies as inline JSON or a @path to a JSON file
--cc-overrideCommerce Cloud override identifier (repeatable)

b2c mrt bundle list

List bundles in a project.

bash
b2c mrt bundle list --project my-storefront
b2c mrt bundle list -p my-storefront --limit 10
b2c mrt bundle list -p my-storefront --json

b2c mrt bundle history

View deployment history for an environment. This command is backend-aware: under --json it returns the serving backend's native response verbatim.

bash
b2c mrt bundle history -p my-storefront -e production
b2c mrt bundle history -p my-storefront -e staging --limit 5

# Force the SCAPI backend
b2c mrt bundle history -p my-storefront -e staging --mrt-backend scapi

b2c mrt bundle download

Download a bundle artifact.

bash
# Download to current directory
b2c mrt bundle download 12345 -p my-storefront

# Download to specific path
b2c mrt bundle download 12345 -p my-storefront -o ./artifacts/bundle.tgz

# Get download URL only
b2c mrt bundle download 12345 -p my-storefront --url-only

b2c mrt bundle delete

Delete one or more bundles. Bundles are deleted asynchronously by the server and only project admins can run this command. With more than one bundle ID the CLI uses the bulk-delete endpoint and reports any rejected bundles (e.g. bundles in use by an active deployment).

bash
# Delete a single bundle
b2c mrt bundle delete 12345 -p my-storefront

# Delete several at once
b2c mrt bundle delete 12345 12346 12347 -p my-storefront

# Skip the confirmation prompt
b2c mrt bundle delete 12345 -p my-storefront --force

Organization Member Commands

Organization members are distinct from project members: they hold a role at the organization level and can optionally be granted permission to view all projects and manage custom domain certificates.

b2c mrt org member list

bash
b2c mrt org member list --org my-org
b2c mrt org member list --org my-org --search alice

b2c mrt org member add

Roles: owner or member.

bash
b2c mrt org member add alice@example.com --org my-org --role member
b2c mrt org member add bob@example.com --org my-org --role owner --view-all-projects

b2c mrt org member get

bash
b2c mrt org member get alice@example.com --org my-org

b2c mrt org member update

bash
b2c mrt org member update alice@example.com --org my-org --view-all-projects
b2c mrt org member update alice@example.com --org my-org --no-cert-permission

b2c mrt org member remove

bash
b2c mrt org member remove alice@example.com --org my-org

Organization Certificate Commands

Manage custom domain certificates for environments that use a non-MRT-managed hostname. Certificates are organization-scoped; reference a certificate from env create, env update, or env clone via --certificate-id.

b2c mrt org cert list

bash
b2c mrt org cert list --org my-org
b2c mrt org cert list --org my-org --custom-only

b2c mrt org cert get

Returns the validation record (the DNS entry the customer must add to validate the certificate).

bash
b2c mrt org cert get 123 --org my-org

b2c mrt org cert create

bash
b2c mrt org cert create shop.example.com --org my-org

The output includes the validation record. Add it to your DNS to complete validation.

b2c mrt org cert delete

bash
b2c mrt org cert delete 123 --org my-org

b2c mrt org cert restart-validation

Restart validation for a certificate that has not yet been validated. The response includes a fresh validation record.

bash
b2c mrt org cert restart-validation 123 --org my-org

Tail Logs

b2c mrt tail-logs

Tail application logs from a Managed Runtime environment in real time. Connects via WebSocket and streams log entries until interrupted with Ctrl+C.

bash
# Tail all logs
b2c mrt tail-logs -p my-storefront -e staging

# Filter by log level
b2c mrt tail-logs -p my-storefront -e production --level ERROR --level WARN

# Search with regex pattern
b2c mrt tail-logs -p my-storefront -e staging --search "timeout"

# Search with OR pattern
b2c mrt tail-logs -p my-storefront -e staging --search "GET|POST"

# Output as JSON
b2c mrt tail-logs -p my-storefront -e staging --json

Flags:

FlagDescription
--levelFilter by log level (ERROR, WARN, INFO, DEBUG, etc.). Repeatable for multiple levels.
--search, -gFilter entries matching a regex pattern (case-insensitive)
--no-colorDisable colored output

Save Credentials

b2c mrt save-credentials

Save MRT credentials (username and API key) to the ~/.mobify file. Prompts for confirmation before overwriting an existing file.

bash
# Save credentials
b2c mrt save-credentials --user user@example.com --api-key abc123

# Overwrite without confirmation
b2c mrt save-credentials --user user@example.com --api-key abc123 --yes

# Save to a custom credentials file
b2c mrt save-credentials --user user@example.com --api-key abc123 --credentials-file ./my-creds

# Save for a specific cloud origin (writes to ~/.mobify--<hostname>)
b2c mrt save-credentials --user user@example.com --api-key abc123 --cloud-origin https://cloud-staging.example.com

Flags:

FlagDescription
--userMRT username (email). Required.
--api-keyMRT API key. Required.
--cloud-originMRT cloud origin URL. Determines the credentials file path (e.g., ~/.mobify--<hostname>).
--credentials-fileExplicit path to credentials file (overrides default ~/.mobify).
--yes, -yOverwrite existing credentials without confirmation.

User Commands

b2c mrt user profile

View your MRT user profile.

bash
b2c mrt user profile
b2c mrt user profile --json

b2c mrt user api-key

Reset your MRT API key. The current key is invalidated immediately — running this command without --yes prompts for confirmation. The new key is printed once; copy it and update any saved credentials.

bash
b2c mrt user api-key
b2c mrt user api-key --yes
b2c mrt user api-key --json

b2c mrt user email-prefs

View or update email notification preferences. With no flags the command prints the current preferences; pass --node-deprecation to enable Node.js deprecation notifications, or --no-node-deprecation to disable them.

bash
# View current preferences
b2c mrt user email-prefs

# Enable Node.js deprecation notifications
b2c mrt user email-prefs --node-deprecation

# Disable them
b2c mrt user email-prefs --no-node-deprecation

Common Workflows

Deploy to Production

bash
# 1. Push and deploy to staging for testing
b2c mrt bundle deploy -p my-storefront -e staging -m "v1.0.0-rc1"

# 2. After testing, deploy to production
b2c mrt bundle deploy -p my-storefront -e production -m "v1.0.0"

# 3. Or deploy an existing bundle
b2c mrt bundle deploy 12345 -p my-storefront -e production

Set Up a New Environment

bash
# 1. Create the environment
b2c mrt env create qa -p my-storefront --name "QA Environment" --region us-east-1

# 2. Configure environment variables
b2c mrt env var set API_URL=https://api.qa.example.com -p my-storefront -e qa

# 3. Deploy a bundle
b2c mrt bundle deploy -p my-storefront -e qa

Invalidate Cache After Content Update

bash
# Invalidate a specific path pattern
b2c mrt env invalidate -p my-storefront -e production --pattern "/products/*"