npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@salesforce/b2c-cli

v1.11.0

Published

A Salesforce B2C Commerce CLI

Readme

Salesforce Agentforce Commerce B2C CLI

oclif

A command-line interface for Salesforce Agentforce Commerce (formerly Commerce Cloud) B2C instances and platform services.

Installation

npm (Recommended)

npm install -g @salesforce/b2c-cli

Homebrew (macOS/Linux)

brew tap SalesforceCommerceCloud/tools
brew install b2c-cli

GitHub Release Tarball

For pre-release versions not yet published to npm, download the tarball from GitHub Releases and install:

npm install -g ./salesforce-b2c-cli-<version>.tgz

Usage

b2c COMMAND
b2c --help [COMMAND]

Configuration

The CLI can be configured via command-line flags or environment variables:

See the documentation for full configuration options: https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/configuration.html

| Environment Variable | Description | |---------------------|-------------| | SFCC_SERVER | B2C instance hostname | | SFCC_CODE_VERSION | Code version | | SFCC_CLIENT_ID | OAuth client ID | | SFCC_CLIENT_SECRET | OAuth client secret | | SFCC_USERNAME | Username for WebDAV | | SFCC_PASSWORD | Password/access key for WebDAV |

Commands

Code Management

Deploy and manage code versions on B2C Commerce instances.

# List code versions
b2c code list

# Deploy cartridges
b2c code deploy --server my-sandbox.demandware.net --code-version v1

# Watch and sync changes during development
b2c code watch

# Activate a code version
b2c code activate v1

# Delete a code version
b2c code delete old-version

Jobs and Site Import/Export

Execute jobs and manage site archives.

# Run a job
b2c job run my-job --wait

# Import a site archive
b2c job import ./site-data.zip

# Export site data
b2c job export --global-data meta_data

# Search job executions
b2c job search --status RUNNING

On-Demand Sandboxes (ODS)

Create and manage on-demand sandboxes.

# List sandboxes
b2c ods list

# Create a new sandbox
b2c ods create

# Get sandbox details
b2c ods get <sandbox-id>

# Start/stop/restart a sandbox
b2c ods start <sandbox-id>
b2c ods stop <sandbox-id>
b2c ods restart <sandbox-id>

# Delete a sandbox
b2c ods delete <sandbox-id>

Managed Runtime (MRT)

Manage MRT projects, environments, and deployments.

# Push a bundle
b2c mrt push --project my-storefront --environment staging

# Create an environment
b2c mrt env create staging --project my-storefront --name "Staging"

# Manage environment variables
b2c mrt env var list -p my-project -e staging
b2c mrt env var set API_KEY=secret -p my-project -e staging
b2c mrt env var delete OLD_KEY -p my-project -e staging

SLAS Client Management

Manage Shopper Login and API Security (SLAS) clients.

# List SLAS clients
b2c slas client list

# Create a client
b2c slas client create --name "My App"

# Get client details
b2c slas client get <client-id>

# Update a client
b2c slas client update <client-id>

# Delete a client
b2c slas client delete <client-id>

WebDAV Operations

File operations on instance WebDAV.

# List files
b2c webdav ls /cartridges

# Upload/download files
b2c webdav put local-file.txt /remote/path/
b2c webdav get /remote/path/file.txt

# Create directory
b2c webdav mkdir /remote/new-dir

# Delete files
b2c webdav rm /remote/path/file.txt

# Archive operations
b2c webdav zip /remote/dir archive.zip
b2c webdav unzip /remote/archive.zip

Sites

List and inspect storefront sites.

b2c sites list

User Management (Account Manager)

Manage users in Account Manager.

# List users with pagination
b2c am users list --page 0 --size 20

# Get user details by email
b2c am users get [email protected]

# Create a new user
b2c am users create --org org-id --mail [email protected] --first-name John --last-name Doe

# Update a user
b2c am users update [email protected] --first-name Jane

# Reset a user to INITIAL state
b2c am users reset [email protected]

# Delete (disable) a user
b2c am users delete [email protected]

Role Management (Account Manager)

Manage roles and role assignments in Account Manager.

# List roles with pagination
b2c am roles list --page 0 --size 20 --target-type User

# Get role details
b2c am roles get bm-admin

# Grant a role to a user
b2c am roles grant [email protected] --role bm-admin

# Grant a role with tenant scope
b2c am roles grant [email protected] --role bm-admin --scope "tenant1,tenant2"

# Revoke a role from a user
b2c am roles revoke [email protected] --role bm-admin

Organization Management (Account Manager)

Manage organizations in Account Manager.

# List organizations with pagination
b2c am orgs list --page 0 --size 25

# List all organizations
b2c am orgs list --all

# Get organization details by ID
b2c am orgs get org-123

# Get organization details by name
b2c am orgs get "My Organization"

# Get audit logs for an organization
b2c am orgs audit org-123

# Get audit logs with extended columns
b2c am orgs audit org-123 --extended

Authentication

Get OAuth tokens for scripting.

b2c auth token

Logging

Control log output with flags or environment variables:

# Debug logging
b2c code deploy --log-level debug
b2c code deploy -D  # shorthand

# JSON output for scripting
b2c code deploy --json

See the documentation for more logging options.

Documentation

Full documentation is available at: https://salesforcecommercecloud.github.io/b2c-developer-tooling/

License

This project is licensed under the Apache License 2.0. See LICENSE.txt for full details.