@sanity/cli 8.6.0 → 8.8.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 (103) hide show
  1. package/README.md +918 -40
  2. package/dist/actions/api/distillApiRoutes.js +1 -1
  3. package/dist/actions/api/distillApiRoutes.js.map +1 -1
  4. package/dist/actions/api/resolveEndpoint.js +1 -1
  5. package/dist/actions/api/resolveEndpoint.js.map +1 -1
  6. package/dist/actions/backup/archiveDir.js +7 -3
  7. package/dist/actions/backup/archiveDir.js.map +1 -1
  8. package/dist/actions/context/resolveOrganizationId.js +17 -0
  9. package/dist/actions/context/resolveOrganizationId.js.map +1 -0
  10. package/dist/actions/context/waitForJob.js +24 -0
  11. package/dist/actions/context/waitForJob.js.map +1 -0
  12. package/dist/actions/context/watchJob.js +32 -0
  13. package/dist/actions/context/watchJob.js.map +1 -0
  14. package/dist/actions/deploy/deployApp.js +6 -6
  15. package/dist/actions/deploy/deployApp.js.map +1 -1
  16. package/dist/actions/deploy/deployStudio.js +6 -6
  17. package/dist/actions/deploy/deployStudio.js.map +1 -1
  18. package/dist/actions/exec/execScript.js +6 -18
  19. package/dist/actions/exec/execScript.js.map +1 -1
  20. package/dist/actions/exec/runScript.worker.js +21 -0
  21. package/dist/actions/exec/runScript.worker.js.map +1 -0
  22. package/dist/actions/init/initAction.js +1 -1
  23. package/dist/actions/init/initAction.js.map +1 -1
  24. package/dist/actions/media/importMedia.js +4 -2
  25. package/dist/actions/media/importMedia.js.map +1 -1
  26. package/dist/commands/backups/download.js +8 -17
  27. package/dist/commands/backups/download.js.map +1 -1
  28. package/dist/commands/backups/list.js +1 -1
  29. package/dist/commands/backups/list.js.map +1 -1
  30. package/dist/commands/context/build.js +111 -0
  31. package/dist/commands/context/build.js.map +1 -0
  32. package/dist/commands/context/create.js +106 -0
  33. package/dist/commands/context/create.js.map +1 -0
  34. package/dist/commands/context/delete.js +68 -0
  35. package/dist/commands/context/delete.js.map +1 -0
  36. package/dist/commands/context/get.js +95 -0
  37. package/dist/commands/context/get.js.map +1 -0
  38. package/dist/commands/context/imports/create.js +270 -0
  39. package/dist/commands/context/imports/create.js.map +1 -0
  40. package/dist/commands/context/imports/delete.js +73 -0
  41. package/dist/commands/context/imports/delete.js.map +1 -0
  42. package/dist/commands/context/imports/download.js +65 -0
  43. package/dist/commands/context/imports/download.js.map +1 -0
  44. package/dist/commands/context/imports/get.js +93 -0
  45. package/dist/commands/context/imports/get.js.map +1 -0
  46. package/dist/commands/context/imports/list.js +105 -0
  47. package/dist/commands/context/imports/list.js.map +1 -0
  48. package/dist/commands/context/jobs/get.js +90 -0
  49. package/dist/commands/context/jobs/get.js.map +1 -0
  50. package/dist/commands/context/list.js +109 -0
  51. package/dist/commands/context/list.js.map +1 -0
  52. package/dist/commands/context/refresh.js +46 -0
  53. package/dist/commands/context/refresh.js.map +1 -0
  54. package/dist/commands/context/update.js +127 -0
  55. package/dist/commands/context/update.js.map +1 -0
  56. package/dist/commands/datasets/alias/delete.js +4 -9
  57. package/dist/commands/datasets/alias/delete.js.map +1 -1
  58. package/dist/commands/datasets/alias/unlink.js +4 -9
  59. package/dist/commands/datasets/alias/unlink.js.map +1 -1
  60. package/dist/commands/datasets/copy.js +1 -1
  61. package/dist/commands/datasets/copy.js.map +1 -1
  62. package/dist/commands/datasets/delete.js +4 -9
  63. package/dist/commands/datasets/delete.js.map +1 -1
  64. package/dist/commands/graphql/undeploy.js +4 -9
  65. package/dist/commands/graphql/undeploy.js.map +1 -1
  66. package/dist/commands/init.js +1 -1
  67. package/dist/commands/init.js.map +1 -1
  68. package/dist/commands/media/create-aspect.js +5 -6
  69. package/dist/commands/media/create-aspect.js.map +1 -1
  70. package/dist/commands/media/delete-aspect.js +7 -23
  71. package/dist/commands/media/delete-aspect.js.map +1 -1
  72. package/dist/commands/media/deploy-aspect.js +4 -9
  73. package/dist/commands/media/deploy-aspect.js.map +1 -1
  74. package/dist/commands/media/export.js +3 -7
  75. package/dist/commands/media/export.js.map +1 -1
  76. package/dist/commands/media/import.js +3 -7
  77. package/dist/commands/media/import.js.map +1 -1
  78. package/dist/commands/organizations/create.js +4 -9
  79. package/dist/commands/organizations/create.js.map +1 -1
  80. package/dist/commands/schemas/delete.js +3 -8
  81. package/dist/commands/schemas/delete.js.map +1 -1
  82. package/dist/commands/tokens/delete.js +4 -7
  83. package/dist/commands/tokens/delete.js.map +1 -1
  84. package/dist/commands/users/invite.js +8 -18
  85. package/dist/commands/users/invite.js.map +1 -1
  86. package/dist/exports/index.js +1 -1
  87. package/dist/exports/index.js.map +1 -1
  88. package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js +18 -0
  89. package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js.map +1 -1
  90. package/dist/generated/apiRoutes.js +11 -9
  91. package/dist/generated/apiRoutes.js.map +1 -1
  92. package/dist/prompts/promptForOrganization.js +19 -0
  93. package/dist/prompts/promptForOrganization.js.map +1 -0
  94. package/dist/services/context.js +132 -0
  95. package/dist/services/context.js.map +1 -0
  96. package/dist/util/extractDocumentsFromNdjsonOrTarball.js.map +1 -1
  97. package/dist/util/sharedFlags.js +24 -0
  98. package/dist/util/sharedFlags.js.map +1 -1
  99. package/oclif.config.js +1 -0
  100. package/oclif.manifest.json +1931 -1133
  101. package/package.json +20 -26
  102. package/dist/util/dates.js +0 -125
  103. package/dist/util/dates.js.map +0 -1
