| description |
B2C CLI scaffold commands for generating cartridges, controllers, hooks, custom APIs, and other B2C Commerce components from templates. |
The b2c scaffold commands help you generate B2C Commerce components from templates (scaffolds). Built-in scaffolds include cartridges, controllers, hooks, custom APIs, job steps, and Page Designer components.
| Command |
Description |
b2c scaffold list |
List available scaffolds |
b2c scaffold generate <id> |
Generate files from a scaffold |
b2c scaffold info <id> |
Show scaffold details and parameters |
b2c scaffold search <query> |
Search scaffolds by name/tags |
b2c scaffold init <name> |
Create a custom scaffold |
b2c scaffold validate <path> |
Validate a scaffold manifest |
List available project scaffolds with optional filtering.
b2c scaffold list [--category <category>] [--source <source>]
| Flag |
Description |
--category, -c |
Filter by category: cartridge, custom-api, page-designer, job, metadata |
--source, -s |
Filter by source: built-in, user, project, plugin |
--columns |
Columns to display (comma-separated) |
--extended, -x |
Show all columns including description and tags |
Default columns: id, displayName, category, source
Extended columns (with -x): adds description, tags, path
# list all available scaffolds
b2c scaffold list
# list only cartridge scaffolds
b2c scaffold list --category cartridge
# list project-local scaffolds
b2c scaffold list --source project
# show extended information
b2c scaffold list -x
Generate files from a scaffold template. You can also use the shorthand b2c scaffold <id>.
b2c scaffold generate <scaffoldId> [--name <name>] [--option key=value] [--output <dir>]
b2c scaffold <scaffoldId> # shorthand
| Argument |
Description |
scaffoldId |
ID of the scaffold to generate (required) |
| Flag |
Description |
--name, -n |
Primary name parameter (shorthand for --option name=VALUE) |
--output, -o |
Output directory (defaults to scaffold default or current directory) |
--option |
Parameter value in key=value format (repeatable) |
--dry-run |
Preview files without writing them |
--force, -f |
Skip prompts, use defaults, and overwrite existing files |
# generate a cartridge interactively
b2c scaffold generate cartridge
# generate with name specified
b2c scaffold cartridge --name app_custom
# generate with multiple options
b2c scaffold generate controller --option controllerName=Account --option cartridgeName=app_custom
# preview what would be generated
b2c scaffold generate cartridge --name app_custom --dry-run
# skip all prompts and use defaults
b2c scaffold generate cartridge --name app_custom --force
# generate to a specific directory
b2c scaffold generate cartridge --name app_custom --output ./src/cartridges
Show detailed information about a scaffold including its parameters and usage.
b2c scaffold info <scaffoldId>
| Argument |
Description |
scaffoldId |
ID of the scaffold to get info for (required) |
Displays:
- Scaffold ID, category, source, and description
- Tags (if any)
- Parameters with types, requirements, defaults, and conditions
- Usage example with required parameters
- Post-generation instructions (if any)
# show info for the cartridge scaffold
b2c scaffold info cartridge
# show info for the controller scaffold
b2c scaffold info controller
Search for scaffolds by name, description, or tags.
b2c scaffold search <query> [--category <category>]
| Argument |
Description |
query |
Search query (required) |
| Flag |
Description |
--category, -c |
Filter results by category |
# search for scaffolds related to API
b2c scaffold search api
# search within a specific category
b2c scaffold search template --category page-designer
Create a new custom scaffold template.
b2c scaffold init [name] [--project | --user | --output <dir>]
| Argument |
Description |
name |
Name for the new scaffold (kebab-case, optional - prompts if not provided) |
| Flag |
Description |
--project |
Create in project scaffolds directory (.b2c/scaffolds/) |
--user |
Create in user scaffolds directory (~/.b2c/scaffolds/) |
--output, -o |
Custom output directory for the scaffold |
--force, -f |
Overwrite existing scaffold if it exists |
# create a project-local scaffold interactively
b2c scaffold init --project
# create a user scaffold with a specific name
b2c scaffold init my-component --user
# create a scaffold in a custom directory
b2c scaffold init my-scaffold --output ./custom-scaffolds
Validate a custom scaffold manifest and templates.
b2c scaffold validate <path> [--strict]
| Argument |
Description |
path |
Path to the scaffold directory (required) |
| Flag |
Description |
--strict |
Treat warnings as errors |
- Manifest structure (scaffold.json)
- Required fields and types
- Parameter definitions and validation patterns
- Template file existence
- Orphaned template files
- EJS syntax in templates
# validate a custom scaffold
b2c scaffold validate ./.b2c/scaffolds/my-scaffold
# validate with strict mode
b2c scaffold validate ./my-scaffold --strict
| Scaffold |
Category |
Description |
cartridge |
cartridge |
B2C cartridge with standard directory structure |
controller |
cartridge |
SFRA controller with route handlers and middleware |
hook |
cartridge |
Hook implementation with hooks.json registration |
service |
cartridge |
B2C web service using LocalServiceRegistry |
custom-api |
cartridge |
Custom SCAPI endpoint with OAS 3.0 schema |
job-step |
cartridge |
Custom job step with steptypes.json registration |
page-designer-component |
cartridge |
Page Designer component with meta/script/template |
Use b2c scaffold info <id> to see the parameters for each scaffold.