You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli,docs): add documentation links to CLI help and improve docs (#76)
* feat(cli): add documentation links to CLI help output
Add links to online documentation in CLI help output for both topics
and individual commands.
- Add withDocs() helper function to i18n module
- Update all topic descriptions in package.json with docs URLs
- Update all command descriptions to use withDocs() with anchored links
Example topic help output:
$ b2c code --help
Deploy and manage code versions on instances
Docs: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/code.html
Example command help output:
$ b2c code activate --help
DESCRIPTION
Activate or reload a code version
Docs: https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/code.html#b2c-code-activate
* docs: improve CLI reference and authentication documentation
- Streamline auth.md with clearer credential requirements
- Update code.md with improved examples
- Add setup instructions to various CLI reference pages
- Expand authentication guide with detailed OAuth and WebDAV setup
- Minor fixes to configuration and other docs
- ODS operations (requires `Sandbox API User` role)
117
-
- SLAS operations (requires `SLAS Organization Administrator` or `Sandbox API User` role depending on auth method)
118
-
119
-
### Basic Auth (WebDAV)
120
-
121
-
WebDAV operations support Basic Auth using your Business Manager username and WebDAV access key:
122
-
123
-
```bash
124
-
export SFCC_USERNAME=my-user
125
-
export SFCC_PASSWORD=my-webdav-access-key
126
-
```
127
-
128
-
Used by:
129
-
-`code deploy` (file upload)
130
-
-`code watch` (file upload)
131
-
-`webdav` commands
132
-
133
-
### MRT API Key
134
-
135
-
Managed Runtime commands use a separate API key obtained from the MRT dashboard:
136
-
137
-
```bash
138
-
export SFCC_MRT_API_KEY=your-mrt-api-key
139
-
```
140
-
141
-
See [MRT Commands](./mrt#authentication) for details.
142
-
143
-
### Mixed Authentication
144
-
145
-
Some commands (like `code deploy` with `--reload`) require both OAuth and WebDAV access:
146
-
147
-
```bash
148
-
export SFCC_CLIENT_ID=my-client
149
-
export SFCC_CLIENT_SECRET=my-secret
150
-
export SFCC_USERNAME=my-user
151
-
export SFCC_PASSWORD=my-access-key
152
-
b2c code deploy --reload
153
-
```
154
-
155
-
### Configuration File
156
-
157
-
Credentials can be stored in a `dw.json` file:
158
-
159
-
```json
160
-
{
161
-
"client-id": "my-client",
162
-
"client-secret": "my-secret",
163
-
"username": "my-user",
164
-
"password": "my-access-key"
165
-
}
166
-
```
167
-
168
-
Use `--config` to specify a custom config file path, or `--instance` to select a named instance configuration.
169
-
170
-
### Tenant Scope
171
-
172
-
For ODS and SLAS operations, your API client must have tenant scope configured for the realm/organization you wish to manage. This is set up in Account Manager when creating or editing the API client.
105
+
::: tip
106
+
Each command page below documents its specific authentication requirements including required scopes.
File upload operations require WebDAV access. Basic authentication is recommended:
21
+
22
+
```bash
23
+
export SFCC_USERNAME=your-bm-username
24
+
export SFCC_PASSWORD=your-webdav-access-key
25
+
```
26
+
27
+
### OCAPI Operations (list, activate, delete)
28
+
29
+
These commands require OAuth authentication with OCAPI permissions for the `/code_versions` resource configured in Business Manager.
30
+
31
+
```bash
32
+
export SFCC_CLIENT_ID=your-client-id
33
+
export SFCC_CLIENT_SECRET=your-client-secret
34
+
```
35
+
36
+
For complete setup instructions including OCAPI configuration, see the [Authentication Guide](/guide/authentication).
37
+
38
+
---
39
+
9
40
## b2c code list
10
41
11
42
List all code versions on a B2C Commerce instance.
@@ -56,10 +87,6 @@ version2 No Yes 11/28/2024, 10:15:00 AM 15
56
87
staging No No 11/25/2024, 9:00:00 AM 12
57
88
```
58
89
59
-
### Authentication
60
-
61
-
This command requires OAuth authentication. Provide `--client-id` and `--client-secret` or set the corresponding `SFCC_CLIENT_ID` and `SFCC_CLIENT_SECRET` environment variables.
62
-
63
90
---
64
91
65
92
## b2c code deploy
@@ -127,15 +154,6 @@ b2c code deploy
127
154
128
155
Cartridges are discovered by searching for `.project` files (Eclipse project markers commonly used in SFCC development). The directory containing the `.project` file is considered a cartridge.
129
156
130
-
### Authentication
131
-
132
-
This command requires both WebDAV and OAuth authentication:
133
-
134
-
-**WebDAV** (for file upload): Basic Auth (`--username`/`--password`) or OAuth
135
-
-**OAuth** (for code version reload): `--client-id` and `--client-secret`
136
-
137
-
Basic authentication is recommended for WebDAV operations due to better performance.
Copy file name to clipboardExpand all lines: docs/cli/ods.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,9 @@ ODS commands require an Account Manager API Client.
29
29
30
30
**Client Credentials**: Used when both `--client-id` and `--client-secret` are provided. The `Sandbox API User` role must be assigned to the API client.
31
31
32
-
### Tenant Scope
32
+
### Tenant Filter
33
33
34
-
The API clientmust have tenant scope configured for the realm(s) you wish to manage. This is configured in Account Manager under the API client's **Organizations** section.
34
+
The API client's roles must have a tenant filter configured for the realm(s) you wish to manage. In Account Manager, under each role (e.g., `Sandbox API User`), add the realm IDs you need to access to the **Tenant Filter**.
Copy file name to clipboardExpand all lines: docs/cli/sites.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,28 @@ description: Commands for listing and managing storefront sites on B2C Commerce
6
6
7
7
Commands for managing sites on B2C Commerce instances.
8
8
9
+
## Authentication
10
+
11
+
Sites commands require OAuth authentication with OCAPI permissions for the `/sites` resource.
12
+
13
+
### Required OCAPI Permissions
14
+
15
+
| Resource | Methods |
16
+
|----------|---------|
17
+
|`/sites`| GET |
18
+
|`/sites/*`| GET |
19
+
20
+
### Configuration
21
+
22
+
```bash
23
+
export SFCC_CLIENT_ID=your-client-id
24
+
export SFCC_CLIENT_SECRET=your-client-secret
25
+
```
26
+
27
+
For complete setup instructions, see the [Authentication Guide](/guide/authentication).
28
+
29
+
---
30
+
9
31
## b2c sites list
10
32
11
33
List sites on a B2C Commerce instance.
@@ -55,6 +77,3 @@ Found 2 site(s):
55
77
Status: online
56
78
```
57
79
58
-
### Authentication
59
-
60
-
This command requires OAuth authentication. Provide `--client-id` and `--client-secret` or set the corresponding `SFCC_CLIENT_ID` and `SFCC_CLIENT_SECRET` environment variables.
0 commit comments