Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

Migrating from sfcc-ci

sfcc-ci is deprecated. The @salesforce/b2c-cli package is its replacement, providing the same core capabilities plus additional features.

If you haven't installed the B2C CLI yet, see the Installation guide.

Authentication

The biggest change from sfcc-ci is how authentication works by default.

sfcc-ci uses stateful auth — you run sfcc-ci client:auth once to store a token, then all subsequent commands use it automatically.

b2c-cli defaults to stateless auth — credentials are provided per-command via environment variables or flags. This is more explicit and works better in CI/CD pipelines where each step is independent.

Stateful Auth (sfcc-ci Compatible)

For users who prefer the sfcc-ci workflow, the B2C CLI includes a compatibility layer that mirrors the stateful auth pattern:

sfcc-cib2c-cli
sfcc-ci client:auth <id> <secret>b2c client:auth --client-id <id> --client-secret <secret>
sfcc-ci client:auth:renewb2c client:auth:renew
sfcc-ci client:auth:tokenb2c client:auth:token
sfcc-ci auth:login [client]b2c auth:login [client]
sfcc-ci auth:logoutb2c auth:logout

The colon-separated forms are aliases — the canonical commands are b2c auth client, b2c auth login, etc.

After authenticating, subsequent commands automatically use the stored token when it is valid. See Auth Commands for full details.

For automation and CI/CD, set credentials as environment variables and the CLI uses them directly — no separate auth step needed:

bash
export SFCC_CLIENT_ID=my-client-id
export SFCC_CLIENT_SECRET=my-secret

# Commands authenticate automatically
b2c code list
b2c sandbox list

See Authentication Setup for the full guide including Account Manager configuration, OCAPI permissions, and WebDAV access.

TIP

Use stateless auth (environment variables) for CI/CD pipelines and stateful auth (b2c auth client or b2c auth login) for local development.

Command Mapping

The B2C CLI's canonical syntax uses spaces instead of colons (e.g., b2c code deploy), but for the most commonly used commands, sfcc-ci's colon-separated syntax is also accepted (e.g., b2c code:deploy). The tables below show the drop-in colon form where available.

Code Management

sfcc-cib2c-cliNotes
sfcc-ci code:listb2c code:list
sfcc-ci code:deploy <archive>b2c code:deployDeploys from local cartridge source
sfcc-ci code:activate <version>b2c code:activate <version>
sfcc-ci code:deleteb2c code:delete

Instance / Data

sfcc-cib2c-cliNotes
sfcc-ci instance:upload <file>b2c webdav put <file> <remote-path>See WebDAV commands
sfcc-ci instance:import <archive>b2c content import <archive>Or b2c job run sfcc-site-archive-import
sfcc-ci instance:exportb2c content exportSee Content commands

Jobs

sfcc-cib2c-cliNotes
sfcc-ci job:run <id>b2c job:run <id>Supports --wait and --timeout
sfcc-ci job:status <id> <exec>b2c job wait <id> --execution-id <exec>

Sandbox

Sandbox commands map directly, with spaces replacing colons:

sfcc-cib2c-cli
sfcc-ci sandbox:listb2c sandbox list
sfcc-ci sandbox:createb2c sandbox create
sfcc-ci sandbox:getb2c sandbox get
sfcc-ci sandbox:deleteb2c sandbox delete
sfcc-ci sandbox:startb2c sandbox start
sfcc-ci sandbox:stopb2c sandbox stop
sfcc-ci sandbox:restartb2c sandbox restart
sfcc-ci sandbox:resetb2c sandbox reset
sfcc-ci sandbox:alias:listb2c sandbox alias list
sfcc-ci sandbox:alias:addb2c sandbox alias create
sfcc-ci sandbox:alias:deleteb2c sandbox alias delete

SLAS

sfcc-cib2c-cli
sfcc-ci slas:client:addb2c slas client create
sfcc-ci slas:client:getb2c slas client get
sfcc-ci slas:client:listb2c slas client list
sfcc-ci slas:client:deleteb2c slas client delete

