重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
b2c-sites by salesforcecommercecloud/b2c-developer-tooling
npx skills add https://github.com/salesforcecommercecloud/b2c-developer-tooling --skill b2c-sites使用 b2c CLI 插件来列出和管理 Salesforce B2C Commerce 实例上的店面站点。
提示: 如果
b2c没有全局安装,请使用npx @salesforce/b2c-cli代替(例如,npx @salesforce/b2c-cli sites list)。
b2c sites list列出 B2C Commerce 实例上的所有站点,显示站点 ID、显示名称和店面状态。
# 列出配置实例上的所有站点
b2c sites list
# 列出特定服务器上的站点
b2c sites list --server my-sandbox.demandware.net
# 以 JSON 格式列出站点(便于解析/自动化)
b2c sites list --json
# 使用配置中的特定实例
b2c sites list --instance production
# 启用调试日志
b2c sites list --debug
管理站点上活动代码模块的有序列表。单数别名 同样有效。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
sites cartridge# 列出店面站点的代码模块路径
b2c sites cartridges list --site-id RefArch
# 列出 Business Manager 代码模块路径
b2c sites cartridges list --bm
# 将代码模块添加到站点路径的开头(默认)
b2c sites cartridges add plugin_applepay --site-id RefArch
# 将代码模块添加到末尾
b2c sites cartridges add plugin_applepay --site-id RefArch --position last
# 在特定代码模块之后添加代码模块
b2c sites cartridges add plugin_applepay --site-id RefArch --position after --target app_storefront_base
# 将代码模块添加到 Business Manager
b2c sites cartridges add bm_extension --bm --position first
# 从站点移除代码模块
b2c sites cartridges remove old_cartridge --site-id RefArch
# 替换整个代码模块路径
b2c sites cartridges set "app_storefront_base:plugin_applepay:plugin_wishlists" --site-id RefArch
# 用于自动化的 JSON 输出
b2c sites cartridges list --site-id RefArch --json
当 /sites/*/cartridges 的 OCAPI 直接权限不可用时,代码模块命令会自动回退到站点存档导入/导出。Business Manager (--bm) 更新始终使用站点存档导入。
关键标志(继承自 InstanceCommand):
| 标志 | 简写 | 描述 |
|---|---|---|
--server | -s | B2C 实例主机名(环境变量:SFCC_SERVER) |
--json | 以 JSON 格式输出完整的站点数据 | |
--instance | 配置中的命名实例 | |
--debug | 启用调试日志 |
输出列: ID、显示名称、状态(storefront_status)。
JSON 输出 返回完整的 OCAPI 站点响应,包括所有站点属性(对于提取频道 ID、自定义首选项以及表格中未显示的其他站点元数据非常有用)。
为其他命令查找站点 ID: 许多命令(例如,站点导入/导出)需要站点 ID。使用 sites list 来查找有效的 ID:
b2c sites list
# 然后在其他命令中使用该 ID
b2c site-import upload --site RefArch ...
检查站点状态: 状态列显示每个站点的店面状态(在线/离线),对于验证部署状态很有用。
脚本编写和自动化: 使用 --json 获取 CI/CD 流水线可读的机器输出:
b2c sites list --json | jq '.data[].id'
每周安装量
65
代码仓库
GitHub 星标数
34
首次出现
2026年2月21日
安全审计
安装于
github-copilot60
codex57
cursor57
opencode56
gemini-cli55
amp55
Use the b2c CLI plugin to list and manage storefront sites on Salesforce B2C Commerce instances.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli sites list).
b2c sites listLists all sites on a B2C Commerce instance, showing site ID, display name, and storefront status.
# list all sites on the configured instance
b2c sites list
# list sites on a specific server
b2c sites list --server my-sandbox.demandware.net
# list sites with JSON output (useful for parsing/automation)
b2c sites list --json
# use a specific instance from config
b2c sites list --instance production
# enable debug logging
b2c sites list --debug
Manage the ordered list of active cartridges on a site. The singular alias sites cartridge also works.
# list the cartridge path for a storefront site
b2c sites cartridges list --site-id RefArch
# list the Business Manager cartridge path
b2c sites cartridges list --bm
# add a cartridge to the beginning of a site's path (default)
b2c sites cartridges add plugin_applepay --site-id RefArch
# add a cartridge to the end
b2c sites cartridges add plugin_applepay --site-id RefArch --position last
# add a cartridge after a specific cartridge
b2c sites cartridges add plugin_applepay --site-id RefArch --position after --target app_storefront_base
# add a cartridge to Business Manager
b2c sites cartridges add bm_extension --bm --position first
# remove a cartridge from a site
b2c sites cartridges remove old_cartridge --site-id RefArch
# replace the entire cartridge path
b2c sites cartridges set "app_storefront_base:plugin_applepay:plugin_wishlists" --site-id RefArch
# JSON output for automation
b2c sites cartridges list --site-id RefArch --json
When OCAPI direct permissions for /sites/*/cartridges are unavailable, cartridge commands automatically fall back to site archive import/export. Business Manager (--bm) updates always use site archive import.
Key flags (inherited from InstanceCommand):
| Flag | Short | Description |
|---|---|---|
--server | -s | B2C instance hostname (env: SFCC_SERVER) |
--json | Output full site data as JSON | |
--instance | Named instance from config | |
--debug | Enable debug logging |
Output columns: ID, Display Name, Status (storefront_status).
JSON output returns the full OCAPI sites response including all site properties (useful for extracting channel IDs, custom preferences, and other site metadata not shown in the table).
Finding site IDs for other commands: Many commands (e.g., site import/export) require a site ID. Use sites list to discover valid IDs:
b2c sites list
# then use the ID in other commands
b2c site-import upload --site RefArch ...
Checking site status: The status column shows the storefront status (online/offline) for each site, useful for verifying deployment state.
Scripting and automation: Use --json to get machine-readable output for CI/CD pipelines:
b2c sites list --json | jq '.data[].id'
Weekly Installs
65
Repository
GitHub Stars
34
First Seen
Feb 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot60
codex57
cursor57
opencode56
gemini-cli55
amp55
Lark Skill Maker 教程:基于飞书CLI创建AI技能,自动化工作流与API调用指南
41,900 周安装