重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
b2c-content by salesforcecommercecloud/b2c-developer-tooling
npx skills add https://github.com/salesforcecommercecloud/b2c-developer-tooling --skill b2c-content使用 b2c CLI 从 Salesforce B2C Commerce 内容库中导出、列出和验证 Page Designer 内容。
提示: 如果
b2c未全局安装,请使用npx @salesforce/b2c-cli代替(例如,npx @salesforce/b2c-cli content export homepage)。
# 从共享库导出单个页面
b2c content export homepage --library SharedLibrary
# 导出多个页面
b2c content export homepage about-us contact --library SharedLibrary
# 导出匹配正则表达式模式的页面
b2c content export "hero-.*" --library SharedLibrary --regex
# 导出到特定的输出目录
b2c content export homepage --library SharedLibrary -o ./my-export
# 按 ID 导出特定组件
b2c content export hero-banner --library SharedLibrary
# 从站点私有库导出
b2c content export homepage --library RefArch --site-library
# 预览而不下载(试运行)
b2c content export homepage --library SharedLibrary --dry-run
# 以 JSON 格式输出导出
b2c content export homepage --library SharedLibrary --json
# 从本地 XML 文件导出(离线,无需实例)
b2c content export homepage --library SharedLibrary --library-file ./library.xml --offline
# 按文件夹分类筛选页面
b2c content export homepage --library SharedLibrary --folder seasonal
# 自定义资源提取路径
b2c content export homepage --library SharedLibrary -q "image.path" -q "video.url"
# 在导出中包含孤立组件
b2c content export homepage --library SharedLibrary --keep-orphans
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 列出库中的所有内容
b2c content list --library SharedLibrary
# 仅列出页面
b2c content list --library SharedLibrary --type page
# 列出包括组件
b2c content list --library SharedLibrary --components
# 显示树形结构
b2c content list --library SharedLibrary --tree
# 从站点私有库列出
b2c content list --library RefArch --site-library
# 从本地 XML 文件列出
b2c content list --library SharedLibrary --library-file ./library.xml
# JSON 输出
b2c content list --library SharedLibrary --json
--library 标志可以在 dw.json 或 package.json 中配置,这样您就不需要每次都传递它:
// dw.json
{
"hostname": "my-sandbox.demandware.net",
"content-library": "SharedLibrary"
}
// package.json
{
"b2c": {
"contentLibrary": "SharedLibrary"
}
}
配置了库之后,命令变得更简短:
b2c content export homepage
b2c content list --type page
# 验证单个元定义文件
b2c content validate cartridge/experience/pages/storePage.json
# 递归验证目录中的所有元定义
b2c content validate cartridge/experience/
# 使用通配符模式验证
b2c content validate 'cartridge/experience/**/*.json'
# 显式指定模式类型
b2c content validate --type componenttype mycomponent.json
# 用于 CI/脚本的 JSON 输出
b2c content validate cartridge/experience/ --json
模式类型会根据文件路径(experience/pages/ → pagetype,experience/components/ → componenttype)和 JSON 内容自动检测。使用 --type 来覆盖。
有关 content 主题中可用命令和选项的完整列表,请参阅 b2c content --help。
b2c-cli:b2c-site-import-export - 站点存档导入/导出操作b2c-cli:b2c-webdav - 内容库上的低级文件操作b2c-cli:b2c-config - 配置和凭据管理每周安装次数
63
代码仓库
GitHub 星标数
33
首次出现
2026年2月21日
安全审计
安装于
github-copilot58
codex55
cursor55
opencode54
gemini-cli53
amp53
Use the b2c CLI to export, list, and validate Page Designer content from Salesforce B2C Commerce content libraries.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli content export homepage).
# export a single page from a shared library
b2c content export homepage --library SharedLibrary
# export multiple pages
b2c content export homepage about-us contact --library SharedLibrary
# export pages matching a regex pattern
b2c content export "hero-.*" --library SharedLibrary --regex
# export to a specific output directory
b2c content export homepage --library SharedLibrary -o ./my-export
# export a specific component by ID
b2c content export hero-banner --library SharedLibrary
# export from a site-private library
b2c content export homepage --library RefArch --site-library
# preview without downloading (dry run)
b2c content export homepage --library SharedLibrary --dry-run
# export with JSON output
b2c content export homepage --library SharedLibrary --json
# export from a local XML file (offline, no instance needed)
b2c content export homepage --library SharedLibrary --library-file ./library.xml --offline
# filter pages by folder classification
b2c content export homepage --library SharedLibrary --folder seasonal
# custom asset extraction paths
b2c content export homepage --library SharedLibrary -q "image.path" -q "video.url"
# include orphan components in export
b2c content export homepage --library SharedLibrary --keep-orphans
# list all content in a library
b2c content list --library SharedLibrary
# list only pages
b2c content list --library SharedLibrary --type page
# list including components
b2c content list --library SharedLibrary --components
# show tree structure
b2c content list --library SharedLibrary --tree
# list from a site-private library
b2c content list --library RefArch --site-library
# list from a local XML file
b2c content list --library SharedLibrary --library-file ./library.xml
# JSON output
b2c content list --library SharedLibrary --json
The --library flag can be configured in dw.json or package.json so you don't need to pass it every time:
// dw.json
{
"hostname": "my-sandbox.demandware.net",
"content-library": "SharedLibrary"
}
// package.json
{
"b2c": {
"contentLibrary": "SharedLibrary"
}
}
With a configured library, commands become shorter:
b2c content export homepage
b2c content list --type page
# validate a single metadefinition file
b2c content validate cartridge/experience/pages/storePage.json
# validate all metadefinitions in a directory recursively
b2c content validate cartridge/experience/
# validate with a glob pattern
b2c content validate 'cartridge/experience/**/*.json'
# explicitly specify the schema type
b2c content validate --type componenttype mycomponent.json
# JSON output for CI/scripting
b2c content validate cartridge/experience/ --json
Schema types are auto-detected from file paths (experience/pages/ → pagetype, experience/components/ → componenttype) and from JSON content. Use --type to override.
See b2c content --help for a full list of available commands and options in the content topic.
b2c-cli:b2c-site-import-export - Site archive import/export operationsb2c-cli:b2c-webdav - Low-level file operations on content librariesb2c-cli:b2c-config - Configuration and credential managementWeekly Installs
63
Repository
GitHub Stars
33
First Seen
Feb 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot58
codex55
cursor55
opencode54
gemini-cli53
amp53
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
127,000 周安装