User / Org / Role (Account Manager)

Account Manager operations are under the am topic:

sfcc-cib2c-cli
sfcc-ci user:listb2c am users list
sfcc-ci user:createb2c am users create
sfcc-ci user:deleteb2c am users delete
sfcc-ci org:listb2c am orgs list
sfcc-ci role:listb2c am roles list
sfcc-ci role:grantb2c am roles grant
sfcc-ci role:revokeb2c am roles revoke

Environment Variables

Most sfcc-ci environment variables are supported directly or through backward-compatible aliases. Existing CI/CD configurations using these variables will continue to work.

sfcc-cib2c-cliStatus
SFCC_OAUTH_CLIENT_IDSFCC_CLIENT_IDBoth accepted
SFCC_OAUTH_CLIENT_SECRETSFCC_CLIENT_SECRETBoth accepted
SFCC_LOGIN_URLSFCC_ACCOUNT_MANAGER_HOSTBoth accepted
SFCC_OAUTH_USER_NAMESFCC_OAUTH_USER_NAMESame
SFCC_OAUTH_USER_PASSWORDSFCC_OAUTH_USER_PASSWORDSame
SFCC_SANDBOX_API_HOSTSFCC_SANDBOX_API_HOSTSame
SFCC_SCAPI_SHORTCODESFCC_SHORTCODERenamed
SFCC_SCAPI_TENANTIDSFCC_TENANT_IDRenamed

The B2C CLI also introduces new environment variables not present in sfcc-ci:

VariablePurpose
SFCC_SERVERB2C instance hostname
SFCC_USERNAMEWebDAV / Basic auth username
SFCC_PASSWORDWebDAV / Basic auth password
SFCC_CODE_VERSIONCode version for deployments
SFCC_AUTH_METHODSAuth method priority (comma-separated)

See the Configuration guide for the complete list of environment variables and configuration sources.

Configuration

The dw.json configuration file is fully supported. Fields are normalized to camelCase (e.g., client-id in the file becomes clientId internally), but both kebab-case and camelCase are accepted.

The B2C CLI adds a layered configuration system with a clear priority order:

  1. CLI flags (highest priority)
  2. Environment variables (SFCC_*)
  3. dw.json in the current directory
  4. Instance configuration (b2c setup instance)
  5. Defaults (lowest priority)

Instance management uses b2c setup instance create instead of sfcc-ci instance:add. See the Configuration guide for details.

CI/CD Migration

Before (sfcc-ci)

sfcc-ci CI/CD pipelines typically authenticate first, then run commands:

bash
# Authenticate (stores token)
sfcc-ci client:auth $SFCC_OAUTH_CLIENT_ID $SFCC_OAUTH_CLIENT_SECRET

# Deploy code
sfcc-ci code:deploy build/code.zip -i $INSTANCE
sfcc-ci code:activate v1 -i $INSTANCE

After (b2c-cli — stateless)

With the B2C CLI, set environment variables and run commands directly:

bash
# No separate auth step — credentials are used automatically
export SFCC_CLIENT_ID=$SFCC_OAUTH_CLIENT_ID
export SFCC_CLIENT_SECRET=$SFCC_OAUTH_CLIENT_SECRET
export SFCC_SERVER=$INSTANCE

b2c code deploy
b2c code activate v1

After (b2c-cli — stateful, sfcc-ci compatible)

If you prefer minimal changes to your existing pipeline scripts:

bash
# Same pattern as sfcc-ci — colon-separated aliases are supported
b2c client:auth --client-id $SFCC_OAUTH_CLIENT_ID --client-secret $SFCC_OAUTH_CLIENT_SECRET

b2c code:deploy
b2c code:activate v1 --server $INSTANCE

GitHub Actions

The B2C CLI provides official GitHub Actions that handle installation, credential configuration, and caching automatically. See the CI/CD with GitHub Actions guide for complete examples and action reference.

Next Steps

Released under the Apache-2.0 License.