Install AI Tools

B2C Commerce tools, documentation, and skills for your assistant.

Claude

Install the plugin Recommended

bash
claude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
claude plugin install b2c-dx-mcp@b2c-developer-tooling --scope project

Start a new Claude Code session in your project. Use --scope user instead for all projects.

Manual MCP setup

From your project directory:

bash
claude mcp add --transport stdio --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. Use --scope user instead for all projects. See Claude Code MCP setup.

Claude Desktop setup

Codex

Install the plugin Recommended

bash
codex plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
codex plugin add b2c-dx-mcp@b2c-developer-tooling

Start a new Codex session in your project. This setup also works with the Codex IDE extension and the ChatGPT Work desktop app.

Manual MCP setup
bash
codex mcp add b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Or add this to ~/.codex/config.toml (or $CODEX_HOME/config.toml if customized):

toml
[mcp_servers.b2c-dx-mcp]
command = "npx"
args = ["-y", "@salesforce/b2c-dx-mcp@latest"]

Start a new session. See Codex MCP configuration.

ChatGPT online setup

VS Code

Install the plugin Recommended

  1. Open the Command Palette (Cmd/Ctrl+Shift+P) and run Chat: Install Plugin from Source.
  2. Enter SalesforceCommerceCloud/b2c-developer-tooling.
  3. Select b2c-dx-mcp and follow the installation prompts.
  4. Start a new chat in GitHub Copilot.
Manual MCP setup

Add this to .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "b2c-dx-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

See VS Code MCP setup.

Copilot CLI setup

Cursor

Reload the MCP server in Cursor after installation.

Manual MCP setup

Add this to .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "b2c-dx-mcp": {
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

For all projects, use ~/.cursor/mcp.json instead.

See Cursor's MCP documentation.

OpenCode

Add this to opencode.json in your project:

json
{
  "mcp": {
    "b2c-dx-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@salesforce/b2c-dx-mcp@latest"],
      "enabled": true
    }
  }
}

Restart OpenCode. For all projects, use ~/.config/opencode/opencode.json. See OpenCode MCP setup.

Gemini

From your project directory, run:

bash
gemini mcp add --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new Gemini CLI session. Use --scope user instead for all projects. See Gemini CLI MCP setup.

No separate skills plugins needed.

Other clients and manual setup →
Skip to content
View as Markdown
View as Markdown

Sites Commands

Commands for managing sites on B2C Commerce instances.

Authentication

Site reads and cartridge-path writes run over SCAPI (the site/sites API). Configure shortCode, tenantId, and sfcc.sites / sfcc.sites.rw on your API client to use it.

Cartridge-path writes (add/remove/set) require sfcc.sites.rw. In auto mode they temporarily fall back to the OCAPI Data API and then site archive import/export when direct API access is unavailable. The archive path requires job execution permissions for sfcc-site-archive-import and WebDAV write access to Impex/.

bash
export SFCC_CLIENT_ID=your-client-id
export SFCC_CLIENT_SECRET=your-client-secret
export SFCC_TENANT_ID=zzxy_prd
export SFCC_SHORTCODE=kv7kzm78
Legacy OCAPI backend (deprecated)

OCAPI is deprecated and disabled on newer instances. Commands default to --api-backend auto, falling back on safe SCAPI capability/auth/request rejections; force a backend with --api-backend scapi|ocapi. For the OCAPI path, grant GET on /sites and /sites/*, and POST/PUT/DELETE on /sites/*/cartridges for cartridge-path writes.

For complete setup instructions, see the Authentication Guide.


b2c sites list

List sites on a B2C Commerce instance.

B2C CLI listing storefront site IDs and their online status.

Usage

bash
b2c sites list

Flags

Uses global instance and authentication flags.

Examples

bash
# List sites on an instance
b2c sites list --server my-sandbox.demandware.net --client-id xxx --client-secret yyy

# Using environment variables
export SFCC_SERVER=my-sandbox.demandware.net
export SFCC_CLIENT_ID=your-client-id
export SFCC_CLIENT_SECRET=your-client-secret
b2c sites list

