|
| 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