| description | Commands for managing Managed Runtime projects, environments, bundles, and deployments. |
|---|
Commands for managing Managed Runtime (MRT) projects, environments, and bundles for PWA Kit storefronts.
| Topic | Commands | Description |
|---|---|---|
mrt org |
list, b2c |
List organizations and B2C connections |
mrt project |
list, create, get, update, delete |
Manage MRT projects |
mrt project member |
list, add, get, update, remove |
Manage project members |
mrt project notification |
list, create, get, update, delete |
Manage deployment notifications |
mrt env |
list, create, get, update, delete, invalidate, b2c |
Manage environments |
mrt env var |
list, set, delete |
Manage environment variables |
mrt env redirect |
list, create, delete, clone |
Manage URL redirects |
mrt env access-control |
list |
Manage access control headers |
mrt bundle |
deploy, list, history, download |
Manage bundles and deployments |
mrt tail-logs |
Tail real-time application logs | |
mrt save-credentials |
Save MRT credentials to ~/.mobify | |
mrt user |
profile, api-key, email-prefs |
Manage user settings |
These flags are available on all MRT commands:
| Flag | Environment Variable | Description |
|---|---|---|
--api-key |
MRT_API_KEY |
MRT API key |
--project, -p |
MRT_PROJECT |
MRT project slug |
--environment, -e |
MRT_ENVIRONMENT |
Target environment (e.g., staging, production). MRT_TARGET also supported. |
MRT commands resolve configuration in the following order of precedence:
- Command-line flags
- Environment variables
dw.jsonfile (mrtProject,mrtEnvironmentfields)~/.mobifyconfig file (forapi_key)
MRT commands use API key authentication. The API key is configured in the Managed Runtime dashboard.
- Log in to the Managed Runtime dashboard
- Navigate to Account Settings > API Keys
- Copy your API key (or generate one if you haven't already)
Provide the API key via one of these methods:
- Save credentials (recommended):
b2c mrt save-credentials --user you@example.com --api-key your-api-key - Command-line flag:
--api-key your-api-key - Environment variable:
export MRT_API_KEY=your-api-key
For complete setup instructions, see the Authentication Guide.
List organizations you have access to.
b2c mrt org list
b2c mrt org list --jsonGet B2C Commerce instances connected to an organization.
b2c mrt org b2c my-organization
b2c mrt org b2c my-organization --jsonList MRT projects.
b2c mrt project list
b2c mrt project list --limit 10 --offset 0
b2c mrt project list --jsonCreate a new MRT project.
b2c mrt project create my-storefront --name "My Storefront"
b2c mrt project create my-storefront --name "My Storefront" --organization my-orgGet details of an MRT project.
b2c mrt project get --project my-storefront
b2c mrt project get -p my-storefront --jsonUpdate an MRT project.
b2c mrt project update --project my-storefront --name "Updated Name"Delete an MRT project.
b2c mrt project delete --project my-storefront
b2c mrt project delete -p my-storefront --forceList members of an MRT project.
b2c mrt project member list --project my-storefront
b2c mrt project member list -p my-storefront --jsonAdd a member to an MRT project.
b2c mrt project member add user@example.com --project my-storefront --role admin
b2c mrt project member add user@example.com -p my-storefront --role developerRoles: admin, developer, viewer
Get details of a project member.
b2c mrt project member get user@example.com --project my-storefrontUpdate a project member's role.
b2c mrt project member update user@example.com --project my-storefront --role viewerRemove a member from an MRT project.
b2c mrt project member remove user@example.com --project my-storefront
b2c mrt project member remove user@example.com -p my-storefront --forceConfigure email notifications for deployment events.
List notifications for an MRT project.
b2c mrt project notification list --project my-storefrontCreate a deployment notification.
# 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-failedGet details of a notification.
b2c mrt project notification get abc-123 --project my-storefrontUpdate a notification.
b2c mrt project notification update abc-123 -p my-storefront --on-start --no-on-failedDelete a notification.
b2c mrt project notification delete abc-123 --project my-storefront
b2c mrt project notification delete abc-123 -p my-storefront --forceList environments in an MRT project.
b2c mrt env list --project my-storefront
b2c mrt env list -p my-storefront --jsonCreate a new environment.
# Create a staging environment
b2c mrt env create staging --project my-storefront --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.comFlags:
| Flag | Description |
|---|---|
--name, -n |
Display name (required) |
--region, -r |
AWS region for SSR |
--production |
Mark as production |
--hostname |
Hostname pattern for V8 Tag |
--external-hostname |
Full external hostname |
--external-domain |
External domain for SSR |
--allow-cookies |
Forward HTTP cookies |
--enable-source-maps |
Enable source maps |
--proxy |
Proxy configuration in format path=host (repeatable) |
--wait, -w |
Wait for the environment to be ready before returning |
Get environment details.
b2c mrt env get --project my-storefront --environment staging
b2c mrt env get -p my-storefront -e production --jsonUpdate an environment.
b2c mrt env update -p my-storefront -e staging --name "Updated Staging"
b2c mrt env update -p my-storefront -e production --allow-cookiesDelete an environment.
b2c mrt env delete staging --project my-storefront
b2c mrt env delete old-env -p my-storefront --forceInvalidate CDN cache for an environment.
# Invalidate all cached content
b2c mrt env invalidate -p my-storefront -e production
# Invalidate specific paths
b2c mrt env invalidate -p my-storefront -e production --path "/products/*" --path "/categories/*"Get or update B2C Commerce connection for an environment.
# 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,SiteGenesisList environment variables.
b2c mrt env var list --project my-storefront --environment production
b2c mrt env var list -p my-storefront -e staging --jsonSet environment variables.
# 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 productionDelete an environment variable.
b2c mrt env var delete MY_VAR -p my-storefront -e productionList URL redirects for an environment.
b2c mrt env redirect list -p my-storefront -e production
b2c mrt env redirect list -p my-storefront -e production --limit 50Create a URL redirect.
b2c mrt env redirect create -p my-storefront -e production \
--from "/old-path" --to "/new-path"
# Permanent redirect (301)
b2c mrt env redirect create -p my-storefront -e production \
--from "/legacy/*" --to "/modern/$1" --permanentDelete a URL redirect.
b2c mrt env redirect delete abc-123 -p my-storefront -e productionClone redirects from one environment to another.
b2c mrt env redirect clone -p my-storefront \
--source staging --target productionList access control headers for an environment.
b2c mrt env access-control list -p my-storefront -e staging
b2c mrt env access-control list -p my-storefront -e staging --jsonPush a local build or deploy an existing bundle.
# 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 productionFlags:
| Flag | Description | Default |
|---|---|---|
--message, -m |
Bundle message/description | |
--build-dir, -b |
Path to build directory | build |
--ssr-only |
Server-only file patterns | ssr.js,ssr.mjs,server/**/* |
--ssr-shared |
Shared file patterns | static/**/*,client/**/* |
--node-version, -n |
Node.js version for SSR | 22.x |
--ssr-param |
SSR parameters (key=value) |
List bundles in a project.
b2c mrt bundle list --project my-storefront
b2c mrt bundle list -p my-storefront --limit 10
b2c mrt bundle list -p my-storefront --jsonView deployment history for an environment.
b2c mrt bundle history -p my-storefront -e production
b2c mrt bundle history -p my-storefront -e staging --limit 5Download a bundle artifact.
# 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-onlyTail application logs from a Managed Runtime environment in real time. Connects via WebSocket and streams log entries until interrupted with Ctrl+C.
# 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 --jsonFlags:
| Flag | Description |
|---|---|
--level |
Filter by log level (ERROR, WARN, INFO, DEBUG, etc.). Repeatable for multiple levels. |
--search, -g |
Filter entries matching a regex pattern (case-insensitive) |
--no-color |
Disable colored output |
Save MRT credentials (username and API key) to the ~/.mobify file. Prompts for confirmation before overwriting an existing file.
# 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.comFlags:
| Flag | Description |
|---|---|
--user |
MRT username (email). Required. |
--api-key |
MRT API key. Required. |
--cloud-origin |
MRT cloud origin URL. Determines the credentials file path (e.g., ~/.mobify--<hostname>). |
--credentials-file |
Explicit path to credentials file (overrides default ~/.mobify). |
--yes, -y |
Overwrite existing credentials without confirmation. |
View your MRT user profile.
b2c mrt user profile
b2c mrt user profile --jsonReset your MRT API key.
b2c mrt user api-key --resetView or update email preferences.
# View current preferences
b2c mrt user email-prefs
# Update preferences
b2c mrt user email-prefs --marketing --no-notifications# 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# 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 specific paths
b2c mrt env invalidate -p my-storefront -e production \
--path "/products/*" --path "/categories/*"