b2c-debug
B2C Debug Skill
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 the MCP diagnostics tools when available. If the B2C DX MCP server is installed (tools named
debug_start_session,debug_set_breakpoints,debug_wait_for_stop,debug_capture_at_breakpoint, etc.), use them instead of the RPC-basedb2c debug cli --rpcworkflow. The MCP tools manage session state for you, return structured JSON, and support a non-blocking poll workflow (debug_list_sessions/debug_wait_for_stop) that is far more reliable for agents than driving JSONL over stdio. Only fall back tob2c debug cli(REPL or--rpc) when the MCP server is not installed, or when a human wants an interactive terminal session.
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).
Configuration & Authentication
The CLI auto-discovers the target instance and credentials from SFCC_* environment variables, dw.json in the current or parent directories, ~/.mobify, package.json, and configuration plugins. 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, --unmask to reveal secrets). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.