Skip to content

Commit f12984e

Browse files
authored
feat(cli): add setup ide prophet command and docs (#151)
1 parent dd792bc commit f12984e

File tree

12 files changed

+850
-64
lines changed

12 files changed

+850
-64
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@salesforce/b2c-cli': minor
3+
---
4+
5+
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.

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const guideSidebar = [
4949
items: [
5050
{text: 'Authentication Setup', link: '/guide/authentication'},
5151
{text: 'Account Manager', link: '/guide/account-manager'},
52+
{text: 'IDE Integration', link: '/guide/ide-integration'},
5253
{text: 'Scaffolding', link: '/guide/scaffolding'},
5354
{text: 'Security', link: '/guide/security'},
5455
{text: 'Storefront Next', link: '/guide/storefront-next'},

docs/cli/setup.md

Lines changed: 133 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
description: Commands for viewing configuration, installing AI agent skills, and setting up the development environment.
2+
description: Commands for viewing configuration, managing instances, installing AI agent skills, and generating IDE integration scripts.
33
---
44

55
# Setup Commands
66

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

99
## b2c setup inspect
1010

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

2121
### Flags
2222

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

2828
### Examples
2929

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

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

108+
## b2c setup ide
109+
110+
Show help for IDE integration setup commands.
111+
112+
### Usage
113+
114+
```bash
115+
b2c setup ide
116+
```
117+
118+
### Examples
119+
120+
```bash
121+
# Show setup ide subcommands
122+
b2c setup ide --help
123+
124+
# Generate Prophet integration script
125+
b2c setup ide prophet
126+
```
127+
128+
## b2c setup ide prophet
129+
130+
Generate a `dw.js` script for the [Prophet VS Code extension](https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet).
131+
132+
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.
133+
134+
### Usage
135+
136+
```bash
137+
b2c setup ide prophet [FLAGS]
138+
```
139+
140+
### Flags
141+
142+
| Flag | Description | Default |
143+
| ---------------- | ------------------------------------------ | ------- |
144+
| `--output`, `-o` | Path for generated script file | `dw.js` |
145+
| `--force`, `-f` | Overwrite output file if it already exists | `false` |
146+
| `--json` | Output results as JSON | `false` |
147+
148+
### Examples
149+
150+
```bash
151+
# Generate ./dw.js
152+
b2c setup ide prophet
153+
154+
# Overwrite existing dw.js
155+
b2c setup ide prophet --force
156+
157+
# Generate into .vscode folder
158+
b2c setup ide prophet --output .vscode/dw.js
159+
160+
# Pin generated script to a specific instance context
161+
b2c setup ide prophet --instance staging
162+
```
163+
164+
### Output
165+
166+
The command creates a JavaScript file that:
167+
168+
1. Executes `setup inspect --json --unmask`
169+
2. Reads resolved config values (including plugin-provided sources)
170+
3. Falls back to loading `dw.json` from `SFCC_CONFIG` or the `dw.js` directory if inspect cannot run
171+
4. Exports the final object via `module.exports = dwJson`
172+
5. Emits Prophet-compatible keys such as:
173+
- `hostname`, `username`, `password`
174+
- `code-version`
175+
- `cartridgesPath`, `siteID`, `storefrontPassword` (when present)
176+
6. Logs diagnostics to both stdout and stderr when resolution fails
177+
108178
## b2c setup instance list
109179

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

118188
### Flags
119189

120-
| Flag | Description | Default |
121-
|------|-------------|---------|
190+
| Flag | Description | Default |
191+
| -------- | ---------------------- | ------- |
122192
| `--json` | Output results as JSON | `false` |
123193

124194
### Examples
@@ -156,23 +226,23 @@ b2c setup instance create [NAME] [FLAGS]
156226

157227
### Arguments
158228

159-
| Argument | Description | Required |
160-
|----------|-------------|----------|
161-
| `NAME` | Instance name | Yes (or prompted) |
229+
| Argument | Description | Required |
230+
| -------- | ------------- | ----------------- |
231+
| `NAME` | Instance name | Yes (or prompted) |
162232

163233
### Flags
164234

165-
| Flag | Description | Default |
166-
|------|-------------|---------|
167-
| `--hostname`, `-s` | B2C instance hostname | Prompted |
168-
| `--username` | WebDAV username | |
169-
| `--password` | WebDAV password | Prompted if username set |
170-
| `--client-id` | OAuth client ID | |
171-
| `--client-secret` | OAuth client secret | Prompted if client-id set |
172-
| `--code-version` | Code version | |
173-
| `--active` | Set as active instance | `false` |
174-
| `--force` | Non-interactive mode | `false` |
175-
| `--json` | Output results as JSON | `false` |
235+
| Flag | Description | Default |
236+
| ------------------ | ---------------------- | ------------------------- |
237+
| `--hostname`, `-s` | B2C instance hostname | Prompted |
238+
| `--username` | WebDAV username | |
239+
| `--password` | WebDAV password | Prompted if username set |
240+
| `--client-id` | OAuth client ID | |
241+
| `--client-secret` | OAuth client secret | Prompted if client-id set |
242+
| `--code-version` | Code version | |
243+
| `--active` | Set as active instance | `false` |
244+
| `--force` | Non-interactive mode | `false` |
245+
| `--json` | Output results as JSON | `false` |
176246

177247
### Examples
178248

@@ -213,16 +283,16 @@ b2c setup instance remove NAME [FLAGS]
213283

214284
### Arguments
215285

216-
| Argument | Description | Required |
217-
|----------|-------------|----------|
218-
| `NAME` | Instance name to remove | Yes |
286+
| Argument | Description | Required |
287+
| -------- | ----------------------- | -------- |
288+
| `NAME` | Instance name to remove | Yes |
219289

220290
### Flags
221291

222-
| Flag | Description | Default |
223-
|------|-------------|---------|
292+
| Flag | Description | Default |
293+
| --------- | ------------------------ | ------- |
224294
| `--force` | Skip confirmation prompt | `false` |
225-
| `--json` | Output results as JSON | `false` |
295+
| `--json` | Output results as JSON | `false` |
226296

227297
### Examples
228298

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

247317
### Arguments
248318

249-
| Argument | Description | Required |
250-
|----------|-------------|----------|
251-
| `NAME` | Instance name to set as active | Yes |
319+
| Argument | Description | Required |
320+
| -------- | ------------------------------ | -------- |
321+
| `NAME` | Instance name to set as active | Yes |
252322

253323
### Flags
254324

255-
| Flag | Description | Default |
256-
|------|-------------|---------|
325+
| Flag | Description | Default |
326+
| -------- | ---------------------- | ------- |
257327
| `--json` | Output results as JSON | `false` |
258328

259329
### Examples
@@ -299,34 +369,34 @@ b2c setup skills [SKILLSET]
299369

300370
### Arguments
301371

302-
| Argument | Description | Default |
303-
|----------|-------------|---------|
372+
| Argument | Description | Default |
373+
| ---------- | ---------------------------------------- | ---------------------- |
304374
| `SKILLSET` | Skill set to install: `b2c` or `b2c-cli` | Prompted interactively |
305375

306376
### Flags
307377

308-
| Flag | Description | Default |
309-
|------|-------------|---------|
310-
| `--list`, `-l` | List available skills without installing | `false` |
311-
| `--skill` | Install specific skill(s) (can be repeated) | |
312-
| `--ide` | Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, manual | Auto-detect |
313-
| `--global`, `-g` | Install to user home directory (global scope) | `false` |
314-
| `--update`, `-u` | Update existing skills (overwrite) | `false` |
315-
| `--version` | Specific release version | `latest` |
316-
| `--force` | Skip confirmation prompts (non-interactive) | `false` |
317-
| `--json` | Output results as JSON | `false` |
378+
| Flag | Description | Default |
379+
| ---------------- | ----------------------------------------------------------------------------- | ----------- |
380+
| `--list`, `-l` | List available skills without installing | `false` |
381+
| `--skill` | Install specific skill(s) (can be repeated) | |
382+
| `--ide` | Target IDE(s): claude-code, cursor, windsurf, vscode, codex, opencode, manual | Auto-detect |
383+
| `--global`, `-g` | Install to user home directory (global scope) | `false` |
384+
| `--update`, `-u` | Update existing skills (overwrite) | `false` |
385+
| `--version` | Specific release version | `latest` |
386+
| `--force` | Skip confirmation prompts (non-interactive) | `false` |
387+
| `--json` | Output results as JSON | `false` |
318388

319389
### Supported IDEs
320390

321-
| IDE Value | IDE Name | Project Path | Global Path |
322-
|-----------|----------|--------------|-------------|
323-
| `claude-code` | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
324-
| `cursor` | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
325-
| `windsurf` | Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
326-
| `vscode` | VS Code / GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` |
327-
| `codex` | OpenAI Codex CLI | `.codex/skills/` | `~/.codex/skills/` |
328-
| `opencode` | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
329-
| `manual` | Manual | `.claude/skills/` | `~/.claude/skills/` |
391+
| IDE Value | IDE Name | Project Path | Global Path |
392+
| ------------- | ------------------------ | ------------------- | ----------------------------- |
393+
| `claude-code` | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
394+
| `cursor` | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
395+
| `windsurf` | Windsurf | `.windsurf/skills/` | `~/.codeium/windsurf/skills/` |
396+
| `vscode` | VS Code / GitHub Copilot | `.github/skills/` | `~/.copilot/skills/` |
397+
| `codex` | OpenAI Codex CLI | `.codex/skills/` | `~/.codex/skills/` |
398+
| `opencode` | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
399+
| `manual` | Manual | `.claude/skills/` | `~/.claude/skills/` |
330400

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

@@ -390,6 +460,7 @@ claude plugin install b2c
390460
```
391461

392462
The marketplace provides:
463+
393464
- Automatic updates when new versions are released
394465
- Centralized plugin management
395466
- Version tracking
@@ -398,14 +469,15 @@ Use `--ide manual` if you prefer manual installation to the same paths.
398469

399470
### Skill Sets
400471

401-
| Skill Set | Description |
402-
|-----------|-------------|
403-
| `b2c` | B2C Commerce development patterns and practices |
404-
| `b2c-cli` | B2C CLI commands and operations |
472+
| Skill Set | Description |
473+
| --------- | ----------------------------------------------- |
474+
| `b2c` | B2C Commerce development patterns and practices |
475+
| `b2c-cli` | B2C CLI commands and operations |
405476

406477
### Output
407478

408479
When installing, the command reports:
480+
409481
- Successfully installed skills with paths
410482
- Skipped skills (already exist, use `--update` to overwrite)
411483
- Errors encountered during installation
@@ -427,10 +499,10 @@ Successfully installed 12 skill(s):
427499

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

430-
| Artifact | Contents |
431-
|----------|----------|
432-
| `b2c-cli-skills.zip` | Skills for B2C CLI commands and operations |
433-
| `b2c-skills.zip` | Skills for B2C Commerce development patterns |
502+
| Artifact | Contents |
503+
| -------------------- | -------------------------------------------- |
504+
| `b2c-cli-skills.zip` | Skills for B2C CLI commands and operations |
505+
| `b2c-skills.zip` | Skills for B2C Commerce development patterns |
434506

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

0 commit comments

Comments
 (0)