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(cap): add list, tasks, and pull commands with improved UX
- cap list: export and parse commerce_feature_states for installed features
- cap tasks: show config tasks with clickable BM links
- cap pull: download and extract app source packages from instance or GitHub
- Standardize --site-id flag across all cap commands (--site as alias)
- cap uninstall: auto-resolve domain from feature state (drop --domain)
- cap install: keep archive by default, upload to Impex/commerce-apps/
- Fix sites API select query (*) -> (**) and null XML parse handling
- Remove stub fixture fallback from list operation
- Export all CAP operations and types from SDK main index
- Update CLI docs, skill, and add changeset
description: Commands for validating, packaging, installing, and uninstalling Commerce App Packages (CAPs).
2
+
description: Commands for validating, packaging, installing, uninstalling, and listing Commerce App Packages (CAPs) and commerce features.
3
3
---
4
4
5
5
# Commerce App (CAP) Commands
6
6
7
-
Commands for managing Commerce App Packages (CAPs) — the standard format for distributing B2C Commerce integrations.
7
+
Commands for managing Commerce App Packages (CAPs) — the standard format for distributing B2C Commerce integrations — and listing commerce features installed on an instance.
8
8
9
9
## Overview
10
10
11
11
A Commerce App Package bundles cartridges, IMPEX data, and Storefront Next extensions into a single installable unit. See the [Commerce Apps guide](/guide/commerce-apps) for full workflow details.
12
12
13
+
The `cap list` and `cap tasks` commands work with the broader commerce feature state system, which tracks all installed features including ISV apps, native apps, native features, and custom features.
14
+
13
15
## Authentication
14
16
15
-
Installand uninstall commands require OAuth authentication with OCAPI permissions and WebDAV access.
17
+
Install, uninstall, list, and tasks commands require OAuth authentication with OCAPI permissions and WebDAV access.
16
18
17
19
### Required OCAPI Permissions
18
20
19
21
Configure these resources in Business Manager under **Administration** > **Site Development** > **Open Commerce API Settings**:
20
22
21
23
| Resource | Methods | Commands |
22
24
|----------|---------|----------|
23
-
|`/jobs/*/executions`| POST |`cap install`, `cap uninstall`|
24
-
|`/jobs/*/executions/*`| GET |`cap install`, `cap uninstall`|
25
+
|`/jobs/*/executions`| POST |`cap install`, `cap uninstall`, `cap list`, `cap tasks`|
26
+
|`/jobs/*/executions/*`| GET |`cap install`, `cap uninstall`, `cap list`, `cap tasks`|
27
+
|`/sites`| GET |`cap list` (when no `--site-id` specified) |
25
28
26
29
### WebDAV Access
27
30
28
-
The `cap install` command uploads the CAP zip to WebDAV (`Temp/`) before triggering the install job.
31
+
The `cap install` command uploads the CAP zip to WebDAV (`Impex/commerce-apps/`) before triggering the install job. The `cap list`, `cap tasks`, and `cap uninstall` commands download site archive exports via WebDAV.
29
32
30
33
---
31
34
@@ -119,7 +122,7 @@ b2c cap package ./commerce-avalara-tax-app-v0.2.5
119
122
b2c cap package ./commerce-avalara-tax-app-v0.2.5 --output ./dist
120
123
121
124
# Package with explicit zip filename
122
-
b2c cap package ./commerce-avalara-tax-app-v0.2.5 --output ./dist/my-tax-app.zip
125
+
b2c cap package ./commerce-avalara-tax-app-v0.2.5 --output ./dist/my-app.zip
123
126
```
124
127
125
128
---
@@ -131,7 +134,7 @@ Install a Commerce App Package on a B2C Commerce instance.
131
134
### Usage
132
135
133
136
```bash
134
-
b2c cap install PATH --site SITE_ID
137
+
b2c cap install PATH --site-id SITE_ID
135
138
```
136
139
137
140
### Arguments
@@ -144,8 +147,8 @@ b2c cap install PATH --site SITE_ID
144
147
145
148
| Flag | Short | Description |
146
149
|------|-------|-------------|
147
-
|`--site SITE_ID`|`-s`|**Required.** Site ID to install the app on |
148
-
|`--keep-archive`|`-k`| Keep the uploaded zip on the instance after install |
150
+
|`--site-id SITE_ID`|`-s`|**Required.** Site ID to install the app on |
151
+
|`--clean-archive`|| Delete the uploaded zip from the instance after install |
149
152
|`--timeout SECONDS`|`-t`| Timeout in seconds (default: no timeout) |
150
153
|`--skip-validate`|| Skip CAP structure validation before install |
151
154
|`--json`|| Output result as JSON |
@@ -154,37 +157,37 @@ b2c cap install PATH --site SITE_ID
154
157
155
158
1. Validates the CAP structure (unless `--skip-validate`)
156
159
2. Packages the directory into a zip if a directory is provided
157
-
3. Uploads the zip to WebDAV at `Temp/{id}-v{version}.zip`
160
+
3. Uploads the zip to WebDAV at `Impex/commerce-apps/{id}-v{version}.zip`
158
161
4. Executes the `sfcc-install-commerce-app` system job
159
162
5. Waits for job completion
160
-
6.Removes the uploaded zip (unless`--keep-archive`)
163
+
6.Archive is kept on the instance by default (use`--clean-archive` to remove)
161
164
162
165
### Examples
163
166
164
167
```bash
165
168
# Install from a local directory
166
-
b2c cap install ./commerce-avalara-tax-app-v0.2.5 --site RefArch
169
+
b2c cap install ./commerce-avalara-tax-app-v0.2.5 --site-id RefArch
167
170
168
171
# Install from a zip
169
-
b2c cap install ./commerce-avalara-tax-app-v0.2.5.zip --site RefArch
172
+
b2c cap install ./commerce-avalara-tax-app-v0.2.5.zip --site-id RefArch
170
173
171
174
# Install without running validation first
172
-
b2c cap install ./commerce-avalara-tax-app-v0.2.5 --site RefArch --skip-validate
175
+
b2c cap install ./commerce-avalara-tax-app-v0.2.5 --site-id RefArch --skip-validate
173
176
174
-
#Keep the uploaded archive for debugging
175
-
b2c cap install ./commerce-avalara-tax-app-v0.2.5 --site RefArch --keep-archive
177
+
#Remove the uploaded archive after install
178
+
b2c cap install ./commerce-avalara-tax-app-v0.2.5 --site-id RefArch --clean-archive
176
179
```
177
180
178
181
---
179
182
180
183
## b2c cap uninstall
181
184
182
-
Uninstall a Commerce App from a B2C Commerce instance.
185
+
Uninstall a Commerce App from a B2C Commerce instance. Looks up the app's domain automatically from the commerce feature state.
183
186
184
187
### Usage
185
188
186
189
```bash
187
-
b2c cap uninstall APP_NAME --domain DOMAIN --site SITE_ID
|`--site SITE_ID`|`-s`|**Required.** Site ID to uninstall the app from |
203
+
|`--site-id SITE_ID`|`-s`|**Required.** Site ID to uninstall the app from |
202
204
|`--timeout SECONDS`|`-t`| Timeout in seconds (default: no timeout) |
203
205
|`--json`|| Output result as JSON |
204
206
205
207
### Examples
206
208
207
209
```bash
208
210
# Uninstall Avalara Tax from a site
209
-
b2c cap uninstall avalara-tax --domain tax --site RefArch
211
+
b2c cap uninstall avalara-tax --site-id RefArch
210
212
```
211
213
212
214
---
213
215
214
216
## b2c cap list
215
217
216
-
> **Not yet implemented.** Listing installed Commerce Apps will be available in a future release.
218
+
List commerce features installed on a B2C Commerce instance. Exports the `commerce_feature_states` data unit from each site and parses the results.
219
+
220
+
### Usage
221
+
222
+
```bash
223
+
b2c cap list [--site-id SITE_IDS]
224
+
```
225
+
226
+
### Flags
227
+
228
+
| Flag | Short | Description |
229
+
|------|-------|-------------|
230
+
|`--site-id SITE_IDS`|`-s`| Site IDs to query (comma-separated). If omitted, queries all sites. |
231
+
|`--timeout SECONDS`|`-t`| Timeout in seconds (default: no timeout) |
232
+
|`--local`|`-l`| List locally detected Commerce App Packages (no instance required) |
233
+
|`--json`|| Output result as JSON |
234
+
235
+
### Table Columns
236
+
237
+
| Column | Description |
238
+
|--------|-------------|
239
+
| Site ID | Site the feature is installed on (includes `Sites-` prefix) |
240
+
| Name | Feature name (e.g. `avalara-tax`) |
241
+
| Type |`ISV_APP`, `NATIVE_APP`, `NATIVE_FEATURE`, or `CUSTOM_FEATURE`|
242
+
| Source |`CUSTOM` (uploaded via WebDAV) or `REGISTRY` (from App Registry) |
243
+
| Install Status | e.g. `INSTALLED`|
244
+
| Config Status | e.g. `NOT_CONFIGURED`, `CONFIGURED`|
245
+
| Version | Feature version if available |
246
+
| Installed At | Installation timestamp |
247
+
248
+
### JSON Output
249
+
250
+
With `--json`, returns the full feature state including `configTasks` (parsed JSON array of configuration steps) and `installationMetadata` (parsed JSON with job details, cartridge mappings, and IMPEX uninstall data).
251
+
252
+
### Examples
253
+
254
+
```bash
255
+
# List all installed features across all sites
256
+
b2c cap list
257
+
258
+
# List features for specific sites
259
+
b2c cap list --site-id RefArch,SiteGenesis
260
+
261
+
# Machine-readable output with full details
262
+
b2c cap list --json
263
+
264
+
# List locally detected CAP directories
265
+
b2c cap list --local
266
+
```
267
+
268
+
---
269
+
270
+
## b2c cap tasks
271
+
272
+
List configuration tasks for an installed Commerce App, with clickable links to Business Manager pages.
273
+
274
+
### Usage
275
+
276
+
```bash
277
+
b2c cap tasks APP_NAME --site-id SITE_ID
278
+
```
279
+
280
+
### Arguments
281
+
282
+
| Argument | Description |
283
+
|----------|-------------|
284
+
|`APP_NAME`| Commerce App feature name (e.g. `avalara-tax`) |
285
+
286
+
### Flags
287
+
288
+
| Flag | Short | Description |
289
+
|------|-------|-------------|
290
+
|`--site-id SITE_ID`|`-s`|**Required.** Site ID to query |
291
+
|`--timeout SECONDS`|`-t`| Timeout in seconds (default: no timeout) |
292
+
|`--json`|| Output result as JSON |
293
+
294
+
### Examples
295
+
296
+
```bash
297
+
# Show configuration tasks for an installed app
298
+
b2c cap tasks avalara-tax --site-id RefArch
299
+
300
+
# Get tasks as JSON (includes full feature state)
301
+
b2c cap tasks avalara-tax --site-id RefArch --json
302
+
```
303
+
304
+
---
305
+
306
+
## b2c cap pull
307
+
308
+
Pull installed Commerce App source packages from a B2C Commerce instance. By default, pulls all registry-sourced apps. Optionally specify a single app by name.
309
+
310
+
Useful for deploying cartridges to a code version or working with Storefront Next extensions locally.
311
+
312
+
### Usage
313
+
314
+
```bash
315
+
b2c cap pull [APP_NAME] [--site-id SITE_ID] [--output DIR]
316
+
```
317
+
318
+
### Arguments
319
+
320
+
| Argument | Description |
321
+
|----------|-------------|
322
+
|`APP_NAME`|*(optional)* Commerce App feature name to pull (e.g. `avalara-tax`). If omitted, pulls all registry apps. |
323
+
324
+
### Flags
325
+
326
+
| Flag | Short | Description |
327
+
|------|-------|-------------|
328
+
|`--site-id SITE_ID`|`-s`| Site ID to query for installed apps. If omitted, queries all sites. |
0 commit comments