Skip to content

Commit ae17d7e

Browse files
committed
docs
1 parent 232e6d2 commit ae17d7e

File tree

5 files changed

+270
-68
lines changed

5 files changed

+270
-68
lines changed

docs/.vitepress/config.mts

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig } from 'vitepress';
1+
import {defineConfig} from 'vitepress';
22
import typedocSidebar from '../api/typedoc-sidebar.json';
33

44
// Version configuration from environment
@@ -15,73 +15,74 @@ const basePath = isReleaseBuild ? `${siteBase}/release/` : `${siteBase}/`;
1515
function getVersionItems() {
1616
if (releaseVersion === 'unreleased') {
1717
// No release yet - only show dev
18-
return [{ text: 'Development (main)', link: '/' }];
18+
return [{text: 'Development (main)', link: '/'}];
1919
}
2020

2121
if (isReleaseBuild) {
2222
// Release build: base is /b2c-developer-tooling/release/
2323
// Use ../ to navigate up to main docs
2424
return [
25-
{ text: 'Development (main)', link: '../' },
26-
{ text: 'Latest Release', link: '/' },
25+
{text: 'Development (main)', link: '../'},
26+
{text: 'Latest Release', link: '/'},
2727
];
2828
}
2929

3030
// Main build: base is /b2c-developer-tooling/
3131
return [
32-
{ text: 'Development (main)', link: '/' },
33-
{ text: 'Latest Release', link: '/release/' },
32+
{text: 'Development (main)', link: '/'},
33+
{text: 'Latest Release', link: '/release/'},
3434
];
3535
}
3636