package/README.md CHANGED
@@ -33,6 +33,19 @@ Code for sanity cli
33
33
  - [`sanity blueprints stacks`](#sanity-blueprints-stacks)
34
34
  - [`sanity build [OUTPUTDIR]`](#sanity-build-outputdir)
35
35
  - [`sanity codemod [CODEMODNAME]`](#sanity-codemod-codemodname)
36
+ - [`sanity context build KNOWLEDGEBASEID`](#sanity-context-build-knowledgebaseid)
37
+ - [`sanity context create`](#sanity-context-create)
38
+ - [`sanity context delete KNOWLEDGEBASEID`](#sanity-context-delete-knowledgebaseid)
39
+ - [`sanity context get KNOWLEDGEBASEID`](#sanity-context-get-knowledgebaseid)
40
+ - [`sanity context imports create KNOWLEDGEBASEID`](#sanity-context-imports-create-knowledgebaseid)
41
+ - [`sanity context imports delete KNOWLEDGEBASEID IMPORTID`](#sanity-context-imports-delete-knowledgebaseid-importid)
42
+ - [`sanity context imports download KNOWLEDGEBASEID IMPORTID`](#sanity-context-imports-download-knowledgebaseid-importid)
43
+ - [`sanity context imports get KNOWLEDGEBASEID IMPORTID`](#sanity-context-imports-get-knowledgebaseid-importid)
44
+ - [`sanity context imports list KNOWLEDGEBASEID`](#sanity-context-imports-list-knowledgebaseid)
45
+ - [`sanity context jobs get KNOWLEDGEBASEID JOBID`](#sanity-context-jobs-get-knowledgebaseid-jobid)
46
+ - [`sanity context list`](#sanity-context-list)
47
+ - [`sanity context refresh KNOWLEDGEBASEID`](#sanity-context-refresh-knowledgebaseid)
48
+ - [`sanity context update KNOWLEDGEBASEID`](#sanity-context-update-knowledgebaseid)
36
49
  - [`sanity cors add ORIGIN`](#sanity-cors-add-origin)
37
50
  - [`sanity cors delete [ORIGIN]`](#sanity-cors-delete-origin)
38
51
  - [`sanity cors list`](#sanity-cors-list)
@@ -126,6 +139,21 @@ Code for sanity cli
126
139
  - [`sanity users invite [EMAIL]`](#sanity-users-invite-email)
127
140
  - [`sanity users list`](#sanity-users-list)
128
141
  - [`sanity versions`](#sanity-versions)
142
+ - [`sanity workflows abort INSTANCEID`](#sanity-workflows-abort-instanceid)
143
+ - [`sanity workflows definition delete NAME`](#sanity-workflows-definition-delete-name)
144
+ - [`sanity workflows definition diff NAME`](#sanity-workflows-definition-diff-name)
145
+ - [`sanity workflows definition list`](#sanity-workflows-definition-list)
146
+ - [`sanity workflows definition show NAME`](#sanity-workflows-definition-show-name)
147
+ - [`sanity workflows deploy`](#sanity-workflows-deploy)
148
+ - [`sanity workflows diagnose INSTANCEID`](#sanity-workflows-diagnose-instanceid)
149
+ - [`sanity workflows fire-action INSTANCEID`](#sanity-workflows-fire-action-instanceid)
150
+ - [`sanity workflows list`](#sanity-workflows-list)
151
+ - [`sanity workflows nuke`](#sanity-workflows-nuke)
152
+ - [`sanity workflows reset-activity INSTANCEID ACTIVITY`](#sanity-workflows-reset-activity-instanceid-activity)
153
+ - [`sanity workflows set-stage INSTANCEID`](#sanity-workflows-set-stage-instanceid)
154
+ - [`sanity workflows show INSTANCEID`](#sanity-workflows-show-instanceid)
155
+ - [`sanity workflows start NAME`](#sanity-workflows-start-name)
156
+ - [`sanity workflows tail INSTANCEID`](#sanity-workflows-tail-instanceid)
129
157
 
130
158
  ## `sanity api ENDPOINT`
131
159
 
@@ -392,7 +420,7 @@ EXAMPLES
392
420
  USAGE
393
421
  $ sanity blueprints add TYPE [--json] [--example <value> | -n <value> | --fn-type
394
422
  document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
395
- te|media-library-asset-update|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
423
+ te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
396
424
  --fn-helpers | --fn-installer skip|npm|pnpm|yarn] [-i | ]
397
425
 
398
426
  ARGUMENTS
@@ -409,8 +437,8 @@ FLAGS
409
437
  --fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
410
438
  events by specifying this flag multiple times
411
439
  <options: document-publish|document-create|document-delete|document-update|media-library-
412
- asset-create|media-library-asset-delete|media-library-asset-update|scheduled-function|syn
413
- c-tag-invalidate>
440
+ asset-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-func
441
+ tion|sync-tag-invalidate>
414
442
  --javascript Use JavaScript instead of TypeScript
415
443
  --json Format output as json
416
444
  --language=<option> [default: ts] Language of the new function
@@ -503,7 +531,9 @@ DESCRIPTION
503
531
 
504
532
  Use --fn-installer to force which package manager to use when deploying functions.
505
533
 
506
- Set SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.
534
+ Set SANITY_ASSET_TIMEOUT (seconds) to override the 180-second timeout for processing resource assets.
535
+
536
+ Set SANITY_ASSET_CONCURRENCY to override how many resource assets are processed at once (default 4).
507
537
 
508
538
  Exit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun
509
539
  'blueprints info' to check).
@@ -530,16 +560,16 @@ Destroy a remote Stack deployment and its resources
530
560
 
531
561
  ```
532
562
  USAGE
533
- $ sanity blueprints destroy [--json] [--project-id <value> --stack <value> --force] [--organization-id <value> ]
563
+ $ sanity blueprints destroy [--json] [--project-id <value> --stack <value> -f] [--organization-id <value> ]
534
564
  [--no-wait]
535
565
 
536
566
  FLAGS
537
- --force Force Stack destruction (skip confirmation)
538
- --json Format output as json
539
- --no-wait Do not wait for Stack destruction to complete
540
- --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
541
- --project-id=<value> Sanity project ID used to scope Blueprint and Stack
542
- --stack=<value> Stack name or ID to destroy (defaults to the locally configured Stack)
567
+ -f, --force Force Stack destruction (skip confirmation)
568
+ --json Format output as json
569
+ --no-wait Do not wait for Stack destruction to complete
570
+ --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
571
+ --project-id=<value> Sanity project ID used to scope Blueprint and Stack
572
+ --stack=<value> Stack name or ID to destroy (defaults to the locally configured Stack)
543
573
 
544
574
  DESCRIPTION
545
575
  Destroy a remote Stack deployment and its resources
@@ -596,13 +626,14 @@ Display the status and resources of the remote Stack deployment
596
626
 
597
627
  ```
598
628
  USAGE
599
- $ sanity blueprints info [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
629
+ $ sanity blueprints info [--json] [-v] [--stack <value>] [--project-id <value> | --organization-id <value>]
600
630
 
601
631
  FLAGS
602
- --json Format output as json
603
- --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
604
- --project-id=<value> Sanity project ID used to scope Blueprint and Stack
605
- --stack=<value> Stack name or ID
632
+ -v, --verbose Show resource and external IDs
633
+ --json Format output as json
634
+ --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
635
+ --project-id=<value> Sanity project ID used to scope Blueprint and Stack
636
+ --stack=<value> Stack name or ID
606
637
 
607
638
  DESCRIPTION
608
639
  Display the status and resources of the remote Stack deployment
@@ -653,12 +684,12 @@ DESCRIPTION
653
684
 
654
685
  A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions,
655
686
  etc.). A Stack is the remote deployment target where your Blueprint is applied.
656
- [NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]
657
687
 
658
688
  This is typically the first command you run in a new project. It creates a local Blueprint manifest file
659
689
  (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.
660
- Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is
661
- .gitignored by default.
690
+ Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. A .gitignore
691
+ covering node_modules, .env, and Function build output is created or updated; the .sanity/ config itself is not
692
+ ignored.
662
693
 
663
694
  After initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.
664
695
 
@@ -693,8 +724,8 @@ Display logs for the current Blueprint's Stack deployment
693
724
 
694
725
  ```
695
726
  USAGE
696
- $ sanity blueprints logs [--json] [--stack <value>] [--project-id <value> | --organization-id <value>] [-l <value>
697
- | -w] [--since <value> | ] [--before <value> | ]
727
+ $ sanity blueprints logs [--stack <value>] [--project-id <value> | --organization-id <value>] [-l <value> | [-w |
728
+ --json]] [--since <value> | ] [--before <value> | ]
698
729
 
699
730
  FLAGS
700
731
  -l, --limit=<value> Maximum number of log entries to retrieve (1-500)
@@ -844,9 +875,10 @@ List remote Stack deployments for your project or organization
844
875
 
845
876
  ```
846
877
  USAGE
847
- $ sanity blueprints stacks [--json] [--project-id <value> | --organization-id <value> | --include-projects]
878
+ $ sanity blueprints stacks [--json] [--project-id <value> | --organization-id <value> | --include-projects | --all]
848
879
 
849
880
  FLAGS
881
+ --all List Stacks from every organization and project you have access to
850
882
  --include-projects Include Stacks from all projects within the organization. Requires --organization-id.
851
883
  --json Format output as json
852
884
  --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
@@ -860,11 +892,14 @@ DESCRIPTION
860
892
  Use this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to
861
893
  audit what's deployed across your project.
862
894
 
863
- Use --include-projects with --organization-id to also list Stacks from all projects within the organization.
895
+ Without a scope, prompts for an organization or project. Use --all to list Stacks across every organization and
896
+ project you can access, or --include-projects with --organization-id for one organization and its projects.
864
897
 
865
898
  EXAMPLES
866
899
  $ sanity blueprints stacks
867
900
 
901
+ $ sanity blueprints stacks --all
902
+
868
903
  $ sanity blueprints stacks --project-id <projectId>
869
904
 
870
905
  $ sanity blueprints stacks --organization-id <organizationId>
@@ -928,6 +963,389 @@ EXAMPLES
928
963
  $ sanity codemod reactIconsV3 --dry
929
964
  ```
930
965
 
966
+ ## `sanity context build KNOWLEDGEBASEID`
967
+
968
+ Build a knowledge base from its imported content
969
+
970
+ ```
971
+ USAGE
972
+ $ sanity context build KNOWLEDGEBASEID [--cancel | --watch]
973
+
974
+ ARGUMENTS
975
+ KNOWLEDGEBASEID Knowledge base ID
976
+
977
+ FLAGS
978
+ --cancel Cancel the running build instead of starting one
979
+ --watch Wait for the build to finish, exiting non-zero if it fails
980
+
981
+ DESCRIPTION
982
+ Build a knowledge base from its imported content
983
+
984
+ EXAMPLES
985
+ Start a build and return the job ID
986
+
987
+ $ sanity context build kb-abc123
988
+
989
+ Start a build and wait for it to finish (non-zero exit on failure)
990
+
991
+ $ sanity context build kb-abc123 --watch
992
+
993
+ Cancel the running build, if any
994
+
995
+ $ sanity context build kb-abc123 --cancel
996
+ ```
997
+
998
+ ## `sanity context create`
999
+
1000
+ Create a knowledge base
1001
+
1002
+ ```
1003
+ USAGE
1004
+ $ sanity context create [--organization <id>] [--description <value>] [--title <value>]
1005
+
1006
+ FLAGS
1007
+ --description=<value> Knowledge base description
1008
+ --title=<value> Knowledge base title
1009
+
1010
+ OVERRIDE FLAGS
1011
+ --organization=<id> Organization to create the knowledge base in (overrides CLI configuration)
1012
+
1013
+ DESCRIPTION
1014
+ Create a knowledge base
1015
+
1016
+ EXAMPLES
1017
+ Interactively create a knowledge base
1018
+
1019
+ $ sanity context create
1020
+
1021
+ Create a knowledge base in a specific organization
1022
+
1023
+ $ sanity context create --organization org-abc123 --title "Support docs" --description "Product docs and \
1024
+ troubleshooting guides"
1025
+ ```
1026
+
1027
+ ## `sanity context delete KNOWLEDGEBASEID`
1028
+
1029
+ Delete a knowledge base and its generated content
1030
+
1031
+ ```
1032
+ USAGE
1033
+ $ sanity context delete KNOWLEDGEBASEID [-y]
1034
+
1035
+ ARGUMENTS
1036
+ KNOWLEDGEBASEID Knowledge base ID
1037
+
1038
+ FLAGS
1039
+ -y, --yes Skip confirmation prompt (unattended mode)
1040
+
1041
+ DESCRIPTION
1042
+ Delete a knowledge base and its generated content
1043
+
1044
+ EXAMPLES
1045
+ Delete a knowledge base after confirmation
1046
+
1047
+ $ sanity context delete kb-abc123
1048
+
1049
+ Delete a knowledge base without confirmation prompt
1050
+
1051
+ $ sanity context delete kb-abc123 --yes
1052
+ ```
1053
+
1054
+ ## `sanity context get KNOWLEDGEBASEID`
1055
+
1056
+ Get details of a knowledge base
1057
+
1058
+ ```
1059
+ USAGE
1060
+ $ sanity context get KNOWLEDGEBASEID [--json]
1061
+
1062
+ ARGUMENTS
1063
+ KNOWLEDGEBASEID Knowledge base ID
1064
+
1065
+ FLAGS
1066
+ --json Output the knowledge base in JSON format
1067
+
1068
+ DESCRIPTION
1069
+ Get details of a knowledge base
1070
+
1071
+ EXAMPLES
1072
+ Get details of a specific knowledge base
1073
+
1074
+ $ sanity context get kb-abc123
1075
+
1076
+ Output the knowledge base as JSON
1077
+
1078
+ $ sanity context get kb-abc123 --json
1079
+ ```
1080
+
1081
+ ## `sanity context imports create KNOWLEDGEBASEID`
1082
+
1083
+ Import content into a knowledge base
1084
+
1085
+ ```
1086
+ USAGE
1087
+ $ sanity context imports create KNOWLEDGEBASEID [--content-type <mime>] [--file <path> | --text <value> | --url <url> |
1088
+ --query <value>] [--sanity-dataset <name> ] [--sanity-project <id> ] [--title <value> ]
1089
+
1090
+ ARGUMENTS
1091
+ KNOWLEDGEBASEID Knowledge base ID
1092
+
1093
+ FLAGS
1094
+ --content-type=<mime> Content type of the import (--text: text/markdown or text/plain; --file: any MIME type,
1095
+ inferred from the file extension when omitted)
1096
+ --file=<path> Path to a local file to import
1097
+ --query=<value> GROQ query binding a Sanity dataset as a source
1098
+ --sanity-dataset=<name> Sanity dataset for a dataset import
1099
+ --sanity-project=<id> Sanity project ID for a dataset import
1100
+ --text=<value> Inline text content to import (requires --title)
1101
+ --title=<value> Title for an inline text import
1102
+ --url=<url> Website URL to crawl
1103
+
1104
+ DESCRIPTION
1105
+ Import content into a knowledge base
1106
+
1107
+ EXAMPLES
1108
+ Import inline text
1109
+
1110
+ $ sanity context imports create kb-abc123 --text "Refunds are processed within 5 days" --title "Refund policy"
1111
+
1112
+ Upload and import a local file
1113
+
1114
+ $ sanity context imports create kb-abc123 --file ./handbook.pdf
1115
+
1116
+ Crawl a website
1117
+
1118
+ $ sanity context imports create kb-abc123 --url https://example.com/docs
1119
+
1120
+ Bind a Sanity dataset as a source
1121
+
1122
+ $ sanity context imports create kb-abc123 --query '*[_type == "article"]' --sanity-project abc123 \
1123
+ --sanity-dataset production
1124
+ ```
1125
+
1126
+ ## `sanity context imports delete KNOWLEDGEBASEID IMPORTID`
1127
+
1128
+ Delete an import from a knowledge base
1129
+
1130
+ ```
1131
+ USAGE
1132
+ $ sanity context imports delete KNOWLEDGEBASEID IMPORTID [-y]
1133
+
1134
+ ARGUMENTS
1135
+ KNOWLEDGEBASEID Knowledge base ID
1136
+ IMPORTID Import ID
1137
+
1138
+ FLAGS
1139
+ -y, --yes Skip confirmation prompt (unattended mode)
1140
+
1141
+ DESCRIPTION
1142
+ Delete an import from a knowledge base
1143
+
1144
+ EXAMPLES
1145
+ Delete an import after confirmation
1146
+
1147
+ $ sanity context imports delete kb-abc123 import-def456
1148
+
1149
+ Delete an import without confirmation prompt
1150
+
1151
+ $ sanity context imports delete kb-abc123 import-def456 --yes
1152
+ ```
1153
+
1154
+ ## `sanity context imports download KNOWLEDGEBASEID IMPORTID`
1155
+
1156
+ Get a short-lived signed URL for the original uploaded bytes of a file import
1157
+
1158
+ ```
1159
+ USAGE
1160
+ $ sanity context imports download KNOWLEDGEBASEID IMPORTID [--json]
1161
+
1162
+ ARGUMENTS
1163
+ KNOWLEDGEBASEID Knowledge base ID
1164
+ IMPORTID Import ID
1165
+
1166
+ FLAGS
1167
+ --json Output the download URL in JSON format
1168
+
1169
+ DESCRIPTION
1170
+ Get a short-lived signed URL for the original uploaded bytes of a file import
1171
+
1172
+ EXAMPLES
1173
+ Get a download URL for an uploaded file
1174
+
1175
+ $ sanity context imports download kb-abc123 import-def456
1176
+ ```
1177
+
1178
+ ## `sanity context imports get KNOWLEDGEBASEID IMPORTID`
1179
+
1180
+ Get details of an import
1181
+
1182
+ ```
1183
+ USAGE
1184
+ $ sanity context imports get KNOWLEDGEBASEID IMPORTID [--json]
1185
+
1186
+ ARGUMENTS
1187
+ KNOWLEDGEBASEID Knowledge base ID
1188
+ IMPORTID Import ID
1189
+
1190
+ FLAGS
1191
+ --json Output the import in JSON format
1192
+
1193
+ DESCRIPTION
1194
+ Get details of an import
1195
+
1196
+ EXAMPLES
1197
+ Get details of a specific import
1198
+
1199
+ $ sanity context imports get kb-abc123 import-def456
1200
+
1201
+ Output the import as JSON
1202
+
1203
+ $ sanity context imports get kb-abc123 import-def456 --json
1204
+ ```
1205
+
1206
+ ## `sanity context imports list KNOWLEDGEBASEID`
1207
+
1208
+ List imports for a knowledge base
1209
+
1210
+ ```
1211
+ USAGE
1212
+ $ sanity context imports list KNOWLEDGEBASEID [--json]
1213
+
1214
+ ARGUMENTS
1215
+ KNOWLEDGEBASEID Knowledge base ID
1216
+
1217
+ FLAGS
1218
+ --json Output imports in JSON format
1219
+
1220
+ DESCRIPTION
1221
+ List imports for a knowledge base
1222
+
1223
+ EXAMPLES
1224
+ List all imports for a knowledge base
1225
+
1226
+ $ sanity context imports list kb-abc123
1227
+
1228
+ Output imports as JSON
1229
+
1230
+ $ sanity context imports list kb-abc123 --json
1231
+ ```
1232
+
1233
+ ## `sanity context jobs get KNOWLEDGEBASEID JOBID`
1234
+
1235
+ Get the status of a knowledge base job
1236
+
1237
+ ```
1238
+ USAGE
1239
+ $ sanity context jobs get KNOWLEDGEBASEID JOBID [--json] [--watch]
1240
+
1241
+ ARGUMENTS
1242
+ KNOWLEDGEBASEID Knowledge base ID
1243
+ JOBID Job ID
1244
+
1245
+ FLAGS
1246
+ --json Output the job in JSON format
1247
+ --watch Poll until the job reaches a terminal state
1248
+
1249
+ DESCRIPTION
1250
+ Get the status of a knowledge base job
1251
+
1252
+ EXAMPLES
1253
+ Get the current status of a job
1254
+
1255
+ $ sanity context jobs get kb-abc123 job-def456
1256
+
1257
+ Wait for the job to finish (non-zero exit if it does not succeed)
1258
+
1259
+ $ sanity context jobs get kb-abc123 job-def456 --watch
1260
+ ```
1261
+
1262
+ ## `sanity context list`
1263
+
1264
+ List knowledge bases in an organization
1265
+
1266
+ ```
1267
+ USAGE
1268
+ $ sanity context list [--organization <id>] [--json]
1269
+
1270
+ FLAGS
1271
+ --json Output knowledge bases in JSON format
1272
+
1273
+ OVERRIDE FLAGS
1274
+ --organization=<id> Organization to list knowledge bases for (overrides CLI configuration)
1275
+
1276
+ DESCRIPTION
1277
+ List knowledge bases in an organization
1278
+
1279
+ EXAMPLES
1280
+ List knowledge bases, selecting the organization interactively
1281
+
1282
+ $ sanity context list
1283
+
1284
+ List knowledge bases in a specific organization
1285
+
1286
+ $ sanity context list --organization org-abc123
1287
+
1288
+ Output knowledge bases as JSON
1289
+
1290
+ $ sanity context list --organization org-abc123 --json
1291
+ ```
1292
+
1293
+ ## `sanity context refresh KNOWLEDGEBASEID`
1294
+
1295
+ Refresh a knowledge base: re-check sources and apply what changed
1296
+
1297
+ ```
1298
+ USAGE
1299
+ $ sanity context refresh KNOWLEDGEBASEID
1300
+
1301
+ ARGUMENTS
1302
+ KNOWLEDGEBASEID Knowledge base ID
1303
+
1304
+ DESCRIPTION
1305
+ Refresh a knowledge base: re-check sources and apply what changed
1306
+
1307
+ EXAMPLES
1308
+ Start an incremental refresh
1309
+
1310
+ $ sanity context refresh kb-abc123
1311
+ ```
1312
+
1313
+ ## `sanity context update KNOWLEDGEBASEID`
1314
+
1315
+ Update a knowledge base
1316
+
1317
+ ```
1318
+ USAGE
1319
+ $ sanity context update KNOWLEDGEBASEID [--description <value>] [--refresh-enabled] [--refresh-frequency
1320
+ weekly|monthly] [--title <value>]
1321
+
1322
+ ARGUMENTS
1323
+ KNOWLEDGEBASEID Knowledge base ID
1324
+
1325
+ FLAGS
1326
+ --description=<value> New knowledge base description
1327
+ --[no-]refresh-enabled Enable scheduled refresh (--no-refresh-enabled to disable)
1328
+ --refresh-frequency=<option> How often scheduled refresh runs
1329
+ <options: weekly|monthly>
1330
+ --title=<value> New knowledge base title
1331
+
1332
+ DESCRIPTION
1333
+ Update a knowledge base
1334
+
1335
+ EXAMPLES
1336
+ Rename a knowledge base
1337
+
1338
+ $ sanity context update kb-abc123 --title "New title"
1339
+
1340
+ Enable weekly scheduled refresh
1341
+
1342
+ $ sanity context update kb-abc123 --refresh-enabled --refresh-frequency weekly
1343
+
1344
+ Disable scheduled refresh
1345
+
1346
+ $ sanity context update kb-abc123 --no-refresh-enabled
1347
+ ```
1348
+
931
1349
  ## `sanity cors add ORIGIN`
932
1350
 
933
1351
  Add a CORS origin to the project
@@ -2027,13 +2445,13 @@ Add a Function to your Blueprint
2027
2445
 
2028
2446
  ```
2029
2447
  USAGE
2030
- $ sanity functions add [--json] [--example <value> | -n <value> | | --language ts|js | --javascript | | ]
2031
- [--type document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-as
2032
- set-delete|media-library-asset-update|scheduled-function|sync-tag-invalidate... ] [--helpers] [--installer
2033
- skip|npm|pnpm|yarn] [-i | ]
2448
+ $ sanity functions add [--json] [--example <value> | -n <value> | --type
2449
+ document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
2450
+ te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
2451
+ --helpers | --installer skip|npm|pnpm|yarn | -i]
2034
2452
 
2035
2453
  FLAGS
2036
- -i, --install Shortcut for --fn-installer npm
2454
+ -i, --install Shortcut for --installer npm
2037
2455
  -n, --name=<value> Name of the Function to add
2038
2456
  --example=<value> Example to use for the Function
2039
2457
  --[no-]helpers Add helpers to the new Function
@@ -2046,8 +2464,8 @@ FLAGS
2046
2464
  --type=<option>... Document change event(s) that should trigger the function; you can specify multiple events
2047
2465
  by specifying this flag multiple times
2048
2466
  <options: document-publish|document-create|document-delete|document-update|media-library-ass
2049
- et-create|media-library-asset-delete|media-library-asset-update|scheduled-function|sync-tag-
2050
- invalidate>
2467
+ et-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-function|s
2468
+ ync-tag-invalidate>
2051
2469
 
2052
2470
  DESCRIPTION
2053
2471
  Add a Function to your Blueprint
@@ -2093,13 +2511,13 @@ DESCRIPTION
2093
2511
 
2094
2512
  Open the emulator in your browser to interactively test your functions with the payload editor.
2095
2513
 
2096
- Optionally, set the host and port with the --host and --port flags. Function timeout can be configured with the
2097
- --timeout flag.
2514
+ Optionally, set the host and port with the --host and --port flags. Port 8974 is reserved for the emulator's
2515
+ live-reload WebSocket server. Function timeout can be configured with the --timeout flag.
2098
2516
 
2099
2517
  To invoke a function with the CLI, use 'functions test'.
2100
2518
 
2101
2519
  EXAMPLES
2102
- $ sanity functions dev --host 127.0.0.1 --port 8974
2520
+ $ sanity functions dev --host 127.0.0.1 --port 3333
2103
2521
 
2104
2522
  $ sanity functions dev --timeout 60
2105
2523
  ```
@@ -2199,7 +2617,7 @@ Retrieve or delete logs for a Sanity Function
2199
2617
 
2200
2618
  ```
2201
2619
  USAGE
2202
- $ sanity functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w]
2620
+ $ sanity functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w | ]
2203
2621
 
2204
2622
  ARGUMENTS
2205
2623
  [NAME] The name of the Sanity Function
@@ -2240,7 +2658,7 @@ USAGE
2240
2658
  $ sanity functions test [NAME] [--json] [--data-before <value> | [-d <value> | -f <value> | --document-id <value>]
2241
2659
  | | | --file-before <value> | --file-after <value> | --document-id-before <value> | --document-id-after <value>]
2242
2660
  [--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>] [-a <value>] [--with-user-token]
2243
- [--media-library-id <value> | [--project-id <value> | --organization-id <value>] | --dataset <value>]
2661
+ [--media-library-id <value> | [--project-id <value> | --organization-id <value>] | --dataset <value>] [--no-wait]
2244
2662
 
2245
2663
  ARGUMENTS
2246
2664
  [NAME] The name of the Sanity Function
@@ -2262,6 +2680,7 @@ FLAGS
2262
2680
  --file-before=<value> Original document
2263
2681
  --json Format output as json
2264
2682
  --media-library-id=<value> Sanity Media Library ID to use
2683
+ --no-wait Skip durable wait delays instead of sleeping
2265
2684
  --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
2266
2685
  --project-id=<value> Sanity project ID used to scope Blueprint and Stack
2267
2686
  --with-user-token Prime access token from CLI config
@@ -2793,14 +3212,14 @@ Delete an aspect definition
2793
3212
 
2794
3213
  ```
2795
3214
  USAGE
2796
- $ sanity media delete-aspect ASPECTNAME [-p <id>] [--media-library-id <value>] [--yes]
3215
+ $ sanity media delete-aspect ASPECTNAME [-p <id>] [--media-library-id <value>] [-y]
2797
3216
 
2798
3217
  ARGUMENTS
2799
3218
  ASPECTNAME Name of the aspect to delete
2800
3219
 
2801
3220
  FLAGS
2802
- --media-library-id=<value> The id of the target media library
2803
- --yes Run without prompts and confirm deletion
3221
+ -y, --yes Run without prompts and confirm deletion
3222
+ --media-library-id=<value> The id of the target media library
2804
3223
 
2805
3224
  OVERRIDE FLAGS
2806
3225
  -p, --project-id=<id> Project ID to delete media aspect from (overrides CLI configuration)
@@ -3686,13 +4105,13 @@ Delete an API token from the project
3686
4105
 
3687
4106
  ```
3688
4107
  USAGE
3689
- $ sanity tokens delete [TOKENID] [-p <id>] [--yes]
4108
+ $ sanity tokens delete [TOKENID] [-p <id>] [-y]
3690
4109
 
3691
4110
  ARGUMENTS
3692
4111
  [TOKENID] Token ID to delete (will prompt if not provided)
3693
4112
 
3694
4113
  FLAGS
3695
- --yes Skip confirmation prompt (unattended mode)
4114
+ -y, --yes Skip confirmation prompt (unattended mode)
3696
4115
 
3697
4116
  OVERRIDE FLAGS
3698
4117
  -p, --project-id=<id> Project ID to delete token from (overrides CLI configuration)
@@ -3945,4 +4364,463 @@ EXAMPLES
3945
4364
  $ sanity versions
3946
4365
  ```
3947
4366
 
4367
+ ## `sanity workflows abort INSTANCEID`
4368
+
4369
+ 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.
4370
+
4371
+ ```
4372
+ USAGE
4373
+ $ sanity workflows abort INSTANCEID [--deployment <value> | --tag <value>] [--reason <value>]
4374
+
4375
+ ARGUMENTS
4376
+ INSTANCEID Workflow instance id.
4377
+
4378
+ FLAGS
4379
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
4380
+ partition still comes from the loaded instance.
4381
+ --reason=<value> Reason for aborting (recorded in history).
4382
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4383
+ resources are searched; omit to span them all.
4384
+
4385
+ DESCRIPTION
4386
+ Abort an in-flight workflow instance — a hard stop: pending effects are cancelled, stage guards removed, and the
4387
+ instance is marked terminal where it stands.
4388
+
4389
+ EXAMPLES
4390
+ $ sanity workflows abort wf-instance.abc123
4391
+
4392
+ $ sanity workflows abort wf-instance.abc123 --reason 'superseded by relaunch'
4393
+ ```
4394
+
4395
+ ## `sanity workflows definition delete NAME`
4396
+
4397
+ Delete a deployed workflow definition (every version, or one via --version). Refuses while non-terminal instances exist unless --cascade aborts them first — instances are aborted in place, never deleted.
4398
+
4399
+ ```
4400
+ USAGE
4401
+ $ sanity workflows definition delete NAME [--deployment <value> | --tag <value>] [--version <value>] [--cascade] [--reason
4402
+ <value>]
4403
+
4404
+ ARGUMENTS
4405
+ NAME Workflow definition name.
4406
+
4407
+ FLAGS
4408
+ --cascade Abort every non-terminal instance pinned to the targeted versions, then delete.
4409
+ --deployment=<value> Deployment name — the unique identity of one deployment in the config.
4410
+ --reason=<value> Free-text reason — recorded on each cascade-abort history entry.
4411
+ --tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
4412
+ names exactly one; pass --deployment when it spans several.
4413
+ --version=<value> Delete only this deployed version (default: every version).
4414
+
4415
+ DESCRIPTION
4416
+ Delete a deployed workflow definition (every version, or one via --version). Refuses while non-terminal instances
4417
+ exist unless --cascade aborts them first — instances are aborted in place, never deleted.
4418
+
4419
+ EXAMPLES
4420
+ $ sanity workflows definition delete my-workflow
4421
+
4422
+ $ sanity workflows definition delete my-workflow --version 2
4423
+
4424
+ $ sanity workflows definition delete my-workflow --cascade --reason 'workflow retired'
4425
+ ```
4426
+
4427
+ ## `sanity workflows definition diff NAME`
4428
+
4429
+ Diff an in-code definition against the deployed version (latest by default).
4430
+
4431
+ ```
4432
+ USAGE
4433
+ $ sanity workflows definition diff NAME [--deployment <value> | --tag <value>] [--version <value>]
4434
+
4435
+ ARGUMENTS
4436
+ NAME Workflow definition name.
4437
+
4438
+ FLAGS
4439
+ --deployment=<value> Deployment name — the unique identity of one deployment in the config.
4440
+ --tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
4441
+ names exactly one; pass --deployment when it spans several.
4442
+ --version=<value> Deployed version to diff against (default: latest).
4443
+
4444
+ DESCRIPTION
4445
+ Diff an in-code definition against the deployed version (latest by default).
4446
+
4447
+ EXAMPLES
4448
+ $ sanity workflows definition diff productLaunch
4449
+
4450
+ $ sanity workflows definition diff productLaunch --version 2
4451
+ ```
4452
+
4453
+ ## `sanity workflows definition list`
4454
+
4455
+ List deployed workflow definitions.
4456
+
4457
+ ```
4458
+ USAGE
4459
+ $ sanity workflows definition list [--tag <value>] [--limit <value>] [--name <value>] [--json]
4460
+
4461
+ FLAGS
4462
+ --json Emit structured JSON instead of rendered output.
4463
+ --limit=<value> [default: 100] The maximum number of definitions to return.
4464
+ --name=<value> Filter to a single workflow definition name (e.g. product-launch).
4465
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4466
+ resources are searched; omit to span them all.
4467
+
4468
+ DESCRIPTION
4469
+ List deployed workflow definitions.
4470
+
4471
+ EXAMPLES
4472
+ $ sanity workflows definition list
4473
+
4474
+ $ sanity workflows definition list --tag prod
4475
+
4476
+ $ sanity workflows definition list --json
4477
+ ```
4478
+
4479
+ ## `sanity workflows definition show NAME`
4480
+
4481
+ Show a deployed workflow definition.
4482
+
4483
+ ```
4484
+ USAGE
4485
+ $ sanity workflows definition show NAME [--tag <value>] [--version <value>] [--json]
4486
+
4487
+ ARGUMENTS
4488
+ NAME Workflow definition name.
4489
+
4490
+ FLAGS
4491
+ --json Emit structured JSON instead of rendered output.
4492
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4493
+ resources are searched; omit to span them all.
4494
+ --version=<value> Specific version (default: latest).
4495
+
4496
+ DESCRIPTION
4497
+ Show a deployed workflow definition.
4498
+ ```
4499
+
4500
+ ## `sanity workflows deploy`
4501
+
4502
+ Validate, diff, and deploy workflow definitions to the resource bound by the selected deployment.
4503
+
4504
+ ```
4505
+ USAGE
4506
+ $ sanity workflows deploy [--all-tags | | [--deployment <value> | --tag <value>]] [--dry-run] [--check] [--only
4507
+ <value>] [--share-defs]
4508
+
4509
+ FLAGS
4510
+ --all-tags Deploy every deployment in the config, not just a selection.
4511
+ --check Validate definitions only; do not contact the dataset.
4512
+ --deployment=<value> Deployment name — the unique identity of one deployment in the config.
4513
+ --dry-run Validate + diff against the deployed version; do not write.
4514
+ --only=<value> Limit deploy/check/diff to a single workflow definition by name (deployments are selected with
4515
+ --deployment). Every targeted deployment must contain it.
4516
+ --[no-]share-defs Share the definition documents newly created by this deploy with Sanity — the full document,
4517
+ verbatim (structure, names, filters, effect configuration, seeded values), plus its deployment
4518
+ coordinates (project and dataset, or resource id); never content documents, instances, or your
4519
+ Sanity auth token. Sharing is the default in every environment, including CI / non-TTY /
4520
+ DO_NOT_TRACK. Use --no-share-defs to opt out.
4521
+ --tag=<value> Workflow environment tag (e.g. prod, test) — deploys every deployment carrying the tag (a tag is
4522
+ an environment group).
4523
+
4524
+ DESCRIPTION
4525
+ Validate, diff, and deploy workflow definitions to the resource bound by the selected deployment.
4526
+
4527
+ EXAMPLES
4528
+ $ sanity workflows deploy --deployment review-prod
4529
+
4530
+ $ sanity workflows deploy --tag prod
4531
+
4532
+ $ sanity workflows deploy --all-tags
4533
+
4534
+ $ sanity workflows deploy --check
4535
+
4536
+ $ sanity workflows deploy --dry-run
4537
+
4538
+ $ sanity workflows deploy --only productLaunch
4539
+ ```
4540
+
4541
+ ## `sanity workflows diagnose INSTANCEID`
4542
+
4543
+ Explain why a workflow instance is or isn't progressing, and what would unstick it.
4544
+
4545
+ ```
4546
+ USAGE
4547
+ $ sanity workflows diagnose INSTANCEID [--deployment <value> | --tag <value>] [--json]
4548
+
4549
+ ARGUMENTS
4550
+ INSTANCEID Workflow instance id.
4551
+
4552
+ FLAGS
4553
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
4554
+ partition still comes from the loaded instance.
4555
+ --json Emit structured JSON instead of rendered output.
4556
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4557
+ resources are searched; omit to span them all.
4558
+
4559
+ DESCRIPTION
4560
+ Explain why a workflow instance is or isn't progressing, and what would unstick it.
4561
+
4562
+ EXAMPLES
4563
+ $ sanity workflows diagnose wf-instance.abc123
4564
+
4565
+ $ sanity workflows diagnose wf-instance.abc123 --tag prod
4566
+
4567
+ $ sanity workflows diagnose wf-instance.abc123 --json
4568
+ ```
4569
+
4570
+ ## `sanity workflows fire-action INSTANCEID`
4571
+
4572
+ Fire an action on an instance to unstick a waiting activity — the write acts as the configured token. Omit --action to list what can be fired.
4573
+
4574
+ ```
4575
+ USAGE
4576
+ $ sanity workflows fire-action INSTANCEID [--deployment <value> | --tag <value>] [--activity <value>] [--action <value>]
4577
+ [--param <value>...] [--json]
4578
+
4579
+ ARGUMENTS
4580
+ INSTANCEID Workflow instance id.
4581
+
4582
+ FLAGS
4583
+ --action=<value> Action to fire. Omit to list the actions available on the instance.
4584
+ --activity=<value> Activity the action belongs to. Required to fire; omit --action to list.
4585
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
4586
+ partition still comes from the loaded instance.
4587
+ --json Emit structured JSON instead of rendered output.
4588
+ --param=<value>... [default: ] Action param as key=value (repeatable). Values are JSON-parsed, falling back to a
4589
+ string.
4590
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4591
+ resources are searched; omit to span them all.
4592
+
4593
+ DESCRIPTION
4594
+ Fire an action on an instance to unstick a waiting activity — the write acts as the configured token. Omit --action to
4595
+ list what can be fired.
4596
+
4597
+ EXAMPLES
4598
+ $ sanity workflows fire-action wf-instance.abc123
4599
+
4600
+ $ sanity workflows fire-action wf-instance.abc123 --activity approve --action approve
4601
+
4602
+ $ sanity workflows fire-action wf-instance.abc123 --activity publish --action publish --param note=shipping
4603
+ ```
4604
+
4605
+ ## `sanity workflows list`
4606
+
4607
+ List workflow instances in the configured dataset (in-flight by default).
4608
+
4609
+ ```
4610
+ USAGE
4611
+ $ sanity workflows list [--tag <value>] [--include-completed] [--failed] [--definition <value>] [--document
4612
+ <value>] [--limit <value>] [--json]
4613
+
4614
+ FLAGS
4615
+ --definition=<value> Only instances of this workflow definition (its `name`; the instance's `definition` field).
4616
+ --document=<value> Only instances that reference this document (resource-qualified GDR URI, e.g.
4617
+ "dataset:proj:ds:article-1").
4618
+ --failed Only instances with at least one failed activity.
4619
+ --include-completed Include completed/aborted instances (default: in-flight only).
4620
+ --json Emit structured JSON instead of rendered output.
4621
+ --limit=<value> [default: 50] Maximum rows to return.
4622
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4623
+ resources are searched; omit to span them all.
4624
+
4625
+ DESCRIPTION
4626
+ List workflow instances in the configured dataset (in-flight by default).
4627
+
4628
+ EXAMPLES
4629
+ $ sanity workflows list
4630
+
4631
+ $ sanity workflows list --include-completed
4632
+
4633
+ $ sanity workflows list --definition productLaunch
4634
+
4635
+ $ sanity workflows list --document dataset:proj:ds:article-1
4636
+
4637
+ $ sanity workflows list --tag prod
4638
+
4639
+ $ sanity workflows list --json
4640
+ ```
4641
+
4642
+ ## `sanity workflows nuke`
4643
+
4644
+ Delete engine-owned documents — a whole deployment tag, or a single instance.
4645
+
4646
+ ```
4647
+ USAGE
4648
+ $ sanity workflows nuke [--deployment <value>] [--tag <value>] [--instance <value>] [--force]
4649
+
4650
+ FLAGS
4651
+ --deployment=<value> The deployment name to reset. With --instance, narrows which deployment the instance is looked
4652
+ up in when its tag spans several.
4653
+ --force Skip the confirmation prompt (for scripts/CI). The plan still prints.
4654
+ --instance=<value> Delete a single terminal instance by id, plus its guard docs, instead of a tag.
4655
+ --tag=<value> The deployment tag to reset (while it names exactly one deployment). Not valid with --instance,
4656
+ which reads its tag from the instance id.
4657
+
4658
+ DESCRIPTION
4659
+ Delete engine-owned documents — a whole deployment tag, or a single instance.
4660
+
4661
+ The reset for a dataset holding engine documents the versioned upgrade framework cannot yet migrate: deletes the tag's
4662
+ instances, definitions, and guards (across every alias-bound resource). --instance <id> instead deletes one terminal
4663
+ instance plus its guards. Content documents are never touched. Prints a dry-run plan, then confirms (--force skips the
4664
+ prompt; the plan still prints).
4665
+
4666
+ EXAMPLES
4667
+ $ sanity workflows nuke --deployment plugin-dev
4668
+
4669
+ $ sanity workflows nuke --tag plugin-dev --force
4670
+
4671
+ $ sanity workflows nuke --instance plugin-dev.wf-instance.abc123
4672
+ ```
4673
+
4674
+ ## `sanity workflows reset-activity INSTANCEID ACTIVITY`
4675
+
4676
+ Reset a failed activity on an in-flight instance — back to active to re-run it, or --skip to bypass it (mark it skipped) so a gated exit transition can fire.
4677
+
4678
+ ```
4679
+ USAGE
4680
+ $ sanity workflows reset-activity INSTANCEID ACTIVITY [--deployment <value> | --tag <value>] [--skip]
4681
+
4682
+ ARGUMENTS
4683
+ INSTANCEID Workflow instance id.
4684
+ ACTIVITY Activity name within the current stage.
4685
+
4686
+ FLAGS
4687
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
4688
+ partition still comes from the loaded instance.
4689
+ --skip Bypass the activity (mark it skipped) instead of re-running it (back to active).
4690
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4691
+ resources are searched; omit to span them all.
4692
+
4693
+ DESCRIPTION
4694
+ Reset a failed activity on an in-flight instance — back to active to re-run it, or --skip to bypass it (mark it
4695
+ skipped) so a gated exit transition can fire.
4696
+
4697
+ EXAMPLES
4698
+ $ sanity workflows reset-activity wf-instance.abc123 legal-review
4699
+
4700
+ $ sanity workflows reset-activity wf-instance.abc123 legal-review --skip
4701
+ ```
4702
+
4703
+ ## `sanity workflows set-stage INSTANCEID`
4704
+
4705
+ Force an instance into a stage, regardless of its declared transitions and filters — the engine's setStage admin override. The target stage's enter lifecycle still runs (auto-activities start, stage guards reconcile), and the post-move cascade can immediately auto-transition the instance onward.
4706
+
4707
+ ```
4708
+ USAGE
4709
+ $ sanity workflows set-stage INSTANCEID [--deployment <value> | --tag <value>] [--to <value>] [--reason <value>]
4710
+
4711
+ ARGUMENTS
4712
+ INSTANCEID Workflow instance id to move.
4713
+
4714
+ FLAGS
4715
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
4716
+ partition still comes from the loaded instance.
4717
+ --reason=<value> Free-text reason — recorded on the history entry for audit.
4718
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4719
+ resources are searched; omit to span them all.
4720
+ --to=<value> Target stage name. Omit on an interactive terminal to pick from the workflow’s stages.
4721
+
4722
+ DESCRIPTION
4723
+ Force an instance into a stage, regardless of its declared transitions and filters — the engine's setStage admin
4724
+ override. The target stage's enter lifecycle still runs (auto-activities start, stage guards reconcile), and the
4725
+ post-move cascade can immediately auto-transition the instance onward.
4726
+
4727
+ EXAMPLES
4728
+ $ sanity workflows set-stage wf-instance.abc123 --to ready
4729
+
4730
+ $ sanity workflows set-stage wf-instance.abc123
4731
+
4732
+ $ sanity workflows set-stage wf-instance.abc123 --to ready --reason 'unblock for demo'
4733
+ ```
4734
+
4735
+ ## `sanity workflows show INSTANCEID`
4736
+
4737
+ Show the state, activities, and effects of a workflow instance.
4738
+
4739
+ ```
4740
+ USAGE
4741
+ $ sanity workflows show INSTANCEID [--tag <value>] [--include history...] [--json]
4742
+
4743
+ ARGUMENTS
4744
+ INSTANCEID Workflow instance document id.
4745
+
4746
+ FLAGS
4747
+ --include=<option>... [default: ] Optional sections to include in rendered output (--json always carries the full
4748
+ document).
4749
+ <options: history>
4750
+ --json Emit structured JSON instead of rendered output.
4751
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4752
+ resources are searched; omit to span them all.
4753
+
4754
+ DESCRIPTION
4755
+ Show the state, activities, and effects of a workflow instance.
4756
+
4757
+ EXAMPLES
4758
+ $ sanity workflows show wf-instance.abc123
4759
+
4760
+ $ sanity workflows show wf-instance.abc123 --include history
4761
+
4762
+ $ sanity workflows show wf-instance.abc123 --json
4763
+ ```
4764
+
4765
+ ## `sanity workflows start NAME`
4766
+
4767
+ Start a workflow instance from a deployed definition. Supply values for the workflow's input-sourced fields with --field (e.g. the subject document ref).
4768
+
4769
+ ```
4770
+ USAGE
4771
+ $ sanity workflows start NAME [--deployment <value> | --tag <value>] [--version <value>] [--field <value>...]
4772
+ [--instance-id <value>] [--json]
4773
+
4774
+ ARGUMENTS
4775
+ NAME Workflow definition name.
4776
+
4777
+ FLAGS
4778
+ --deployment=<value> Deployment name — the unique identity of one deployment in the config.
4779
+ --field=<value>... [default: ] Initial value for a declared input-sourced field, as name=value (repeatable).
4780
+ Values are JSON-parsed, falling back to a string; ref kinds take a JSON object with a GDR `id`
4781
+ and doc `type`.
4782
+ --instance-id=<value> Start under this instance id — for retries. The id is the start's idempotency key: pass the id
4783
+ of a start that failed partway and the engine resumes it instead of creating a duplicate (an
4784
+ already-settled start replays as a no-op). Omit to mint a fresh id.
4785
+ --json Emit structured JSON instead of rendered output.
4786
+ --tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
4787
+ names exactly one; pass --deployment when it spans several.
4788
+ --version=<value> Definition version to start from (default: highest deployed).
4789
+
4790
+ DESCRIPTION
4791
+ Start a workflow instance from a deployed definition. Supply values for the workflow's input-sourced fields with
4792
+ --field (e.g. the subject document ref).
4793
+
4794
+ EXAMPLES
4795
+ $ sanity workflows start productLaunch
4796
+
4797
+ $ sanity workflows start article-review --field subject='{"id":"dataset:proj:ds:article-1","type":"article"}'
4798
+
4799
+ $ sanity workflows start productLaunch --version 2 --tag prod
4800
+
4801
+ $ sanity workflows start productLaunch --instance-id prod.wf-instance.a1b2c3d4e5f6
4802
+ ```
4803
+
4804
+ ## `sanity workflows tail INSTANCEID`
4805
+
4806
+ Stream new history entries on a workflow instance as they land in the dataset.
4807
+
4808
+ ```
4809
+ USAGE
4810
+ $ sanity workflows tail INSTANCEID [--tag <value>]
4811
+
4812
+ ARGUMENTS
4813
+ INSTANCEID Workflow instance id to tail.
4814
+
4815
+ FLAGS
4816
+ --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which resources
4817
+ are searched; omit to span them all.
4818
+
4819
+ DESCRIPTION
4820
+ Stream new history entries on a workflow instance as they land in the dataset.
4821
+
4822
+ EXAMPLES
4823
+ $ sanity workflows tail wf-instance.abc123
4824
+ ```
4825
+
3948
4826
  <!-- commandsstop -->