@sanity/workflow-cli 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +75 -46
  3. package/dist/commands/{abort.d.ts → editorial-workflows/abort.d.ts} +3 -2
  4. package/dist/commands/{abort.js → editorial-workflows/abort.js} +7 -6
  5. package/dist/commands/{definition → editorial-workflows/definition}/delete.d.ts +3 -2
  6. package/dist/commands/{definition → editorial-workflows/definition}/delete.js +6 -5
  7. package/dist/commands/{definition → editorial-workflows/definition}/diff.d.ts +2 -1
  8. package/dist/commands/{definition → editorial-workflows/definition}/diff.js +7 -6
  9. package/dist/commands/{definition → editorial-workflows/definition}/list.d.ts +5 -1
  10. package/dist/commands/{definition → editorial-workflows/definition}/list.js +27 -24
  11. package/dist/commands/{definition → editorial-workflows/definition}/show.d.ts +3 -2
  12. package/dist/commands/{definition → editorial-workflows/definition}/show.js +9 -8
  13. package/dist/commands/{deploy.d.ts → editorial-workflows/deploy.d.ts} +2 -1
  14. package/dist/commands/{deploy.js → editorial-workflows/deploy.js} +14 -13
  15. package/dist/commands/{diagnose.d.ts → editorial-workflows/diagnose.d.ts} +2 -1
  16. package/dist/commands/{diagnose.js → editorial-workflows/diagnose.js} +7 -6
  17. package/dist/commands/{fire-action.d.ts → editorial-workflows/fire-action.d.ts} +3 -2
  18. package/dist/commands/{fire-action.js → editorial-workflows/fire-action.js} +8 -7
  19. package/dist/commands/{list.d.ts → editorial-workflows/list.d.ts} +4 -1
  20. package/dist/commands/{list.js → editorial-workflows/list.js} +33 -28
  21. package/dist/commands/editorial-workflows/nuke.d.ts +12 -0
  22. package/dist/commands/editorial-workflows/nuke.js +77 -0
  23. package/dist/commands/{reset-activity.d.ts → editorial-workflows/reset-activity.d.ts} +2 -1
  24. package/dist/commands/{reset-activity.js → editorial-workflows/reset-activity.js} +2 -1
  25. package/dist/commands/{set-stage.d.ts → editorial-workflows/set-stage.d.ts} +4 -3
  26. package/dist/commands/{set-stage.js → editorial-workflows/set-stage.js} +6 -5
  27. package/dist/commands/{show.d.ts → editorial-workflows/show.d.ts} +2 -1
  28. package/dist/commands/{show.js → editorial-workflows/show.js} +40 -26
  29. package/dist/commands/{start.d.ts → editorial-workflows/start.d.ts} +20 -4
  30. package/dist/commands/{start.js → editorial-workflows/start.js} +58 -16
  31. package/dist/commands/{tail.d.ts → editorial-workflows/tail.d.ts} +2 -1
  32. package/dist/commands/{tail.js → editorial-workflows/tail.js} +10 -8
  33. package/dist/hooks/finally/telemetry.js +2 -2
  34. package/dist/hooks/prerun/telemetry.d.ts +4 -3
  35. package/dist/lib/base-command.d.ts +4 -6
  36. package/dist/lib/base-command.js +6 -0
  37. package/dist/lib/client.d.ts +8 -0
  38. package/dist/lib/client.js +1 -1
  39. package/dist/lib/context.d.ts +6 -2
  40. package/dist/lib/context.js +9 -7
  41. package/dist/lib/definitions.js +2 -2
  42. package/dist/lib/flags.d.ts +4 -3
  43. package/dist/lib/nuke.d.ts +89 -0
  44. package/dist/lib/nuke.js +111 -0
  45. package/dist/lib/operation-args.d.ts +3 -1
  46. package/dist/lib/ops-report.d.ts +2 -1
  47. package/dist/lib/prompt.d.ts +11 -0
  48. package/dist/lib/prompt.js +4 -0
  49. package/dist/lib/select-deployment.d.ts +12 -7
  50. package/dist/lib/select-deployment.js +26 -1
  51. package/dist/lib/share-definitions.d.ts +23 -28
  52. package/dist/lib/share-definitions.js +30 -40
  53. package/dist/lib/telemetry-setup.d.ts +2 -2
  54. package/dist/lib/telemetry.d.ts +18 -10
  55. package/dist/lib/telemetry.js +5 -2
  56. package/dist/lib/ui.d.ts +12 -0
  57. package/dist/lib/ui.js +9 -0
  58. package/oclif.manifest.json +138 -46
  59. package/package.json +11 -9
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "commands": {
3
- "abort": {
4
- "aliases": [],
3
+ "editorial-workflows:abort": {
4
+ "aliases": [
5
+ "abort"
6
+ ],
5
7
  "args": {
6
8
  "instanceId": {
7
9
  "description": "Workflow instance id.",
@@ -9,7 +11,7 @@
9
11
  "required": true
10
12
  }
11
13
  },
12
- "description": "Abort an in-flight workflow instance — a hard stop: pending effects are cancelled, stage guards lifted, and the instance is marked terminal where it stands.",
14
+ "description": "Abort an in-flight workflow instance — a hard stop: pending effects are cancelled, stage guards removed, and the instance is marked terminal where it stands.",
13
15
  "examples": [
14
16
  "<%= config.bin %> abort wf-instance.abc123",
15
17
  "<%= config.bin %> abort wf-instance.abc123 --reason 'superseded by relaunch'"
@@ -32,7 +34,7 @@
32
34
  },
33
35
  "hasDynamicHelp": false,
34
36
  "hiddenAliases": [],
35
- "id": "abort",
37
+ "id": "editorial-workflows:abort",
36
38
  "pluginAlias": "@sanity/workflow-cli",
37
39
  "pluginName": "@sanity/workflow-cli",
38
40
  "pluginType": "core",
@@ -41,11 +43,14 @@
41
43
  "relativePath": [
42
44
  "dist",
43
45
  "commands",
46
+ "editorial-workflows",
44
47
  "abort.js"
45
48
  ]
46
49
  },
47
- "deploy": {
48
- "aliases": [],
50
+ "editorial-workflows:deploy": {
51
+ "aliases": [
52
+ "deploy"
53
+ ],
49
54
  "args": {},
50
55
  "description": "Validate, diff, and deploy workflow definitions to the resource bound by the selected deployment.",
51
56
  "examples": [
@@ -92,7 +97,7 @@
92
97
  "type": "option"
93
98
  },
94
99
  "share-defs": {
95
- "description": "Share the definition documents newly created by this deploy with Sanity — the full document, verbatim (structure, names, filters, effect configuration, seeded values), plus its deployment coordinates (project and dataset, or resource id); never content documents, instances, or your Sanity auth token. Opt-out: an interactive terminal is asked once (the answer is remembered), while unattended runs (CI / non-TTY / DO_NOT_TRACK) share nothing unless --share-defs is passed. Use --no-share-defs to opt out. An explicit --share-defs also sends telemetry for this deploy regardless of CI / DO_NOT_TRACK.",
100
+ "description": "Share the definition documents newly created by this deploy with Sanity — the full document, verbatim (structure, names, filters, effect configuration, seeded values), plus its deployment coordinates (project and dataset, or resource id); never content documents, instances, or your Sanity auth token. Sharing is the default in every environment, including CI / non-TTY / DO_NOT_TRACK. Use --no-share-defs to opt out.",
96
101
  "name": "share-defs",
97
102
  "allowNo": true,
98
103
  "type": "boolean"
@@ -100,7 +105,7 @@
100
105
  },
101
106
  "hasDynamicHelp": false,
102
107
  "hiddenAliases": [],
103
- "id": "deploy",
108
+ "id": "editorial-workflows:deploy",
104
109
  "pluginAlias": "@sanity/workflow-cli",
105
110
  "pluginName": "@sanity/workflow-cli",
106
111
  "pluginType": "core",
@@ -109,11 +114,14 @@
109
114
  "relativePath": [
110
115
  "dist",
111
116
  "commands",
117
+ "editorial-workflows",
112
118
  "deploy.js"
113
119
  ]
114
120
  },
115
- "diagnose": {
116
- "aliases": [],
121
+ "editorial-workflows:diagnose": {
122
+ "aliases": [
123
+ "diagnose"
124
+ ],
117
125
  "args": {
118
126
  "instanceId": {
119
127
  "description": "Workflow instance id.",
@@ -144,7 +152,7 @@
144
152
  },
145
153
  "hasDynamicHelp": false,
146
154
  "hiddenAliases": [],
147
- "id": "diagnose",
155
+ "id": "editorial-workflows:diagnose",
148
156
  "pluginAlias": "@sanity/workflow-cli",
149
157
  "pluginName": "@sanity/workflow-cli",
150
158
  "pluginType": "core",
@@ -153,11 +161,14 @@
153
161
  "relativePath": [
154
162
  "dist",
155
163
  "commands",
164
+ "editorial-workflows",
156
165
  "diagnose.js"
157
166
  ]
158
167
  },
159
- "fire-action": {
160
- "aliases": [],
168
+ "editorial-workflows:fire-action": {
169
+ "aliases": [
170
+ "fire-action"
171
+ ],
161
172
  "args": {
162
173
  "instanceId": {
163
174
  "description": "Workflow instance id.",
@@ -210,7 +221,7 @@
210
221
  },
211
222
  "hasDynamicHelp": false,
212
223
  "hiddenAliases": [],
213
- "id": "fire-action",
224
+ "id": "editorial-workflows:fire-action",
214
225
  "pluginAlias": "@sanity/workflow-cli",
215
226
  "pluginName": "@sanity/workflow-cli",
216
227
  "pluginType": "core",
@@ -219,11 +230,14 @@
219
230
  "relativePath": [
220
231
  "dist",
221
232
  "commands",
233
+ "editorial-workflows",
222
234
  "fire-action.js"
223
235
  ]
224
236
  },
225
- "list": {
226
- "aliases": [],
237
+ "editorial-workflows:list": {
238
+ "aliases": [
239
+ "list"
240
+ ],
227
241
  "args": {},
228
242
  "description": "List workflow instances in the configured dataset (in-flight by default).",
229
243
  "examples": [
@@ -278,7 +292,7 @@
278
292
  },
279
293
  "hasDynamicHelp": false,
280
294
  "hiddenAliases": [],
281
- "id": "list",
295
+ "id": "editorial-workflows:list",
282
296
  "pluginAlias": "@sanity/workflow-cli",
283
297
  "pluginName": "@sanity/workflow-cli",
284
298
  "pluginType": "core",
@@ -287,10 +301,53 @@
287
301
  "relativePath": [
288
302
  "dist",
289
303
  "commands",
304
+ "editorial-workflows",
290
305
  "list.js"
291
306
  ]
292
307
  },
293
- "reset-activity": {
308
+ "editorial-workflows:nuke": {
309
+ "aliases": [
310
+ "nuke"
311
+ ],
312
+ "args": {},
313
+ "description": "The reset for a dataset holding engine documents the versioned upgrade framework cannot yet migrate: deletes the tag's instances, definitions, and guards (across every alias-bound resource). Content documents are never touched. Prints a dry-run plan, then requires you to type back every involved dataset (--force skips the prompt; the plan still prints).",
314
+ "examples": [
315
+ "<%= config.bin %> nuke --tag plugin-dev",
316
+ "<%= config.bin %> nuke --tag plugin-dev --force"
317
+ ],
318
+ "flags": {
319
+ "tag": {
320
+ "description": "The deployment tag to reset. Required — a destructive reset never guesses the environment.",
321
+ "name": "tag",
322
+ "required": true,
323
+ "hasDynamicHelp": false,
324
+ "multiple": false,
325
+ "type": "option"
326
+ },
327
+ "force": {
328
+ "description": "Skip the confirmation prompt (for scripts/CI). The plan still prints.",
329
+ "name": "force",
330
+ "allowNo": false,
331
+ "type": "boolean"
332
+ }
333
+ },
334
+ "hasDynamicHelp": false,
335
+ "hiddenAliases": [],
336
+ "id": "editorial-workflows:nuke",
337
+ "pluginAlias": "@sanity/workflow-cli",
338
+ "pluginName": "@sanity/workflow-cli",
339
+ "pluginType": "core",
340
+ "strict": true,
341
+ "summary": "Delete every engine-owned document for a deployment tag — the dev-period big red button.",
342
+ "isESM": true,
343
+ "relativePath": [
344
+ "dist",
345
+ "commands",
346
+ "editorial-workflows",
347
+ "nuke.js"
348
+ ]
349
+ },
350
+ "editorial-workflows:reset-activity": {
294
351
  "aliases": [],
295
352
  "args": {
296
353
  "instanceId": {
@@ -308,8 +365,10 @@
308
365
  "flags": {},
309
366
  "hasDynamicHelp": false,
310
367
  "hidden": true,
311
- "hiddenAliases": [],
312
- "id": "reset-activity",
368
+ "hiddenAliases": [
369
+ "reset-activity"
370
+ ],
371
+ "id": "editorial-workflows:reset-activity",
313
372
  "pluginAlias": "@sanity/workflow-cli",
314
373
  "pluginName": "@sanity/workflow-cli",
315
374
  "pluginType": "core",
@@ -318,11 +377,14 @@
318
377
  "relativePath": [
319
378
  "dist",
320
379
  "commands",
380
+ "editorial-workflows",
321
381
  "reset-activity.js"
322
382
  ]
323
383
  },
324
- "set-stage": {
325
- "aliases": [],
384
+ "editorial-workflows:set-stage": {
385
+ "aliases": [
386
+ "set-stage"
387
+ ],
326
388
  "args": {
327
389
  "instanceId": {
328
390
  "description": "Workflow instance id to move.",
@@ -361,7 +423,7 @@
361
423
  },
362
424
  "hasDynamicHelp": false,
363
425
  "hiddenAliases": [],
364
- "id": "set-stage",
426
+ "id": "editorial-workflows:set-stage",
365
427
  "pluginAlias": "@sanity/workflow-cli",
366
428
  "pluginName": "@sanity/workflow-cli",
367
429
  "pluginType": "core",
@@ -370,11 +432,14 @@
370
432
  "relativePath": [
371
433
  "dist",
372
434
  "commands",
435
+ "editorial-workflows",
373
436
  "set-stage.js"
374
437
  ]
375
438
  },
376
- "show": {
377
- "aliases": [],
439
+ "editorial-workflows:show": {
440
+ "aliases": [
441
+ "show"
442
+ ],
378
443
  "args": {
379
444
  "instanceId": {
380
445
  "description": "Workflow instance document id.",
@@ -409,7 +474,7 @@
409
474
  },
410
475
  "hasDynamicHelp": false,
411
476
  "hiddenAliases": [],
412
- "id": "show",
477
+ "id": "editorial-workflows:show",
413
478
  "pluginAlias": "@sanity/workflow-cli",
414
479
  "pluginName": "@sanity/workflow-cli",
415
480
  "pluginType": "core",
@@ -418,11 +483,14 @@
418
483
  "relativePath": [
419
484
  "dist",
420
485
  "commands",
486
+ "editorial-workflows",
421
487
  "show.js"
422
488
  ]
423
489
  },
424
- "start": {
425
- "aliases": [],
490
+ "editorial-workflows:start": {
491
+ "aliases": [
492
+ "start"
493
+ ],
426
494
  "args": {
427
495
  "name": {
428
496
  "description": "Workflow definition name.",
@@ -434,7 +502,8 @@
434
502
  "examples": [
435
503
  "<%= config.bin %> start productLaunch",
436
504
  "<%= config.bin %> start article-review --field subject='{\"id\":\"dataset:proj:ds:article-1\",\"type\":\"article\"}'",
437
- "<%= config.bin %> start productLaunch --version 2 --tag prod"
505
+ "<%= config.bin %> start productLaunch --version 2 --tag prod",
506
+ "<%= config.bin %> start productLaunch --instance-id prod.wf-instance.a1b2c3d4e5f6"
438
507
  ],
439
508
  "flags": {
440
509
  "tag": {
@@ -459,6 +528,13 @@
459
528
  "multiple": true,
460
529
  "type": "option"
461
530
  },
531
+ "instance-id": {
532
+ "description": "Start under this instance id — for retries. The id is the start's idempotency key: pass the id of a start that failed partway and the engine resumes it instead of creating a duplicate (an already-settled start replays as a no-op). Omit to mint a fresh id.",
533
+ "name": "instance-id",
534
+ "hasDynamicHelp": false,
535
+ "multiple": false,
536
+ "type": "option"
537
+ },
462
538
  "json": {
463
539
  "description": "Emit structured JSON instead of rendered output.",
464
540
  "name": "json",
@@ -468,7 +544,7 @@
468
544
  },
469
545
  "hasDynamicHelp": false,
470
546
  "hiddenAliases": [],
471
- "id": "start",
547
+ "id": "editorial-workflows:start",
472
548
  "pluginAlias": "@sanity/workflow-cli",
473
549
  "pluginName": "@sanity/workflow-cli",
474
550
  "pluginType": "core",
@@ -477,11 +553,14 @@
477
553
  "relativePath": [
478
554
  "dist",
479
555
  "commands",
556
+ "editorial-workflows",
480
557
  "start.js"
481
558
  ]
482
559
  },
483
- "tail": {
484
- "aliases": [],
560
+ "editorial-workflows:tail": {
561
+ "aliases": [
562
+ "tail"
563
+ ],
485
564
  "args": {
486
565
  "instanceId": {
487
566
  "description": "Workflow instance id to tail.",
@@ -504,7 +583,7 @@
504
583
  },
505
584
  "hasDynamicHelp": false,
506
585
  "hiddenAliases": [],
507
- "id": "tail",
586
+ "id": "editorial-workflows:tail",
508
587
  "pluginAlias": "@sanity/workflow-cli",
509
588
  "pluginName": "@sanity/workflow-cli",
510
589
  "pluginType": "core",
@@ -513,11 +592,14 @@
513
592
  "relativePath": [
514
593
  "dist",
515
594
  "commands",
595
+ "editorial-workflows",
516
596
  "tail.js"
517
597
  ]
518
598
  },
519
- "definition:delete": {
520
- "aliases": [],
599
+ "editorial-workflows:definition:delete": {
600
+ "aliases": [
601
+ "definition:delete"
602
+ ],
521
603
  "args": {
522
604
  "name": {
523
605
  "description": "Workflow definition name.",
@@ -562,7 +644,7 @@
562
644
  },
563
645
  "hasDynamicHelp": false,
564
646
  "hiddenAliases": [],
565
- "id": "definition:delete",
647
+ "id": "editorial-workflows:definition:delete",
566
648
  "pluginAlias": "@sanity/workflow-cli",
567
649
  "pluginName": "@sanity/workflow-cli",
568
650
  "pluginType": "core",
@@ -571,12 +653,15 @@
571
653
  "relativePath": [
572
654
  "dist",
573
655
  "commands",
656
+ "editorial-workflows",
574
657
  "definition",
575
658
  "delete.js"
576
659
  ]
577
660
  },
578
- "definition:diff": {
579
- "aliases": [],
661
+ "editorial-workflows:definition:diff": {
662
+ "aliases": [
663
+ "definition:diff"
664
+ ],
580
665
  "args": {
581
666
  "name": {
582
667
  "description": "Workflow definition name.",
@@ -607,7 +692,7 @@
607
692
  },
608
693
  "hasDynamicHelp": false,
609
694
  "hiddenAliases": [],
610
- "id": "definition:diff",
695
+ "id": "editorial-workflows:definition:diff",
611
696
  "pluginAlias": "@sanity/workflow-cli",
612
697
  "pluginName": "@sanity/workflow-cli",
613
698
  "pluginType": "core",
@@ -616,12 +701,15 @@
616
701
  "relativePath": [
617
702
  "dist",
618
703
  "commands",
704
+ "editorial-workflows",
619
705
  "definition",
620
706
  "diff.js"
621
707
  ]
622
708
  },
623
- "definition:list": {
624
- "aliases": [],
709
+ "editorial-workflows:definition:list": {
710
+ "aliases": [
711
+ "definition:list"
712
+ ],
625
713
  "args": {},
626
714
  "description": "List deployed workflow definitions.",
627
715
  "examples": [
@@ -654,7 +742,7 @@
654
742
  },
655
743
  "hasDynamicHelp": false,
656
744
  "hiddenAliases": [],
657
- "id": "definition:list",
745
+ "id": "editorial-workflows:definition:list",
658
746
  "pluginAlias": "@sanity/workflow-cli",
659
747
  "pluginName": "@sanity/workflow-cli",
660
748
  "pluginType": "core",
@@ -663,12 +751,15 @@
663
751
  "relativePath": [
664
752
  "dist",
665
753
  "commands",
754
+ "editorial-workflows",
666
755
  "definition",
667
756
  "list.js"
668
757
  ]
669
758
  },
670
- "definition:show": {
671
- "aliases": [],
759
+ "editorial-workflows:definition:show": {
760
+ "aliases": [
761
+ "definition:show"
762
+ ],
672
763
  "args": {
673
764
  "name": {
674
765
  "description": "Workflow definition name.",
@@ -695,7 +786,7 @@
695
786
  },
696
787
  "hasDynamicHelp": false,
697
788
  "hiddenAliases": [],
698
- "id": "definition:show",
789
+ "id": "editorial-workflows:definition:show",
699
790
  "pluginAlias": "@sanity/workflow-cli",
700
791
  "pluginName": "@sanity/workflow-cli",
701
792
  "pluginType": "core",
@@ -704,10 +795,11 @@
704
795
  "relativePath": [
705
796
  "dist",
706
797
  "commands",
798
+ "editorial-workflows",
707
799
  "definition",
708
800
  "show.js"
709
801
  ]
710
802
  }
711
803
  },
712
- "version": "0.11.0"
804
+ "version": "0.13.0"
713
805
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/workflow-cli",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "Command-line tool for deploying, inspecting, and administering Sanity workflow definitions and instances.",
5
5
  "keywords": [
6
6
  "cli",
@@ -56,15 +56,15 @@
56
56
  "jiti": "^2.7.0",
57
57
  "log-symbols": "^7.0.1",
58
58
  "ora": "^9.4.0",
59
- "@sanity/workflow-engine": "0.16.0"
59
+ "@sanity/workflow-engine": "0.18.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/diff": "^8.0.0",
63
63
  "@types/node": "^24.12.4",
64
64
  "oclif": "^4.23.16",
65
65
  "vitest": "^4.1.8",
66
- "@sanity/workflow-engine-test": "0.11.0",
67
- "@sanity/workflow-examples": "0.6.0"
66
+ "@sanity/workflow-engine-test": "0.13.0",
67
+ "@sanity/workflow-examples": "0.8.0"
68
68
  },
69
69
  "oclif": {
70
70
  "bin": "sanity-workflows",
@@ -79,11 +79,13 @@
79
79
  ],
80
80
  "topicSeparator": " ",
81
81
  "topics": {
82
- "definition": {
83
- "description": "Read and manage workflow definitions"
84
- },
85
- "dev": {
86
- "description": "Local scaffolding helpers"
82
+ "editorial-workflows": {
83
+ "description": "Editorial Workflows — deploy, inspect, and administer definitions and instances",
84
+ "subtopics": {
85
+ "definition": {
86
+ "description": "Read and manage workflow definitions"
87
+ }
88
+ }
87
89
  }
88
90
  }
89
91
  },