|
| 1 | +--- |
| 2 | +description: Migrate from sfcc-ci to @salesforce/b2c-cli with command mappings, environment variable compatibility, and CI/CD pipeline updates. |
| 3 | +--- |
| 4 | + |
| 5 | +# Migrating from sfcc-ci |
| 6 | + |
| 7 | +[sfcc-ci](https://github.com/SalesforceCommerceCloud/sfcc-ci) is deprecated. The `@salesforce/b2c-cli` package is its replacement, providing the same core capabilities plus additional features. |
| 8 | + |
| 9 | +If you haven't installed the B2C CLI yet, see the [Installation guide](./installation). |
| 10 | + |
| 11 | +## Authentication |
| 12 | + |
| 13 | +The biggest change from sfcc-ci is how authentication works by default. |
| 14 | + |
| 15 | +**sfcc-ci** uses **stateful auth** — you run `sfcc-ci client:auth` once to store a token, then all subsequent commands use it automatically. |
| 16 | + |
| 17 | +**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. |
| 18 | + |
| 19 | +### Stateful Auth (sfcc-ci Compatible) |
| 20 | + |
| 21 | +For users who prefer the sfcc-ci workflow, the B2C CLI includes a compatibility layer that mirrors the stateful auth pattern: |
| 22 | + |
| 23 | +| sfcc-ci | b2c-cli | |
| 24 | +|---------|---------| |
| 25 | +| `sfcc-ci client:auth <id> <secret>` | `b2c auth client --client-id <id> --client-secret <secret>` | |
| 26 | +| `sfcc-ci client:auth:renew` | `b2c auth client renew` | |
| 27 | +| `sfcc-ci client:auth:token` | `b2c auth client token` | |
| 28 | +| `sfcc-ci auth:login [client]` | `b2c auth login [client]` | |
| 29 | +| `sfcc-ci auth:logout` | `b2c auth logout` | |
| 30 | + |
| 31 | +The colon-separated forms (`client:auth`, `client:auth:renew`, `client:auth:token`, `auth:login`, `auth:logout`) are also accepted as aliases. |
| 32 | + |
| 33 | +After authenticating, subsequent commands automatically use the stored token when it is valid. See [Auth Commands](/cli/auth) for full details. |
| 34 | + |
| 35 | +### Stateless Auth (Recommended for CI/CD) |
| 36 | + |
| 37 | +For automation and CI/CD, set credentials as environment variables and the CLI uses them directly — no separate auth step needed: |
| 38 | + |
| 39 | +```bash |
| 40 | +export SFCC_CLIENT_ID=my-client-id |
| 41 | +export SFCC_CLIENT_SECRET=my-secret |
| 42 | + |
| 43 | +# Commands authenticate automatically |
| 44 | +b2c code list |
| 45 | +b2c sandbox list |
| 46 | +``` |
| 47 | + |
| 48 | +See [Authentication Setup](./authentication) for the full guide including Account Manager configuration, OCAPI permissions, and WebDAV access. |
| 49 | + |
| 50 | +::: tip |
| 51 | +Use **stateless auth** (environment variables) for CI/CD pipelines and **stateful auth** (`b2c auth client` or `b2c auth login`) for local development. |
| 52 | +::: |
| 53 | + |
| 54 | +## Command Mapping |
| 55 | + |
| 56 | +The B2C CLI uses space-separated commands instead of colons (e.g., `code deploy` instead of `code:deploy`). For the most commonly used commands, colon-separated aliases are also accepted for backward compatibility. |
| 57 | + |
| 58 | +### Code Management |
| 59 | + |
| 60 | +| sfcc-ci | b2c-cli | Notes | |
| 61 | +|---------|---------|-------| |
| 62 | +| `sfcc-ci code:list` | `b2c code list` | Also accepts `code:list` | |
| 63 | +| `sfcc-ci code:deploy <archive>` | `b2c code deploy` | Deploys from local cartridge source; also accepts `code:deploy` | |
| 64 | +| `sfcc-ci code:activate <version>` | `b2c code activate <version>` | Also accepts `code:activate` | |
| 65 | +| `sfcc-ci code:delete` | `b2c code delete` | Also accepts `code:delete` | |
| 66 | + |
| 67 | +### Instance / Data |
| 68 | + |
| 69 | +| sfcc-ci | b2c-cli | Notes | |
| 70 | +|---------|---------|-------| |
| 71 | +| `sfcc-ci instance:upload <file>` | `b2c webdav put <file> <remote-path>` | See [WebDAV commands](/cli/webdav) | |
| 72 | +| `sfcc-ci instance:import <archive>` | `b2c content import <archive>` | Or `b2c job run sfcc-site-archive-import` | |
| 73 | +| `sfcc-ci instance:export` | `b2c content export` | See [Content commands](/cli/content) | |
| 74 | + |
| 75 | +### Jobs |
| 76 | + |
| 77 | +| sfcc-ci | b2c-cli | Notes | |
| 78 | +|---------|---------|-------| |
| 79 | +| `sfcc-ci job:run <id>` | `b2c job run <id>` | Also accepts `job:run`; supports `--wait` and `--timeout` | |
| 80 | +| `sfcc-ci job:status <id> <exec>` | `b2c job wait <id> --execution-id <exec>` | | |
| 81 | + |
| 82 | +### Sandbox |
| 83 | + |
| 84 | +Sandbox commands map directly, with spaces replacing colons: |
| 85 | + |
| 86 | +| sfcc-ci | b2c-cli | |
| 87 | +|---------|---------| |
| 88 | +| `sfcc-ci sandbox:list` | `b2c sandbox list` | |
| 89 | +| `sfcc-ci sandbox:create` | `b2c sandbox create` | |
| 90 | +| `sfcc-ci sandbox:get` | `b2c sandbox get` | |
| 91 | +| `sfcc-ci sandbox:delete` | `b2c sandbox delete` | |
| 92 | +| `sfcc-ci sandbox:start` | `b2c sandbox start` | |
| 93 | +| `sfcc-ci sandbox:stop` | `b2c sandbox stop` | |
| 94 | +| `sfcc-ci sandbox:restart` | `b2c sandbox restart` | |
| 95 | +| `sfcc-ci sandbox:reset` | `b2c sandbox reset` | |
| 96 | +| `sfcc-ci sandbox:alias:list` | `b2c sandbox alias list` | |
| 97 | +| `sfcc-ci sandbox:alias:add` | `b2c sandbox alias create` | |
| 98 | +| `sfcc-ci sandbox:alias:delete` | `b2c sandbox alias delete` | |
| 99 | + |
| 100 | +### SLAS |
| 101 | + |
| 102 | +| sfcc-ci | b2c-cli | |
| 103 | +|---------|---------| |
| 104 | +| `sfcc-ci slas:client:add` | `b2c slas client create` | |
| 105 | +| `sfcc-ci slas:client:get` | `b2c slas client get` | |
| 106 | +| `sfcc-ci slas:client:list` | `b2c slas client list` | |
| 107 | +| `sfcc-ci slas:client:delete` | `b2c slas client delete` | |
| 108 | + |
| 109 | +### User / Org / Role (Account Manager) |
| 110 | + |
| 111 | +Account Manager operations are under the `am` topic: |
| 112 | + |
| 113 | +| sfcc-ci | b2c-cli | |
| 114 | +|---------|---------| |
| 115 | +| `sfcc-ci user:list` | `b2c am users list` | |
| 116 | +| `sfcc-ci user:create` | `b2c am users create` | |
| 117 | +| `sfcc-ci user:delete` | `b2c am users delete` | |
| 118 | +| `sfcc-ci org:list` | `b2c am orgs list` | |
| 119 | +| `sfcc-ci role:list` | `b2c am roles list` | |
| 120 | +| `sfcc-ci role:grant` | `b2c am roles grant` | |
| 121 | +| `sfcc-ci role:revoke` | `b2c am roles revoke` | |
| 122 | + |
| 123 | +## Environment Variables |
| 124 | + |
| 125 | +Most sfcc-ci environment variables are supported directly or through backward-compatible aliases. Existing CI/CD configurations using these variables will continue to work. |
| 126 | + |
| 127 | +| sfcc-ci | b2c-cli | Status | |
| 128 | +|---------|---------|--------| |
| 129 | +| `SFCC_OAUTH_CLIENT_ID` | `SFCC_CLIENT_ID` | Both accepted | |
| 130 | +| `SFCC_OAUTH_CLIENT_SECRET` | `SFCC_CLIENT_SECRET` | Both accepted | |
| 131 | +| `SFCC_LOGIN_URL` | `SFCC_ACCOUNT_MANAGER_HOST` | Both accepted | |
| 132 | +| `SFCC_OAUTH_USER_NAME` | `SFCC_OAUTH_USER_NAME` | Same | |
| 133 | +| `SFCC_OAUTH_USER_PASSWORD` | `SFCC_OAUTH_USER_PASSWORD` | Same | |
| 134 | +| `SFCC_SANDBOX_API_HOST` | `SFCC_SANDBOX_API_HOST` | Same | |
| 135 | +| `SFCC_SCAPI_SHORTCODE` | `SFCC_SHORTCODE` | Renamed | |
| 136 | +| `SFCC_SCAPI_TENANTID` | `SFCC_TENANT_ID` | Renamed | |
| 137 | + |
| 138 | +The B2C CLI also introduces new environment variables not present in sfcc-ci: |
| 139 | + |
| 140 | +| Variable | Purpose | |
| 141 | +|----------|---------| |
| 142 | +| `SFCC_SERVER` | B2C instance hostname | |
| 143 | +| `SFCC_USERNAME` | WebDAV / Basic auth username | |
| 144 | +| `SFCC_PASSWORD` | WebDAV / Basic auth password | |
| 145 | +| `SFCC_CODE_VERSION` | Code version for deployments | |
| 146 | +| `SFCC_AUTH_METHODS` | Auth method priority (comma-separated) | |
| 147 | + |
| 148 | +See the [Configuration guide](./configuration) for the complete list of environment variables and configuration sources. |
| 149 | + |
| 150 | +## Configuration |
| 151 | + |
| 152 | +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. |
| 153 | + |
| 154 | +The B2C CLI adds a layered configuration system with a clear priority order: |
| 155 | + |
| 156 | +1. CLI flags (highest priority) |
| 157 | +2. Environment variables (`SFCC_*`) |
| 158 | +3. `dw.json` in the current directory |
| 159 | +4. Instance configuration (`b2c setup instance`) |
| 160 | +5. Defaults (lowest priority) |
| 161 | + |
| 162 | +Instance management uses `b2c setup instance create` instead of `sfcc-ci instance:add`. See the [Configuration guide](./configuration) for details. |
| 163 | + |
| 164 | +## CI/CD Migration |
| 165 | + |
| 166 | +### Before (sfcc-ci) |
| 167 | + |
| 168 | +sfcc-ci CI/CD pipelines typically authenticate first, then run commands: |
| 169 | + |
| 170 | +```bash |
| 171 | +# Authenticate (stores token) |
| 172 | +sfcc-ci client:auth $SFCC_OAUTH_CLIENT_ID $SFCC_OAUTH_CLIENT_SECRET |
| 173 | + |
| 174 | +# Deploy code |
| 175 | +sfcc-ci code:deploy build/code.zip -i $INSTANCE |
| 176 | +sfcc-ci code:activate v1 -i $INSTANCE |
| 177 | +``` |
| 178 | + |
| 179 | +### After (b2c-cli — stateless) |
| 180 | + |
| 181 | +With the B2C CLI, set environment variables and run commands directly: |
| 182 | + |
| 183 | +```bash |
| 184 | +# No separate auth step — credentials are used automatically |
| 185 | +export SFCC_CLIENT_ID=$SFCC_OAUTH_CLIENT_ID |
| 186 | +export SFCC_CLIENT_SECRET=$SFCC_OAUTH_CLIENT_SECRET |
| 187 | +export SFCC_SERVER=$INSTANCE |
| 188 | + |
| 189 | +b2c code deploy |
| 190 | +b2c code activate v1 |
| 191 | +``` |
| 192 | + |
| 193 | +### After (b2c-cli — stateful, sfcc-ci compatible) |
| 194 | + |
| 195 | +If you prefer minimal changes to your existing pipeline scripts: |
| 196 | + |
| 197 | +```bash |
| 198 | +# Same pattern as sfcc-ci |
| 199 | +b2c auth client --client-id $SFCC_OAUTH_CLIENT_ID --client-secret $SFCC_OAUTH_CLIENT_SECRET |
| 200 | + |
| 201 | +b2c code deploy |
| 202 | +b2c code activate v1 --server $INSTANCE |
| 203 | +``` |
| 204 | + |
| 205 | +### GitHub Actions |
| 206 | + |
| 207 | +The B2C CLI provides official GitHub Actions that handle installation, credential configuration, and caching automatically. See the [CI/CD with GitHub Actions](./ci-cd) guide for complete examples and action reference. |
| 208 | + |
| 209 | +## Next Steps |
| 210 | + |
| 211 | +- [Installation](./installation) — install the B2C CLI |
| 212 | +- [Authentication Setup](./authentication) — configure API clients, OCAPI, and WebDAV |
| 213 | +- [Configuration](./configuration) — environment variables, dw.json, and instance management |
| 214 | +- [CI/CD with GitHub Actions](./ci-cd) — official GitHub Actions for automation |
| 215 | +- [CLI Reference](/cli/) — browse all available commands |
0 commit comments