b2c-config
Installation
SKILL.md
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).
Authentication
Most commands that interact with a B2C Commerce instance require authentication. The CLI supports several methods:
- Client credentials (API client): Configure
clientIdandclientSecretin dw.json or environment variables. This is the default for automated/CI use. - Browser-based (implicit OAuth): Use
--user-authon any OAuth-enabled command to authenticate interactively via the browser. This opens Account Manager in your default browser for login. - Basic auth: Configure
usernameandpasswordfor WebDAV operations. - Stateful sessions: Use
b2c auth loginfor persistent browser-based login sessions.
--user-auth Flag
Many commands support --user-auth to use browser-based implicit OAuth instead of client credentials. This is useful when: