Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/prophet-ide-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@salesforce/b2c-cli': minor
---

Add `b2c setup ide prophet` to generate a Prophet-compatible `dw.js` script from resolved CLI configuration (including plugin-resolved values), plus new IDE integration docs and setup command reference.
1 change: 1 addition & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const guideSidebar = [
items: [
{text: 'Authentication Setup', link: '/guide/authentication'},
{text: 'Account Manager', link: '/guide/account-manager'},
{text: 'IDE Integration', link: '/guide/ide-integration'},
{text: 'Scaffolding', link: '/guide/scaffolding'},
{text: 'Security', link: '/guide/security'},
{text: 'Storefront Next', link: '/guide/storefront-next'},
Expand Down
194 changes: 133 additions & 61 deletions docs/cli/setup.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
description: Commands for viewing configuration, installing AI agent skills, and setting up the development environment.
description: Commands for viewing configuration, managing instances, installing AI agent skills, and generating IDE integration scripts.
---

# Setup Commands

Commands for viewing configuration and setting up the development environment.
Commands for viewing configuration, setting up the development environment, and generating IDE integration scripts.

## b2c setup inspect

Expand All @@ -20,10 +20,10 @@ b2c setup inspect [FLAGS]

### Flags

| Flag | Description | Default |
|------|-------------|---------|
| Flag | Description | Default |
| ---------- | ------------------------------------------------------------- | ------- |
| `--unmask` | Show sensitive values unmasked (passwords, secrets, API keys) | `false` |
| `--json` | Output results as JSON | `false` |
| `--json` | Output results as JSON | `false` |

### Examples

Expand Down Expand Up @@ -105,6 +105,76 @@ Use `--unmask` to reveal the actual values when needed for debugging.

- [Configuration Guide](/guide/configuration) - How to configure the CLI

## b2c setup ide

Show help for IDE integration setup commands.

### Usage

```bash
b2c setup ide
```

### Examples

```bash
# Show setup ide subcommands
b2c setup ide --help

# Generate Prophet integration script
b2c setup ide prophet
```

## b2c setup ide prophet

Generate a `dw.js` script for the [Prophet VS Code extension](https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet).

The script runs `b2c setup inspect --json --unmask` at runtime and maps the resolved configuration into a `dw.json`-compatible structure that Prophet can consume.

### Usage

```bash
b2c setup ide prophet [FLAGS]
```

### Flags

| Flag | Description | Default |
| ---------------- | ------------------------------------------ | ------- |
| `--output`, `-o` | Path for generated script file | `dw.js` |
| `--force`, `-f` | Overwrite output file if it already exists | `false` |
| `--json` | Output results as JSON | `false` |

### Examples

```bash
# Generate ./dw.js
b2c setup ide prophet

# Overwrite existing dw.js
b2c setup ide prophet --force

# Generate into .vscode folder
b2c setup ide prophet --output .vscode/dw.js

# Pin generated script to a specific instance context
b2c setup ide prophet --instance staging
```

### Output

The command creates a JavaScript file that:

1. Executes `setup inspect --json --unmask`
2. Reads resolved config values (including plugin-provided sources)
3. Falls back to loading `dw.json` from `SFCC_CONFIG` or the `dw.js` directory if inspect cannot run
4. Exports the final object via `module.exports = dwJson`
5. Emits Prophet-compatible keys such as:
- `hostname`, `username`, `password`
- `code-version`
- `cartridgesPath`, `siteID`, `storefrontPassword` (when present)
6. Logs diagnostics to both stdout and stderr when resolution fails

## b2c setup instance list

List all configured B2C Commerce instances from dw.json.
Expand All @@ -117,8 +187,8 @@ b2c setup instance list [FLAGS]

### Flags

| Flag | Description | Default |
|------|-------------|---------|
| Flag | Description | Default |
| -------- | ---------------------- | ------- |
| `--json` | Output results as JSON | `false` |

### Examples
Expand Down Expand Up @@ -156,23 +226,23 @@ b2c setup instance create [NAME] [FLAGS]

### Arguments

| Argument | Description | Required |
|----------|-------------|----------|
| `NAME` | Instance name | Yes (or prompted) |
| Argument | Description | Required |
| -------- | ------------- | ----------------- |
| `NAME` | Instance name | Yes (or prompted) |

### Flags

| Flag | Description | Default |
|------|-------------|---------|
| `--hostname`, `-s` | B2C instance hostname | Prompted |
| `--username` | WebDAV username | |
| `--password` | WebDAV password | Prompted if username set |
| `--client-id` | OAuth client ID | |
| `--client-secret` | OAuth client secret | Prompted if client-id set |
| `--code-version` | Code version | |
| `--active` | Set as active instance | `false` |
| `--force` | Non-interactive mode | `false` |
| `--json` | Output results as JSON | `false` |
| Flag | Description | Default |
| ------------------ | ---------------------- | ------------------------- |
| `--hostname`, `-s` | B2C instance hostname | Prompted |
| `--username` | WebDAV username | |
| `--password` | WebDAV password | Prompted if username set |
| `--client-id` | OAuth client ID | |
| `--client-secret` | OAuth client secret | Prompted if client-id set |
| `--code-version` | Code version | |
| `--active` | Set as active instance | `false` |
| `--force` | Non-interactive mode | `false` |
| `--json` | Output results as JSON | `false` |

### Examples

Expand Down Expand Up @@ -213,16 +283,16 @@ b2c setup instance remove NAME [FLAGS]

### Arguments

| Argument | Description | Required |
|----------|-------------|----------|
| `NAME` | Instance name to remove | Yes |
| Argument | Description | Required |
| -------- | ----------------------- | -------- |
| `NAME` | Instance name to remove | Yes |

### Flags

| Flag | Description | Default |
|------|-------------|---------|
| Flag | Description | Default |
| --------- | ------------------------ | ------- |
| `--force` | Skip confirmation prompt | `false` |
| `--json` | Output results as JSON | `false` |
| `--json` | Output results as JSON | `false` |

### Examples

Expand All @@ -246,14 +316,14 @@ b2c setup instance set-active NAME [FLAGS]

### Arguments

| Argument | Description | Required |
|----------|-------------|----------|
| `NAME` | Instance name to set as active | Yes |
| Argument | Description | Required |
| -------- | ------------------------------ | -------- |
| `NAME` | Instance name to set as active | Yes |

### Flags

| Flag | Description | Default |
|------|-------------|---------|
| Flag | Description | Default |
| -------- | ---------------------- | ------- |
| `--json` | Output results as JSON | `false` |

### Examples
Expand Down Expand Up @@ -299,34 +369,34 @@ b2c setup skills [SKILLSET]

### Arguments

| Argument | Description | Default |
|----------|-------------|---------|
| Argument | Description | Default |
| ---------- | ---------------------------------------- | ---------------------- |
| `SKILLSET` | Skill set to install: `b2c` or `b2c-cli` | Prompted interactively |

### Flags

| Flag | Description | Default |
|------|-------------|---------|
| `--list`, `-l` | List available skills without installing | `false` |
| `--skill` | Install specific skill(s) (can be repeated) | |
| `--ide` | Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, manual | Auto-detect |
| `--global`, `-g` | Install to user home directory (global scope) | `false` |
| `--update`, `-u` | Update existing skills (overwrite) | `false` |
| `--version` | Specific release version | `latest` |
| `--force` | Skip confirmation prompts (non-interactive) | `false` |
| `--json` | Output results as JSON | `false` |
| Flag | Description | Default |
| ---------------- | ----------------------------------------------------------------------------- | ----------- |
| `--list`, `-l` | List available skills without installing | `false` |
| `--skill` | Install specific skill(s) (can be repeated) | |
| `--ide` | Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, manual | Auto-detect |
| `--global`, `-g` | Install to user home directory (global scope) | `false` |
| `--update`, `-u` | Update existing skills (overwrite) | `false` |
| `--version` | Specific release version | `latest` |
| `--force` | Skip confirmation prompts (non-interactive) | `false` |
| `--json` | Output results as JSON | `false` |

### Supported IDEs

| IDE Value | IDE Name | Project Path | Global Path |
|-----------|----------|--------------|-------------|
| `claude-code` | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
| `cursor` | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
| `windsurf` | Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
| `vscode` | VS Code / GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` |
| `codex` | OpenAI Codex CLI | `.codex/skills/` | `~/.codex/skills/` |
| `opencode` | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
| `manual` | Manual | `.claude/skills/` | `~/.claude/skills/` |
| IDE Value | IDE Name | Project Path | Global Path |
| ------------- | ------------------------ | ------------------- | ----------------------------- |
| `claude-code` | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
| `cursor` | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
| `windsurf` | Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
| `vscode` | VS Code / GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` |
| `codex` | OpenAI Codex CLI | `.codex/skills/` | `~/.codex/skills/` |
| `opencode` | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
| `manual` | Manual | `.claude/skills/` | `~/.claude/skills/` |

Use `manual` when you want to install to the Claude Code paths without marketplace recommendations.

Expand Down Expand Up @@ -390,6 +460,7 @@ claude plugin install b2c
```

The marketplace provides:

- Automatic updates when new versions are released
- Centralized plugin management
- Version tracking
Expand All @@ -398,14 +469,15 @@ Use `--ide manual` if you prefer manual installation to the same paths.

### Skill Sets

| Skill Set | Description |
|-----------|-------------|
| `b2c` | B2C Commerce development patterns and practices |
| `b2c-cli` | B2C CLI commands and operations |
| Skill Set | Description |
| --------- | ----------------------------------------------- |
| `b2c` | B2C Commerce development patterns and practices |
| `b2c-cli` | B2C CLI commands and operations |

### Output

When installing, the command reports:

- Successfully installed skills with paths
- Skipped skills (already exist, use `--update` to overwrite)
- Errors encountered during installation
Expand All @@ -427,10 +499,10 @@ Successfully installed 12 skill(s):

Skills are downloaded from the GitHub releases of the [b2c-developer-tooling](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling) repository:

| Artifact | Contents |
|----------|----------|
| `b2c-cli-skills.zip` | Skills for B2C CLI commands and operations |
| `b2c-skills.zip` | Skills for B2C Commerce development patterns |
| Artifact | Contents |
| -------------------- | -------------------------------------------- |
| `b2c-cli-skills.zip` | Skills for B2C CLI commands and operations |
| `b2c-skills.zip` | Skills for B2C Commerce development patterns |

Downloaded artifacts are cached locally at: `~/.cache/b2c-cli/skills/{version}/{skillset}/`

Expand Down
Loading
Loading