3737
const guideSidebar = [
3838
{
3939
text: 'Getting Started',
4040
items: [
41-
{ text: 'Introduction', link: '/guide/' },
42-
{ text: 'Installation', link: '/guide/installation' },
43-
{ text: 'Configuration', link: '/guide/configuration' },
44-
{ text: 'Agent Skills & Plugins', link: '/guide/agent-skills' },
41+
{text: 'Introduction', link: '/guide/'},
42+
{text: 'Installation', link: '/guide/installation'},
43+
{text: 'Configuration', link: '/guide/configuration'},
44+
{text: 'Agent Skills & Plugins', link: '/guide/agent-skills'},
4545
],
4646
},
4747
{
4848
text: 'Guides',
4949
items: [
50-
{ text: 'Authentication Setup', link: '/guide/authentication' },
51-
{ text: 'Account Manager', link: '/guide/account-manager' },
52-
{ text: 'Scaffolding', link: '/guide/scaffolding' },
53-
{ text: 'Security', link: '/guide/security' },
54-
{ text: 'Storefront Next', link: '/guide/storefront-next' },
50+
{text: 'Authentication Setup', link: '/guide/authentication'},
51+
{text: 'Account Manager', link: '/guide/account-manager'},
52+
{text: 'Scaffolding', link: '/guide/scaffolding'},
53+
{text: 'Security', link: '/guide/security'},
54+
{text: 'Storefront Next', link: '/guide/storefront-next'},
5555
],
5656
},
5757
{
5858
text: 'Extending',
5959
items: [
60-
{ text: 'Custom Plugins', link: '/guide/extending' },
61-
{ text: '3rd Party Plugins', link: '/guide/third-party-plugins' },
60+
{text: 'Custom Plugins', link: '/guide/extending'},
61+
{text: '3rd Party Plugins', link: '/guide/third-party-plugins'},
6262
],
6363
},
6464
{
6565
text: 'CLI Reference',
6666
items: [
67-
{ text: 'Overview', link: '/cli/' },
68-
{ text: 'Code Commands', link: '/cli/code' },
69-
{ text: 'Content Commands', link: '/cli/content' },
70-
{ text: 'Job Commands', link: '/cli/jobs' },
71-
{ text: 'Logs Commands', link: '/cli/logs' },
72-
{ text: 'Sites Commands', link: '/cli/sites' },
73-
{ text: 'WebDAV Commands', link: '/cli/webdav' },
74-
{ text: 'Sandbox Commands', link: '/cli/sandbox' },
75-
{ text: 'MRT Commands', link: '/cli/mrt' },
76-
{ text: 'eCDN Commands', link: '/cli/ecdn' },
77-
{ text: 'SLAS Commands', link: '/cli/slas' },
78-
{ text: 'Custom APIs', link: '/cli/custom-apis' },
79-
{ text: 'SCAPI Schemas', link: '/cli/scapi-schemas' },
80-
{ text: 'Setup Commands', link: '/cli/setup' },
81-
{ text: 'Scaffold Commands', link: '/cli/scaffold' },
82-
{ text: 'Auth Commands', link: '/cli/auth' },
83-
{ text: 'Account Manager Commands', link: '/cli/account-manager' },
84-
{ text: 'Logging', link: '/cli/logging' },
67+
{text: 'Overview', link: '/cli/'},
68+
{text: 'Code Commands', link: '/cli/code'},
69+
{text: 'Content Commands', link: '/cli/content'},
70+
{text: 'Job Commands', link: '/cli/jobs'},
71+
{text: 'Logs Commands', link: '/cli/logs'},
72+
{text: 'Sites Commands', link: '/cli/sites'},
73+
{text: 'WebDAV Commands', link: '/cli/webdav'},
74+
{text: 'Sandbox Commands', link: '/cli/sandbox'},
75+
{text: 'MRT Commands', link: '/cli/mrt'},
76+
{text: 'eCDN Commands', link: '/cli/ecdn'},
77+
{text: 'SLAS Commands', link: '/cli/slas'},
78+
{text: 'Custom APIs', link: '/cli/custom-apis'},
79+
{text: 'SCAPI Schemas', link: '/cli/scapi-schemas'},
80+
{text: 'Setup Commands', link: '/cli/setup'},
81+
{text: 'Scaffold Commands', link: '/cli/scaffold'},
82+
{text: 'Docs Commands', link: '/cli/docs'},
83+
{text: 'Auth Commands', link: '/cli/auth'},
84+
{text: 'Account Manager Commands', link: '/cli/account-manager'},
85+
{text: 'Logging', link: '/cli/logging'},
8586
],
8687
},
8788
];
@@ -122,7 +123,7 @@ export default defineConfig({
122123

123124
// Show deeper heading levels in the outline
124125
markdown: {
125-
toc: { level: [2, 3, 4] },
126+
toc: {level: [2, 3, 4]},
126127
},
127128

128129
themeConfig: {
@@ -131,9 +132,9 @@ export default defineConfig({
131132
level: [2, 3],
132133
},
133134
nav: [
134-
{ text: 'Guide', link: '/guide/' },
135-
{ text: 'CLI Reference', link: '/cli/' },
136-
{ text: 'API Reference', link: '/api/' },
135+
{text: 'Guide', link: '/guide/'},
136+
{text: 'CLI Reference', link: '/cli/'},
137+
{text: 'API Reference', link: '/api/'},
137138
{
138139
text: isReleaseBuild ? 'Latest Release' : 'dev',
139140
items: getVersionItems(),
@@ -151,13 +152,13 @@ export default defineConfig({
151152
'/api/': [
152153
{
153154
text: 'API Reference',
154-
items: [{ text: 'Overview', link: '/api/' }],
155+
items: [{text: 'Overview', link: '/api/'}],
155156
},
156157
...typedocSidebar,
157158
],
158159
},
159160

160-
socialLinks: [{ icon: 'github', link: 'https://github.com/SalesforceCommerceCloud/b2c-developer-tooling' }],
161+
socialLinks: [{icon: 'github', link: 'https://github.com/SalesforceCommerceCloud/b2c-developer-tooling'}],
161162

162163
search: {
163164
provider: 'local',

docs/cli/docs.md

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
---
2+
description: Search, read, and download B2C Commerce Script API documentation and bundled XSD schemas.
3+
---
4+
5+
# Docs Commands
6+
7+
Commands for searching and reading Script API documentation (`dw.*` classes/modules), reading bundled XSD schemas, and downloading fresh documentation from an instance.
8+
9+
## Authentication
10+
11+
| Operation | Auth Required |
12+
| --------------- | --------------------------------- |
13+
| `docs search` | None (uses local bundled docs) |
14+
| `docs read` | None (uses local bundled docs) |
15+
| `docs schema` | None (uses local bundled schemas) |
16+
| `docs download` | Instance + WebDAV credentials |
17+
18+
For `b2c docs download`, configure instance and WebDAV access:
19+
20+
```bash
21+
export SFCC_SERVER=my-sandbox.demandware.net
22+
export SFCC_USERNAME=your-username
23+
export SFCC_PASSWORD=your-password
24+
```
25+
26+
In addition to these topic-specific options, all commands also support [global flags](./index#global-flags).
27+
28+
---
29+
30+
## b2c docs search
31+
32+
Search bundled Script API documentation using fuzzy matching.
33+
34+
### Usage
35+
36+
```bash
37+
b2c docs search [query]
38+
```
39+
40+
### Arguments
41+
42+
| Argument | Description | Required |
43+
| -------- | ------------------------------------------------------- | ------------------------------------- |
44+
| `query` | Search query (class name, module path, or partial text) | No (required unless `--list` is used) |
45+
46+
### Flags
47+
48+
| Flag | Description | Default |
49+
| --------------- | ---------------------------------------- | ------- |
50+
| `--limit`, `-l` | Maximum number of results to display | `20` |
51+
| `--list` | List all available documentation entries | `false` |
52+
53+
### Examples
54+
55+
```bash
56+
# Search by class name
57+
b2c docs search ProductMgr
58+
59+
# Search with multiple terms
60+
b2c docs search "catalog product"
61+
62+
# Limit result count
63+
b2c docs search status --limit 5
64+
65+
# List all available entries
66+
b2c docs search --list
67+
```
68+
69+
### Output
70+
71+
Default output is a table with `ID`, `Title`, and `Match` score. With `--list`, output shows all entries (`ID` and `Title`) plus a total count.
72+
73+
---
74+
75+
## b2c docs read
76+
77+
Read Script API documentation for a specific class or module.
78+
79+
### Usage
80+
81+
```bash
82+
b2c docs read <query>
83+
```
84+
85+
### Arguments
86+
87+
| Argument | Description | Required |
88+
| -------- | ---------------------------------- | -------- |
89+
| `query` | Class/module name or partial match | Yes |
90+
91+
### Flags
92+
93+
| Flag | Description | Default |
94+
| ------------- | ------------------------------------------- | ------- |
95+
| `--raw`, `-r` | Output raw markdown (no terminal rendering) | `false` |
96+
97+
### Examples
98+
99+
```bash
100+
# Read a class doc
101+
b2c docs read ProductMgr
102+
103+
# Read by fully qualified name
104+
b2c docs read dw.catalog.ProductMgr
105+
106+
# Output raw markdown for piping
107+
b2c docs read ProductMgr --raw
108+
109+
# JSON output with selected entry + content
110+
b2c docs read ProductMgr --json
111+
```
112+
113+
### Output
114+
115+
By default, markdown is rendered for terminal display. Raw markdown is emitted when using `--raw` (or when output is not a TTY).
116+
117+
---
118+
119+
## b2c docs schema
120+
121+
Read bundled XSD schemas (import/export data format definitions).
122+
123+
### Usage
124+
125+
```bash
126+
b2c docs schema [query]
127+
```
128+
129+
### Arguments
130+
131+
| Argument | Description | Required |
132+
| -------- | ------------------------------------------------------------- | ------------------------------------- |
133+
| `query` | Schema name or partial match (for example `catalog`, `order`) | No (required unless `--list` is used) |
134+
135+
### Flags
136+
137+
| Flag | Description | Default |
138+
| -------------- | -------------------------- | ------- |
139+
| `--list`, `-l` | List all available schemas | `false` |
140+
141+
### Examples
142+
143+
```bash
144+
# Read a specific schema
145+
b2c docs schema catalog
146+
147+
# Fuzzy match by schema name
148+
b2c docs schema order
149+
150+
# List available schemas
151+
b2c docs schema --list
152+
153+
# JSON output
154+
b2c docs schema catalog --json
155+
```
156+
157+
### Output
158+
159+
Without `--json`, the command writes schema XML directly to stdout. With `--list`, it prints available schema IDs and a total count.
160+
161+
---
162+
163+
## b2c docs download
164+
165+
Download Script API documentation from a B2C Commerce instance to a local directory.
166+
167+
### Usage
168+
169+
```bash
170+
b2c docs download <output>
171+
```
172+
173+
### Arguments
174+
175+
| Argument | Description | Required |
176+
| -------- | ----------------------------------------- | -------- |
177+
| `output` | Local output directory for extracted docs | Yes |
178+
179+
### Flags
180+
181+
| Flag | Description | Default |
182+
| ---------------- | ------------------------------------------------- | ------- |
183+
| `--keep-archive` | Keep the downloaded archive file after extraction | `false` |
184+
185+
In addition to [global flags](./index#global-flags), this command supports [instance flags](./index#instance-flags) and authentication flags for WebDAV access.
186+
187+
### Examples
188+
189+
```bash
190+
# Download docs to a local directory
191+
b2c docs download ./docs
192+
193+
# Keep the downloaded archive
194+
b2c docs download ./docs --keep-archive
195+
196+
# Specify instance hostname directly
197+
b2c docs download ./my-docs --server sandbox.demandware.net
198+
199+
# JSON output
200+
b2c docs download ./docs --json
201+
```
202+
203+
### Output
204+
205+
The command reports the number of extracted files and output path. If `--keep-archive` is set, it also prints the saved archive location.

0 commit comments

Comments
 (0)