Skip to content

Commit f800185

Browse files
committed
docs: example libraries config in content commands
Add a concrete example of the libraries config (mixed shared + site entries) under b2c content export, and a corresponding inferred-flag example under b2c content list, so the new behavior is visible in the CLI command docs and not just the configuration guide.
1 parent e8d7fb9 commit f800185

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

docs/cli/content.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,38 @@ export SFCC_SERVER=my-sandbox.demandware.net
102102
export SFCC_CLIENT_ID=your-client-id
103103
export SFCC_CLIENT_SECRET=your-client-secret
104104
b2c content export homepage
105+
106+
# With a libraries config entry (see below) marking "homepage" as site-private,
107+
# --site-library is inferred automatically:
108+
b2c content export homepage --library homepage
109+
```
110+
111+
### Configuring multiple libraries
112+
113+
Listing libraries under `b2c.libraries` in `package.json` (or `libraries` in `dw.json`) lets the CLI pick a default library and infer `--site-library` per entry. Bare strings are shared libraries; `{id, siteLibrary: true}` marks a site-private library. Both forms can be mixed:
114+
115+
```json
116+
{
117+
"b2c": {
118+
"libraries": [
119+
"RefArch",
120+
{ "id": "homepage", "siteLibrary": true }
121+
]
122+
}
123+
}
124+
```
125+
126+
With this config:
127+
128+
```bash
129+
# Uses RefArch (first entry) as the default library
130+
b2c content export hero-banner
131+
132+
# --site-library is inferred from the matching entry
133+
b2c content export homepage --library homepage
134+
135+
# Explicit flag still overrides the config
136+
b2c content export homepage --library homepage --no-site-library
105137
```
106138

107139
### Output
@@ -166,6 +198,11 @@ b2c content list --library SharedLibrary --tree
166198
# List from a site-private library
167199
b2c content list --library RefArch --site-library
168200

201+
# With a libraries config entry marking "homepage" as site-private,
202+
# --site-library is inferred automatically (see "b2c content export"
203+
# above for an example b2c.libraries config):
204+
b2c content list --library homepage
205+
169206
# List from a local XML file
170207
b2c content list --library SharedLibrary --library-file ./library.xml
171208

0 commit comments

Comments
 (0)