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

This skill helps you manage Salesforce B2C On-demand sandboxes using the b2c CLI, including create, start, stop, and delete with safeguards.

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

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

Files (1)
SKILL.md
3.3 KB
---
name: b2c-sandbox
description: Create and manage (B2C/SFCC/Demandware) on-demand sandboxes (ODS) with the b2c cli. Use when provisioning development instances, starting/stopping sandboxes, checking sandbox status, or managing sandbox lifecycle.
---

# B2C Sandbox Skill

Only create or delete sandboxes when explicitly requested. Always confirm destructive actions.

Use the `b2c` CLI plugin to manage Salesforce B2C Commerce On-demand sandboxes (ODS). Only create or delete a sandbox if explicitly asked as this may be a billable or destructible action.

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

> **Alias:** The `ods` prefix is still supported as a backward-compatible alias (e.g., `b2c ods list` works the same as `b2c sandbox list`).

## Sandbox ID Formats

Commands that operate on a specific sandbox accept two ID formats:

- **UUID**: The full sandbox UUID (e.g., `abc12345-1234-1234-1234-abc123456789`)
- **Realm-instance**: The realm-instance format (e.g., `zzzv-123` or `zzzv_123`)

The realm-instance format uses the 4-character realm code followed by a dash or underscore and the instance number. When using a realm-instance format, the CLI will automatically look up the corresponding UUID.

## Examples

### List Sandboxes

```bash
b2c sandbox list

# for realm zzpq with JSON output
b2c sandbox list --realm zzpq --json

# filter by status and those created by a specific user, only print the columns id,state,hostname
b2c sandbox list --filter-params 'state=started,creating&[email protected]' --realm zzpq --columns id,state,hostname
```

### Create Sandbox

Only create a sandbox if explicitly asked as this may be a billable action.

```bash
# create in realm zzpq with 4 hour TTL (0 = infinite); json output and wait for completion (this may take 5-10 minutes; timeout is 10 minutes)
b2c sandbox create --realm zzpq --ttl 4 --json --wait

# create in realm zzpq with large profile (medium is default)
b2c sandbox create --realm zzpq --profile large

# create without automatic OCAPI/WebDAV permissions
b2c sandbox create --realm zzpq --no-set-permissions

# use a different client ID for default permissions
b2c sandbox create --realm zzpq --permissions-client-id my-other-client

# custom OCAPI settings (replaces defaults)
b2c sandbox create --realm zzpq --ocapi-settings '[{"client_id":"my-client","resources":[{"resource_id":"/code_versions","methods":["get"]}]}]'

# with start/stop scheduler
b2c sandbox create --realm zzpq --start-scheduler '{"weekdays":["MONDAY","TUESDAY"],"time":"08:00:00Z"}' --stop-scheduler '{"weekdays":["MONDAY","TUESDAY"],"time":"19:00:00Z"}'

# get full log trace output to debug
b2c sandbox create --realm zzpq --log-level trace
```

### Get/Start/Stop/Restart/Delete Sandbox

Commands that operate on a specific sandbox support both UUID and realm-instance formats:

```bash
# Using UUID
b2c sandbox get abc12345-1234-1234-1234-abc123456789
b2c sandbox start abc12345-1234-1234-1234-abc123456789
b2c sandbox stop abc12345-1234-1234-1234-abc123456789

# Using realm-instance format
b2c sandbox get zzzv-123
b2c sandbox start zzzv_123
b2c sandbox stop zzzv-123
b2c sandbox restart zzzv-123
b2c sandbox delete zzzv-123 --force
```

### More Commands

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

Overview

This skill provides commands to create, manage, and inspect Salesforce B2C Commerce on-demand sandboxes (ODS) using the b2c CLI. It streamlines provisioning development instances, controlling lifecycle actions (start/stop/restart/delete), and checking sandbox status. The skill supports both UUID and realm-instance ID formats and includes options for permissions, OCAPI settings, TTL, and schedulers.

How this skill works

The skill issues b2c CLI sandbox commands to list, create, inspect, start, stop, restart, and delete sandboxes. It accepts full UUIDs or realm-instance identifiers (realm_code-instanceNumber); when given the realm-instance format the CLI resolves the corresponding UUID automatically. Destructive actions (create/delete) require explicit user confirmation and may be billable.

When to use it

  • Provision a new development sandbox for testing or feature work.
  • Start or stop sandboxes to control costs or resource usage.
  • Restart a sandbox to recover from transient issues.
  • Check sandbox state, hostname, or other metadata before deployments.
  • Delete expired or unused sandboxes after confirming backups or exports.

Best practices

  • Only create or delete sandboxes when explicitly requested to avoid unexpected charges or data loss.
  • Prefer realm-instance shorthand (zzzz-123) for quick lookups; the CLI will map to UUIDs automatically.
  • Use --json and --wait when automating pipelines to capture structured output and block until completion.
  • Configure permissions and OCAPI settings explicitly if your integration requires custom access.
  • Use TTL and scheduler options to limit run time and automate start/stop windows to save costs.

Example use cases

  • Create a medium sandbox for a short-lived feature branch with a 4-hour TTL: b2c sandbox create --realm zzpq --ttl 4 --wait --json.
  • Start an existing sandbox before running integration tests: b2c sandbox start zzzv-123.
  • Stop unused sandboxes overnight via the start/stop scheduler to reduce charges.
  • List sandboxes filtered by state and creator to audit active development instances.
  • Delete a sandbox after a release, confirming the action to prevent data loss: b2c sandbox delete zzzv-123 --force.

FAQ

Can I use short realm-instance IDs instead of full UUIDs?

Yes. The CLI accepts realm-instance formats (realmcode-number or realmcode_number) and resolves them to UUIDs automatically.

Are sandbox creations and deletions billable?

They can be. Only perform create or delete operations when explicitly requested and confirm destructive actions to avoid unexpected charges.