Install AI Tools

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

Claude

Using Claude Desktop? See Claude Desktop (Cowork) setup.

Install the plugin Recommended

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

Start a new Claude Code session. To install for the current project only, run it from your project directory with --scope project.

Manual MCP setup
bash
claude mcp add --transport stdio --scope user b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. To configure the current project only, run it from your project directory with --scope project. See Claude Code MCP setup.

Codex/ChatGPT

Using the ChatGPT desktop app (ChatGPT Work)? See ChatGPT Work setup.

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. Codex plugins also work in ChatGPT Work.

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.

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

Run:

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

Start a new Gemini CLI session. To configure the current project only, run it from your project directory with --scope project. See Gemini CLI MCP setup.

No separate skills plugins needed.

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

Auth Commands ​

Sign in and out of Account Manager, check who you're signed in as, and get access tokens for scripts.

b2c auth login ​

Sign in with your Account Manager account in the browser and stay signed in. Later commands reuse the sign-in until you run b2c auth logout. Running auth login again renews it.

Usage ​

bash
b2c auth login [--client-id <id>]

Pass the client ID with --client-id or as the CLIENTID argument. When omitted, the configured client ID (SFCC_CLIENT_ID or dw.json) is used. With no client configured, you sign in with the CLI's built-in client, the same sign-in that file, log, sandbox, and Account Manager commands use, so they won't ask again.

bash
# Sign in with your Account Manager account
b2c auth login

# With your own API client
b2c auth login --client-id your-client-id

# Deprecated implicit flow, for clients not yet migrated
b2c auth login --client-id your-client-id --auth-methods implicit

Commands that have a client secret, JWT, or access key configured don't need a sign-in.

When the saved sign-in isn't used

A command skips the saved sign-in, with a warning, when you pass --client-secret, --user-auth, or --auth-methods, or when the saved sign-in has expired. --client-id alone doesn't skip it when it matches the signed-in client.

To sign in with your own API client, register it as described in Redirect URLs. If you see a deprecation warning about the implicit flow, see Implicit Flow Deprecation.

Flags ​

FlagEnvironment VariableDescription
--client-idSFCC_CLIENT_IDClient ID (default: the configured client, then the built-in client)
--account-manager-hostSFCC_ACCOUNT_MANAGER_HOSTAccount Manager hostname
--auth-scopeSFCC_OAUTH_SCOPESOAuth scopes to request (can be repeated)
--auth-methodsSFCC_AUTH_METHODSuser (default) or implicit (deprecated)

b2c auth logout ​

Sign out of Account Manager and clear all saved sign-ins. Commands that need Account Manager ask you to sign in again; commands with a configured client secret, JWT, or access key keep working.

bash
b2c auth logout

b2c auth status ​

Show who you're signed in as and how the configured instance authenticates.

bash
# Sessions, plus how the configured instance authenticates
b2c auth status

# For a specific instance
b2c auth status --server my-sandbox.example.com

# As JSON
b2c auth status --json

When an instance is configured, the command shows how file and API requests to it authenticate and whether you're signed in, followed by your saved sign-ins. One sign-in can work for several instances. Sign out with b2c auth logout.

b2c auth client ​

