b2c-mrt
B2C MRT Skill
Use the b2c CLI to manage Managed Runtime (MRT) projects, environments, bundles, and deployments for PWA Kit storefronts.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli mrt bundle deploy).
Configuration & Authentication
The CLI resolves the MRT API key from MRT_API_KEY (or SFCC_MRT_API_KEY), dw.json, ~/.mobify, or configuration plugins. Project and environment defaults can also come from package.json under b2c (mrtProject, mrtEnvironment) or environment variables. package.json cannot supply API keys or other secrets. Flags like --api-key, -p, and -e are usually unnecessary when defaults are configured — only pass them to override.
Run b2c setup inspect to see the resolved configuration and which source provided each value (use --json for scripting; keep secrets masked unless the user explicitly requests their values). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.
MRT Backends (legacy vs SCAPI)
Most MRT commands run against the legacy MRT Cloud API (API key). Several commands can also run over the SCAPI MRT backend: mrt bundle history, mrt bundle list, mrt bundle deploy (both the local-build push and deploying an existing <bundleId>), and the mrt env var family (list / set / push / delete). Choose with --mrt-backend (MRT_BACKEND / SFCC_MRT_BACKEND, or mrtBackend in dw.json):
auto(default) — use SCAPI when it's configured (--short-code+--tenant-id+ client-credentials or JWT Bearer auth), otherwise legacy. Falls back to legacy on safe pre-execution errors. Each command requests its own scopes: bundle commands usesfcc.storefront.deployments[.rw]; env var commands usesfcc.storefront.environments[.rw](reads accept either tier, writes require.rw).legacy— always the MRT Cloud API.scapi— always SCAPI, with no fallback; errors if prerequisites are missing. Also errors on unsupported commands (every MRT command except the bundle and env var commands above).