b2c-config
B2C Config Skill
The B2C CLI (@salesforce/b2c-cli) is a command-line tool for Salesforce B2C Commerce development. It provides commands organized by topic: auth, code, webdav, sandbox, mrt, scapi, slas, ecdn, job, logs, sites, content, cip, setup, and more. Use b2c --help or b2c <topic> --help for a full list.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli setup inspect).
How the CLI Discovers Configuration (read this first)
The CLI automatically detects instance hostname, credentials, tenant ID, MRT API key, and other settings from multiple sources. You usually do not need to pass --server, --client-id, --client-secret, --username, --password, --tenant-id, --short-code, or --api-key as flags — the CLI picks them up from the environment or config files.
Sources, in resolution order (highest priority first):
- CLI flags and environment variables — explicit values always win. Includes
.envfiles in the current project directory (auto-loaded). - Plugin sources (high priority) — custom configuration plugins (e.g., secret managers).
dw.json— searched starting at the current directory and walking up the directory tree. Supports a single instance or aconfigs[]array withactive: true/-i <name>selection.~/.mobify— home-directory file (MRT API key only).- Plugin sources (low priority).
package.jsonunder theb2ckey — non-sensitive project defaults (e.g.,shortCode,clientId,mrtProject). Sensitive fields likeclientSecret/passwordare intentionally not allowed here.