Output

The command displays a list of sites with their:

  • Site ID
  • Display name
  • Status

Example output:

Found 2 site(s):

  RefArch
    Display Name: Reference Architecture
    Status: online

  SiteGenesis
    Display Name: Site Genesis
    Status: online

Cartridge Commands

Manage the cartridge path for a site — the ordered list of cartridges that are active on a storefront. Use sites cartridges or the singular alias sites cartridge.

Business Manager

Use the --bm flag as a shorthand for --site-id Sites-Site to manage the Business Manager cartridge path. BM updates always use site archive import since OCAPI direct updates are not supported for the BM site.

Automatic Fallback

If OCAPI permissions for /sites/*/cartridges are not available, cartridge commands automatically fall back to site archive import/export. This means the commands work even without specific cartridge OCAPI permissions, as long as job execution and WebDAV access are configured.


b2c sites cartridges list

List the cartridge path for a site.

Usage

bash
b2c sites cartridges list --site-id <site-id>
b2c sites cartridges list --bm

Flags

FlagDescription
--site-id <id>Site ID (e.g. RefArch)
--bmUse Business Manager site (Sites-Site)
--jsonOutput as JSON

One of --site-id or --bm is required.

Examples

bash
# List cartridge path for a storefront site
b2c sites cartridges list --site-id RefArch

# List Business Manager cartridge path
b2c sites cartridges list --bm

# JSON output for automation
b2c sites cartridges list --site-id RefArch --json

b2c sites cartridges add

Add a cartridge to a site's cartridge path.

Usage

bash
b2c sites cartridges add <cartridge> --site-id <site-id> [--position <position>] [--target <target>]

Arguments

ArgumentDescription
cartridgeName of the cartridge to add

Flags

FlagDescription
--site-id <id>Site ID (e.g. RefArch)
--bmUse Business Manager site (Sites-Site)
--position <pos>Position: first (default), last, before, after
--target <name>Target cartridge (required when position is before or after)
--jsonOutput as JSON

Examples

bash
# Add to beginning of path (default)
b2c sites cartridges add plugin_applepay --site-id RefArch

# Add to end
b2c sites cartridges add plugin_applepay --site-id RefArch --position last

# Add after a specific cartridge
b2c sites cartridges add plugin_applepay --site-id RefArch --position after --target app_storefront_base

# Add to Business Manager
b2c sites cartridges add bm_extension --bm --position first

b2c sites cartridges remove

Remove a cartridge from a site's cartridge path.

Destructive Operation

This command modifies the site cartridge path. It is blocked in safe mode — set the SFCC_SAFETY_LEVEL=NONE environment variable or update the "safety" section in your dw.json configuration file to allow it.

Usage

bash
b2c sites cartridges remove <cartridge> --site-id <site-id>

Arguments

ArgumentDescription
cartridgeName of the cartridge to remove

Flags

FlagDescription
--site-id <id>Site ID (e.g. RefArch)
--bmUse Business Manager site (Sites-Site)
--jsonOutput as JSON

Examples

bash
b2c sites cartridges remove old_cartridge --site-id RefArch
b2c sites cartridges remove bm_extension --bm

b2c sites cartridges set

Replace the entire cartridge path for a site.

Destructive Operation

This command replaces the entire cartridge path. It is blocked in safe mode — set the SFCC_SAFETY_LEVEL=NONE environment variable or configure "safety": {"level": "NONE"} in your dw.json to allow it.

Usage

bash
b2c sites cartridges set <cartridges> --site-id <site-id>

Arguments

ArgumentDescription
cartridgesNew cartridge path (colon-separated, e.g. cart1:cart2:cart3)

Flags

FlagDescription
--site-id <id>Site ID (e.g. RefArch)
--bmUse Business Manager site (Sites-Site)
--jsonOutput as JSON

Examples

bash
b2c sites cartridges set "app_storefront_base:plugin_applepay:plugin_wishlists" --site-id RefArch
b2c sites cartridges set "bm_ext1:bm_ext2" --bm