b2c-webdav

📁 salesforcecommercecloud/b2c-developer-tooling 📅 2 days ago
1
总安装量
1
周安装量
#53402
全站排名
安装命令
npx skills add https://github.com/salesforcecommercecloud/b2c-developer-tooling --skill b2c-webdav

Agent 安装分布

amp 1
opencode 1
kimi-cli 1
github-copilot 1
gemini-cli 1

Skill 文档

B2C WebDAV Skill

Use the b2c CLI plugin to perform WebDAV file operations on Salesforce B2C Commerce instances. This includes listing files, uploading, downloading, and managing files across different WebDAV roots.

Tip: If b2c is not installed globally, use npx @salesforce/b2c-cli instead (e.g., npx @salesforce/b2c-cli webdav ls).

WebDAV Roots

The --root flag specifies the WebDAV directory:

  • impex (default) – Import/Export directory
  • temp – Temporary files
  • cartridges – Code cartridges
  • realmdata – Realm data
  • catalogs – Product catalogs
  • libraries – Content libraries
  • static – Static resources
  • logs – Application logs
  • securitylogs – Security logs

Examples

List Files

# list files in the default IMPEX root
b2c webdav ls

# list files in a specific path
b2c webdav ls src/instance

# list files in the cartridges root
b2c webdav ls --root=cartridges

# list files with JSON output
b2c webdav ls --root=impex --json

Reading Log Files

Use the logs root to access instance log files:

# list all log files
b2c webdav ls --root=logs

# list log files with JSON output for parsing
b2c webdav ls --root=logs --json

# download a specific log file (e.g., customerror log)
b2c webdav get customerror-blade0-1-appserver-20240115.log --root=logs

# download a log file to a specific local path
b2c webdav get error-blade0-1-appserver-20240115.log --root=logs -o ./downloads/error.log

# output log file content to stdout (for piping to grep, etc.)
b2c webdav get customerror-blade0-1-appserver-20240115.log --root=logs -o -

# pipe log content to grep to search for errors
b2c webdav get customerror-blade0-1-appserver-20240115.log --root=logs -o - | grep "OrderNo"

# download security logs
b2c webdav ls --root=securitylogs
b2c webdav get security-blade0-1-20240115.log --root=securitylogs

# list archived logs (compressed after 3 days)
b2c webdav ls log_archive --root=logs

Log File Reference

Log File Naming Pattern

Log files follow this naming pattern:

<type>-<hostname>-appserver-<date>.log

Example: customerror-blade0-1-appserver-20240115.log

Custom Log File Types

Files generated by script logging (dw.system.Logger):

Log Type Generated By Default State
customdebug Logger.debug() / log.debug() Disabled
custominfo Logger.info() / log.info() Disabled
customwarn Logger.warn() / log.warn() Always enabled
customerror Logger.error() / log.error() Always enabled
customfatal log.fatal() Always enabled

Custom Named Log Files

Created with Logger.getLogger(prefix, category):

custom-<prefix>-<hostname>-appserver-<date>.log

Example: custom-orderexport-blade0-1-appserver-20240115.log

# list custom named log files
b2c webdav ls --root=logs | grep "custom-orderexport"

# download a custom named log
b2c webdav get custom-orderexport-blade0-1-appserver-20240115.log --root=logs

System Log File Types

Log Type Description
error System errors in scripts, templates, platform
warn Lock status, slot warnings, servlet warnings
info System information
debug Debug information (when enabled)
fatal Critical system failures
api API problems and violations
deprecation Usage of deprecated APIs
jobs Job status information
staging Replication process information
quota Quota warnings and limit violations
sql SQL and replication issues
syslog API processing, staging, import/export
sysevent Appserver registration, cartridge logs

Log Retention and Archives

Location Retention
/Logs/ Current logs (< 3 days old)
/Logs/log_archive/ Compressed logs (3-30 days)
Production/Staging 30 days
Security logs 90 days
# list current logs
b2c webdav ls --root=logs

# list archived (gzipped) logs
b2c webdav ls log_archive --root=logs

# download archived log
b2c webdav get log_archive/customerror-blade0-1-appserver-20240112.log.gz --root=logs

Security Logs

Security logs track authentication events:

# list security logs
b2c webdav ls --root=securitylogs

# download security log
b2c webdav get security-blade0-1-20240115.log --root=securitylogs -o - | grep "LOGIN"

Import/Export Logs

Located in IMPEX root under /log/:

# list import/export logs
b2c webdav ls log --root=impex

# download catalog import log
b2c webdav get log/Catalog-Import-20240115.log --root=impex

Common Log Queries

# find recent error logs
b2c webdav ls --root=logs | grep customerror

# search for specific order in error log
b2c webdav get customerror-blade0-1-appserver-20240115.log --root=logs -o - | grep "ORD12345"

# search for payment errors
b2c webdav get customerror-blade0-1-appserver-20240115.log --root=logs -o - | grep -i "payment"

# check job failures
b2c webdav get jobs-blade0-1-appserver-20240115.log --root=logs -o - | grep -i "failed"

# check quota warnings
b2c webdav get quota-blade0-1-appserver-20240115.log --root=logs -o - | grep "exceeded"

# check deprecated API usage
b2c webdav get deprecation-blade0-1-appserver-20240115.log --root=logs

Download Files

# download a file from IMPEX (default root)
b2c webdav get src/instance/export.zip

# download to a specific local path
b2c webdav get src/instance/export.zip -o ./downloads/export.zip

# download from a specific root
b2c webdav get customerror.log --root=logs

# output file content to stdout
b2c webdav get src/instance/data.xml -o -

Upload Files

# upload a file to IMPEX
b2c webdav put ./local-file.zip src/instance/

# upload to a specific root
b2c webdav put ./my-cartridge.zip --root=cartridges

Create Directories

# create a directory in IMPEX
b2c webdav mkdir src/instance/my-folder

# create a directory in a specific root
b2c webdav mkdir my-folder --root=temp

Delete Files

# delete a file
b2c webdav rm src/instance/old-export.zip

# delete from a specific root
b2c webdav rm old-file.txt --root=temp

Delete Cartridges

To delete cartridges from a code version, use the cartridges root with the path format {code-version}/{cartridge-name}:

# delete a cartridge from a code version
b2c webdav rm v25_1_0/app_mysite --root=cartridges

# delete multiple cartridges
b2c webdav rm v25_1_0/app_mysite --root=cartridges
b2c webdav rm v25_1_0/int_myintegration --root=cartridges

# list cartridges in a code version first
b2c webdav ls v25_1_0 --root=cartridges

Important: The path is {code-version}/{cartridge-name}, not /cartridges/{code-version}/.... The --root=cartridges (or -r cartridges) flag sets the WebDAV root.

Zip/Unzip Remote Files

# create a zip archive of a remote directory
b2c webdav zip src/instance/my-folder

# extract a remote zip archive
b2c webdav unzip src/instance/archive.zip

More Commands

See b2c webdav --help for a full list of available commands and options in the webdav topic.

Related Skills

  • b2c-cli:b2c-code – Higher-level code deployment (preferred for cartridge upload)
  • b2c-cli:b2c-job – Import/export site archives