Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

CLI Reference

The b2c CLI provides commands for managing Salesforce B2C Commerce instances.

Global Flags

These flags are available on all commands that interact with B2C instances:

Instance Flags

FlagEnvironment VariableDescription
--server, -sSFCC_SERVERB2C instance hostname
--webdav-serverSFCC_WEBDAV_SERVERSecure WebDAV hostname
--code-version, -vSFCC_CODE_VERSIONCode version

Authentication Flags

FlagEnvironment VariableDescription
--client-idSFCC_CLIENT_IDOAuth client ID
--client-secretSFCC_CLIENT_SECRETOAuth client secret
--username, -uSFCC_USERNAMEUsername for Basic Auth
--password, -pSFCC_PASSWORDPassword/access key for Basic Auth

Safety Mode

Safety Mode provides protection against accidental or unwanted destructive operations. This is particularly important when using the CLI in automated environments, CI/CD pipelines, or as a tool for AI agents.

Environment VariableValuesDescription
SFCC_SAFETY_LEVELNONE (default)No restrictions
NO_DELETEBlock DELETE operations
NO_UPDATEBlock DELETE and destructive operations (reset, stop, restart)
READ_ONLYBlock all write operations (GET only)

Example:

bash
# Prevent deletions in CI/CD
export SFCC_SAFETY_LEVEL=NO_DELETE
b2c sandbox create --realm test  # ✅ Allowed
b2c sandbox delete test-id       # ❌ Blocked

# Read-only mode for reporting
export SFCC_SAFETY_LEVEL=READ_ONLY
b2c sandbox list                 # ✅ Allowed
b2c sandbox create --realm test  # ❌ Blocked

Safety Mode operates at the HTTP layer and cannot be bypassed by command-line flags. See the Security Guide for detailed information.

Other Environment Variables

Environment VariableDescription
B2C_SKIP_NEW_VERSION_CHECKSkip the new version availability check

Command Topics

Instance Operations

Services

Development

Account Management

All Account Manager commands are under the am topic:

  • b2c am users ... - User management commands
  • b2c am roles ... - Role management commands
  • b2c am orgs ... - Organization management commands
  • b2c am clients ... - API client management (list, get, create, update, delete, password)

Utilities

  • Docs Commands - Search/read Script API docs and XSD schemas, and download docs from an instance
  • Auth Commands - Authentication and token management
  • Logging - Log levels, output formats, and environment variables

Getting Help

Get help for any command:

bash
b2c --help
b2c code --help
b2c code deploy --help

Released under the Apache-2.0 License.