Get a token with a client ID and secret (or a user's password) and save it for later commands. It's mainly for scripts migrated from sfcc-ci client:auth; see Migrating from sfcc-ci. You don't need it for CI/CD, because commands with a configured client secret get their own tokens.

The secret is not stored, and the saved token doesn't renew: when it expires, run the command again.

Usage ​

bash
# Client credentials grant (client ID + secret)
b2c auth client --client-id <id> --client-secret <secret>

# Resource owner password credentials grant (+ user credentials)
b2c auth client --client-id <id> --client-secret <secret> --user <email> --user-password <pwd>

# Force a specific grant type
b2c auth client --client-id <id> --client-secret <secret> --grant-type client_credentials

Flags ​

FlagEnvironment VariableDescription
--client-idSFCC_CLIENT_IDClient ID (required)
--client-secretSFCC_CLIENT_SECRETClient secret (required)
--grant-type / -tForce grant type: client_credentials or password
--userSFCC_OAUTH_USER_NAMEUsername for password grant
--user-passwordSFCC_OAUTH_USER_PASSWORDPassword for password grant
--auth-scopeSFCC_OAUTH_SCOPESOAuth scopes to request
--account-manager-hostSFCC_ACCOUNT_MANAGER_HOSTAccount Manager hostname

Grant type auto-detection ​

If --grant-type is not specified:

  • client_credentials is used when only --client-id and --client-secret are provided
  • password is used when --user and --user-password are also provided

Examples ​

bash
# Authenticate with client credentials from the environment
export SFCC_CLIENT_ID=my-client
export SFCC_CLIENT_SECRET=my-secret
b2c auth client

# Authenticate with user credentials
b2c auth client --client-id <id> --client-secret <secret> \
  --user admin@example.com --user-password secret123

b2c auth client token ​

Return the current stored authentication token. Compatible with the sfcc-ci client:auth:token workflow.

Usage ​

bash
# Raw token to stdout (pipe-friendly)
b2c auth client token

# Full metadata as JSON
b2c auth client token --json

Output ​

Raw token output (default):

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...

JSON output (--json):

json
{
  "accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "clientId": "my-client-id",
  "expires": "2025-01-27T12:00:00.000Z",
  "scopes": ["mail", "roles"],
  "user": "admin@example.com",
  "renewable": true
}

b2c auth token ​

Get an OAuth access token for use in scripts or other tools.

Usage ​

bash
b2c auth token

Flags ​

FlagEnvironment VariableDescription
--client-idSFCC_CLIENT_IDClient ID for OAuth
--client-secretSFCC_CLIENT_SECRETClient Secret for OAuth
--auth-scopeSFCC_OAUTH_SCOPESOAuth scopes to request (can be repeated)
--client-auth-methodSFCC_CLIENT_AUTH_METHODHow client credentials are sent: basic (default), basic-unencoded, or body. See client authentication method
--account-manager-hostSFCC_ACCOUNT_MANAGER_HOSTAccount Manager hostname (default: account.demandware.com)
--short-codeSFCC_SHORTCODESCAPI short code
--tenant-idSFCC_TENANT_IDOrganization/tenant ID
--auth-methodsSFCC_AUTH_METHODSAllowed auth methods in priority order (comma-separated): client-credentials, jwt, user, implicit, basic, api-key
--user-authSign in with your Account Manager account in the browser
--jwt-certSFCC_JWT_CERTPath to JWT certificate file (cert.pem) for JWT Bearer authentication
--jwt-keySFCC_JWT_KEYPath to JWT private key file (key.pem) for JWT Bearer authentication
--jwt-passphraseSFCC_JWT_PASSPHRASEPassphrase for encrypted JWT private key

Examples ​

bash
# Get a token with default scopes
b2c auth token --client-id xxx --client-secret yyy

# Get a token with specific scopes
b2c auth token --auth-scope sfcc.orders --auth-scope sfcc.products

# Output as JSON (useful for parsing)
b2c auth token --json

# Using environment variables
export SFCC_CLIENT_ID=my-client
export SFCC_CLIENT_SECRET=my-secret
b2c auth token

Output ​

The command outputs the access token:

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...

With --json:

json
{"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", "expires_in": 1799}

Use Cases ​

Scripting ​

Use the token in shell scripts:

bash
TOKEN=$(b2c auth token)
curl -H "Authorization: Bearer $TOKEN" https://my-instance.demandware.net/s/-/dw/data/v24_3/sites

CI/CD Pipelines ​

Get a token for use with other tools:

bash
export SFCC_TOKEN=$(b2c auth token --json | jq -r '.token')

Testing API Calls ​

Quickly get a token for testing OCAPI or SCAPI:

bash
b2c auth token | pbcopy  # macOS: copy to clipboard

Authentication Overview ​

For which commands need which credentials, see Authentication Setup. Each command page documents its requirements, including scopes.