Skip to content

Commit 6e82d3d

Browse files
authored
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
1 parent eb629e1 commit 6e82d3d

File tree

147 files changed

+1000
-581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1000
-581
lines changed

docs/cli/auth.md

Lines changed: 13 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -88,85 +88,20 @@ b2c auth token | pbcopy # macOS: copy to clipboard
8888

8989
## Authentication Overview
9090

91-
The CLI supports multiple authentication methods depending on the operation.
91+
For complete authentication setup instructions, see the [Authentication Setup Guide](/guide/authentication).
9292

93-
### Account Manager API Client (OAuth)
93+
### Quick Reference
9494

95-
Most instance operations require an Account Manager API Client. The CLI supports two authentication methods:
95+
| Operation | Auth Required |
96+
|-----------|--------------|
97+
| [Code](/cli/code) deploy/watch | WebDAV credentials |
98+
| [Code](/cli/code) list/activate/delete, [Jobs](/cli/jobs), [Sites](/cli/sites) | OAuth + OCAPI configuration |
99+
| SCAPI commands ([eCDN](/cli/ecdn), [schemas](/cli/scapi-schemas), [custom-apis](/cli/custom-apis)) | OAuth + SCAPI scopes |
100+
| [ODS](/cli/ods), [SLAS](/cli/slas) | OAuth + appropriate roles |
101+
| [MRT](/cli/mrt) | API Key |
96102

97-
| Auth Method | When Used | Role Configuration |
98-
|-------------|-----------|-------------------|
99-
| User Authentication | Only `--client-id` provided | Roles on your **user account** |
100-
| Client Credentials | Both `--client-id` and `--client-secret` provided | Roles on the **API client** |
103+
See [Configuration](/guide/configuration) for setting up credentials via environment variables or config files.
101104

102-
```bash
103-
# User Authentication (opens browser for login)
104-
b2c ods list --client-id xxx
105-
106-
# Client Credentials
107-
export SFCC_CLIENT_ID=my-client
108-
export SFCC_CLIENT_SECRET=my-secret
109-
b2c ods list
110-
```
111-
112-
Used by:
113-
- Code management (`code list`, `code activate`, `code delete`)
114-
- Job operations (`job run`, `job search`, `job import`, `job export`)
115-
- Site operations (`sites list`)
116-
- 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.
107+
:::

docs/cli/code.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,37 @@ description: Commands for deploying cartridges, activating code versions, and wa
66

77
Commands for managing cartridge code on B2C Commerce instances.
88

9+
## Authentication
10+
11+
Code commands use different authentication depending on the operation:
12+
13+
| Operation | Auth Required |
14+
|-----------|--------------|
15+
| `code deploy`, `code watch` | WebDAV (Basic Auth or OAuth) |
16+
| `code list`, `code activate`, `code delete` | OAuth + OCAPI |
17+
18+
### WebDAV Operations (deploy, watch)
19+
20+
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+
940
## b2c code list
1041

1142
List all code versions on a B2C Commerce instance.
@@ -56,10 +87,6 @@ version2 No Yes 11/28/2024, 10:15:00 AM 15
5687
staging No No 11/25/2024, 9:00:00 AM 12
5788
```
5889

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

6592
## b2c code deploy
@@ -127,15 +154,6 @@ b2c code deploy
127154

128155
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.
129156

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.
138-
139157
---
140158

141159
## b2c code activate
@@ -185,10 +203,6 @@ b2c code activate --code-version v2
185203

186204
Use `--reload` when you've made changes via WebDAV and need the instance to pick up the changes without deploying again.
187205

188-
### Authentication
189-
190-
This command requires OAuth authentication. Provide `--client-id` and `--client-secret` or set the corresponding environment variables.
191-
192206
---
193207

194208
## b2c code delete
@@ -230,10 +244,6 @@ b2c code delete old-version --force
230244
- You cannot delete the currently active code version
231245
- The command will prompt for confirmation unless `--force` is used
232246

233-
### Authentication
234-
235-
This command requires OAuth authentication. Provide `--client-id` and `--client-secret` or set the corresponding environment variables.
236-
237247
---
238248

239249
## b2c code watch
@@ -301,11 +311,3 @@ Press `Ctrl+C` to stop watching.
301311
|----------|-------------|
302312
| `SFCC_UPLOAD_DEBOUNCE_TIME` | Debounce time in milliseconds (default: 100) |
303313

304-
### Authentication
305-
306-
This command requires both WebDAV and OAuth authentication:
307-
308-
- **WebDAV** (for file upload): Basic Auth (`--username`/`--password`) or OAuth
309-
- **OAuth** (for determining active code version): `--client-id` and `--client-secret`
310-
311-
Basic authentication is recommended for WebDAV operations due to better performance.

docs/cli/custom-apis.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export SFCC_SHORTCODE=kv7kzm78
4141
b2c scapi custom status --client-id xxx --client-secret xxx --tenant-id zzxy_prd
4242
```
4343

