/b2c-cli:b2c-debugfrom b2c-cli
Debugs server-side scripts on Salesforce B2C Commerce instances using the b2c CLI. Sets breakpoints, steps through code, inspects variables, and evaluates expressions in SFRA controllers, hooks, jobs, and custom APIs.
Ships in b2c-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Debug server-side scripts on Salesforce B2C Commerce instances — set breakpoints, step through code, and inspect variables in SFRA controllers, hooks, jobs, and custom APIs.
Prefer MCP debugging when available:
debug_controlresumes/steps;debug_inspectreads stacks and variables;debug_evaluateevaluates expressions. Seeskill://mcp/b2c-mcp-debugger/SKILL.mdfor the MCP workflow. Use the CLI for a requested terminal session or when MCP is unavailable.
b2c debug provides a Debug Adapter Protocol (DAP) debug adapter for IDEs. For terminal or headless use without the MCP tools, b2c debug cli also offers an interactive REPL and a JSONL --rpc mode.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli debug cli).
The CLI resolves the target instance and debugger credentials from environment variables (including project .env), the selected project-local or shared dw.json, and configuration plugins. It does not search parent directories. package.json supplies only non-sensitive defaults; ~/.mobify supplies MRT credentials, not debugger credentials. Flags like --server, --username, and --password are usually unnecessary — only pass them to override what's auto-detected.
Run b2c setup inspect to see the resolved configuration and which source provided each value (use --json for scripting; keep secrets masked unless the user explicitly requests their values). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.
For MCP debugging, pass projectDirectory to debug_start_session whenever the MCP server may have been launched outside the project. The tool uses that root to load the project's .env and default dw.json; pass configPath to select a different primary dw.json-format file and instanceName to select a named instance from the primary or shared default file. Cartridge discovery and local/server source mapping default to projectDirectory; pass cartridgeDirectory only when the cartridges live under a different root. The start call captures this information in resolution, which debug_list_sessions returns without requiring the caller to repeat it. The MCP server controls its SDAPI client identity internally, so callers do not pass a debugger client ID.
WebDAV_Manage_Customization: a username and a WebDAV File Access and UX Studio access key used as the password (not the Account Manager password)# Start interactive debugger
b2c debug cli
# Specify cartridge directory for source mapping
b2c debug cli --cartridge-path ./cartridges
# Use a custom client ID (for concurrent sessions)
b2c debug cli --client-id my-session
In the REPL:
break Cart.js:42
break Checkout.js:100 if basket.totalGrossPrice > 100
breakpoints
delete 1
stack
vars
members basket.productLineItems
eval basket.productLineItems.length
eval request.httpParameterMap.get("pid").stringValue
continue
step
stepin
stepout
threads
thread 5
frame 2
For headless scripts, agents, and programmatic integration, use --rpc mode. Commands and responses are JSONL (one JSON object per line) on stdin/stdout.
b2c debug cli --rpc
{"id": 1, "command": "set_breakpoints", "args": {"breakpoints": [{"file": "Cart.js", "line": 42}]}}
{"id": 2, "command": "get_stack"}
{"id": 3, "command": "get_variables", "args": {"scope": "local"}}
{"id": 4, "command": "evaluate", "args": {"expression": "basket.totalGrossPrice"}}
{"id": 5, "command": "continue"}
{"event": "ready", "data": {}}
{"id": 1, "result": {"breakpoints": [{"id": 1, "file": "Cart.js", "line": 42, "script_path": "/app_storefront/cartridge/controllers/Cart.js"}]}}
{"event": "thread_stopped", "data": {"thread_id": 5, "location": {"file": "Cart.js", "line": 42, "function_name": "show"}}}
| Command | Key Args | Description |
|---|---|---|
set_breakpoints | breakpoints: [{file, line, condition?}] | Replace all breakpoints |
list_breakpoints | List current breakpoints | |
continue | thread_id? | Resume halted thread |
step_over | thread_id? | Step to next line |
step_into | thread_id? | Step into function |
step_out | thread_id? | Step out of function |
get_stack | thread_id? | Get call stack |
get_variables | thread_id?, frame_index?, scope?, object_path? | Get variables |
evaluate | expression, thread_id?, frame_index? | Evaluate expression |
list_threads | List threads | |
select_thread | thread_id | Switch thread |
select_frame | index | Switch frame |
For VS Code and other DAP-compatible IDEs:
b2c debug
This starts a DAP debug adapter over stdio, used by IDE launch configurations.
b2c-cli:b2c-logs - Retrieve server logs for investigating errors found during debuggingb2c-cli:b2c-code - Deploy code changes before debuggingb2c-cli:b2c-config - Verify instance configuration and credentialsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
28 skills in this plugin
/b2c-amManage Account Manager resources including API clients, users, roles, and organizations. Use this skill whenever the user needs to create or update API clients, onboard or offboard developers, assign Account Manager roles scoped to tenants, audit user permissions, look up organizations, or provision API clients for CI/CD pipelines. Also use when managing AM role assignments or querying Account Manager data — even if they just say "add a new developer" or "set up an API client". For instance-level Business Manager administration (BM roles, BM users, BM access keys, BM whoami), defer to the `b2c-cli:b2c-bm-users-roles` skill./b2c-bm-users-rolesManage Business Manager users, access roles, role permissions, and per-user access keys on a B2C Commerce instance using the b2c CLI. Use this skill whenever the user needs to list or search BM users on a sandbox or production instance, identify which BM user an OAuth token resolves to ("whoami"), assign or revoke instance-level access roles, edit role permissions, look up a user's WebDAV / OCAPI / Storefront access key, or rotate access keys for SSO-managed users. Also use when the user asks "what's my BM login on sandbox X", "rotate my WebDAV password", "how do I make a custom BM role", "audit BM users on this instance", or "delete a stale BM user from a sandbox".npx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin b2c-cliOther plugins' skills for the same job