Note
This project is currently in Developer Preview. Not all features are implemented, and the API may change in future releases. Please provide feedback via GitHub issues.
A command-line interface for Salesforce Commerce Cloud B2C.
npm install -g @salesforce/b2c-clib2c COMMAND
b2c --help [COMMAND]The CLI can be configured via command-line flags or environment variables:
| Environment Variable | Description |
|---|---|
SFCC_SERVER |
B2C instance hostname |
SFCC_CODE_VERSION |
Code version |
SFCC_CLIENT_ID |
OAuth client ID |
SFCC_CLIENT_SECRET |
OAuth client secret |
SFCC_USERNAME |
Username for WebDAV |
SFCC_PASSWORD |
Password/access key for WebDAV |
Deploy and manage code versions on B2C Commerce instances.
# List code versions
b2c code list
# Deploy cartridges
b2c code deploy --server my-sandbox.demandware.net --code-version v1
# Watch and sync changes during development
b2c code watch
# Activate a code version
b2c code activate v1
# Delete a code version
b2c code delete old-versionExecute jobs and manage site archives.
# Run a job
b2c job run my-job --wait
# Import a site archive
b2c job import ./site-data.zip
# Export site data
b2c job export --global-data meta_data
# Search job executions
b2c job search --status RUNNINGCreate and manage on-demand sandboxes.
# List sandboxes
b2c ods list
# Create a new sandbox
b2c ods create
# Get sandbox details
b2c ods get <sandbox-id>
# Start/stop/restart a sandbox
b2c ods start <sandbox-id>
b2c ods stop <sandbox-id>
b2c ods restart <sandbox-id>
# Delete a sandbox
b2c ods delete <sandbox-id>Manage MRT projects, environments, and deployments.
# Push a bundle
b2c mrt push --project my-storefront --environment staging
# Create an environment
b2c mrt env create staging --project my-storefront --name "Staging"
# Manage environment variables
b2c mrt env var list -p my-project -e staging
b2c mrt env var set API_KEY=secret -p my-project -e staging
b2c mrt env var delete OLD_KEY -p my-project -e stagingManage Shopper Login and API Security (SLAS) clients.
# List SLAS clients
b2c slas client list
# Create a client
b2c slas client create --name "My App"
# Get client details
b2c slas client get <client-id>
# Update a client
b2c slas client update <client-id>
# Delete a client
b2c slas client delete <client-id>File operations on instance WebDAV.
# List files
b2c webdav ls /cartridges
# Upload/download files
b2c webdav put local-file.txt /remote/path/
b2c webdav get /remote/path/file.txt
# Create directory
b2c webdav mkdir /remote/new-dir
# Delete files
b2c webdav rm /remote/path/file.txt
# Archive operations
b2c webdav zip /remote/dir archive.zip
b2c webdav unzip /remote/archive.zipList and inspect storefront sites.
b2c sites listGet OAuth tokens for scripting.
b2c auth tokenControl log output with flags or environment variables:
# Debug logging
b2c code deploy --log-level debug
b2c code deploy -D # shorthand
# JSON output for scripting
b2c code deploy --jsonSee the documentation for more logging options.
Full documentation is available at: https://salesforcecommercecloud.github.io/b2c-developer-tooling/
This project is licensed under the Apache License 2.0. See LICENSE.txt for full details.
This project is currently in Developer Preview and is provided "as-is" without warranty of any kind. It is not yet generally available (GA) and should not be used in production environments. Features, APIs, and functionality may change without notice in future releases.