From 3a4aae978515e446713ac5fee0b0e301b6575d82 Mon Sep 17 00:00:00 2001 From: Charles Lavery Date: Wed, 18 Mar 2026 09:49:49 -0400 Subject: [PATCH 1/2] Add sfcc-ci migration guide, command aliases, and env var compatibility Add migration guide at docs/guide/sfcc-ci-migration.md covering authentication changes, command mapping tables, environment variable compatibility, and CI/CD migration patterns. Add hidden command aliases for sfcc-ci backward compatibility (client:auth, code:deploy, code:list, code:activate, code:delete, job:run, etc.). Add environment variable fallbacks for sfcc-ci names (SFCC_OAUTH_CLIENT_ID, SFCC_OAUTH_CLIENT_SECRET, SFCC_LOGIN_URL) in both CLI flags and SDK env source. --- .changeset/sfcc-ci-migration-guide.md | 7 + docs/.vitepress/config.mts | 1 + docs/guide/sfcc-ci-migration.md | 215 ++++++++++++++++++ .../b2c-cli/src/commands/auth/client/index.ts | 5 + .../b2c-cli/src/commands/auth/client/renew.ts | 3 + .../b2c-cli/src/commands/auth/client/token.ts | 2 + packages/b2c-cli/src/commands/auth/login.ts | 3 + packages/b2c-cli/src/commands/auth/logout.ts | 2 + .../b2c-cli/src/commands/code/activate.ts | 2 + packages/b2c-cli/src/commands/code/delete.ts | 2 + packages/b2c-cli/src/commands/code/deploy.ts | 2 + packages/b2c-cli/src/commands/code/list.ts | 2 + packages/b2c-cli/src/commands/job/run.ts | 2 + .../b2c-tooling-sdk/src/cli/oauth-command.ts | 3 + .../src/config/sources/env-source.ts | 4 + 15 files changed, 255 insertions(+) create mode 100644 .changeset/sfcc-ci-migration-guide.md create mode 100644 docs/guide/sfcc-ci-migration.md diff --git a/.changeset/sfcc-ci-migration-guide.md b/.changeset/sfcc-ci-migration-guide.md new file mode 100644 index 00000000..deeaea25 --- /dev/null +++ b/.changeset/sfcc-ci-migration-guide.md @@ -0,0 +1,7 @@ +--- +'@salesforce/b2c-dx-docs': patch +'@salesforce/b2c-tooling-sdk': patch +'@salesforce/b2c-cli': patch +--- + +Added sfcc-ci migration guide with command mappings and CI/CD migration instructions. Added backward-compatible sfcc-ci command aliases (`client:auth`, `code:deploy`, `code:list`, `code:activate`, `job:run`, etc.) and environment variable aliases (`SFCC_OAUTH_CLIENT_ID`, `SFCC_OAUTH_CLIENT_SECRET`, `SFCC_LOGIN_URL`). diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 3df0dc84..1b8a5343 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -43,6 +43,7 @@ const guidesSidebar = [ items: [ {text: 'Authentication Setup', link: '/guide/authentication'}, {text: 'CI/CD with GitHub Actions', link: '/guide/ci-cd'}, + {text: 'sfcc-ci Migration', link: '/guide/sfcc-ci-migration'}, {text: 'Account Manager', link: '/guide/account-manager'}, {text: 'Analytics Reports (CIP/CCAC)', link: '/guide/analytics-reports-cip-ccac'}, {text: 'IDE Integration', link: '/guide/ide-integration'}, diff --git a/docs/guide/sfcc-ci-migration.md b/docs/guide/sfcc-ci-migration.md new file mode 100644 index 00000000..097532d0 --- /dev/null +++ b/docs/guide/sfcc-ci-migration.md @@ -0,0 +1,215 @@ +--- +description: Migrate from sfcc-ci to @salesforce/b2c-cli with command mappings, environment variable compatibility, and CI/CD pipeline updates. +--- + +# Migrating from sfcc-ci + +[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. + +If you haven't installed the B2C CLI yet, see the [Installation guide](./installation). + +## 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-ci | b2c-cli | +|---------|---------| +| `sfcc-ci client:auth ` | `b2c auth client --client-id --client-secret ` | +| `sfcc-ci client:auth:renew` | `b2c auth client renew` | +| `sfcc-ci client:auth:token` | `b2c auth client token` | +| `sfcc-ci auth:login [client]` | `b2c auth login [client]` | +| `sfcc-ci auth:logout` | `b2c auth logout` | + +The colon-separated forms (`client:auth`, `client:auth:renew`, `client:auth:token`, `auth:login`, `auth:logout`) are also accepted as aliases. + +After authenticating, subsequent commands automatically use the stored token when it is valid. See [Auth Commands](/cli/auth) for full details. + +### Stateless Auth (Recommended for CI/CD) + +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](./authentication) 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 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. + +### Code Management + +| sfcc-ci | b2c-cli | Notes | +|---------|---------|-------| +| `sfcc-ci code:list` | `b2c code list` | Also accepts `code:list` | +| `sfcc-ci code:deploy ` | `b2c code deploy` | Deploys from local cartridge source; also accepts `code:deploy` | +| `sfcc-ci code:activate ` | `b2c code activate ` | Also accepts `code:activate` | +| `sfcc-ci code:delete` | `b2c code delete` | Also accepts `code:delete` | + +### Instance / Data + +| sfcc-ci | b2c-cli | Notes | +|---------|---------|-------| +| `sfcc-ci instance:upload ` | `b2c webdav put ` | See [WebDAV commands](/cli/webdav) | +| `sfcc-ci instance:import ` | `b2c content import ` | Or `b2c job run sfcc-site-archive-import` | +| `sfcc-ci instance:export` | `b2c content export` | See [Content commands](/cli/content) | + +### Jobs + +| sfcc-ci | b2c-cli | Notes | +|---------|---------|-------| +| `sfcc-ci job:run ` | `b2c job run ` | Also accepts `job:run`; supports `--wait` and `--timeout` | +| `sfcc-ci job:status ` | `b2c job wait --execution-id ` | | + +### Sandbox + +Sandbox commands map directly, with spaces replacing colons: + +| sfcc-ci | b2c-cli | +|---------|---------| +| `sfcc-ci sandbox:list` | `b2c sandbox list` | +| `sfcc-ci sandbox:create` | `b2c sandbox create` | +| `sfcc-ci sandbox:get` | `b2c sandbox get` | +| `sfcc-ci sandbox:delete` | `b2c sandbox delete` | +| `sfcc-ci sandbox:start` | `b2c sandbox start` | +| `sfcc-ci sandbox:stop` | `b2c sandbox stop` | +| `sfcc-ci sandbox:restart` | `b2c sandbox restart` | +| `sfcc-ci sandbox:reset` | `b2c sandbox reset` | +| `sfcc-ci sandbox:alias:list` | `b2c sandbox alias list` | +| `sfcc-ci sandbox:alias:add` | `b2c sandbox alias create` | +| `sfcc-ci sandbox:alias:delete` | `b2c sandbox alias delete` | + +### SLAS + +| sfcc-ci | b2c-cli | +|---------|---------| +| `sfcc-ci slas:client:add` | `b2c slas client create` | +| `sfcc-ci slas:client:get` | `b2c slas client get` | +| `sfcc-ci slas:client:list` | `b2c slas client list` | +| `sfcc-ci slas:client:delete` | `b2c slas client delete` | + +### User / Org / Role (Account Manager) + +Account Manager operations are under the `am` topic: + +| sfcc-ci | b2c-cli | +|---------|---------| +| `sfcc-ci user:list` | `b2c am users list` | +| `sfcc-ci user:create` | `b2c am users create` | +| `sfcc-ci user:delete` | `b2c am users delete` | +| `sfcc-ci org:list` | `b2c am orgs list` | +| `sfcc-ci role:list` | `b2c am roles list` | +| `sfcc-ci role:grant` | `b2c am roles grant` | +| `sfcc-ci role:revoke` | `b2c 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-ci | b2c-cli | Status | +|---------|---------|--------| +| `SFCC_OAUTH_CLIENT_ID` | `SFCC_CLIENT_ID` | Both accepted | +| `SFCC_OAUTH_CLIENT_SECRET` | `SFCC_CLIENT_SECRET` | Both accepted | +| `SFCC_LOGIN_URL` | `SFCC_ACCOUNT_MANAGER_HOST` | Both accepted | +| `SFCC_OAUTH_USER_NAME` | `SFCC_OAUTH_USER_NAME` | Same | +| `SFCC_OAUTH_USER_PASSWORD` | `SFCC_OAUTH_USER_PASSWORD` | Same | +| `SFCC_SANDBOX_API_HOST` | `SFCC_SANDBOX_API_HOST` | Same | +| `SFCC_SCAPI_SHORTCODE` | `SFCC_SHORTCODE` | Renamed | +| `SFCC_SCAPI_TENANTID` | `SFCC_TENANT_ID` | Renamed | + +The B2C CLI also introduces new environment variables not present in sfcc-ci: + +| Variable | Purpose | +|----------|---------| +| `SFCC_SERVER` | B2C instance hostname | +| `SFCC_USERNAME` | WebDAV / Basic auth username | +| `SFCC_PASSWORD` | WebDAV / Basic auth password | +| `SFCC_CODE_VERSION` | Code version for deployments | +| `SFCC_AUTH_METHODS` | Auth method priority (comma-separated) | + +See the [Configuration guide](./configuration) 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](./configuration) 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 +b2c auth client --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](./ci-cd) guide for complete examples and action reference. + +## Next Steps + +- [Installation](./installation) — install the B2C CLI +- [Authentication Setup](./authentication) — configure API clients, OCAPI, and WebDAV +- [Configuration](./configuration) — environment variables, dw.json, and instance management +- [CI/CD with GitHub Actions](./ci-cd) — official GitHub Actions for automation +- [CLI Reference](/cli/) — browse all available commands diff --git a/packages/b2c-cli/src/commands/auth/client/index.ts b/packages/b2c-cli/src/commands/auth/client/index.ts index 1c5a5171..6570bbcf 100644 --- a/packages/b2c-cli/src/commands/auth/client/index.ts +++ b/packages/b2c-cli/src/commands/auth/client/index.ts @@ -21,6 +21,8 @@ import {t} from '../../../i18n/index.js'; * Use --renew to enable automatic token renewal for later use with `auth client renew`. */ export default class AuthClient extends BaseCommand { + static hiddenAliases = ['client:auth']; + static description = t('commands.auth.client.description', 'Authenticate an API client and save session'); static examples = [ @@ -34,16 +36,19 @@ export default class AuthClient extends BaseCommand { 'client-id': Flags.string({ description: 'Client ID for OAuth', env: 'SFCC_CLIENT_ID', + default: async () => process.env.SFCC_OAUTH_CLIENT_ID || undefined, helpGroup: 'AUTH', }), 'client-secret': Flags.string({ description: 'Client secret for OAuth', env: 'SFCC_CLIENT_SECRET', + default: async () => process.env.SFCC_OAUTH_CLIENT_SECRET || undefined, helpGroup: 'AUTH', }), 'account-manager-host': Flags.string({ description: `Account Manager hostname for OAuth (default: ${DEFAULT_ACCOUNT_MANAGER_HOST})`, env: 'SFCC_ACCOUNT_MANAGER_HOST', + default: async () => process.env.SFCC_LOGIN_URL || undefined, helpGroup: 'AUTH', }), 'auth-scope': Flags.string({ diff --git a/packages/b2c-cli/src/commands/auth/client/renew.ts b/packages/b2c-cli/src/commands/auth/client/renew.ts index a19f859a..99e81f0a 100644 --- a/packages/b2c-cli/src/commands/auth/client/renew.ts +++ b/packages/b2c-cli/src/commands/auth/client/renew.ts @@ -19,6 +19,8 @@ import {t} from '../../../i18n/index.js'; * to client_credentials grant using the stored base64-encoded client:secret. */ export default class AuthClientRenew extends BaseCommand { + static hiddenAliases = ['client:auth:renew']; + static description = t('commands.auth.client.renew.description', 'Renew the client authentication token'); static examples = ['<%= config.bin %> <%= command.id %>']; @@ -27,6 +29,7 @@ export default class AuthClientRenew extends BaseCommand 'account-manager-host': Flags.string({ description: `Account Manager hostname for OAuth (default: ${DEFAULT_ACCOUNT_MANAGER_HOST})`, env: 'SFCC_ACCOUNT_MANAGER_HOST', + default: async () => process.env.SFCC_LOGIN_URL || undefined, helpGroup: 'AUTH', }), }; diff --git a/packages/b2c-cli/src/commands/auth/client/token.ts b/packages/b2c-cli/src/commands/auth/client/token.ts index 9ca84f48..2a19d474 100644 --- a/packages/b2c-cli/src/commands/auth/client/token.ts +++ b/packages/b2c-cli/src/commands/auth/client/token.ts @@ -25,6 +25,8 @@ interface AuthClientTokenOutput { * Mirrors sfcc-ci `client:auth:token` command behavior. */ export default class AuthClientToken extends BaseCommand { + static hiddenAliases = ['client:auth:token']; + static description = t( 'commands.auth.client.token.description', 'Return the current authentication token (stateful)', diff --git a/packages/b2c-cli/src/commands/auth/login.ts b/packages/b2c-cli/src/commands/auth/login.ts index 4a797729..c2aa9205 100644 --- a/packages/b2c-cli/src/commands/auth/login.ts +++ b/packages/b2c-cli/src/commands/auth/login.ts @@ -15,6 +15,8 @@ import {t, withDocs} from '../../i18n/index.js'; * until it expires or you run auth:logout. */ export default class AuthLogin extends BaseCommand { + static hiddenAliases = ['auth:login']; + static args = { clientId: Args.string({ description: 'Client ID for OAuth (falls back to SFCC_CLIENT_ID env var)', @@ -33,6 +35,7 @@ export default class AuthLogin extends BaseCommand { 'account-manager-host': Flags.string({ description: `Account Manager hostname for OAuth (default: ${DEFAULT_ACCOUNT_MANAGER_HOST})`, env: 'SFCC_ACCOUNT_MANAGER_HOST', + default: async () => process.env.SFCC_LOGIN_URL || undefined, helpGroup: 'AUTH', }), 'auth-scope': Flags.string({ diff --git a/packages/b2c-cli/src/commands/auth/logout.ts b/packages/b2c-cli/src/commands/auth/logout.ts index 0fa24a9e..8e0485ac 100644 --- a/packages/b2c-cli/src/commands/auth/logout.ts +++ b/packages/b2c-cli/src/commands/auth/logout.ts @@ -13,6 +13,8 @@ import {t, withDocs} from '../../i18n/index.js'; * (client credentials or implicit) when configured. */ export default class AuthLogout extends BaseCommand { + static hiddenAliases = ['auth:logout']; + static description = withDocs( t('commands.auth.logout.description', 'Clear stored session (stateful auth)'), '/cli/auth.html#b2c-auth-logout', diff --git a/packages/b2c-cli/src/commands/code/activate.ts b/packages/b2c-cli/src/commands/code/activate.ts index 8b8c4522..972ec845 100644 --- a/packages/b2c-cli/src/commands/code/activate.ts +++ b/packages/b2c-cli/src/commands/code/activate.ts @@ -9,6 +9,8 @@ import {activateCodeVersion, reloadCodeVersion} from '@salesforce/b2c-tooling-sd import {t, withDocs} from '../../i18n/index.js'; export default class CodeActivate extends InstanceCommand { + static hiddenAliases = ['code:activate']; + static args = { codeVersion: Args.string({ description: 'Code version ID to activate', diff --git a/packages/b2c-cli/src/commands/code/delete.ts b/packages/b2c-cli/src/commands/code/delete.ts index 8dae3729..302226d9 100644 --- a/packages/b2c-cli/src/commands/code/delete.ts +++ b/packages/b2c-cli/src/commands/code/delete.ts @@ -27,6 +27,8 @@ async function confirm(message: string): Promise { } export default class CodeDelete extends InstanceCommand { + static hiddenAliases = ['code:delete']; + static args = { codeVersion: Args.string({ description: 'Code version ID to delete', diff --git a/packages/b2c-cli/src/commands/code/deploy.ts b/packages/b2c-cli/src/commands/code/deploy.ts index 08eb6b1d..f8659532 100644 --- a/packages/b2c-cli/src/commands/code/deploy.ts +++ b/packages/b2c-cli/src/commands/code/deploy.ts @@ -15,6 +15,8 @@ import {CartridgeCommand} from '@salesforce/b2c-tooling-sdk/cli'; import {t, withDocs} from '../../i18n/index.js'; export default class CodeDeploy extends CartridgeCommand { + static hiddenAliases = ['code:deploy']; + static args = { ...CartridgeCommand.baseArgs, }; diff --git a/packages/b2c-cli/src/commands/code/list.ts b/packages/b2c-cli/src/commands/code/list.ts index e8ea884a..4de569f1 100644 --- a/packages/b2c-cli/src/commands/code/list.ts +++ b/packages/b2c-cli/src/commands/code/list.ts @@ -34,6 +34,8 @@ const COLUMNS: Record> = { const DEFAULT_COLUMNS = ['id', 'active', 'rollback', 'lastModified', 'cartridges']; export default class CodeList extends InstanceCommand { + static hiddenAliases = ['code:list']; + static description = withDocs( t('commands.code.list.description', 'List code versions on a B2C Commerce instance'), '/cli/code.html#b2c-code-list', diff --git a/packages/b2c-cli/src/commands/job/run.ts b/packages/b2c-cli/src/commands/job/run.ts index f03e3c73..00b71bf2 100644 --- a/packages/b2c-cli/src/commands/job/run.ts +++ b/packages/b2c-cli/src/commands/job/run.ts @@ -14,6 +14,8 @@ import { import {t, withDocs} from '../../i18n/index.js'; export default class JobRun extends JobCommand { + static hiddenAliases = ['job:run']; + static args = { jobId: Args.string({ description: 'Job ID to execute', diff --git a/packages/b2c-tooling-sdk/src/cli/oauth-command.ts b/packages/b2c-tooling-sdk/src/cli/oauth-command.ts index 077d8ed7..c50974ce 100644 --- a/packages/b2c-tooling-sdk/src/cli/oauth-command.ts +++ b/packages/b2c-tooling-sdk/src/cli/oauth-command.ts @@ -45,11 +45,13 @@ export abstract class OAuthCommand extends BaseCommand 'client-id': Flags.string({ description: 'Client ID for OAuth', env: 'SFCC_CLIENT_ID', + default: async () => process.env.SFCC_OAUTH_CLIENT_ID || undefined, helpGroup: 'AUTH', }), 'client-secret': Flags.string({ description: 'Client Secret for OAuth', env: 'SFCC_CLIENT_SECRET', + default: async () => process.env.SFCC_OAUTH_CLIENT_SECRET || undefined, helpGroup: 'AUTH', }), 'auth-scope': Flags.string({ @@ -90,6 +92,7 @@ export abstract class OAuthCommand extends BaseCommand 'account-manager-host': Flags.string({ description: `Account Manager hostname for OAuth (default: ${DEFAULT_ACCOUNT_MANAGER_HOST})`, env: 'SFCC_ACCOUNT_MANAGER_HOST', + default: async () => process.env.SFCC_LOGIN_URL || undefined, helpGroup: 'AUTH', }), }; diff --git a/packages/b2c-tooling-sdk/src/config/sources/env-source.ts b/packages/b2c-tooling-sdk/src/config/sources/env-source.ts index 1016daf4..cfa73f55 100644 --- a/packages/b2c-tooling-sdk/src/config/sources/env-source.ts +++ b/packages/b2c-tooling-sdk/src/config/sources/env-source.ts @@ -20,6 +20,10 @@ import {getLogger} from '../../logging/logger.js'; * Mapping of SFCC_* environment variable names to NormalizedConfig field names. */ const ENV_VAR_MAP: Record = { + // sfcc-ci legacy aliases — listed first so canonical names below take precedence + SFCC_OAUTH_CLIENT_ID: 'clientId', + SFCC_OAUTH_CLIENT_SECRET: 'clientSecret', + SFCC_LOGIN_URL: 'accountManagerHost', SFCC_SERVER: 'hostname', SFCC_WEBDAV_SERVER: 'webdavHostname', SFCC_CODE_VERSION: 'codeVersion', From 50f9a6b0e48c93be4387027146489d2a7efae949 Mon Sep 17 00:00:00 2001 From: Charles Lavery Date: Wed, 18 Mar 2026 10:00:13 -0400 Subject: [PATCH 2/2] Use colon-separated aliases in migration guide for drop-in compatibility --- docs/guide/sfcc-ci-migration.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/guide/sfcc-ci-migration.md b/docs/guide/sfcc-ci-migration.md index 097532d0..84b47192 100644 --- a/docs/guide/sfcc-ci-migration.md +++ b/docs/guide/sfcc-ci-migration.md @@ -22,13 +22,13 @@ For users who prefer the sfcc-ci workflow, the B2C CLI includes a compatibility | sfcc-ci | b2c-cli | |---------|---------| -| `sfcc-ci client:auth ` | `b2c auth client --client-id --client-secret ` | -| `sfcc-ci client:auth:renew` | `b2c auth client renew` | -| `sfcc-ci client:auth:token` | `b2c auth client token` | -| `sfcc-ci auth:login [client]` | `b2c auth login [client]` | -| `sfcc-ci auth:logout` | `b2c auth logout` | +| `sfcc-ci client:auth ` | `b2c client:auth --client-id --client-secret ` | +| `sfcc-ci client:auth:renew` | `b2c client:auth:renew` | +| `sfcc-ci client:auth:token` | `b2c client:auth:token` | +| `sfcc-ci auth:login [client]` | `b2c auth:login [client]` | +| `sfcc-ci auth:logout` | `b2c auth:logout` | -The colon-separated forms (`client:auth`, `client:auth:renew`, `client:auth:token`, `auth:login`, `auth:logout`) are also accepted as aliases. +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](/cli/auth) for full details. @@ -53,16 +53,16 @@ Use **stateless auth** (environment variables) for CI/CD pipelines and **statefu ## Command Mapping -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. +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-ci | b2c-cli | Notes | |---------|---------|-------| -| `sfcc-ci code:list` | `b2c code list` | Also accepts `code:list` | -| `sfcc-ci code:deploy ` | `b2c code deploy` | Deploys from local cartridge source; also accepts `code:deploy` | -| `sfcc-ci code:activate ` | `b2c code activate ` | Also accepts `code:activate` | -| `sfcc-ci code:delete` | `b2c code delete` | Also accepts `code:delete` | +| `sfcc-ci code:list` | `b2c code:list` | | +| `sfcc-ci code:deploy ` | `b2c code:deploy` | Deploys from local cartridge source | +| `sfcc-ci code:activate ` | `b2c code:activate ` | | +| `sfcc-ci code:delete` | `b2c code:delete` | | ### Instance / Data @@ -76,7 +76,7 @@ The B2C CLI uses space-separated commands instead of colons (e.g., `code deploy` | sfcc-ci | b2c-cli | Notes | |---------|---------|-------| -| `sfcc-ci job:run ` | `b2c job run ` | Also accepts `job:run`; supports `--wait` and `--timeout` | +| `sfcc-ci job:run ` | `b2c job:run ` | Supports `--wait` and `--timeout` | | `sfcc-ci job:status ` | `b2c job wait --execution-id ` | | ### Sandbox @@ -195,11 +195,11 @@ b2c code activate v1 If you prefer minimal changes to your existing pipeline scripts: ```bash -# Same pattern as sfcc-ci -b2c auth client --client-id $SFCC_OAUTH_CLIENT_ID --client-secret $SFCC_OAUTH_CLIENT_SECRET +# 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 +b2c code:deploy +b2c code:activate v1 --server $INSTANCE ``` ### GitHub Actions