44+
For complete setup instructions, see the [Authentication Guide](/guide/authentication#scapi-authentication).
45+
4446
---
4547

4648
## b2c scapi custom status

docs/cli/ecdn.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ eCDN commands require OAuth authentication with these scopes:
3535
| Read operations | `sfcc.cdn-zones` |
3636
| Write operations | `sfcc.cdn-zones.rw` |
3737

38+
For complete setup instructions, see the [Authentication Guide](/guide/authentication#scapi-authentication).
39+
3840
---
3941

4042
## Zone Management

docs/cli/jobs.md

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@ description: Commands for executing jobs, importing and exporting site archives,
66

77
Commands for executing and monitoring jobs on B2C Commerce instances.
88

9+
## Authentication
10+
11+
Job commands require OAuth authentication with OCAPI permissions.
12+
13+
### Required OCAPI Permissions
14+
15+
Configure these resources in Business Manager under **Administration** > **Site Development** > **Open Commerce API Settings**:
16+
17+
| Resource | Methods | Commands |
18+
|----------|---------|----------|
19+
| `/jobs/*/executions` | POST | `job run` |
20+
| `/jobs/*/executions/*` | GET | `job run --wait`, `job wait` |
21+
| `/job_execution_search` | POST | `job search` |
22+
23+
### WebDAV Access
24+
25+
The `job import` and `job export` commands also require WebDAV access for file transfer.
26+
27+
### Configuration
28+
29+
```bash
30+
# OAuth credentials
31+
export SFCC_CLIENT_ID=your-client-id
32+
export SFCC_CLIENT_SECRET=your-client-secret
33+
34+
# WebDAV (for import/export)
35+
export SFCC_USERNAME=your-bm-username
36+
export SFCC_PASSWORD=your-webdav-access-key
37+
```
38+
39+
For complete setup instructions, see the [Authentication Guide](/guide/authentication).
40+
41+
---
42+
943
## b2c job run
1044

1145
Execute a job on a B2C Commerce instance.
@@ -68,10 +102,6 @@ b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":[
68102
b2c job run sfcc-search-index-product-full-update --wait --body '{"site_scope":["RefArch"]}'
69103
```
70104

71-
### Authentication
72-
73-
This command requires OAuth authentication with OCAPI permissions for the `/jobs` resource.
74-
75105
---
76106

77107
## b2c job wait
@@ -114,10 +144,6 @@ b2c job wait my-job abc123-def456 --timeout 600
114144
b2c job wait my-job abc123-def456 --poll-interval 5
115145
```
116146

117-
### Authentication
118-
119-
This command requires OAuth authentication with OCAPI permissions for the `/jobs` resource.
120-
121147
---
122148

123149
## b2c job search
@@ -171,10 +197,6 @@ The command displays a table of job executions with:
171197
- Status
172198
- Start Time
173199

174-
### Authentication
175-
176-
This command requires OAuth authentication with OCAPI permissions for the `/job_execution_search` resource.
177-
178200
---
179201

180202
## b2c job import
@@ -229,10 +251,6 @@ b2c job import ./my-site-data --timeout 300
229251
- The archive is uploaded to `Impex/src/instance/` on the instance
230252
- By default, the archive is deleted after successful import (use `--keep-archive` to retain)
231253

232-
### Authentication
233-
234-
This command requires OAuth authentication with OCAPI permissions for the `/jobs` resource and WebDAV access for file upload.
235-
236254
---
237255

238256
## b2c job export
@@ -317,6 +335,3 @@ When using `--global-data`, available types include:
317335
- `services` - Service configurations
318336
- And more (see OCAPI documentation)
319337

320-
### Authentication
321-
322-
This command requires OAuth authentication with OCAPI permissions for the `/jobs` resource and WebDAV access for file download.

docs/cli/mrt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ MRT commands use API key authentication. The API key is configured in the Manage
4848

4949
1. Log in to the [Managed Runtime dashboard](https://runtime.commercecloud.com/)
5050
2. Navigate to **Account Settings** > **API Keys**
51-
3. Create a new API key or use an existing one
51+
3. Copy your API key (or generate one if you haven't already)
5252

5353
### Configuration
5454

@@ -64,6 +64,8 @@ Provide the API key via one of these methods:
6464
}
6565
```
6666

67+
For complete setup instructions, see the [Authentication Guide](/guide/authentication#managed-runtime-api-key).
68+
6769
---
6870

6971
## Organization Commands

docs/cli/ods.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ ODS commands require an Account Manager API Client.
2929

3030
**Client Credentials**: Used when both `--client-id` and `--client-secret` are provided. The `Sandbox API User` role must be assigned to the API client.
3131

32-
### Tenant Scope
32+
### Tenant Filter
3333

34-
The API client must 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**.
3535

3636
### Configuration
3737

@@ -45,6 +45,8 @@ export SFCC_CLIENT_SECRET=my-secret
4545
b2c ods list
4646
```
4747

48+
For complete setup instructions, see the [Authentication Guide](/guide/authentication#account-manager-api-client).
49+
4850
---
4951

5052
## b2c ods list

docs/cli/scapi-schemas.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export SFCC_SHORTCODE=kv7kzm78
3737
b2c scapi schemas list --client-id xxx --client-secret xxx --tenant-id zzxy_prd
3838
```
3939

40+
For complete setup instructions, see the [Authentication Guide](/guide/authentication#scapi-authentication).
41+
4042
---
4143

4244
## b2c scapi schemas list

docs/cli/sites.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,28 @@ description: Commands for listing and managing storefront sites on B2C Commerce
66

77
Commands for managing sites on B2C Commerce instances.
88

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+
931
## b2c sites list
1032

1133
List sites on a B2C Commerce instance.
@@ -55,6 +77,3 @@ Found 2 site(s):
5577
Status: online
5678
```
5779

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

Comments
 (0)