From b2c-cli
Imports and exports B2C Commerce site archives with metadata XML via the b2c CLI. Handles archive structure, import/export commands, schema validation errors, and large archive splitting.
How this skill is triggered — by the user, by Claude, or both
Slash command
/b2c-cli:b2c-site-import-exportThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use the `b2c` CLI plugin to import and export site archives on Salesforce B2C Commerce instances.
Use the b2c CLI plugin to import and export site archives on Salesforce B2C Commerce instances.
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cliinstead (e.g.,npx @salesforce/b2c-cli job import).
The CLI auto-discovers the target instance and credentials from SFCC_* environment variables, dw.json in the current or parent directories, ~/.mobify, package.json, and configuration plugins. Flags like --server, --client-id, --client-secret, --username, and --password are usually unnecessary — only pass them to override what's auto-detected.
Run b2c setup inspect to see the resolved configuration and which source provided each value (use --json for scripting, --unmask to reveal secrets). For precedence rules and troubleshooting, see the b2c-cli:b2c-config skill.
# Import a local directory as a site archive (waits for completion by default)
b2c job import ./my-site-data
# Import and return immediately without waiting
b2c job import ./my-site-data --no-wait
# Import a local zip file
b2c job import ./export.zip
# Keep the archive on the instance after import
b2c job import ./my-site-data --keep-archive
# Show job log if the import fails
b2c job import ./my-site-data --show-log
# Import an archive that already exists on the instance (in Impex/src/instance/)
b2c job import existing-archive.zip --remote
An instance rejects a single import archive above its size limit (typically 200 MB). Use --split on a directory import to import the data in multiple smaller parts:
# Split a large directory import into multiple archive parts
b2c job import ./big-site-data --split
# Tune the per-archive size limit (default 190mb; bare number is MiB)
b2c job import ./big-site-data --split --max-size 150mb
How splitting works:
catalogs, libraries, sites, meta, …) in dependency order — never splitting a single unit.static/ folder) are deferred into later archive parts, packed by compressed size. They attach to the catalogs/libraries created by the metadata import.If a single file, or a single data unit's XML, is larger than --max-size on its own, the command errors (a file is never split across archives). A normal directory import that exceeds the limit warns and recommends --split. --split cannot be combined with --remote, subset paths, or --no-wait.
# Export global metadata (waits for completion by default)
b2c job export --global-data meta_data
# Export a site with specific data units
b2c job export --site RefArch --site-data content,site_preferences
meta/system-objecttype-extensions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.demandware.com/xml/impex/metadata/2006-10-31">
<type-extension type-id="Product">
<custom-attribute-definitions>
<attribute-definition attribute-id="vendorSKU">
<display-name xml:lang="x-default">Vendor SKU</display-name>
<type>string</type>
<mandatory-flag>false</mandatory-flag>
<externally-managed-flag>true</externally-managed-flag>
</attribute-definition>
</custom-attribute-definitions>
<group-definitions>
<attribute-group group-id="CustomAttributes">
<display-name xml:lang="x-default">Custom Attributes</display-name>
<attribute attribute-id="vendorSKU"/>
</attribute-group>
</group-definitions>
</type-extension>
</metadata>
my-import/
└── meta/
└── system-objecttype-extensions.xml
b2c job import ./my-import
meta/system-objecttype-extensions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.demandware.com/xml/impex/metadata/2006-10-31">
<type-extension type-id="SitePreferences">
<custom-attribute-definitions>
<attribute-definition attribute-id="enableFeatureX">
<display-name xml:lang="x-default">Enable Feature X</display-name>
<type>boolean</type>
<default-value>false</default-value>
</attribute-definition>
</custom-attribute-definitions>
</type-extension>
</metadata>
sites/MySite/preferences.xml:
<?xml version="1.0" encoding="UTF-8"?>
<preferences xmlns="http://www.demandware.com/xml/impex/preferences/2007-03-31">
<custom-preferences>
<all-instances>
<preference preference-id="enableFeatureX">true</preference>
</all-instances>
</custom-preferences>
</preferences>
my-import/
├── meta/
│ └── system-objecttype-extensions.xml
└── sites/
└── MySite/
└── preferences.xml
b2c job import ./my-import
meta/custom-objecttype-definitions.xml:
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.demandware.com/xml/impex/metadata/2006-10-31">
<custom-type type-id="APIConfiguration">
<display-name xml:lang="x-default">API Configuration</display-name>
<staging-mode>source-to-target</staging-mode>
<storage-scope>site</storage-scope>
<key-definition attribute-id="configId">
<display-name xml:lang="x-default">Config ID</display-name>
<type>string</type>
<min-length>1</min-length>
</key-definition>
<attribute-definitions>
<attribute-definition attribute-id="endpoint">
<display-name xml:lang="x-default">API Endpoint</display-name>
<type>string</type>
</attribute-definition>
<attribute-definition attribute-id="apiKey">
<display-name xml:lang="x-default">API Key</display-name>
<type>password</type>
</attribute-definition>
<attribute-definition attribute-id="isActive">
<display-name xml:lang="x-default">Active</display-name>
<type>boolean</type>
<default-value>true</default-value>
</attribute-definition>
</attribute-definitions>
</custom-type>
</metadata>
b2c job import ./my-import
customobjects/APIConfiguration.xml:
<?xml version="1.0" encoding="UTF-8"?>
<custom-objects xmlns="http://www.demandware.com/xml/impex/customobject/2006-10-31">
<custom-object type-id="APIConfiguration" object-id="payment-gateway">
<object-attribute attribute-id="endpoint">https://api.payment.com/v2</object-attribute>
<object-attribute attribute-id="isActive">true</object-attribute>
</custom-object>
</custom-objects>
site-archive/
├── services.xml # Service configurations (credentials, profiles, services)
├── meta/
│ ├── system-objecttype-extensions.xml # Custom attributes on system objects
│ └── custom-objecttype-definitions.xml # Custom object type definitions
├── sites/
│ └── {SiteID}/
│ ├── preferences.xml # Site preference values
│ └── library/
│ └── content/
│ └── content.xml # Content assets
├── catalogs/
│ └── {CatalogID}/
│ └── catalog.xml # Products and categories
├── pricebooks/
│ └── {PriceBookID}/
│ └── pricebook.xml # Price definitions
├── customobjects/
│ └── {ObjectTypeID}.xml # Custom object instances
└── inventory-lists/
└── {InventoryListID}/
└── inventory.xml # Inventory records
# Search for recent job executions
b2c job search
# Wait for a specific job execution
b2c job wait <job-id> <execution-id>
# View job logs on failure
b2c job import ./my-data --show-log
--no-wait only when you want to return immediately--show-log to debug failed importsFor service configurations (HTTP, FTP, SOAP services), see the b2c:b2c-webservices skill which includes:
Quick example:
# Import service configuration
b2c job import ./services-folder
Where services-folder/services.xml follows the patterns in the b2c:b2c-webservices skill.
b2c:b2c-webservices - Service configurations (HTTP, FTP, SOAP), services.xml formatb2c:b2c-metadata - System object extensions and custom object definitionsb2c-cli:b2c-job - Running jobs and monitoring import statusnpx claudepluginhub salesforcecommercecloud/b2c-developer-tooling --plugin b2c-cliRun and monitor jobs on B2C Commerce instances via the b2c CLI, including site archive import/export and search indexing. Activates when users mention triggering jobs, importing folders, or rebuilding indexes.
Defines custom attributes, object types, and site preferences for Salesforce B2C Commerce via metadata XML. Activates whenever extending the data model for products, orders, or customers.
Creates a Commerce B2B Store in Salesforce and retrieves auto-generated storefront metadata via an interactive 7-step workflow.