/b2c-cli:b2c-amfrom b2c-cli
Manages Account Manager resources: API clients, users, roles, and organizations via the b2c CLI. Handles authentication, role requirements, and CRUD operations for CI/CD and developer onboarding.
Ships in b2c-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use the b2c am commands to manage Account Manager resources: API clients, users, roles, and organizations.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli am clients list).
Account Manager commands work with no configuration: the user signs in with their Account Manager account in the browser.
clientId/clientSecret from SFCC_* env vars (including project .env), the selected project-local or shared dw.json, or configuration plugins — passing --client-id/--client-secret flags is usually unnecessary.--user-auth): When client credentials are configured but you need browser-based login (required for org and client management).Run
b2c setup inspectto confirm which credentials the CLI sees and where they came from. For precedence and troubleshooting, see theb2c-cli:b2c-configskill.
| Operations | Client Credentials (roles on API client) | User Auth (roles on user account) |
|---|---|---|
| AM Users & Roles | User Administrator | Account Administrator or User Administrator |
| AM Organizations | Not supported -- use --user-auth | Account Administrator |
| AM API Clients | Not supported -- use --user-auth | Account Administrator or API Administrator |
Organization and API client management are only available with user authentication. For Business Manager administration (BM roles, users, access keys, whoami), see the b2c-cli:b2c-bm-users-roles skill.
b2c am clients list
# with pagination
b2c am clients list --size 50 --page 2
# JSON output
b2c am clients list --json
# by UUID
b2c am clients get <api-client-id>
# with expanded organizations and roles
b2c am clients get <api-client-id> --expand organizations,roles
Jobs, sites, Storefront Next storefronts, and other SCAPI and OCAPI commands need an Account Manager API client. If the user has none, or b2c setup inspect shows no clientId, you can create one with the user's own sign-in. Requires user auth (--user-auth) with the API Administrator or Account Administrator role.
Always confirm the client in detail with the user before creating it. A new client is a credential for the organization, and it cannot be deleted until it has been disabled for 7 days. Before running create, show the user every value — name, organization, roles, role tenant filter (the tenant IDs it can reach), scopes and default scopes, redirect URLs, and whether it is active — and wait for explicit approval. Ask again for each client; do not reuse an approval. Let the user choose the password, or generate one and tell them where it is stored; never print it.
Find the organization: b2c am orgs list --user-auth (or b2c am orgs get <org-id>).
Choose access for what the user needs:
| Need | Roles and tenant filter | Scopes |
|---|---|---|
| Every client | mail,roles,tenantFilter,openid | |
| Jobs, sites, and other SCAPI commands | SALESFORCE_COMMERCE_API with tenant IDs (abcd_001) | Per command: sfcc.jobs.rw, sfcc.sites, ... (b2c docs read guide-authentication) |
| Storefront Next storefronts (SCAPI) | SALESFORCE_COMMERCE_API with tenant IDs | sfcc.storefront.storefronts.rw, sfcc.storefront.environments.rw, sfcc.storefront.deployments.rw |
| Sandboxes and SLAS clients | Sandbox API User with realm or tenant IDs |
Add the same scopes to --scopes and --default-scopes. Only grant the tenants and scopes the user asked for.
Create it after the user approves. The command prints the details and asks for confirmation; when the agent cannot answer the prompt, pass --force only after the user approved those exact details.
b2c am clients create --user-auth \
--name "CI/CD Pipeline" \
--orgs <org-id> \
--password "<client-secret>" \
--roles SALESFORCE_COMMERCE_API \
--role-tenant-filter "SALESFORCE_COMMERCE_API:abcd_001,abcd_002" \
--scopes "mail,roles,tenantFilter,openid,sfcc.jobs.rw,sfcc.sites" \
--default-scopes "mail,roles,tenantFilter,openid,sfcc.jobs.rw,sfcc.sites" \
--active
The client authenticates with its secret (client_secret_basic) unless --token-endpoint-auth-method says otherwise; a client set to private_key_jwt rejects the secret with invalid_client ("Invalid authentication method"). Clients are created inactive unless --active is set; activate later with b2c am clients update <api-client-id> --active.
Save it in the instance configuration with the client ID from the output (b2c-cli:b2c-config):
b2c setup instance create staging --hostname staging.example.com \
--client-id <api-client-id> --client-secret "<client-secret>" \
--short-code kv7kzm78 --tenant-id abcd_001
Verify: b2c setup inspect, then a read such as b2c sites list.
Commands that use OCAPI (for example, with --api-backend ocapi) also need the client ID in the instance's Open Commerce API Settings, and WebDAV with client credentials needs WebDAV Client Permissions; see the Authentication guide.
Partial update -- only specified fields are changed.
b2c am clients update <api-client-id> --name "New Name"
b2c am clients update <api-client-id> --active
b2c am clients password <api-client-id> --current "oldPass" --new "newSecurePass123"
Client must be disabled for 7+ days before deletion. Destructive operation (safe mode check); confirm with the user first.
b2c am clients delete <api-client-id>
b2c am users list
# with extended columns (roles, organizations)
b2c am users list --extended
# JSON output with pagination
b2c am users list --size 100 --json
b2c am users get [email protected]
# with expanded roles and organizations
b2c am users get [email protected] --expand-all
b2c am users create \
--org "My Organization" \
--mail [email protected] \
--first-name Jane \
--last-name Doe
The --org flag accepts either an org ID or org name. Users are created in INITIAL state with no roles.
b2c am users update [email protected] --first-name Janet --last-name Smith
Soft-deletes by default. Use --purge for hard delete (user must already be in DELETED state).
# soft delete
b2c am users delete [email protected]
# hard delete (purge)
b2c am users delete [email protected] --purge
Resets password to INITIAL state, clearing expiration. Destructive operation (safe mode check).
b2c am users reset [email protected]
b2c am roles list
# filter by target type
b2c am roles list --target-type User
b2c am roles list --target-type ApiClient
b2c am roles get bm-admin
b2c am roles get SLAS_ORGANIZATION_ADMIN
b2c am roles grant [email protected] --role bm-admin
# with tenant scope
b2c am roles grant [email protected] --role bm-admin --scope zzzz_001,zzzz_002
# revoke entire role
b2c am roles revoke [email protected] --role bm-admin
# revoke specific tenant scopes only
b2c am roles revoke [email protected] --role bm-admin --scope zzzz_001
b2c am orgs list
# all organizations (max page size)
b2c am orgs list --all
# extended columns
b2c am orgs list --extended
Accepts org ID or name.
b2c am orgs get <org-id>
b2c am orgs get "My Organization"
BM-side resources (instance roles, instance users, access keys, whoami) live in the b2c-cli:b2c-bm-users-roles skill. Use it for:
b2c bm roles — list/get/create/delete instance access roles, grant/revoke users, manage permissionsb2c bm users — list, get, search, update, and delete instance users via the OCAPI /users resourceb2c bm whoami — show the BM user the current OAuth token resolves tob2c bm access-key — provision and rotate WebDAV/OCAPI/Storefront access keys for SSO-managed usersDefer to that skill for BM examples and patterns. AM-side onboarding flows (creating an AM user, granting AM roles scoped to tenants) stay here.
# Create the user
b2c am users create --org $ORG_ID --mail [email protected] \
--first-name Alex --last-name Developer
# Grant Business Manager Admin role scoped to a specific tenant
b2c am roles grant [email protected] --role bm-admin --scope zzxy_prd
# Revoke roles
b2c am roles revoke [email protected] --role bm-admin
# Soft delete the user
b2c am users delete [email protected]
# Permanent deletion (user must be in DELETED state first)
b2c am users delete [email protected] --purge
# Export all users as JSON
b2c am users list --size 4000 --json
# Pipe to jq for filtering
b2c am users list --json | jq '.[] | select(.userState == "ACTIVE")'
All am commands support --json for programmatic output. List commands support --columns, --extended, --size, and --page for pagination and column control.
Destructive operations (user delete, user reset, client delete) check safe mode. Only delete or purge users when explicitly requested.
See b2c am --help for a full list of available commands and options.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
account-manager, api-clients, user-management, role-management, b2c-cli
npx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin b2c-cli28 skills in this plugin
/b2c-bm-users-rolesManage Business Manager users, access roles, role permissions, and per-user access keys on a B2C Commerce instance using the b2c CLI. Use this skill whenever the user needs to list or search BM users on a sandbox or production instance, identify which BM user an OAuth token resolves to ("whoami"), assign or revoke instance-level access roles, edit role permissions, look up a user's WebDAV / OCAPI / Storefront access key, or rotate access keys for SSO-managed users. Also use when the user asks "what's my BM login on sandbox X", "rotate my WebDAV password", "how do I make a custom BM role", "audit BM users on this instance", or "delete a stale BM user from a sandbox"./b2c-capManage Commerce App Packages (CAPs), also called commerce apps or apps, and commerce features using the b2c CLI. Use this skill whenever the user needs to validate, package, install, uninstall, list, or pull commerce apps on B2C Commerce instances, view configuration tasks, or pull app sources for cartridge deployment or Storefront Next development. Also use when checking which apps are installed on an instance, inspecting app details or versions, or managing app lifecycle — even if they just say "what apps do I have", "list my commerce apps", "which CAPs are installed", "install this app", "pull app sources", or "show installed apps".Other plugins' skills for the same job