b2c-am
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseB2C Account Manager Skill
B2C Account Manager 技能
Use the commands to manage Account Manager resources: API clients, users, roles, and organizations.
b2c amTip: Ifis not installed globally, useb2cinstead (e.g.,npx @salesforce/b2c-cli).npx @salesforce/b2c-cli am clients list
使用 命令管理 Account Manager 资源:API 客户端、用户、角色和组织。
b2c am提示: 如果没有全局安装,请改用b2c(例如:npx @salesforce/b2c-cli)。npx @salesforce/b2c-cli am clients list
Authentication
身份验证
Account Manager commands work out of the box with no configuration. The CLI uses a built-in public client and opens a browser for login.
- Zero-config (browser login): Default. Just run the commands -- the CLI opens a browser for login.
- Client credentials: For CI/CD and automation. Pass and
--client-id(or set--client-secretandSFCC_CLIENT_IDenv vars).SFCC_CLIENT_SECRET - Force browser login (): When client credentials are configured but you need browser-based login (required for org and client management).
--user-auth
Account Manager 命令无需配置即可开箱即用。CLI 使用内置的公共客户端,会打开浏览器进行登录。
- 零配置(浏览器登录): 默认方式。直接运行命令即可,CLI 会打开浏览器供你登录。
- 客户端凭证: 适用于 CI/CD 和自动化场景。传入 和
--client-id参数(或者设置--client-secret和SFCC_CLIENT_ID环境变量)。SFCC_CLIENT_SECRET - 强制浏览器登录(): 当已经配置了客户端凭证,但你需要使用基于浏览器的登录时使用(组织和客户端管理操作需要此模式)。
--user-auth
Role Requirements
角色要求
| Operations | Client Credentials (roles on API client) | User Auth (roles on user account) |
|---|---|---|
| Users & Roles | User Administrator | Account Administrator or User Administrator |
| Organizations | Not supported -- use | Account Administrator |
| API Clients | Not supported -- use | Account Administrator or API Administrator |
Organization and API client management are only available with user authentication.
| 操作 | 客户端凭证(API 客户端上的角色) | 用户授权(用户账户上的角色) |
|---|---|---|
| 用户与角色 | User Administrator | Account Administrator 或 User Administrator |
| 组织 | 不支持 -- 请使用 | Account Administrator |
| API 客户端 | 不支持 -- 请使用 | Account Administrator 或 API Administrator |
组织和 API 客户端管理仅支持用户授权模式。
API Clients
API 客户端
List Clients
列出客户端
bash
b2c am clients listbash
b2c am clients listwith pagination
带分页
b2c am clients list --size 50 --page 2
b2c am clients list --size 50 --page 2
JSON output
JSON 格式输出
b2c am clients list --json
undefinedb2c am clients list --json
undefinedGet Client
获取客户端详情
bash
undefinedbash
undefinedby UUID
通过 UUID 查询
b2c am clients get <api-client-id>
b2c am clients get <api-client-id>
with expanded organizations and roles
展开返回关联的组织和角色信息
b2c am clients get <api-client-id> --expand organizations --expand roles
undefinedb2c am clients get <api-client-id> --expand organizations --expand roles
undefinedCreate Client
创建客户端
Clients are created inactive by default. Requires user auth.
bash
b2c am clients create \
--name "My API Client" \
--orgs <org-id> \
--password "securePassword123"客户端默认创建为未激活状态,需要用户授权模式。
bash
b2c am clients create \
--name "My API Client" \
--orgs <org-id> \
--password "securePassword123"with roles, role tenant filter, and redirect URLs
配置角色、角色租户过滤器和重定向 URL
b2c am clients create
--name "CI/CD Pipeline"
--orgs <org-id>
--password "securePassword123"
--roles SALESFORCE_COMMERCE_API
--role-tenant-filter "SALESFORCE_COMMERCE_API:zzxy_prd"
--redirect-urls "https://example.com/callback"
--active
--name "CI/CD Pipeline"
--orgs <org-id>
--password "securePassword123"
--roles SALESFORCE_COMMERCE_API
--role-tenant-filter "SALESFORCE_COMMERCE_API:zzxy_prd"
--redirect-urls "https://example.com/callback"
--active
undefinedb2c am clients create
--name "CI/CD Pipeline"
--orgs <org-id>
--password "securePassword123"
--roles SALESFORCE_COMMERCE_API
--role-tenant-filter "SALESFORCE_COMMERCE_API:zzxy_prd"
--redirect-urls "https://example.com/callback"
--active
--name "CI/CD Pipeline"
--orgs <org-id>
--password "securePassword123"
--roles SALESFORCE_COMMERCE_API
--role-tenant-filter "SALESFORCE_COMMERCE_API:zzxy_prd"
--redirect-urls "https://example.com/callback"
--active
undefinedUpdate Client
更新客户端
Partial update -- only specified fields are changed.
bash
b2c am clients update <api-client-id> --name "New Name"
b2c am clients update <api-client-id> --active局部更新 -- 仅修改指定的字段。
bash
b2c am clients update <api-client-id> --name "New Name"
b2c am clients update <api-client-id> --activeChange Client Password
修改客户端密码
bash
b2c am clients password <api-client-id> --current "oldPass" --new "newSecurePass123"bash
b2c am clients password <api-client-id> --current "oldPass" --new "newSecurePass123"Delete Client
删除客户端
Client must be disabled for 7+ days before deletion. Destructive operation (safe mode check).
bash
b2c am clients delete <api-client-id>客户端必须先禁用满7天才能删除。这是破坏性操作(会进行安全模式检查)。
bash
b2c am clients delete <api-client-id>Users
用户
List Users
列出用户
bash
b2c am users listbash
b2c am users listwith extended columns (roles, organizations)
展示扩展列(角色、组织)
b2c am users list --extended
b2c am users list --extended
JSON output with pagination
JSON 格式输出带分页
b2c am users list --size 100 --json
undefinedb2c am users list --size 100 --json
undefinedGet User
获取用户详情
bash
b2c am users get user@example.combash
b2c am users get user@example.comwith expanded roles and organizations
展开返回关联的角色和组织信息
b2c am users get user@example.com --expand-all
undefinedb2c am users get user@example.com --expand-all
undefinedCreate User
创建用户
bash
b2c am users create \
--org "My Organization" \
--mail user@example.com \
--first-name Jane \
--last-name DoeThe flag accepts either an org ID or org name. Users are created in INITIAL state with no roles.
--orgbash
b2c am users create \
--org "My Organization" \
--mail user@example.com \
--first-name Jane \
--last-name Doe--orgUpdate User
更新用户
bash
b2c am users update user@example.com --first-name Janet --last-name Smithbash
b2c am users update user@example.com --first-name Janet --last-name SmithDelete User
删除用户
Soft-deletes by default. Use for hard delete (user must already be in DELETED state).
--purgebash
undefined默认执行软删除。使用 参数进行硬删除(用户必须已处于 DELETED 状态)。
--purgebash
undefinedsoft delete
软删除
b2c am users delete user@example.com
b2c am users delete user@example.com
hard delete (purge)
硬删除(永久清除)
b2c am users delete developer@example.com --purge
undefinedb2c am users delete developer@example.com --purge
undefinedReset User Password
重置用户密码
Resets password to INITIAL state, clearing expiration. Destructive operation (safe mode check).
bash
b2c am users reset user@example.com将密码重置为 INITIAL 状态,清除过期时间。这是破坏性操作(会进行安全模式检查)。
bash
b2c am users reset user@example.comRoles
角色
List Roles
列出角色
bash
b2c am roles listbash
b2c am roles listfilter by target type
按目标类型筛选
b2c am roles list --target-type User
b2c am roles list --target-type ApiClient
undefinedb2c am roles list --target-type User
b2c am roles list --target-type ApiClient
undefinedGet Role
获取角色详情
bash
b2c am roles get bm-admin
b2c am roles get SLAS_ORGANIZATION_ADMINbash
b2c am roles get bm-admin
b2c am roles get SLAS_ORGANIZATION_ADMINGrant Role to User
为用户授予角色
bash
b2c am roles grant user@example.com --role bm-adminbash
b2c am roles grant user@example.com --role bm-adminwith tenant scope
限定租户范围
b2c am roles grant user@example.com --role bm-admin --scope zzzz_001,zzzz_002
undefinedb2c am roles grant user@example.com --role bm-admin --scope zzzz_001,zzzz_002
undefinedRevoke Role from User
撤销用户的角色
bash
undefinedbash
undefinedrevoke entire role
撤销整个角色
b2c am roles revoke user@example.com --role bm-admin
b2c am roles revoke user@example.com --role bm-admin
revoke specific tenant scopes only
仅撤销指定租户范围的角色权限
b2c am roles revoke user@example.com --role bm-admin --scope zzzz_001
undefinedb2c am roles revoke user@example.com --role bm-admin --scope zzzz_001
undefinedOrganizations
组织
List Organizations
列出组织
bash
b2c am orgs listbash
b2c am orgs listall organizations (max page size)
列出所有组织(最大分页大小)
b2c am orgs list --all
b2c am orgs list --all
extended columns
展示扩展列
b2c am orgs list --extended
undefinedb2c am orgs list --extended
undefinedGet Organization
获取组织详情
Accepts org ID or name.
bash
b2c am orgs get <org-id>
b2c am orgs get "My Organization"支持传入组织 ID 或者组织名称。
bash
b2c am orgs get <org-id>
b2c am orgs get "My Organization"Common Workflows
常见工作流
User Onboarding
用户入职
bash
undefinedbash
undefinedCreate the user
创建用户
b2c am users create --org $ORG_ID --mail developer@example.com
--first-name Alex --last-name Developer
--first-name Alex --last-name Developer
b2c am users create --org $ORG_ID --mail developer@example.com
--first-name Alex --last-name Developer
--first-name Alex --last-name Developer
Grant Business Manager Admin role scoped to a specific tenant
授予指定租户范围的 Business Manager 管理员角色
b2c am roles grant developer@example.com --role bm-admin --scope zzxy_prd
undefinedb2c am roles grant developer@example.com --role bm-admin --scope zzxy_prd
undefinedUser Offboarding
用户离职
bash
undefinedbash
undefinedRevoke roles
撤销角色
b2c am roles revoke developer@example.com --role bm-admin
b2c am roles revoke developer@example.com --role bm-admin
Soft delete the user
软删除用户
b2c am users delete developer@example.com
b2c am users delete developer@example.com
Permanent deletion (user must be in DELETED state first)
永久删除(用户必须先处于 DELETED 状态)
b2c am users delete developer@example.com --purge
undefinedb2c am users delete developer@example.com --purge
undefinedBulk Operations with JSON
基于 JSON 的批量操作
bash
undefinedbash
undefinedExport all users as JSON
导出所有用户为 JSON 格式
b2c am users list --size 4000 --json
b2c am users list --size 4000 --json
Pipe to jq for filtering
管道传输到 jq 进行筛选
b2c am users list --json | jq '.[] | select(.userState == "ACTIVE")'
undefinedb2c am users list --json | jq '.[] | select(.userState == "ACTIVE")'
undefinedCommon Patterns
通用规则
All commands support for programmatic output. List commands support , , , and for pagination and column control.
am--json--columns--extended--size--pageDestructive operations (user delete, user reset, client delete) check safe mode. Only delete or purge users when explicitly requested.
所有 命令都支持 参数输出可编程使用的格式。列表类命令支持 、、 和 参数进行分页和列展示控制。
am--json--columns--extended--size--page破坏性操作(用户删除、用户密码重置、客户端删除)会进行安全模式检查,仅在显式请求时才会执行删除或清除操作。
More Commands
更多命令
See for a full list of available commands and options.
b2c am --help查看 获取完整的可用命令和参数列表。
b2c am --help