home / skills / salesforcecommercecloud / b2c-developer-tooling / b2c-sites

This skill helps you list and inspect storefront sites on Salesforce B2C Commerce using the b2c cli, enabling quick site context and configuration checks.

npx playbooks add skill salesforcecommercecloud/b2c-developer-tooling --skill b2c-sites

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.0 KB
---
name: b2c-sites
description: List and inspect storefront sites on B2C Commerce (SFCC/Demandware) instances with the b2c cli. Use when finding site IDs, checking site configuration, or listing available sites. Helpful for determining site context when running other commands.
---

# B2C Sites Skill

Use the `b2c` CLI plugin to list and inspect storefront sites on Salesforce B2C Commerce instances.

> **Tip:** If `b2c` is not installed globally, use `npx @salesforce/b2c-cli` instead (e.g., `npx @salesforce/b2c-cli sites list`).

## Examples

### List Sites

```bash
# list all sites on the configured instance
b2c sites list

# list sites on a specific server
b2c sites list --server my-sandbox.demandware.net

# list sites with JSON output (useful for parsing/automation)
b2c sites list --json

# use a specific instance from config
b2c sites list --instance production

# enable debug logging
b2c sites list --debug
```

### More Commands

See `b2c sites --help` for a full list of available commands and options in the `sites` topic.

Overview

This skill lets you list and inspect storefront sites on Salesforce B2C Commerce (SFCC/Demandware) instances using the b2c CLI. It helps you find site IDs, review site configuration, and confirm which sites are available on a given instance. Use it to determine the correct site context before running other B2C CLI commands or automation scripts.

How this skill works

The skill invokes the b2c CLI plugin to query a configured B2C Commerce instance and returns a list of sites and their details. It supports selecting instances or servers from your local b2c config, JSON output for automation, and debug logging for troubleshooting. If the b2c plugin is not installed globally, it works with npx to run the CLI without global installation.

When to use it

  • When you need the site ID to run other B2C commands or scripts
  • When validating site configuration across sandboxes and production
  • When automating deployments or integrations and you need machine-readable site data
  • When troubleshooting which storefronts are enabled or available on an instance
  • When confirming instance-to-site mapping before making changes

Best practices

  • Run b2c sites list with --json for programmatic consumption in CI/CD or scripts
  • Specify --instance or --server to target the correct environment and avoid accidental queries against production
  • Use --debug when you encounter connectivity or authentication issues to see detailed CLI logs
  • Keep your b2c CLI config up to date with named instances to speed workflows and reduce manual server typing
  • Filter or pipe JSON output in scripts rather than relying on formatted console output

Example use cases

  • Script that retrieves site IDs and injects them into deployment or import jobs
  • Audit script that lists all sites across several instances and compares configuration flags
  • Local troubleshooting to confirm whether a storefront exists on a sandbox before testing changes
  • CI pipeline step that fetches site metadata (in JSON) to decide downstream tasks
  • Quick manual check to confirm which site corresponds to a given hostname

FAQ

Do I need a global b2c CLI install to use this skill?

No. If b2c is not installed globally you can run the commands via npx, for example: npx @salesforce/b2c-cli sites list.

Can I get machine-readable output for automation?

Yes. Use the --json flag to produce JSON output suitable for scripts and CI pipelines.