b2c-code

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

B2C Code Skill

B2C代码管理技能

Use the
b2c
CLI to deploy and manage code versions on Salesforce B2C Commerce instances.
Tip: If
b2c
is not installed globally, use
npx @salesforce/b2c-cli
instead (e.g.,
npx @salesforce/b2c-cli code deploy
).
使用
b2c
CLI在Salesforce B2C Commerce实例上部署和管理代码版本。
提示: 若未全局安装
b2c
,请改用
npx @salesforce/b2c-cli
(例如:
npx @salesforce/b2c-cli code deploy
)。

Examples

示例

Deploy Cartridges

部署Cartridges

bash
undefined
bash
undefined

deploy all cartridges from current directory

从当前目录部署所有cartridges

b2c code deploy
b2c code deploy

deploy cartridges from a specific directory

从指定目录部署cartridges

b2c code deploy ./my-cartridges
b2c code deploy ./my-cartridges

deploy to a specific server and code version

部署到指定服务器和代码版本

b2c code deploy --server my-sandbox.demandware.net --code-version v1
b2c code deploy --server my-sandbox.demandware.net --code-version v1

deploy and reload (re-activate) the code version

部署并重新加载(重新激活)代码版本

b2c code deploy --reload
b2c code deploy --reload

delete existing cartridges before upload and reload

上传前删除现有cartridges并重新加载

b2c code deploy --delete --reload
b2c code deploy --delete --reload

deploy only specific cartridges

仅部署指定的cartridges

b2c code deploy -c app_storefront_base -c plugin_applepay
b2c code deploy -c app_storefront_base -c plugin_applepay

exclude specific cartridges from deployment

排除指定的cartridges进行部署

b2c code deploy -x test_cartridge
undefined
b2c code deploy -x test_cartridge
undefined

Watch for Changes

监听文件变更

bash
undefined
bash
undefined

watch cartridges and upload changes automatically

监听cartridges并自动上传变更

b2c code watch
b2c code watch

watch a specific directory

监听指定目录

b2c code watch ./my-cartridges
b2c code watch ./my-cartridges

watch with specific server and code version

监听指定服务器和代码版本

b2c code watch --server my-sandbox.demandware.net --code-version v1
b2c code watch --server my-sandbox.demandware.net --code-version v1

watch only specific cartridges

仅监听指定的cartridges

b2c code watch -c app_storefront_base
b2c code watch -c app_storefront_base

watch excluding specific cartridges

监听时排除指定的cartridges

b2c code watch -x test_cartridge
undefined
b2c code watch -x test_cartridge
undefined

List Code Versions

列出代码版本

bash
undefined
bash
undefined

list code versions on the instance

列出实例上的代码版本

b2c code list
b2c code list

list with JSON output

以JSON格式列出

b2c code list --json
undefined
b2c code list --json
undefined

Activate Code Version

激活代码版本

bash
undefined
bash
undefined

activate a code version

激活某个代码版本

b2c code activate <version-name>
b2c code activate <version-name>

reload (re-activate) the current code version

重新加载(重新激活)当前代码版本

b2c code activate --reload

**Note:** Activating a code version triggers Custom API endpoint registration. If you've added or modified Custom APIs, use `--reload` with deploy or activate to register them. Check registration status with the `b2c-cli:b2c-scapi-custom` skill.
b2c code activate --reload

**注意:** 激活代码版本会触发Custom API端点注册。若您添加或修改了Custom API,请在部署或激活时使用`--reload`参数来完成注册。可通过`b2c-cli:b2c-scapi-custom`技能查看注册状态。

Delete Code Version

删除代码版本

bash
undefined
bash
undefined

delete a code version

删除某个代码版本

b2c code delete <version-name>
undefined
b2c code delete <version-name>
undefined

More Commands

更多命令

See
b2c code --help
for a full list of available commands and options in the
code
topic.
如需查看
code
主题下的所有可用命令和选项,请执行
b2c code --help

Related Skills

相关技能

  • b2c-cli:b2c-scapi-custom
    - Check Custom API registration status after deployment
  • b2c-cli:b2c-webdav
    - Low-level file operations (delete cartridges, list files)
  • b2c:b2c-custom-api-development
    - Creating Custom API endpoints
  • b2c-cli:b2c-scapi-custom
    - 部署后检查Custom API注册状态
  • b2c-cli:b2c-webdav
    - 底层文件操作(删除cartridges、列出文件)
  • b2c:b2c-custom-api-development
    - 创建Custom API端点