@sanity/cli 8.26.0 → 8.28.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 (155) hide show
  1. package/README.md +1534 -411
  2. package/dist/actions/context/commandTable.js +215 -0
  3. package/dist/actions/context/commandTable.js.map +1 -0
  4. package/dist/actions/context/contextCommand.js +246 -0
  5. package/dist/actions/context/contextCommand.js.map +1 -0
  6. package/dist/actions/context/contextSpec.js +18 -0
  7. package/dist/actions/context/contextSpec.js.map +1 -0
  8. package/dist/actions/context/distillContextOperations.js +335 -0
  9. package/dist/actions/context/distillContextOperations.js.map +1 -0
  10. package/dist/actions/context/mcpEndpoint.js +165 -0
  11. package/dist/actions/context/mcpEndpoint.js.map +1 -0
  12. package/dist/actions/context/operationInput.js +226 -0
  13. package/dist/actions/context/operationInput.js.map +1 -0
  14. package/dist/actions/context/operationTypes.js +3 -0
  15. package/dist/actions/context/operationTypes.js.map +1 -0
  16. package/dist/actions/context/removedCommands.js +26 -0
  17. package/dist/actions/context/removedCommands.js.map +1 -0
  18. package/dist/actions/context/renderOperationResult.js +72 -0
  19. package/dist/actions/context/renderOperationResult.js.map +1 -0
  20. package/dist/actions/context/resolveOrganizationId.js +8 -1
  21. package/dist/actions/context/resolveOrganizationId.js.map +1 -1
  22. package/dist/actions/context/sourceFile.js +31 -0
  23. package/dist/actions/context/sourceFile.js.map +1 -0
  24. package/dist/actions/context/syncOutput.js +17 -0
  25. package/dist/actions/context/syncOutput.js.map +1 -0
  26. package/dist/actions/context/table.js +13 -0
  27. package/dist/actions/context/table.js.map +1 -0
  28. package/dist/actions/context/waitForJob.js.map +1 -1
  29. package/dist/actions/context/waitForSourceSync.js +48 -0
  30. package/dist/actions/context/waitForSourceSync.js.map +1 -0
  31. package/dist/actions/context/watchJob.js.map +1 -1
  32. package/dist/actions/context/watchSourceSync.js +40 -0
  33. package/dist/actions/context/watchSourceSync.js.map +1 -0
  34. package/dist/commands/context/build.js +19 -81
  35. package/dist/commands/context/build.js.map +1 -1
  36. package/dist/commands/context/create.js +3 -104
  37. package/dist/commands/context/create.js.map +1 -1
  38. package/dist/commands/context/delete.js +3 -73
  39. package/dist/commands/context/delete.js.map +1 -1
  40. package/dist/commands/context/documents/content.js +117 -0
  41. package/dist/commands/context/documents/content.js.map +1 -0
  42. package/dist/commands/context/documents/delete.js +5 -0
  43. package/dist/commands/context/documents/delete.js.map +1 -0
  44. package/dist/commands/context/documents/edit.js +5 -0
  45. package/dist/commands/context/documents/edit.js.map +1 -0
  46. package/dist/commands/context/documents/get.js +5 -0
  47. package/dist/commands/context/documents/get.js.map +1 -0
  48. package/dist/commands/context/documents/list.js +5 -0
  49. package/dist/commands/context/documents/list.js.map +1 -0
  50. package/dist/commands/context/entries/list.js +2 -2
  51. package/dist/commands/context/entries/list.js.map +1 -1
  52. package/dist/commands/context/entries/rebuild.js +3 -93
  53. package/dist/commands/context/entries/rebuild.js.map +1 -1
  54. package/dist/commands/context/get.js +3 -88
  55. package/dist/commands/context/get.js.map +1 -1
  56. package/dist/commands/context/instructions/create.js +5 -0
  57. package/dist/commands/context/instructions/create.js.map +1 -0
  58. package/dist/commands/context/instructions/delete.js +5 -0
  59. package/dist/commands/context/instructions/delete.js.map +1 -0
  60. package/dist/commands/context/instructions/edit.js +5 -0
  61. package/dist/commands/context/instructions/edit.js.map +1 -0
  62. package/dist/commands/context/issues/apply.js +3 -84
  63. package/dist/commands/context/issues/apply.js.map +1 -1
  64. package/dist/commands/context/issues/dismiss.js +3 -50
  65. package/dist/commands/context/issues/dismiss.js.map +1 -1
  66. package/dist/commands/context/issues/list.js +0 -5
  67. package/dist/commands/context/issues/list.js.map +1 -1
  68. package/dist/commands/context/issues/reopen.js +3 -51
  69. package/dist/commands/context/issues/reopen.js.map +1 -1
  70. package/dist/commands/context/issues/resolve.js +23 -92
  71. package/dist/commands/context/issues/resolve.js.map +1 -1
  72. package/dist/commands/context/jobs/get.js +3 -88
  73. package/dist/commands/context/jobs/get.js.map +1 -1
  74. package/dist/commands/context/list.js +3 -103
  75. package/dist/commands/context/list.js.map +1 -1
  76. package/dist/commands/context/mcp/create.js +152 -0
  77. package/dist/commands/context/mcp/create.js.map +1 -0
  78. package/dist/commands/context/mcp/delete.js +82 -0
  79. package/dist/commands/context/mcp/delete.js.map +1 -0
  80. package/dist/commands/context/mcp/get.js +42 -0
  81. package/dist/commands/context/mcp/get.js.map +1 -0
  82. package/dist/commands/context/mcp/initial-context.js +5 -0
  83. package/dist/commands/context/mcp/initial-context.js.map +1 -0
  84. package/dist/commands/context/mcp/list.js +87 -0
  85. package/dist/commands/context/mcp/list.js.map +1 -0
  86. package/dist/commands/context/mcp/status.js +98 -0
  87. package/dist/commands/context/mcp/status.js.map +1 -0
  88. package/dist/commands/context/mcp/update.js +225 -0
  89. package/dist/commands/context/mcp/update.js.map +1 -0
  90. package/dist/commands/context/query.js +6 -14
  91. package/dist/commands/context/query.js.map +1 -1
  92. package/dist/commands/context/sources/create.js +175 -0
  93. package/dist/commands/context/sources/create.js.map +1 -0
  94. package/dist/commands/context/sources/delete.js +5 -0
  95. package/dist/commands/context/sources/delete.js.map +1 -0
  96. package/dist/commands/context/sources/edit.js +29 -0
  97. package/dist/commands/context/sources/edit.js.map +1 -0
  98. package/dist/commands/context/sources/get.js +5 -0
  99. package/dist/commands/context/sources/get.js.map +1 -0
  100. package/dist/commands/context/sources/list.js +5 -0
  101. package/dist/commands/context/sources/list.js.map +1 -0
  102. package/dist/commands/context/sources/sync.js +5 -0
  103. package/dist/commands/context/sources/sync.js.map +1 -0
  104. package/dist/commands/context/sources/syncs/confirm.js +5 -0
  105. package/dist/commands/context/sources/syncs/confirm.js.map +1 -0
  106. package/dist/commands/context/sources/syncs/discard.js +5 -0
  107. package/dist/commands/context/sources/syncs/discard.js.map +1 -0
  108. package/dist/commands/context/sources/syncs/get.js +5 -0
  109. package/dist/commands/context/sources/syncs/get.js.map +1 -0
  110. package/dist/commands/context/sources/syncs/list.js +5 -0
  111. package/dist/commands/context/sources/syncs/list.js.map +1 -0
  112. package/dist/commands/context/sources/upload.js +63 -0
  113. package/dist/commands/context/sources/upload.js.map +1 -0
  114. package/dist/commands/context/sync.js +5 -0
  115. package/dist/commands/context/sync.js.map +1 -0
  116. package/dist/commands/context/update.js +3 -136
  117. package/dist/commands/context/update.js.map +1 -1
  118. package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js +47 -26
  119. package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js.map +1 -1
  120. package/dist/generated/apiRoutes.js +28 -0
  121. package/dist/generated/apiRoutes.js.map +1 -1
  122. package/dist/generated/contextOperations.js +1116 -0
  123. package/dist/generated/contextOperations.js.map +1 -0
  124. package/dist/hooks/commandNotFound/topicAliases.js +8 -2
  125. package/dist/hooks/commandNotFound/topicAliases.js.map +1 -1
  126. package/dist/prompts/promptForText.js +12 -0
  127. package/dist/prompts/promptForText.js.map +1 -0
  128. package/dist/services/context.js +276 -202
  129. package/dist/services/context.js.map +1 -1
  130. package/dist/util/sharedFlags.js.map +1 -1
  131. package/dist/util/telemetry/cliCommandIdentity.js +16 -18
  132. package/dist/util/telemetry/cliCommandIdentity.js.map +1 -1
  133. package/oclif.config.js +1 -1
  134. package/oclif.manifest.json +4854 -2834
  135. package/package.json +20 -19
  136. package/templates/app-quickstart/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
  137. package/templates/app-quickstart/AGENTS.md +49 -0
  138. package/templates/app-sanity-ui/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
  139. package/templates/app-sanity-ui/AGENTS.md +49 -0
  140. package/templates/shared/dashboard/app-quickstart/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
  141. package/templates/shared/dashboard/app-quickstart/AGENTS.md +49 -0
  142. package/templates/shared/dashboard/app-sanity-ui/.claude/skills/sanity-app-sdk/SKILL.md +49 -0
  143. package/templates/shared/dashboard/app-sanity-ui/AGENTS.md +49 -0
  144. package/dist/commands/context/imports/create.js +0 -270
  145. package/dist/commands/context/imports/create.js.map +0 -1
  146. package/dist/commands/context/imports/delete.js +0 -73
  147. package/dist/commands/context/imports/delete.js.map +0 -1
  148. package/dist/commands/context/imports/download.js +0 -60
  149. package/dist/commands/context/imports/download.js.map +0 -1
  150. package/dist/commands/context/imports/get.js +0 -88
  151. package/dist/commands/context/imports/get.js.map +0 -1
  152. package/dist/commands/context/imports/list.js +0 -100
  153. package/dist/commands/context/imports/list.js.map +0 -1
  154. package/dist/commands/context/refresh.js +0 -46
  155. package/dist/commands/context/refresh.js.map +0 -1
package/README.md CHANGED
@@ -36,16 +36,19 @@ Code for sanity cli
36
36
  - [`sanity context build KNOWLEDGEBASEID`](#sanity-context-build-knowledgebaseid)
37
37
  - [`sanity context create`](#sanity-context-create)
38
38
  - [`sanity context delete KNOWLEDGEBASEID`](#sanity-context-delete-knowledgebaseid)
39
+ - [`sanity context documents content KNOWLEDGEBASEID DOCUMENTID`](#sanity-context-documents-content-knowledgebaseid-documentid)
40
+ - [`sanity context documents delete KNOWLEDGEBASEID DOCUMENTID`](#sanity-context-documents-delete-knowledgebaseid-documentid)
41
+ - [`sanity context documents edit KNOWLEDGEBASEID DOCUMENTID`](#sanity-context-documents-edit-knowledgebaseid-documentid)
42
+ - [`sanity context documents get KNOWLEDGEBASEID DOCUMENTID`](#sanity-context-documents-get-knowledgebaseid-documentid)
43
+ - [`sanity context documents list KNOWLEDGEBASEID`](#sanity-context-documents-list-knowledgebaseid)
39
44
  - [`sanity context entries get KNOWLEDGEBASEID PATH`](#sanity-context-entries-get-knowledgebaseid-path)
40
45
  - [`sanity context entries list KNOWLEDGEBASEID`](#sanity-context-entries-list-knowledgebaseid)
41
- - [`sanity context entries rebuild KNOWLEDGEBASEID PATH`](#sanity-context-entries-rebuild-knowledgebaseid-path)
46
+ - [`sanity context entries rebuild KNOWLEDGEBASEID ENTRYPATH`](#sanity-context-entries-rebuild-knowledgebaseid-entrypath)
42
47
  - [`sanity context get KNOWLEDGEBASEID`](#sanity-context-get-knowledgebaseid)
43
- - [`sanity context imports create KNOWLEDGEBASEID`](#sanity-context-imports-create-knowledgebaseid)
44
- - [`sanity context imports delete KNOWLEDGEBASEID IMPORTID`](#sanity-context-imports-delete-knowledgebaseid-importid)
45
- - [`sanity context imports download KNOWLEDGEBASEID IMPORTID`](#sanity-context-imports-download-knowledgebaseid-importid)
46
- - [`sanity context imports get KNOWLEDGEBASEID IMPORTID`](#sanity-context-imports-get-knowledgebaseid-importid)
47
- - [`sanity context imports list KNOWLEDGEBASEID`](#sanity-context-imports-list-knowledgebaseid)
48
- - [`sanity context issues apply KNOWLEDGEBASEID ISSUEID`](#sanity-context-issues-apply-knowledgebaseid-issueid)
48
+ - [`sanity context instructions create KNOWLEDGEBASEID`](#sanity-context-instructions-create-knowledgebaseid)
49
+ - [`sanity context instructions delete KNOWLEDGEBASEID INSTRUCTIONID`](#sanity-context-instructions-delete-knowledgebaseid-instructionid)
50
+ - [`sanity context instructions edit KNOWLEDGEBASEID INSTRUCTIONID`](#sanity-context-instructions-edit-knowledgebaseid-instructionid)
51
+ - [`sanity context issues apply KNOWLEDGEBASEID ISSUEIDS`](#sanity-context-issues-apply-knowledgebaseid-issueids)
49
52
  - [`sanity context issues dismiss KNOWLEDGEBASEID ISSUEID`](#sanity-context-issues-dismiss-knowledgebaseid-issueid)
50
53
  - [`sanity context issues get KNOWLEDGEBASEID ISSUEID`](#sanity-context-issues-get-knowledgebaseid-issueid)
51
54
  - [`sanity context issues list KNOWLEDGEBASEID`](#sanity-context-issues-list-knowledgebaseid)
@@ -53,8 +56,26 @@ Code for sanity cli
53
56
  - [`sanity context issues resolve KNOWLEDGEBASEID ISSUEID`](#sanity-context-issues-resolve-knowledgebaseid-issueid)
54
57
  - [`sanity context jobs get KNOWLEDGEBASEID JOBID`](#sanity-context-jobs-get-knowledgebaseid-jobid)
55
58
  - [`sanity context list`](#sanity-context-list)
59
+ - [`sanity context mcp create NAME`](#sanity-context-mcp-create-name)
60
+ - [`sanity context mcp delete NAME`](#sanity-context-mcp-delete-name)
61
+ - [`sanity context mcp get NAME`](#sanity-context-mcp-get-name)
62
+ - [`sanity context mcp initial-context MCPENDPOINT`](#sanity-context-mcp-initial-context-mcpendpoint)
63
+ - [`sanity context mcp list`](#sanity-context-mcp-list)
64
+ - [`sanity context mcp status NAME`](#sanity-context-mcp-status-name)
65
+ - [`sanity context mcp update NAME`](#sanity-context-mcp-update-name)
56
66
  - [`sanity context query QUERY`](#sanity-context-query-query)
57
- - [`sanity context refresh KNOWLEDGEBASEID`](#sanity-context-refresh-knowledgebaseid)
67
+ - [`sanity context sources create KNOWLEDGEBASEID`](#sanity-context-sources-create-knowledgebaseid)
68
+ - [`sanity context sources delete KNOWLEDGEBASEID SOURCEID`](#sanity-context-sources-delete-knowledgebaseid-sourceid)
69
+ - [`sanity context sources edit KNOWLEDGEBASEID SOURCEID`](#sanity-context-sources-edit-knowledgebaseid-sourceid)
70
+ - [`sanity context sources get KNOWLEDGEBASEID SOURCEID`](#sanity-context-sources-get-knowledgebaseid-sourceid)
71
+ - [`sanity context sources list KNOWLEDGEBASEID`](#sanity-context-sources-list-knowledgebaseid)
72
+ - [`sanity context sources sync KNOWLEDGEBASEID SOURCEID`](#sanity-context-sources-sync-knowledgebaseid-sourceid)
73
+ - [`sanity context sources syncs confirm KNOWLEDGEBASEID SOURCEID SYNCID`](#sanity-context-sources-syncs-confirm-knowledgebaseid-sourceid-syncid)
74
+ - [`sanity context sources syncs discard KNOWLEDGEBASEID SOURCEID SYNCID`](#sanity-context-sources-syncs-discard-knowledgebaseid-sourceid-syncid)
75
+ - [`sanity context sources syncs get KNOWLEDGEBASEID SOURCEID SYNCID`](#sanity-context-sources-syncs-get-knowledgebaseid-sourceid-syncid)
76
+ - [`sanity context sources syncs list KNOWLEDGEBASEID SOURCEID`](#sanity-context-sources-syncs-list-knowledgebaseid-sourceid)
77
+ - [`sanity context sources upload KNOWLEDGEBASEID SOURCEID`](#sanity-context-sources-upload-knowledgebaseid-sourceid)
78
+ - [`sanity context sync KNOWLEDGEBASEID`](#sanity-context-sync-knowledgebaseid)
58
79
  - [`sanity context update KNOWLEDGEBASEID`](#sanity-context-update-knowledgebaseid)
59
80
  - [`sanity cors add ORIGIN`](#sanity-cors-add-origin)
60
81
  - [`sanity cors delete [ORIGIN]`](#sanity-cors-delete-origin)
@@ -151,11 +172,12 @@ Code for sanity cli
151
172
  - [`sanity versions`](#sanity-versions)
152
173
  - [`sanity whoami`](#sanity-whoami)
153
174
  - [`sanity workflows abort INSTANCEID`](#sanity-workflows-abort-instanceid)
154
- - [`sanity workflows blueprint generate`](#sanity-workflows-blueprint-generate)
155
- - [`sanity workflows definition delete NAME`](#sanity-workflows-definition-delete-name)
156
- - [`sanity workflows definition diff NAME`](#sanity-workflows-definition-diff-name)
157
- - [`sanity workflows definition list`](#sanity-workflows-definition-list)
158
- - [`sanity workflows definition show NAME`](#sanity-workflows-definition-show-name)
175
+ - [`sanity workflows blueprints generate`](#sanity-workflows-blueprints-generate)
176
+ - [`sanity workflows definitions delete NAME`](#sanity-workflows-definitions-delete-name)
177
+ - [`sanity workflows definitions diff NAME`](#sanity-workflows-definitions-diff-name)
178
+ - [`sanity workflows definitions list`](#sanity-workflows-definitions-list)
179
+ - [`sanity workflows definitions show NAME`](#sanity-workflows-definitions-show-name)
180
+ - [`sanity workflows definitions validate FILE`](#sanity-workflows-definitions-validate-file)
159
181
  - [`sanity workflows deploy`](#sanity-workflows-deploy)
160
182
  - [`sanity workflows diagnose INSTANCEID`](#sanity-workflows-diagnose-instanceid)
161
183
  - [`sanity workflows fire-action INSTANCEID`](#sanity-workflows-fire-action-instanceid)
@@ -439,8 +461,8 @@ EXAMPLES
439
461
  USAGE
440
462
  $ sanity blueprints add TYPE [--json] [--example <value> | -n <value> | --fn-type
441
463
  document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
442
- te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
443
- --fn-helpers | --fn-installer skip|npm|pnpm|yarn] [-i | ]
464
+ te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate|durable-function... | --language ts|js
465
+ | --javascript | --fn-helpers | --fn-installer skip|npm|pnpm|yarn] [-i | ]
444
466
 
445
467
  ARGUMENTS
446
468
  TYPE (function) Type of resource to add (only "function" is supported)
@@ -457,7 +479,7 @@ FLAGS
457
479
  events by specifying this flag multiple times
458
480
  <options: document-publish|document-create|document-delete|document-update|media-library-
459
481
  asset-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-func
460
- tion|sync-tag-invalidate>
482
+ tion|sync-tag-invalidate|durable-function>
461
483
  --javascript Use JavaScript instead of TypeScript
462
484
  --json Format output as json
463
485
  --language=<option> [default: ts] Language of the new function
@@ -984,654 +1006,1638 @@ EXAMPLES
984
1006
 
985
1007
  ## `sanity context build KNOWLEDGEBASEID`
986
1008
 
987
- Build a knowledge base from its imported content
1009
+ Start a knowledge base build
988
1010
 
989
1011
  ```
990
1012
  USAGE
991
- $ sanity context build KNOWLEDGEBASEID [--cancel | --watch]
1013
+ $ sanity context build KNOWLEDGEBASEID [--json] [--cancel | --watch]
992
1014
 
993
1015
  ARGUMENTS
994
- KNOWLEDGEBASEID Knowledge base ID
1016
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
995
1017
 
996
1018
  FLAGS
997
1019
  --cancel Cancel the running build instead of starting one
998
- --watch Wait for the build to finish, exiting non-zero if it fails
1020
+ --watch Wait for the job to finish, exiting non-zero if it fails
1021
+
1022
+ GLOBAL FLAGS
1023
+ --json Format output as json.
999
1024
 
1000
1025
  DESCRIPTION
1001
- Build a knowledge base from its imported content
1026
+ Start a knowledge base build
1027
+
1028
+ Queues a build over the knowledge base's current sources and returns a job ID immediately. If a build is already
1029
+ running, the response returns that build's job ID instead of starting a second build. A draft can't be built: the
1030
+ request returns `409` with code `knowledgeBaseIsDraft`.
1002
1031
 
1003
1032
  EXAMPLES
1004
1033
  Start a build and return the job ID
1005
1034
 
1006
- $ sanity context build kb-abc123
1035
+ $ sanity context build kb-abc123
1036
+
1037
+ Start a build and wait for it to finish (non-zero exit on failure)
1038
+
1039
+ $ sanity context build kb-abc123 --watch
1040
+
1041
+ Cancel the running build, if any
1042
+
1043
+ $ sanity context build kb-abc123 --cancel
1044
+ ```
1045
+
1046
+ ## `sanity context create`
1047
+
1048
+ Create a knowledge base
1049
+
1050
+ ```
1051
+ USAGE
1052
+ $ sanity context create [--json] [--title <value>] [--description <value>] [--draft] [--organization <id>]
1053
+
1054
+ FLAGS
1055
+ --description=<value> A short description of what the knowledge base covers. Required unless `draft` is `true`.
1056
+ --[no-]draft Whether to create the knowledge base as a draft. You can add sources to a draft, and they sync
1057
+ right away, but you can't build it, and the list leaves it out unless you set `includeDrafts`
1058
+ to `true`. A draft counts toward your plan's knowledge base limit. To finish it, update it with
1059
+ `draft` set to `false`.
1060
+ --title=<value> The knowledge base's title. Required unless `draft` is `true`.
1061
+
1062
+ GLOBAL FLAGS
1063
+ --json Format output as json.
1064
+
1065
+ OVERRIDE FLAGS
1066
+ --organization=<id> Organization ID (overrides CLI configuration)
1067
+
1068
+ DESCRIPTION
1069
+ Create a knowledge base
1070
+
1071
+ Creates a knowledge base in your organization. To add content to it, add a source. Set `draft` to `true` to create a
1072
+ draft, which needs no title or description until you finish it. If your organization's Context document store can't be
1073
+ used, the request returns `503` with code `contextStoreUnavailable` and you can retry.
1074
+
1075
+ EXAMPLES
1076
+ Create a knowledge base
1077
+
1078
+ $ sanity context create
1079
+
1080
+ Create a knowledge base, as JSON
1081
+
1082
+ $ sanity context create --json
1083
+ ```
1084
+
1085
+ ## `sanity context delete KNOWLEDGEBASEID`
1086
+
1087
+ Delete a knowledge base
1088
+
1089
+ ```
1090
+ USAGE
1091
+ $ sanity context delete KNOWLEDGEBASEID [--json] [-y]
1092
+
1093
+ ARGUMENTS
1094
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1095
+
1096
+ FLAGS
1097
+ -y, --yes Skip confirmation prompt (unattended mode)
1098
+
1099
+ GLOBAL FLAGS
1100
+ --json Format output as json.
1101
+
1102
+ DESCRIPTION
1103
+ Delete a knowledge base
1104
+
1105
+ Deletes the knowledge base and everything it owns: its sources, revisions, stored source files, and its documents in
1106
+ your organization's document store. While a build, refresh, apply, or sync is running, the request returns `409` with
1107
+ code `buildInFlight`. Retry after that work finishes.
1108
+
1109
+ EXAMPLES
1110
+ Delete a knowledge base
1111
+
1112
+ $ sanity context delete <knowledgeBaseId>
1113
+
1114
+ Delete a knowledge base, as JSON
1115
+
1116
+ $ sanity context delete <knowledgeBaseId> --json
1117
+ ```
1118
+
1119
+ ## `sanity context documents content KNOWLEDGEBASEID DOCUMENTID`
1120
+
1121
+ Get a document's markdown
1122
+
1123
+ ```
1124
+ USAGE
1125
+ $ sanity context documents content KNOWLEDGEBASEID DOCUMENTID [--json] [--format json|markdown|plain|raw] [--chunk <value>]
1126
+ [--lines <value>] [--line-numbers] [-o <file>]
1127
+
1128
+ ARGUMENTS
1129
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1130
+ DOCUMENTID The document's ID.
1131
+
1132
+ FLAGS
1133
+ -o, --output=<file> Write the content to this file instead of stdout
1134
+ --chunk=<value> Return only this chunk's lines. Citations name the chunk they quote.
1135
+ --format=<option> Response format. `json` (default) returns the markdown with its line numbers. `markdown` and
1136
+ `plain` return the markdown alone, ready to pass to a model. `raw` returns the bytes the source
1137
+ gave, before conversion: the uploaded file, the crawled page, the dataset document as JSON.
1138
+ <options: json|markdown|plain|raw>
1139
+ --line-numbers Number each line as citations number them
1140
+ --lines=<value> Return only these lines, from 1 and inclusive: `10-20`, or `10` for line 10 to the end. A range
1141
+ past the end returns up to the last line.
1142
+
1143
+ GLOBAL FLAGS
1144
+ --json Format output as json.
1145
+
1146
+ DESCRIPTION
1147
+ Get a document's markdown
1148
+
1149
+ Returns the markdown a document converted to: the text builds read, and the line numbers citations use. Set `chunk` or
1150
+ `lines` to get part of it, and `format` to `markdown` or `plain` to get the text alone instead of JSON. Until the
1151
+ document is converted, the request returns `409` with code `documentNotConverted`. With `format=raw` it returns the
1152
+ document as its source gave it, as an attachment, or `409` with code `documentNotStored` when the document was too
1153
+ large to keep.
1154
+
1155
+ EXAMPLES
1156
+ Print a document's markdown
1157
+
1158
+ $ sanity context documents content kb-abc123 document-def456
1159
+
1160
+ Print lines 10 to 20, each with its line number
1161
+
1162
+ $ sanity context documents content kb-abc123 document-def456 --lines 10-20 --line-numbers
1163
+
1164
+ Download the original file
1165
+
1166
+ $ sanity context documents content kb-abc123 document-def456 --format raw --output handbook.pdf
1167
+ ```
1168
+
1169
+ ## `sanity context documents delete KNOWLEDGEBASEID DOCUMENTID`
1170
+
1171
+ Delete a document
1172
+
1173
+ ```
1174
+ USAGE
1175
+ $ sanity context documents delete KNOWLEDGEBASEID DOCUMENTID [--json] [-y]
1176
+
1177
+ ARGUMENTS
1178
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1179
+ DOCUMENTID The document's ID.
1180
+
1181
+ FLAGS
1182
+ -y, --yes Skip confirmation prompt (unattended mode)
1183
+
1184
+ GLOBAL FLAGS
1185
+ --json Format output as json.
1186
+
1187
+ DESCRIPTION
1188
+ Delete a document
1189
+
1190
+ Deletes a document from its source. A page that is still on the website comes back on the next sync of its source
1191
+ unless the crawl options exclude it. Entries that cite the document stay the same until the next build or refresh,
1192
+ which removes the citations.
1193
+
1194
+ EXAMPLES
1195
+ Delete a document
1196
+
1197
+ $ sanity context documents delete <knowledgeBaseId> <documentId>
1198
+
1199
+ Delete a document, as JSON
1200
+
1201
+ $ sanity context documents delete <knowledgeBaseId> <documentId> --json
1202
+ ```
1203
+
1204
+ ## `sanity context documents edit KNOWLEDGEBASEID DOCUMENTID`
1205
+
1206
+ Keep a missing document
1207
+
1208
+ ```
1209
+ USAGE
1210
+ $ sanity context documents edit KNOWLEDGEBASEID DOCUMENTID --state active [--json]
1211
+
1212
+ ARGUMENTS
1213
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1214
+ DOCUMENTID The document's ID.
1215
+
1216
+ FLAGS
1217
+ --state=<option> (required) Set to `active` to keep a `missing` page in the knowledge base. The count of crawls that
1218
+ missed it starts again.
1219
+ <options: active>
1220
+
1221
+ GLOBAL FLAGS
1222
+ --json Format output as json.
1223
+
1224
+ DESCRIPTION
1225
+ Keep a missing document
1226
+
1227
+ Keeps a `missing` web page in the knowledge base by setting its `state` back to `active`. A document that isn't
1228
+ `missing` returns `409` with code `documentInvalidState`.
1229
+
1230
+ EXAMPLES
1231
+ Keep a missing document
1232
+
1233
+ $ sanity context documents edit <knowledgeBaseId> <documentId>
1234
+
1235
+ Keep a missing document, as JSON
1236
+
1237
+ $ sanity context documents edit <knowledgeBaseId> <documentId> --json
1238
+ ```
1239
+
1240
+ ## `sanity context documents get KNOWLEDGEBASEID DOCUMENTID`
1241
+
1242
+ Get a document
1243
+
1244
+ ```
1245
+ USAGE
1246
+ $ sanity context documents get KNOWLEDGEBASEID DOCUMENTID [--json]
1247
+
1248
+ ARGUMENTS
1249
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1250
+ DOCUMENTID The document's ID.
1251
+
1252
+ GLOBAL FLAGS
1253
+ --json Format output as json.
1254
+
1255
+ DESCRIPTION
1256
+ Get a document
1257
+
1258
+ Returns a document with its conversion status and the chunks of its markdown. Entry citations point at a document's
1259
+ chunks.
1260
+
1261
+ EXAMPLES
1262
+ Get a document
1263
+
1264
+ $ sanity context documents get <knowledgeBaseId> <documentId>
1265
+
1266
+ Get a document, as JSON
1267
+
1268
+ $ sanity context documents get <knowledgeBaseId> <documentId> --json
1269
+ ```
1270
+
1271
+ ## `sanity context documents list KNOWLEDGEBASEID`
1272
+
1273
+ List documents
1274
+
1275
+ ```
1276
+ USAGE
1277
+ $ sanity context documents list KNOWLEDGEBASEID [--json] [--source <value>] [--state active|missing|deleted] [--ids
1278
+ <value>]
1279
+
1280
+ ARGUMENTS
1281
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1282
+
1283
+ FLAGS
1284
+ --ids=<value> Comma-separated IDs of the documents to return, up to 200, in any state. Use it to look up the
1285
+ documents entry citations point at.
1286
+ --source=<value> Return only the documents of this source.
1287
+ --state=<option> Return only documents in this state. Without it, `deleted` documents are left out.
1288
+ <options: active|missing|deleted>
1289
+
1290
+ GLOBAL FLAGS
1291
+ --json Format output as json.
1292
+
1293
+ DESCRIPTION
1294
+ List documents
1295
+
1296
+ Lists the documents in a knowledge base: the pages, dataset documents and files its sources yield, which builds read
1297
+ and cite. Results are cursor-paginated, and you can filter them by `source` and `state`.
1298
+
1299
+ EXAMPLES
1300
+ List documents
1301
+
1302
+ $ sanity context documents list <knowledgeBaseId>
1303
+
1304
+ List documents, as JSON
1305
+
1306
+ $ sanity context documents list <knowledgeBaseId> --json
1307
+ ```
1308
+
1309
+ ## `sanity context entries get KNOWLEDGEBASEID PATH`
1310
+
1311
+ Get an entry and its content
1312
+
1313
+ ```
1314
+ USAGE
1315
+ $ sanity context entries get KNOWLEDGEBASEID PATH [--json]
1316
+
1317
+ ARGUMENTS
1318
+ KNOWLEDGEBASEID Knowledge base ID
1319
+ PATH Entry path, as listed by `sanity context entries list`
1320
+
1321
+ GLOBAL FLAGS
1322
+ --json Format output as json.
1323
+
1324
+ DESCRIPTION
1325
+ Get an entry and its content
1326
+
1327
+ EXAMPLES
1328
+ Print an entry and its content
1329
+
1330
+ $ sanity context entries get kb-abc123 billing/refunds
1331
+
1332
+ Output the entry, including citations, as JSON
1333
+
1334
+ $ sanity context entries get kb-abc123 billing/refunds --json
1335
+ ```
1336
+
1337
+ ## `sanity context entries list KNOWLEDGEBASEID`
1338
+
1339
+ List the entries a knowledge base build produced
1340
+
1341
+ ```
1342
+ USAGE
1343
+ $ sanity context entries list KNOWLEDGEBASEID [--json]
1344
+
1345
+ ARGUMENTS
1346
+ KNOWLEDGEBASEID Knowledge base ID
1347
+
1348
+ GLOBAL FLAGS
1349
+ --json Format output as json.
1350
+
1351
+ DESCRIPTION
1352
+ List the entries a knowledge base build produced
1353
+
1354
+ EXAMPLES
1355
+ List all entries for a knowledge base
1356
+
1357
+ $ sanity context entries list kb-abc123
1358
+
1359
+ Output entries as JSON
1360
+
1361
+ $ sanity context entries list kb-abc123 --json
1362
+ ```
1363
+
1364
+ ## `sanity context entries rebuild KNOWLEDGEBASEID ENTRYPATH`
1365
+
1366
+ Rebuild an entry from its sources
1367
+
1368
+ ```
1369
+ USAGE
1370
+ $ sanity context entries rebuild KNOWLEDGEBASEID ENTRYPATH [--json] [--watch]
1371
+
1372
+ ARGUMENTS
1373
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1374
+ ENTRYPATH The entry's slash-delimited path, such as `pricing/plans/free`, URL-encoded.
1375
+
1376
+ FLAGS
1377
+ --watch Wait for the job to finish, exiting non-zero if it fails
1378
+
1379
+ GLOBAL FLAGS
1380
+ --json Format output as json.
1381
+
1382
+ DESCRIPTION
1383
+ Rebuild an entry from its sources
1384
+
1385
+ Queues a rewrite of the entry at `entryPath` from its cited sources and the active instructions, and returns a job ID
1386
+ immediately. The response also lists the other entries built from any of the same sources. An instruction applies to
1387
+ every entry built from its sources, so those entries can change too. Returns `422` with code `entryDocumentInvalid` if
1388
+ the entry document was edited into a shape the API cannot read.
1389
+
1390
+ EXAMPLES
1391
+ Rebuild an entry from its sources
1392
+
1393
+ $ sanity context entries rebuild <knowledgeBaseId> <entryPath>
1394
+
1395
+ Rebuild an entry from its sources, as JSON
1396
+
1397
+ $ sanity context entries rebuild <knowledgeBaseId> <entryPath> --json
1398
+ ```
1399
+
1400
+ ## `sanity context get KNOWLEDGEBASEID`
1401
+
1402
+ Get a knowledge base
1403
+
1404
+ ```
1405
+ USAGE
1406
+ $ sanity context get KNOWLEDGEBASEID [--json]
1407
+
1408
+ ARGUMENTS
1409
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1410
+
1411
+ GLOBAL FLAGS
1412
+ --json Format output as json.
1413
+
1414
+ DESCRIPTION
1415
+ Get a knowledge base
1416
+
1417
+ Returns a knowledge base's metadata and state. `knowledgeBaseId` accepts the public ID (`kb...`) or the UUID, and you
1418
+ don't need to pass an organization. If you can't read the knowledge base, the request returns `404`. To read the built
1419
+ entries, query `sanity.context.entry` documents with GROQ from your organization's document store.
1420
+
1421
+ EXAMPLES
1422
+ Get a knowledge base
1423
+
1424
+ $ sanity context get <knowledgeBaseId>
1425
+
1426
+ Get a knowledge base, as JSON
1427
+
1428
+ $ sanity context get <knowledgeBaseId> --json
1429
+ ```
1430
+
1431
+ ## `sanity context instructions create KNOWLEDGEBASEID`
1432
+
1433
+ Create an instruction
1434
+
1435
+ ```
1436
+ USAGE
1437
+ $ sanity context instructions create KNOWLEDGEBASEID --statement <value> --scope-document-ids <value>... [--json]
1438
+ [--rebuild-paths <value>...] [--verified]
1439
+
1440
+ ARGUMENTS
1441
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1442
+
1443
+ FLAGS
1444
+ --rebuild-paths=<value>... Paths of entries to rebuild under the new instruction right away. The response
1445
+ returns the rebuild job ID in `rebuildJobId`.
1446
+ --scope-document-ids=<value>... (required) IDs of the documents the instruction applies to. Builds apply it when they
1447
+ write entries built from these documents. IDs of documents that no longer exist are
1448
+ dropped. If none exist, the request returns `422` with code
1449
+ `instructionScopeVanished`.
1450
+ --statement=<value> (required) The instruction in plain language. Builds follow it over what the sources
1451
+ say.
1452
+ --[no-]verified Whether you already checked the instruction for entries that contradict it. When
1453
+ `true`, the background check that files issues for those entries is skipped. It still
1454
+ runs if the rebuild you requested in `rebuildPaths` does not start.
1455
+
1456
+ GLOBAL FLAGS
1457
+ --json Format output as json.
1458
+
1459
+ DESCRIPTION
1460
+ Create an instruction
1461
+
1462
+ Creates a standing instruction for how entries built from its documents are written. Every instruction applies to
1463
+ specific documents, set in `scopeDocumentIds`. To rebuild entries under the new instruction right away, pass their
1464
+ paths in `rebuildPaths`. The response includes the rebuild job ID, or `null` if the rebuild could not start. The
1465
+ instruction is saved either way. After the instruction is saved, a background check files issues for entries that
1466
+ contradict it. If you already checked the instruction for contradictions, set `verified` to skip the background check.
1467
+ If the requested rebuild does not start, the background check runs even when `verified` is set.
1468
+
1469
+ EXAMPLES
1470
+ Create an instruction
1471
+
1472
+ $ sanity context instructions create <knowledgeBaseId>
1473
+
1474
+ Create an instruction, as JSON
1475
+
1476
+ $ sanity context instructions create <knowledgeBaseId> --json
1477
+ ```
1478
+
1479
+ ## `sanity context instructions delete KNOWLEDGEBASEID INSTRUCTIONID`
1480
+
1481
+ Delete an instruction
1482
+
1483
+ ```
1484
+ USAGE
1485
+ $ sanity context instructions delete KNOWLEDGEBASEID INSTRUCTIONID [--json] [--rebuild] [-y]
1486
+
1487
+ ARGUMENTS
1488
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1489
+ INSTRUCTIONID The instruction's ID.
1490
+
1491
+ FLAGS
1492
+ -y, --yes Skip confirmation prompt (unattended mode)
1493
+ --[no-]rebuild Set to `true` to rebuild every entry built from the instruction's documents once it is deleted, so
1494
+ pages written under the instruction reflect their documents again. The response returns the
1495
+ rebuild job ID in `rebuildJobId`.
1496
+
1497
+ GLOBAL FLAGS
1498
+ --json Format output as json.
1499
+
1500
+ DESCRIPTION
1501
+ Delete an instruction
1502
+
1503
+ Deletes the instruction. Builds stop applying it from the next run. Entries already written under it keep their text
1504
+ until they are rebuilt; pass `rebuild=true` to rebuild every entry built from its documents right away.
1505
+
1506
+ EXAMPLES
1507
+ Delete an instruction
1508
+
1509
+ $ sanity context instructions delete <knowledgeBaseId> <instructionId>
1510
+
1511
+ Delete an instruction, as JSON
1512
+
1513
+ $ sanity context instructions delete <knowledgeBaseId> <instructionId> --json
1514
+ ```
1515
+
1516
+ ## `sanity context instructions edit KNOWLEDGEBASEID INSTRUCTIONID`
1517
+
1518
+ Update an instruction
1519
+
1520
+ ```
1521
+ USAGE
1522
+ $ sanity context instructions edit KNOWLEDGEBASEID INSTRUCTIONID [--json] [--statement <value>] [--scope-document-ids
1523
+ <value>...]
1524
+
1525
+ ARGUMENTS
1526
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1527
+ INSTRUCTIONID The instruction's ID.
1528
+
1529
+ FLAGS
1530
+ --scope-document-ids=<value>... IDs of the documents the instruction applies to. Replaces the current list. Omit it
1531
+ to keep the current documents. IDs of documents that no longer exist are dropped. If
1532
+ none exist, the request returns `422` with code `instructionScopeVanished`.
1533
+ --statement=<value> The new instruction text. Omit it to keep the current text.
1534
+
1535
+ GLOBAL FLAGS
1536
+ --json Format output as json.
1537
+
1538
+ DESCRIPTION
1539
+ Update an instruction
1540
+
1541
+ Updates the instruction's statement or documents. The change applies from the next build. Any update also reactivates
1542
+ an archived instruction and ties it to the current content of its documents.
1543
+
1544
+ EXAMPLES
1545
+ Update an instruction
1546
+
1547
+ $ sanity context instructions edit <knowledgeBaseId> <instructionId>
1548
+
1549
+ Update an instruction, as JSON
1550
+
1551
+ $ sanity context instructions edit <knowledgeBaseId> <instructionId> --json
1552
+ ```
1553
+
1554
+ ## `sanity context issues apply KNOWLEDGEBASEID ISSUEIDS`
1555
+
1556
+ Accept and apply issues
1557
+
1558
+ ```
1559
+ USAGE
1560
+ $ sanity context issues apply KNOWLEDGEBASEID ISSUEIDS... [--json] [--watch]
1561
+
1562
+ ARGUMENTS
1563
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1564
+ ISSUEIDS... The IDs of the issues to accept and apply.
1565
+
1566
+ FLAGS
1567
+ --watch Wait for the job to finish, exiting non-zero if it fails
1568
+
1569
+ GLOBAL FLAGS
1570
+ --json Format output as json.
1571
+
1572
+ DESCRIPTION
1573
+ Accept and apply issues
1574
+
1575
+ Accepts the issues in `issueIds`, then queues a job that applies them, rewrites the affected entries, and saves a new
1576
+ revision. Returns a job ID. IDs of issues that no longer exist are skipped. Returns `409` with code
1577
+ `issueNotAutoApplicable`, and accepts none of the issues, if any of them cannot be applied: a `conflict` (resolve it
1578
+ with `POST .../issues/{issueId}/resolve`), or an `update_required` issue whose `scopePath` is `*` or names an entry
1579
+ that no longer exists. Dismiss those instead.
1580
+
1581
+ EXAMPLES
1582
+ Accept and apply issues
1583
+
1584
+ $ sanity context issues apply <knowledgeBaseId>
1585
+
1586
+ Accept and apply issues, as JSON
1587
+
1588
+ $ sanity context issues apply <knowledgeBaseId> --json
1589
+ ```
1590
+
1591
+ ## `sanity context issues dismiss KNOWLEDGEBASEID ISSUEID`
1592
+
1593
+ Dismiss an issue
1594
+
1595
+ ```
1596
+ USAGE
1597
+ $ sanity context issues dismiss KNOWLEDGEBASEID ISSUEID [--json]
1598
+
1599
+ ARGUMENTS
1600
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1601
+ ISSUEID The issue's document ID.
1602
+
1603
+ GLOBAL FLAGS
1604
+ --json Format output as json.
1605
+
1606
+ DESCRIPTION
1607
+ Dismiss an issue
1608
+
1609
+ Marks the issue as rejected. If the issue already left triage, the request returns it unchanged. Returns `422` with
1610
+ code `issueDocumentInvalid` if the issue document was edited into a shape the API cannot verify. Returns `409` with
1611
+ code `issueTransitionConflict` if another change to the issue happened at the same time. You can safely retry a `409`.
1612
+
1613
+ EXAMPLES
1614
+ Dismiss an issue
1615
+
1616
+ $ sanity context issues dismiss <knowledgeBaseId> <issueId>
1617
+
1618
+ Dismiss an issue, as JSON
1619
+
1620
+ $ sanity context issues dismiss <knowledgeBaseId> <issueId> --json
1621
+ ```
1622
+
1623
+ ## `sanity context issues get KNOWLEDGEBASEID ISSUEID`
1624
+
1625
+ Get details of an issue
1626
+
1627
+ ```
1628
+ USAGE
1629
+ $ sanity context issues get KNOWLEDGEBASEID ISSUEID [--json]
1630
+
1631
+ ARGUMENTS
1632
+ KNOWLEDGEBASEID Knowledge base ID
1633
+ ISSUEID Issue ID
1634
+
1635
+ GLOBAL FLAGS
1636
+ --json Format output as json.
1637
+
1638
+ DESCRIPTION
1639
+ Get details of an issue
1640
+
1641
+ EXAMPLES
1642
+ Get details of a specific issue
1643
+
1644
+ $ sanity context issues get kb-abc123 issue.def456
1645
+
1646
+ Output the issue as JSON
1647
+
1648
+ $ sanity context issues get kb-abc123 issue.def456 --json
1649
+ ```
1650
+
1651
+ ## `sanity context issues list KNOWLEDGEBASEID`
1652
+
1653
+ List issues found by knowledge base builds
1654
+
1655
+ ```
1656
+ USAGE
1657
+ $ sanity context issues list KNOWLEDGEBASEID [--json] [--kind conflict|update_required] [--scope <path>] [--severity
1658
+ critical|suggestion] [--status open|accepted|rejected]
1659
+
1660
+ ARGUMENTS
1661
+ KNOWLEDGEBASEID Knowledge base ID
1662
+
1663
+ FLAGS
1664
+ --kind=<option> Only list issues of this kind
1665
+ <options: conflict|update_required>
1666
+ --scope=<path> Only list issues about this entry path or anything under it (`*` for knowledge-base-wide issues)
1667
+ --severity=<option> Only list issues of this severity
1668
+ <options: critical|suggestion>
1669
+ --status=<option> Only list issues with this status (rejected = dismissed, accepted = resolved or applied)
1670
+ <options: open|accepted|rejected>
1671
+
1672
+ GLOBAL FLAGS
1673
+ --json Format output as json.
1674
+
1675
+ DESCRIPTION
1676
+ List issues found by knowledge base builds
1677
+
1678
+ EXAMPLES
1679
+ List all issues for a knowledge base
1680
+
1681
+ $ sanity context issues list kb-abc123
1682
+
1683
+ List issues awaiting triage
1684
+
1685
+ $ sanity context issues list kb-abc123 --status open
1686
+
1687
+ List critical conflicts
1688
+
1689
+ $ sanity context issues list kb-abc123 --kind conflict --severity critical
1690
+
1691
+ List issues about entries under billing/
1692
+
1693
+ $ sanity context issues list kb-abc123 --scope billing
1694
+
1695
+ Output issues as JSON
1696
+
1697
+ $ sanity context issues list kb-abc123 --json
1698
+ ```
1699
+
1700
+ ## `sanity context issues reopen KNOWLEDGEBASEID ISSUEID`
1701
+
1702
+ Reopen an accepted conflict
1703
+
1704
+ ```
1705
+ USAGE
1706
+ $ sanity context issues reopen KNOWLEDGEBASEID ISSUEID [--json]
1707
+
1708
+ ARGUMENTS
1709
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1710
+ ISSUEID The issue's document ID.
1711
+
1712
+ GLOBAL FLAGS
1713
+ --json Format output as json.
1714
+
1715
+ DESCRIPTION
1716
+ Reopen an accepted conflict
1717
+
1718
+ Returns an accepted conflict issue to triage, clears its resolution, and deletes the instruction the resolution
1719
+ created. Reopening an open or dismissed conflict returns it unchanged. Other issue types return `422` with code
1720
+ `issueNotResolvable`.
1721
+
1722
+ EXAMPLES
1723
+ Reopen an accepted conflict
1724
+
1725
+ $ sanity context issues reopen <knowledgeBaseId> <issueId>
1726
+
1727
+ Reopen an accepted conflict, as JSON
1728
+
1729
+ $ sanity context issues reopen <knowledgeBaseId> <issueId> --json
1730
+ ```
1731
+
1732
+ ## `sanity context issues resolve KNOWLEDGEBASEID ISSUEID`
1733
+
1734
+ Resolve a conflict issue
1735
+
1736
+ ```
1737
+ USAGE
1738
+ $ sanity context issues resolve KNOWLEDGEBASEID ISSUEID [--json] [--watch] [--side <value>]
1739
+
1740
+ ARGUMENTS
1741
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1742
+ ISSUEID The issue's document ID.
1743
+
1744
+ FLAGS
1745
+ --side=<value> Index of the correct side, as listed by `sanity context issues get`
1746
+ --watch Wait for the job to finish, exiting non-zero if it fails
1747
+
1748
+ GLOBAL FLAGS
1749
+ --json Format output as json.
1750
+
1751
+ DESCRIPTION
1752
+ Resolve a conflict issue
1753
+
1754
+ Resolves a conflict issue by choosing one of its sides. Set `resolution` to the index of a side in `content.sides`.
1755
+ For a conflict on a single entry, index `0` is the entry's current content, so choosing it keeps the entry as it is.
1756
+ Choosing any other side rewrites the entry, and the returned `jobId` tracks the rewrite. The decision becomes a
1757
+ standing instruction for every future build, and `resolvedBy` records who made it. To change a decision, resolve the
1758
+ accepted conflict again. Other issue types, dismissed conflicts, and out-of-range indexes return `422` with code
1759
+ `issueNotResolvable`.
1760
+
1761
+ EXAMPLES
1762
+ Choose the correct side interactively
1763
+
1764
+ $ sanity context issues resolve kb-abc123 issue-def456
1765
+
1766
+ Choose side 1 and wait for the entry rewrite
1767
+
1768
+ $ sanity context issues resolve kb-abc123 issue-def456 --side 1 --watch
1769
+ ```
1770
+
1771
+ ## `sanity context jobs get KNOWLEDGEBASEID JOBID`
1772
+
1773
+ Get a job
1774
+
1775
+ ```
1776
+ USAGE
1777
+ $ sanity context jobs get KNOWLEDGEBASEID JOBID [--json] [--watch]
1778
+
1779
+ ARGUMENTS
1780
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1781
+ JOBID The job ID returned by the endpoint that started the work.
1782
+
1783
+ FLAGS
1784
+ --watch Wait for the job to finish, exiting non-zero if it fails
1785
+
1786
+ GLOBAL FLAGS
1787
+ --json Format output as json.
1788
+
1789
+ DESCRIPTION
1790
+ Get a job
1791
+
1792
+ Returns the status of a background job, such as a build, sync, or refresh. The endpoint that starts the work returns
1793
+ the job ID.
1794
+
1795
+ EXAMPLES
1796
+ Get a job
1797
+
1798
+ $ sanity context jobs get <knowledgeBaseId> <jobId>
1799
+
1800
+ Get a job, as JSON
1801
+
1802
+ $ sanity context jobs get <knowledgeBaseId> <jobId> --json
1803
+ ```
1804
+
1805
+ ## `sanity context list`
1806
+
1807
+ List knowledge bases
1808
+
1809
+ ```
1810
+ USAGE
1811
+ $ sanity context list [--json] [--include-drafts] [--organization <id>]
1812
+
1813
+ FLAGS
1814
+ --[no-]include-drafts Set to `true` to also list the organization's drafts, which have `state` set to `draft`. Drafts
1815
+ count toward the plan's knowledge base limit, and `createdBy` says who started each one.
1816
+
1817
+ GLOBAL FLAGS
1818
+ --json Format output as json.
1819
+
1820
+ OVERRIDE FLAGS
1821
+ --organization=<id> Organization ID (overrides CLI configuration)
1822
+
1823
+ DESCRIPTION
1824
+ List knowledge bases
1825
+
1826
+ Returns the knowledge bases you can access in the organization set by `organizationId`. Drafts are left out unless you
1827
+ set `includeDrafts` to `true`. Results are cursor-paginated, newest first.
1007
1828
 
1008
- Start a build and wait for it to finish (non-zero exit on failure)
1829
+ EXAMPLES
1830
+ List knowledge bases
1009
1831
 
1010
- $ sanity context build kb-abc123 --watch
1832
+ $ sanity context list
1011
1833
 
1012
- Cancel the running build, if any
1834
+ List knowledge bases, as JSON
1013
1835
 
1014
- $ sanity context build kb-abc123 --cancel
1836
+ $ sanity context list --json
1015
1837
  ```
1016
1838
 
1017
- ## `sanity context create`
1839
+ ## `sanity context mcp create NAME`
1018
1840
 
1019
- Create a knowledge base
1841
+ Create a Context MCP endpoint that serves knowledge bases and a dataset to agents
1020
1842
 
1021
1843
  ```
1022
1844
  USAGE
1023
- $ sanity context create [--organization <id>] [--description <value>] [--title <value>]
1845
+ $ sanity context mcp create NAME [--organization <id>] [-p <id> -d <name>] [--groq-filter <value> ] [--instructions
1846
+ <value>] [--knowledge-base <id>...] [--perspective published|drafts|raw ] [--semantic-search ] [--title <value>]
1847
+ [--workspace <value> ]
1848
+
1849
+ ARGUMENTS
1850
+ NAME Permanent MCP endpoint name used in its URL, made of lowercase letters, digits and hyphens
1024
1851
 
1025
1852
  FLAGS
1026
- --description=<value> Knowledge base description
1027
- --title=<value> Knowledge base title
1853
+ -d, --dataset=<name> Dataset the endpoint serves
1854
+ --groq-filter=<value> GROQ filter that limits which dataset documents the endpoint serves
1855
+ --instructions=<value> Instructions the endpoint serves to connecting agents
1856
+ --knowledge-base=<id>... Knowledge base the endpoint serves; repeat the flag to serve several
1857
+ --perspective=<option> Perspective agents query the dataset with
1858
+ <options: published|drafts|raw>
1859
+ --[no-]semantic-search Let agents use semantic search on the dataset (--no-semantic-search to turn it off)
1860
+ --title=<value> MCP endpoint title
1861
+ --workspace=<value> Studio workspace whose schema agents use, instead of the first workspace
1028
1862
 
1029
1863
  OVERRIDE FLAGS
1030
- --organization=<id> Organization to create the knowledge base in (overrides CLI configuration)
1864
+ -p, --project=<id> Project the dataset belongs to (overrides CLI configuration)
1865
+ --organization=<id> Organization to create the MCP endpoint in (overrides CLI configuration)
1031
1866
 
1032
1867
  DESCRIPTION
1033
- Create a knowledge base
1868
+ Create a Context MCP endpoint that serves knowledge bases and a dataset to agents
1034
1869
 
1035
1870
  EXAMPLES
1036
- Interactively create a knowledge base
1871
+ Create an MCP endpoint that serves two knowledge bases
1037
1872
 
1038
- $ sanity context create
1873
+ $ sanity context mcp create support --title "Support" --knowledge-base kb-abc123 --knowledge-base kb-def456
1039
1874
 
1040
- Create a knowledge base in a specific organization
1875
+ Create an MCP endpoint that serves the products in a dataset
1041
1876
 
1042
- $ sanity context create --organization org-abc123 --title "Support docs" --description "Product docs and \
1043
- troubleshooting guides"
1877
+ $ sanity context mcp create catalog --title "Catalog" --project abc123 --dataset production --perspective drafts \
1878
+ --groq-filter '_type in ["product"]'
1044
1879
  ```
1045
1880
 
1046
- ## `sanity context delete KNOWLEDGEBASEID`
1881
+ ## `sanity context mcp delete NAME`
1047
1882
 
1048
- Delete a knowledge base and its generated content
1883
+ Delete a Context MCP endpoint, which disconnects any agents using it
1049
1884
 
1050
1885
  ```
1051
1886
  USAGE
1052
- $ sanity context delete KNOWLEDGEBASEID [-y]
1887
+ $ sanity context mcp delete NAME [--organization <id>] [-y]
1053
1888
 
1054
1889
  ARGUMENTS
1055
- KNOWLEDGEBASEID Knowledge base ID
1890
+ NAME MCP endpoint name, as in its URL
1056
1891
 
1057
1892
  FLAGS
1058
1893
  -y, --yes Skip confirmation prompt (unattended mode)
1059
1894
 
1895
+ OVERRIDE FLAGS
1896
+ --organization=<id> Organization the MCP endpoint belongs to (overrides CLI configuration)
1897
+
1060
1898
  DESCRIPTION
1061
- Delete a knowledge base and its generated content
1899
+ Delete a Context MCP endpoint, which disconnects any agents using it
1062
1900
 
1063
1901
  EXAMPLES
1064
- Delete a knowledge base after confirmation
1902
+ Delete an MCP endpoint after confirmation
1065
1903
 
1066
- $ sanity context delete kb-abc123
1904
+ $ sanity context mcp delete support
1067
1905
 
1068
- Delete a knowledge base without confirmation prompt
1906
+ Delete an MCP endpoint without confirmation prompt
1069
1907
 
1070
- $ sanity context delete kb-abc123 --yes
1908
+ $ sanity context mcp delete support --yes
1071
1909
  ```
1072
1910
 
1073
- ## `sanity context entries get KNOWLEDGEBASEID PATH`
1911
+ ## `sanity context mcp get NAME`
1074
1912
 
1075
- Get an entry and its content
1913
+ Get details of a Context MCP endpoint, including its URL
1076
1914
 
1077
1915
  ```
1078
1916
  USAGE
1079
- $ sanity context entries get KNOWLEDGEBASEID PATH [--json]
1917
+ $ sanity context mcp get NAME [--json] [--organization <id>]
1080
1918
 
1081
1919
  ARGUMENTS
1082
- KNOWLEDGEBASEID Knowledge base ID
1083
- PATH Entry path, as listed by `sanity context entries list`
1920
+ NAME MCP endpoint name, as in its URL
1084
1921
 
1085
1922
  GLOBAL FLAGS
1086
1923
  --json Format output as json.
1087
1924
 
1925
+ OVERRIDE FLAGS
1926
+ --organization=<id> Organization the MCP endpoint belongs to (overrides CLI configuration)
1927
+
1088
1928
  DESCRIPTION
1089
- Get an entry and its content
1929
+ Get details of a Context MCP endpoint, including its URL
1090
1930
 
1091
1931
  EXAMPLES
1092
- Print an entry and its content
1932
+ Get details of the "support" MCP endpoint
1093
1933
 
1094
- $ sanity context entries get kb-abc123 billing/refunds
1934
+ $ sanity context mcp get support
1095
1935
 
1096
- Output the entry, including citations, as JSON
1936
+ Output an MCP endpoint in a specific organization as JSON
1097
1937
 
1098
- $ sanity context entries get kb-abc123 billing/refunds --json
1938
+ $ sanity context mcp get support --organization org-abc123 --json
1099
1939
  ```
1100
1940
 
1101
- ## `sanity context entries list KNOWLEDGEBASEID`
1941
+ ## `sanity context mcp initial-context MCPENDPOINT`
1102
1942
 
1103
- List the entries a knowledge base build produced
1943
+ Get an MCP endpoint's initial context
1104
1944
 
1105
1945
  ```
1106
1946
  USAGE
1107
- $ sanity context entries list KNOWLEDGEBASEID [--json]
1947
+ $ sanity context mcp initial-context MCPENDPOINT [--json] [--instructions <value>] [--perspective <value>] [--embeddings
1948
+ <value>] [--groq-filter <value>] [--mode knowledge_base|groq] [--knowledge-bases <value>] [--link-resolver <value>]
1949
+ [--workspace <value>] [--heading_offset <value>] [--organization <id>]
1108
1950
 
1109
1951
  ARGUMENTS
1110
- KNOWLEDGEBASEID Knowledge base ID
1952
+ MCPENDPOINT The MCP endpoint's name, set when the endpoint was created.
1953
+
1954
+ FLAGS
1955
+ --embeddings=<value> Set to `true` or `false` to turn semantic search on or off. Omit it to use the dataset
1956
+ source setting. Deprecated: refused from API version `v2026-11-03`. Configure it on the MCP
1957
+ endpoint instead.
1958
+ --groq-filter=<value> A GROQ filter that narrows the endpoint's configured content filter for this request.
1959
+ Documents must match both. Deprecated: refused from API version `v2026-11-03`. Configure it
1960
+ on the MCP endpoint instead.
1961
+ --heading_offset=<value> How many levels to shift markdown headings down, from `0` to `6`. Defaults to `1`, so `#`
1962
+ becomes `##`.
1963
+ --instructions=<value> Agent instructions that replace the endpoint's configured instructions for this request.
1964
+ Deprecated: refused from API version `v2026-11-03`. Configure it on the MCP endpoint
1965
+ instead.
1966
+ --knowledge-bases=<value> Comma-separated knowledge base public IDs (`kb...`) that replace the endpoint's knowledge
1967
+ base sources for this request. Deprecated: refused from API version `v2026-11-03`.
1968
+ Configure it on the MCP endpoint instead.
1969
+ --link-resolver=<value> A JSON array that adds `_url` fields to query results. Each item has `types` (document
1970
+ types), `baseUrl`, and an optional `slugExpression`, a GROQ expression that defaults to
1971
+ `slug.current`. Invalid JSON is ignored.
1972
+ --mode=<option> Serves only one side of the endpoint for this request: `knowledge_base` serves its
1973
+ knowledge bases and `groq` serves its dataset. Omit it to serve every source the endpoint
1974
+ has. A request whose chosen side the endpoint doesn't have is refused. Deprecated: refused
1975
+ from API version `v2026-11-03`. Configure it on the MCP endpoint instead.
1976
+ <options: knowledge_base|groq>
1977
+ --perspective=<value> The perspective for GROQ queries: `published` (default), `previewDrafts`, `raw`, or a
1978
+ release. Deprecated: refused from API version `v2026-11-03`. Configure it on the MCP
1979
+ endpoint instead.
1980
+ --workspace=<value> The studio workspace to use. Replaces the dataset source's workspace for this request.
1981
+ Deprecated: refused from API version `v2026-11-03`. Configure it on the MCP endpoint
1982
+ instead.
1111
1983
 
1112
1984
  GLOBAL FLAGS
1113
1985
  --json Format output as json.
1114
1986
 
1987
+ OVERRIDE FLAGS
1988
+ --organization=<id> Organization ID (overrides CLI configuration)
1989
+
1115
1990
  DESCRIPTION
1116
- List the entries a knowledge base build produced
1991
+ Get an MCP endpoint's initial context
1992
+
1993
+ Returns the same text as the `initial_context` MCP tool, as plain text you can add to a system prompt.
1994
+ `heading_offset` shifts markdown headings down by that many levels. The default is `1`, so `#` becomes `##`.
1117
1995
 
1118
1996
  EXAMPLES
1119
- List all entries for a knowledge base
1997
+ Get an MCP endpoint's initial context
1120
1998
 
1121
- $ sanity context entries list kb-abc123
1999
+ $ sanity context mcp initial-context <mcpEndpoint>
1122
2000
 
1123
- Output entries as JSON
2001
+ Get an MCP endpoint's initial context, as JSON
1124
2002
 
1125
- $ sanity context entries list kb-abc123 --json
2003
+ $ sanity context mcp initial-context <mcpEndpoint> --json
1126
2004
  ```
1127
2005
 
1128
- ## `sanity context entries rebuild KNOWLEDGEBASEID PATH`
2006
+ ## `sanity context mcp list`
1129
2007
 
1130
- Rebuild one entry from its sources
2008
+ List Context MCP endpoints in an organization
1131
2009
 
1132
2010
  ```
1133
2011
  USAGE
1134
- $ sanity context entries rebuild KNOWLEDGEBASEID PATH [--watch]
2012
+ $ sanity context mcp list [--json] [--organization <id>]
1135
2013
 
1136
- ARGUMENTS
1137
- KNOWLEDGEBASEID Knowledge base ID
1138
- PATH Entry path, as listed by `sanity context entries list`
2014
+ GLOBAL FLAGS
2015
+ --json Format output as json.
1139
2016
 
1140
- FLAGS
1141
- --watch Wait for the rebuild to finish, exiting non-zero if it fails
2017
+ OVERRIDE FLAGS
2018
+ --organization=<id> Organization to list MCP endpoints for (overrides CLI configuration)
1142
2019
 
1143
2020
  DESCRIPTION
1144
- Rebuild one entry from its sources
2021
+ List Context MCP endpoints in an organization
1145
2022
 
1146
2023
  EXAMPLES
1147
- Start a rebuild and return the job ID
2024
+ List MCP endpoints, selecting the organization interactively
1148
2025
 
1149
- $ sanity context entries rebuild kb-abc123 billing/refunds
2026
+ $ sanity context mcp list
1150
2027
 
1151
- Rebuild an entry and wait for it to finish (non-zero exit on failure)
2028
+ Output the MCP endpoints of a specific organization as JSON
1152
2029
 
1153
- $ sanity context entries rebuild kb-abc123 billing/refunds --watch
2030
+ $ sanity context mcp list --organization org-abc123 --json
1154
2031
  ```
1155
2032
 
1156
- ## `sanity context get KNOWLEDGEBASEID`
2033
+ ## `sanity context mcp status NAME`
1157
2034
 
1158
- Get details of a knowledge base
2035
+ Check whether an agent connecting with your credentials can use a Context MCP endpoint
1159
2036
 
1160
2037
  ```
1161
2038
  USAGE
1162
- $ sanity context get KNOWLEDGEBASEID [--json]
2039
+ $ sanity context mcp status NAME [--json] [--organization <id>]
1163
2040
 
1164
2041
  ARGUMENTS
1165
- KNOWLEDGEBASEID Knowledge base ID
2042
+ NAME MCP endpoint name, as in its URL
1166
2043
 
1167
2044
  GLOBAL FLAGS
1168
2045
  --json Format output as json.
1169
2046
 
2047
+ OVERRIDE FLAGS
2048
+ --organization=<id> Organization the MCP endpoint belongs to (overrides CLI configuration)
2049
+
1170
2050
  DESCRIPTION
1171
- Get details of a knowledge base
2051
+ Check whether an agent connecting with your credentials can use a Context MCP endpoint
1172
2052
 
1173
2053
  EXAMPLES
1174
- Get details of a specific knowledge base
1175
-
1176
- $ sanity context get kb-abc123
2054
+ Check the "support" MCP endpoint
1177
2055
 
1178
- Output the knowledge base as JSON
1179
-
1180
- $ sanity context get kb-abc123 --json
2056
+ $ sanity context mcp status support
1181
2057
  ```
1182
2058
 
1183
- ## `sanity context imports create KNOWLEDGEBASEID`
2059
+ ## `sanity context mcp update NAME`
1184
2060
 
1185
- Import content into a knowledge base
2061
+ Update a Context MCP endpoint
1186
2062
 
1187
2063
  ```
1188
2064
  USAGE
1189
- $ sanity context imports create KNOWLEDGEBASEID [--content-type <mime>] [--file <path> | --text <value> | --url <url> |
1190
- --query <value>] [--sanity-dataset <name> ] [--sanity-project <id> ] [--title <value> ]
2065
+ $ sanity context mcp update NAME [--organization <id>] [--add-knowledge-base <id>...] [-p <id> -d <name>]
2066
+ [--groq-filter <value>] [--instructions <value>] [--no-dataset | ] [--perspective published|drafts|raw]
2067
+ [--remove-knowledge-base <id>...] [--semantic-search] [--title <value>] [--workspace <value>]
1191
2068
 
1192
2069
  ARGUMENTS
1193
- KNOWLEDGEBASEID Knowledge base ID
2070
+ NAME MCP endpoint name, as in its URL
1194
2071
 
1195
2072
  FLAGS
1196
- --content-type=<mime> Content type of the import (--text: text/markdown or text/plain; --file: any MIME type,
1197
- inferred from the file extension when omitted)
1198
- --file=<path> Path to a local file to import
1199
- --query=<value> GROQ query binding a Sanity dataset as a source
1200
- --sanity-dataset=<name> Sanity dataset for a dataset import
1201
- --sanity-project=<id> Sanity project ID for a dataset import
1202
- --text=<value> Inline text content to import (requires --title)
1203
- --title=<value> Title for an inline text import
1204
- --url=<url> Website URL to crawl
2073
+ -d, --dataset=<name> Dataset the endpoint serves, replacing its current dataset
2074
+ --add-knowledge-base=<id>... Knowledge base to add to the endpoint; repeat the flag to add several
2075
+ --groq-filter=<value> GROQ filter that limits which dataset documents the endpoint serves ("" removes
2076
+ it)
2077
+ --instructions=<value> Instructions the endpoint serves to connecting agents ("" removes them)
2078
+ --no-dataset Stop serving the dataset, which also removes the GROQ filter
2079
+ --perspective=<option> Perspective agents query the dataset with
2080
+ <options: published|drafts|raw>
2081
+ --remove-knowledge-base=<id>... Knowledge base to remove from the endpoint; repeat the flag to remove several
2082
+ --[no-]semantic-search Let agents use semantic search on the dataset (--no-semantic-search to turn it
2083
+ off)
2084
+ --title=<value> New MCP endpoint title
2085
+ --workspace=<value> Studio workspace whose schema agents use ("" goes back to the first workspace)
2086
+
2087
+ OVERRIDE FLAGS
2088
+ -p, --project=<id> Project the dataset belongs to (overrides CLI configuration)
2089
+ --organization=<id> Organization the MCP endpoint belongs to (overrides CLI configuration)
1205
2090
 
1206
2091
  DESCRIPTION
1207
- Import content into a knowledge base
2092
+ Update a Context MCP endpoint
2093
+
2094
+ Only the settings you pass change. Dataset settings (--workspace, --perspective, --semantic-search) apply to the
2095
+ endpoint's dataset and start from the defaults when --dataset switches to another dataset.
1208
2096
 
1209
2097
  EXAMPLES
1210
- Import inline text
2098
+ Rename an MCP endpoint
1211
2099
 
1212
- $ sanity context imports create kb-abc123 --text "Refunds are processed within 5 days" --title "Refund policy"
2100
+ $ sanity context mcp update support --title "Customer support"
1213
2101
 
1214
- Upload and import a local file
2102
+ Serve a different knowledge base
1215
2103
 
1216
- $ sanity context imports create kb-abc123 --file ./handbook.pdf
2104
+ $ sanity context mcp update support --add-knowledge-base kb-def456 --remove-knowledge-base kb-abc123
1217
2105
 
1218
- Crawl a website
2106
+ Switch to another dataset and query its drafts
2107
+
2108
+ $ sanity context mcp update catalog --project abc123 --dataset staging --perspective drafts
2109
+
2110
+ Stop serving the dataset
1219
2111
 
1220
- $ sanity context imports create kb-abc123 --url https://example.com/docs
2112
+ $ sanity context mcp update support --no-dataset
1221
2113
 
1222
- Bind a Sanity dataset as a source
2114
+ Remove the instructions
1223
2115
 
1224
- $ sanity context imports create kb-abc123 --query '*[_type == "article"]' --sanity-project abc123 \
1225
- --sanity-dataset production
2116
+ $ sanity context mcp update support --instructions ""
1226
2117
  ```
1227
2118
 
1228
- ## `sanity context imports delete KNOWLEDGEBASEID IMPORTID`
2119
+ ## `sanity context query QUERY`
1229
2120
 
1230
- Delete an import from a knowledge base
2121
+ Query an organization's Context documents with GROQ
1231
2122
 
1232
2123
  ```
1233
2124
  USAGE
1234
- $ sanity context imports delete KNOWLEDGEBASEID IMPORTID [-y]
2125
+ $ sanity context query QUERY [--json] [--organization <id>] [--params <json>]
1235
2126
 
1236
2127
  ARGUMENTS
1237
- KNOWLEDGEBASEID Knowledge base ID
1238
- IMPORTID Import ID
2128
+ QUERY GROQ query to run against the organization's Context documents
1239
2129
 
1240
2130
  FLAGS
1241
- -y, --yes Skip confirmation prompt (unattended mode)
2131
+ --params=<json> Query parameters as a JSON object
2132
+
2133
+ GLOBAL FLAGS
2134
+ --json Format output as json.
2135
+
2136
+ OVERRIDE FLAGS
2137
+ --organization=<id> Organization to query (overrides CLI configuration)
1242
2138
 
1243
2139
  DESCRIPTION
1244
- Delete an import from a knowledge base
2140
+ Query an organization's Context documents with GROQ
1245
2141
 
1246
2142
  EXAMPLES
1247
- Delete an import after confirmation
2143
+ List open issues across all knowledge bases
1248
2144
 
1249
- $ sanity context imports delete kb-abc123 import-def456
2145
+ $ sanity context query '*[_type == "sanity.context.issue" && status == "open"]{_id, knowledgeBaseId}'
1250
2146
 
1251
- Delete an import without confirmation prompt
2147
+ List the entry paths of one knowledge base as plain JSON
1252
2148
 
1253
- $ sanity context imports delete kb-abc123 import-def456 --yes
2149
+ $ sanity context query '*[_type == "sanity.context.entry" && knowledgeBaseId == $kb].path' --params '{"kb": \
2150
+ "kb-abc123"}' --json
1254
2151
  ```
1255
2152
 
1256
- ## `sanity context imports download KNOWLEDGEBASEID IMPORTID`
2153
+ ## `sanity context sources create KNOWLEDGEBASEID`
1257
2154
 
1258
- Get a short-lived signed URL for the original uploaded bytes of a file import
2155
+ Add a source
1259
2156
 
1260
2157
  ```
1261
2158
  USAGE
1262
- $ sanity context imports download KNOWLEDGEBASEID IMPORTID [--json]
2159
+ $ sanity context sources create KNOWLEDGEBASEID [--json] [--type web|sanity-dataset|files] [--url <value> | --query
2160
+ <value> | --file <path> | --text <path|->] [--include-paths <value>...] [--exclude-paths <value>...] [--max-depth
2161
+ <value>] [--sitemap-only] [--ignore-query-parameters] [--page-limit <value>] [--dry-run] [--sanity-project-id
2162
+ <value>] [--sanity-dataset-id <value>] [--title <value>] [--content-type text/markdown|text/plain] [--watch]
1263
2163
 
1264
2164
  ARGUMENTS
1265
- KNOWLEDGEBASEID Knowledge base ID
1266
- IMPORTID Import ID
2165
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2166
+
2167
+ FLAGS
2168
+ --content-type=<option> The format of `content`: `text/markdown` (the default) or `text/plain`. Only with
2169
+ `content`. Only for type files.
2170
+ <options: text/markdown|text/plain>
2171
+ --[no-]dry-run Set to `true` to estimate what a crawl would fetch without adding the source. The
2172
+ response is then `200` with a preview of the pages the site has, grouped by path. Only
2173
+ for type web.
2174
+ --exclude-paths=<value>... Regular expressions for URL paths to skip. Pages whose path matches one of them aren't
2175
+ crawled. Only for type web.
2176
+ --file=<path> Local file to upload as a files source: a document, or a zip, tar or gzip archive of
2177
+ them
2178
+ --[no-]ignore-query-parameters Whether to treat URLs that differ only by query string as one page. New crawls set it
2179
+ to `true` unless you set it. Set it to `false` when the query string selects different
2180
+ content, such as pagination. Only for type web.
2181
+ --include-paths=<value>... Regular expressions for URL paths to crawl. When set, the crawl only includes pages
2182
+ whose path matches one of them. Only for type web.
2183
+ --max-depth=<value> How many levels deep the crawl goes from the root URL. Only for type web.
2184
+ --page-limit=<value> The maximum number of pages to crawl. The crawl can stop sooner when the knowledge
2185
+ base reaches its source limit. Only for type web.
2186
+ --query=<value> A GROQ query that selects the documents, with an optional projection. It can match up
2187
+ to 5,000 documents. Each sync runs it again. Only for type sanity-dataset.
2188
+ --sanity-dataset-id=<value> The dataset to read documents from. Only for type sanity-dataset.
2189
+ --sanity-project-id=<value> The ID of the Sanity project to read documents from. You need full read access to the
2190
+ dataset and, on its project, the Administrator or Developer role or a custom role that
2191
+ can create datasets. Only for type sanity-dataset.
2192
+ --[no-]sitemap-only Whether to crawl only the pages listed in the site's sitemap. Only for type web.
2193
+ --text=<path|-> Text or markdown to hold as a files source, read from a local file or `-` for stdin
2194
+ --title=<value> The source's title. Only for type files.
2195
+ --type=<option> The source type. `web` crawls a website. Inferred from the other flags when left out.
2196
+ <options: web|sanity-dataset|files>
2197
+ --url=<value> The URL to start crawling from. It must be a public `http` or `https` URL. Only for
2198
+ type web.
2199
+ --watch Wait for the sync to settle, exiting non-zero unless it completes: when it fails, is
2200
+ cancelled or is held for confirmation
1267
2201
 
1268
2202
  GLOBAL FLAGS
1269
2203
  --json Format output as json.
1270
2204
 
1271
2205
  DESCRIPTION
1272
- Get a short-lived signed URL for the original uploaded bytes of a file import
2206
+ Add a source
1273
2207
 
1274
- EXAMPLES
1275
- Get a download URL for an uploaded file
2208
+ Adds a source to a knowledge base. Set `type` to choose what it reads:
1276
2209
 
1277
- $ sanity context imports download kb-abc123 import-def456
1278
- ```
2210
+ - `web`: a website, crawled from `url`
2211
+ - `sanity-dataset`: the documents a GROQ query selects in a Sanity dataset
2212
+ - `files`: files you upload with `POST .../sources/{sourceId}/uploads`, or text you send in `content`
1279
2213
 
1280
- ## `sanity context imports get KNOWLEDGEBASEID IMPORTID`
2214
+ A website or dataset starts its first sync right away. A `files` source syncs when you upload a file, or right away
2215
+ when you send `content`: one request stores the text, adds the source and starts its sync. For a website, set `dryRun`
2216
+ to `true` to preview the crawl without adding the source.
1281
2217
 
1282
- Get details of an import
2218
+ Adding a website that is already a source returns `409` with code `webSourceRootConflict`, and adding more websites
2219
+ than your limit allows returns `409` with code `webSourceRootLimitExceeded`. When the organization's knowledge bases
2220
+ already hold as many source chunks as its plan allows, returns `403` with code `planLimitReached` and adds nothing.
2221
+ Supports the `Idempotency-Key` header.
1283
2222
 
1284
- ```
1285
- USAGE
1286
- $ sanity context imports get KNOWLEDGEBASEID IMPORTID [--json]
2223
+ EXAMPLES
2224
+ Crawl a website
1287
2225
 
1288
- ARGUMENTS
1289
- KNOWLEDGEBASEID Knowledge base ID
1290
- IMPORTID Import ID
2226
+ $ sanity context sources create kb-abc123 --url https://example.com/docs
1291
2227
 
1292
- GLOBAL FLAGS
1293
- --json Format output as json.
2228
+ Estimate how many pages a crawl of /docs would find, without adding it
1294
2229
 
1295
- DESCRIPTION
1296
- Get details of an import
2230
+ $ sanity context sources create kb-abc123 --url https://example.com/docs --dry-run
1297
2231
 
1298
- EXAMPLES
1299
- Get details of a specific import
2232
+ Read the documents a GROQ query selects from a Sanity dataset
2233
+
2234
+ $ sanity context sources create kb-abc123 --query '*[_type == "article"]' --sanity-project-id abc123 \
2235
+ --sanity-dataset-id production
2236
+
2237
+ Upload a local file and wait for its sync
1300
2238
 
1301
- $ sanity context imports get kb-abc123 import-def456
2239
+ $ sanity context sources create kb-abc123 --file ./handbook.pdf --watch
1302
2240
 
1303
- Output the import as JSON
2241
+ Add markdown from stdin
1304
2242
 
1305
- $ sanity context imports get kb-abc123 import-def456 --json
2243
+ cat refunds.md | sanity context sources create kb-abc123 --text - --title "Refund policy"
1306
2244
  ```
1307
2245
 
1308
- ## `sanity context imports list KNOWLEDGEBASEID`
2246
+ ## `sanity context sources delete KNOWLEDGEBASEID SOURCEID`
1309
2247
 
1310
- List imports for a knowledge base
2248
+ Delete a source
1311
2249
 
1312
2250
  ```
1313
2251
  USAGE
1314
- $ sanity context imports list KNOWLEDGEBASEID [--json]
2252
+ $ sanity context sources delete KNOWLEDGEBASEID SOURCEID [--json] [-y]
1315
2253
 
1316
2254
  ARGUMENTS
1317
- KNOWLEDGEBASEID Knowledge base ID
2255
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2256
+ SOURCEID The source's ID.
2257
+
2258
+ FLAGS
2259
+ -y, --yes Skip confirmation prompt (unattended mode)
1318
2260
 
1319
2261
  GLOBAL FLAGS
1320
2262
  --json Format output as json.
1321
2263
 
1322
2264
  DESCRIPTION
1323
- List imports for a knowledge base
2265
+ Delete a source
2266
+
2267
+ Removes a source and its documents from the knowledge base, and starts a refresh that removes their citations from
2268
+ entries and deletes the entries left with none. A source no other knowledge base uses stops syncing and is deleted
2269
+ once that refresh has run.
1324
2270
 
1325
2271
  EXAMPLES
1326
- List all imports for a knowledge base
2272
+ Delete a source
1327
2273
 
1328
- $ sanity context imports list kb-abc123
2274
+ $ sanity context sources delete <knowledgeBaseId> <sourceId>
1329
2275
 
1330
- Output imports as JSON
2276
+ Delete a source, as JSON
1331
2277
 
1332
- $ sanity context imports list kb-abc123 --json
2278
+ $ sanity context sources delete <knowledgeBaseId> <sourceId> --json
1333
2279
  ```
1334
2280
 
1335
- ## `sanity context issues apply KNOWLEDGEBASEID ISSUEID`
2281
+ ## `sanity context sources edit KNOWLEDGEBASEID SOURCEID`
1336
2282
 
1337
- Accept and apply issues to a knowledge base
2283
+ Update a source
1338
2284
 
1339
2285
  ```
1340
2286
  USAGE
1341
- $ sanity context issues apply KNOWLEDGEBASEID ISSUEID... [--watch]
2287
+ $ sanity context sources edit KNOWLEDGEBASEID SOURCEID [--json] [--title <value>] [--include-paths <value>...]
2288
+ [--exclude-paths <value>...] [--max-depth <value>] [--sitemap-only] [--ignore-query-parameters] [--page-limit
2289
+ <value>] [--query <value>] [--sync-frequency weekly|monthly|null] [--confirm-deletions]
1342
2290
 
1343
2291
  ARGUMENTS
1344
- KNOWLEDGEBASEID Knowledge base ID
1345
- ISSUEID... ID of an issue to accept and apply (pass several to apply them in one batch). Conflicts can't be
1346
- applied; resolve them with `sanity context issues resolve`
2292
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2293
+ SOURCEID The source's ID.
1347
2294
 
1348
2295
  FLAGS
1349
- --watch Wait for the apply to finish, exiting non-zero if it fails
2296
+ --[no-]confirm-deletions Set to `true` to apply new crawl options that delete many documents. Without it, a
2297
+ change that would delete all of the documents, or five or more that are over a fifth
2298
+ of them, returns `409` with code `sourceDeletionsUnconfirmed`.
2299
+ --exclude-paths=<value>... Regular expressions for URL paths to skip. Pages whose path matches one of them aren't
2300
+ crawled.
2301
+ --[no-]ignore-query-parameters Whether to treat URLs that differ only by query string as one page. New crawls set it
2302
+ to `true` unless you set it. Set it to `false` when the query string selects different
2303
+ content, such as pagination.
2304
+ --include-paths=<value>... Regular expressions for URL paths to crawl. When set, the crawl only includes pages
2305
+ whose path matches one of them.
2306
+ --max-depth=<value> How many levels deep the crawl goes from the root URL.
2307
+ --page-limit=<value> The maximum number of pages to crawl. The crawl can stop sooner when the knowledge
2308
+ base reaches its source limit.
2309
+ --query=<value> For a `sanity-dataset` source, the GROQ query, replacing the stored one. A sync is
2310
+ queued, and removes the documents the query no longer returns.
2311
+ --[no-]sitemap-only Whether to crawl only the pages listed in the site's sitemap.
2312
+ --sync-frequency=<option> For a `web` or `sanity-dataset` source, how often it syncs on its own: `weekly` or
2313
+ `monthly`. `null` stops scheduled syncs, and you can still start a sync yourself.
2314
+ Setting a frequency requires a plan that includes scheduled syncs; without one, the
2315
+ request returns `403` with code `featureNotInPlan`. Pass `null` to clear it.
2316
+ <options: weekly|monthly|null>
2317
+ --title=<value> The source's title.
2318
+
2319
+ GLOBAL FLAGS
2320
+ --json Format output as json.
1350
2321
 
1351
2322
  DESCRIPTION
1352
- Accept and apply issues to a knowledge base
2323
+ Update a source
2324
+
2325
+ Changes a source's title, a website's crawl options, a dataset's query, or how often a website or dataset syncs on its
2326
+ own. New crawl options delete the documents whose path they leave out. When that would delete all of the source's
2327
+ documents, or five or more that are over a fifth of them, the request returns `409` with code
2328
+ `sourceDeletionsUnconfirmed` until you send it again with `confirmDeletions` set to `true`. New crawl options sent
2329
+ while the source syncs return `409` with code `syncInProgress`; send them again once the sync finishes. A new query
2330
+ queues a sync, which removes the documents the query no longer selects.
2331
+
2332
+ Crawl options on a source that isn't a website, a query on one that isn't a dataset, or a sync frequency on a `files`
2333
+ source, return `422` with code `sourceTypeMismatch`. Setting a sync frequency on a plan without scheduled syncs
2334
+ returns `403` with code `featureNotInPlan`; setting it to `null` always works.
1353
2335
 
1354
2336
  EXAMPLES
1355
- Accept and apply two issues in one batch
2337
+ Update a source
1356
2338
 
1357
- $ sanity context issues apply kb-abc123 issue.def456 issue.ghi789
2339
+ $ sanity context sources edit <knowledgeBaseId> <sourceId>
1358
2340
 
1359
- Apply an issue and wait for it to finish (non-zero exit on failure)
2341
+ Update a source, as JSON
1360
2342
 
1361
- $ sanity context issues apply kb-abc123 issue.def456 --watch
2343
+ $ sanity context sources edit <knowledgeBaseId> <sourceId> --json
1362
2344
  ```
1363
2345
 
1364
- ## `sanity context issues dismiss KNOWLEDGEBASEID ISSUEID`
2346
+ ## `sanity context sources get KNOWLEDGEBASEID SOURCEID`
1365
2347
 
1366
- Dismiss an issue
2348
+ Get a source
1367
2349
 
1368
2350
  ```
1369
2351
  USAGE
1370
- $ sanity context issues dismiss KNOWLEDGEBASEID ISSUEID
2352
+ $ sanity context sources get KNOWLEDGEBASEID SOURCEID [--json]
1371
2353
 
1372
2354
  ARGUMENTS
1373
- KNOWLEDGEBASEID Knowledge base ID
1374
- ISSUEID Issue ID
2355
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2356
+ SOURCEID The source's ID.
2357
+
2358
+ GLOBAL FLAGS
2359
+ --json Format output as json.
1375
2360
 
1376
2361
  DESCRIPTION
1377
- Dismiss an issue
2362
+ Get a source
1378
2363
 
1379
- Dismissing is permanent: dismissed issues can't be reopened.
2364
+ Returns a source with its settings, document counts and latest sync.
1380
2365
 
1381
2366
  EXAMPLES
1382
- Dismiss an issue
2367
+ Get a source
1383
2368
 
1384
- $ sanity context issues dismiss kb-abc123 issue.def456
2369
+ $ sanity context sources get <knowledgeBaseId> <sourceId>
2370
+
2371
+ Get a source, as JSON
2372
+
2373
+ $ sanity context sources get <knowledgeBaseId> <sourceId> --json
1385
2374
  ```
1386
2375
 
1387
- ## `sanity context issues get KNOWLEDGEBASEID ISSUEID`
2376
+ ## `sanity context sources list KNOWLEDGEBASEID`
1388
2377
 
1389
- Get details of an issue
2378
+ List sources
1390
2379
 
1391
2380
  ```
1392
2381
  USAGE
1393
- $ sanity context issues get KNOWLEDGEBASEID ISSUEID [--json]
2382
+ $ sanity context sources list KNOWLEDGEBASEID [--json]
1394
2383
 
1395
2384
  ARGUMENTS
1396
- KNOWLEDGEBASEID Knowledge base ID
1397
- ISSUEID Issue ID
2385
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1398
2386
 
1399
2387
  GLOBAL FLAGS
1400
2388
  --json Format output as json.
1401
2389
 
1402
2390
  DESCRIPTION
1403
- Get details of an issue
2391
+ List sources
2392
+
2393
+ Lists the sources of a knowledge base: the websites, Sanity datasets and files its documents come from, each with its
2394
+ document counts and its latest sync. Results are cursor-paginated.
1404
2395
 
1405
2396
  EXAMPLES
1406
- Get details of a specific issue
2397
+ List sources
1407
2398
 
1408
- $ sanity context issues get kb-abc123 issue.def456
2399
+ $ sanity context sources list <knowledgeBaseId>
1409
2400
 
1410
- Output the issue as JSON
2401
+ List sources, as JSON
1411
2402
 
1412
- $ sanity context issues get kb-abc123 issue.def456 --json
2403
+ $ sanity context sources list <knowledgeBaseId> --json
1413
2404
  ```
1414
2405
 
1415
- ## `sanity context issues list KNOWLEDGEBASEID`
2406
+ ## `sanity context sources sync KNOWLEDGEBASEID SOURCEID`
1416
2407
 
1417
- List issues found by knowledge base builds
2408
+ Sync a source
1418
2409
 
1419
2410
  ```
1420
2411
  USAGE
1421
- $ sanity context issues list KNOWLEDGEBASEID [--json] [--kind
1422
- add_entry|conflict|gap|merge_entry|remove_entry|split_entry|update_required] [--scope <path>] [--severity
1423
- critical|suggestion] [--status open|accepted|rejected]
2412
+ $ sanity context sources sync KNOWLEDGEBASEID SOURCEID [--json] [--watch]
1424
2413
 
1425
2414
  ARGUMENTS
1426
- KNOWLEDGEBASEID Knowledge base ID
2415
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2416
+ SOURCEID The source's ID.
1427
2417
 
1428
2418
  FLAGS
1429
- --kind=<option> Only list issues of this kind
1430
- <options: add_entry|conflict|gap|merge_entry|remove_entry|split_entry|update_required>
1431
- --scope=<path> Only list issues about this entry path or anything under it (`*` for knowledge-base-wide issues)
1432
- --severity=<option> Only list issues of this severity
1433
- <options: critical|suggestion>
1434
- --status=<option> Only list issues with this status (rejected = dismissed, accepted = resolved or applied)
1435
- <options: open|accepted|rejected>
2419
+ --watch Wait for the sync to settle, exiting non-zero unless it completes: when it fails, is cancelled or is held for
2420
+ confirmation
1436
2421
 
1437
2422
  GLOBAL FLAGS
1438
2423
  --json Format output as json.
1439
2424
 
1440
2425
  DESCRIPTION
1441
- List issues found by knowledge base builds
2426
+ Sync a source
1442
2427
 
1443
- EXAMPLES
1444
- List all issues for a knowledge base
1445
-
1446
- $ sanity context issues list kb-abc123
1447
-
1448
- List issues awaiting triage
1449
-
1450
- $ sanity context issues list kb-abc123 --status open
2428
+ Starts a sync of the source. A website or dataset is read again: its sync is queued, and starts once any sync of the
2429
+ source that is running ends, including the first one that started when it was added. Asking again while one waits
2430
+ queues nothing more. Follow it with the source's `latestSync`.
1451
2431
 
1452
- List critical conflicts
2432
+ For a `files` source, set `uploadId` to the upload whose file the source should hold from now on; without it, the
2433
+ source reads its current file again. Its sync starts at once and returns a job ID to poll; the finished job's `result`
2434
+ names the sync and whether it is `held`. While a sync of a `files` source is running, including the first one, the
2435
+ request returns `409` with code `syncInProgress` and leaves the upload for a later request. An `uploadId` whose file
2436
+ never arrived returns `404` with code `uploadNotFound`, and an `uploadId` on a source that isn't `files` returns `422`
2437
+ with code `sourceTypeMismatch`.
1453
2438
 
1454
- $ sanity context issues list kb-abc123 --kind conflict --severity critical
2439
+ Supports the `Idempotency-Key` header.
1455
2440
 
1456
- List issues about entries under billing/
2441
+ EXAMPLES
2442
+ Sync a source
1457
2443
 
1458
- $ sanity context issues list kb-abc123 --scope billing
2444
+ $ sanity context sources sync <knowledgeBaseId> <sourceId>
1459
2445
 
1460
- Output issues as JSON
2446
+ Sync a source, as JSON
1461
2447
 
1462
- $ sanity context issues list kb-abc123 --json
2448
+ $ sanity context sources sync <knowledgeBaseId> <sourceId> --json
1463
2449
  ```
1464
2450
 
1465
- ## `sanity context issues reopen KNOWLEDGEBASEID ISSUEID`
2451
+ ## `sanity context sources syncs confirm KNOWLEDGEBASEID SOURCEID SYNCID`
1466
2452
 
1467
- Reopen a resolved conflict issue
2453
+ Confirm a held sync's deletions
1468
2454
 
1469
2455
  ```
1470
2456
  USAGE
1471
- $ sanity context issues reopen KNOWLEDGEBASEID ISSUEID
2457
+ $ sanity context sources syncs confirm KNOWLEDGEBASEID SOURCEID SYNCID [--json]
1472
2458
 
1473
2459
  ARGUMENTS
1474
- KNOWLEDGEBASEID Knowledge base ID
1475
- ISSUEID Issue ID
2460
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2461
+ SOURCEID The source's ID.
2462
+ SYNCID The sync's ID.
2463
+
2464
+ GLOBAL FLAGS
2465
+ --json Format output as json.
1476
2466
 
1477
2467
  DESCRIPTION
1478
- Reopen a resolved conflict issue
2468
+ Confirm a held sync's deletions
2469
+
2470
+ Deletes the documents a `held` sync didn't find, unless a sync has found them since, completes the sync, and starts a
2471
+ refresh of each knowledge base that uses the source, which removes their citations from entries. A sync that isn't
2472
+ `held` returns `409` with code `syncNotHeld`.
1479
2473
 
1480
2474
  EXAMPLES
1481
- Return a resolved conflict issue to triage
2475
+ Confirm a held sync's deletions
2476
+
2477
+ $ sanity context sources syncs confirm <knowledgeBaseId> <sourceId> <syncId>
2478
+
2479
+ Confirm a held sync's deletions, as JSON
1482
2480
 
1483
- $ sanity context issues reopen kb-abc123 issue.def456
2481
+ $ sanity context sources syncs confirm <knowledgeBaseId> <sourceId> <syncId> --json
1484
2482
  ```
1485
2483
 
1486
- ## `sanity context issues resolve KNOWLEDGEBASEID ISSUEID`
2484
+ ## `sanity context sources syncs discard KNOWLEDGEBASEID SOURCEID SYNCID`
1487
2485
 
1488
- Resolve a conflict issue by choosing the correct side
2486
+ Discard a held sync's deletions
1489
2487
 
1490
2488
  ```
1491
2489
  USAGE
1492
- $ sanity context issues resolve KNOWLEDGEBASEID ISSUEID [--side <value>] [--watch]
2490
+ $ sanity context sources syncs discard KNOWLEDGEBASEID SOURCEID SYNCID [--json]
1493
2491
 
1494
2492
  ARGUMENTS
1495
- KNOWLEDGEBASEID Knowledge base ID
1496
- ISSUEID Issue ID
2493
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2494
+ SOURCEID The source's ID.
2495
+ SYNCID The sync's ID.
1497
2496
 
1498
- FLAGS
1499
- --side=<value> Index of the correct side, as listed by `sanity context issues get`
1500
- --watch Wait for the entry rewrite to finish, exiting non-zero if it fails
2497
+ GLOBAL FLAGS
2498
+ --json Format output as json.
1501
2499
 
1502
2500
  DESCRIPTION
1503
- Resolve a conflict issue by choosing the correct side
2501
+ Discard a held sync's deletions
1504
2502
 
1505
- Resolving also creates a standing instruction that future builds follow. `sanity context issues reopen` removes it.
2503
+ Completes a `held` sync without deleting anything: every document stays as it is. A sync that isn't `held` returns
2504
+ `409` with code `syncNotHeld`.
1506
2505
 
1507
2506
  EXAMPLES
1508
- Interactively choose the correct side of a conflict
1509
-
1510
- $ sanity context issues resolve kb-abc123 issue.def456
2507
+ Discard a held sync's deletions
1511
2508
 
1512
- Choose side 1 and wait for the entry to be rewritten
2509
+ $ sanity context sources syncs discard <knowledgeBaseId> <sourceId> <syncId>
1513
2510
 
1514
- $ sanity context issues resolve kb-abc123 issue.def456 --side 1 --watch
2511
+ Discard a held sync's deletions, as JSON
1515
2512
 
1516
- Keep the entry as it is (for a conflict on a single entry)
1517
-
1518
- $ sanity context issues resolve kb-abc123 issue.def456 --side 0
2513
+ $ sanity context sources syncs discard <knowledgeBaseId> <sourceId> <syncId> --json
1519
2514
  ```
1520
2515
 
1521
- ## `sanity context jobs get KNOWLEDGEBASEID JOBID`
2516
+ ## `sanity context sources syncs get KNOWLEDGEBASEID SOURCEID SYNCID`
1522
2517
 
1523
- Get the status of a knowledge base job
2518
+ Get a sync
1524
2519
 
1525
2520
  ```
1526
2521
  USAGE
1527
- $ sanity context jobs get KNOWLEDGEBASEID JOBID [--json] [--watch]
2522
+ $ sanity context sources syncs get KNOWLEDGEBASEID SOURCEID SYNCID [--json]
1528
2523
 
1529
2524
  ARGUMENTS
1530
- KNOWLEDGEBASEID Knowledge base ID
1531
- JOBID Job ID
1532
-
1533
- FLAGS
1534
- --watch Poll until the job reaches a terminal state
2525
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2526
+ SOURCEID The source's ID.
2527
+ SYNCID The sync's ID.
1535
2528
 
1536
2529
  GLOBAL FLAGS
1537
2530
  --json Format output as json.
1538
2531
 
1539
2532
  DESCRIPTION
1540
- Get the status of a knowledge base job
2533
+ Get a sync
2534
+
2535
+ Returns one sync of a source with its status and counts.
1541
2536
 
1542
2537
  EXAMPLES
1543
- Get the current status of a job
2538
+ Get a sync
1544
2539
 
1545
- $ sanity context jobs get kb-abc123 job-def456
2540
+ $ sanity context sources syncs get <knowledgeBaseId> <sourceId> <syncId>
1546
2541
 
1547
- Wait for the job to finish (non-zero exit if it does not succeed)
2542
+ Get a sync, as JSON
1548
2543
 
1549
- $ sanity context jobs get kb-abc123 job-def456 --watch
2544
+ $ sanity context sources syncs get <knowledgeBaseId> <sourceId> <syncId> --json
1550
2545
  ```
1551
2546
 
1552
- ## `sanity context list`
2547
+ ## `sanity context sources syncs list KNOWLEDGEBASEID SOURCEID`
1553
2548
 
1554
- List knowledge bases in an organization
2549
+ List a source's syncs
1555
2550
 
1556
2551
  ```
1557
2552
  USAGE
1558
- $ sanity context list [--json] [--organization <id>]
2553
+ $ sanity context sources syncs list KNOWLEDGEBASEID SOURCEID [--json]
2554
+
2555
+ ARGUMENTS
2556
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2557
+ SOURCEID The source's ID.
1559
2558
 
1560
2559
  GLOBAL FLAGS
1561
2560
  --json Format output as json.
1562
2561
 
1563
- OVERRIDE FLAGS
1564
- --organization=<id> Organization to list knowledge bases for (overrides CLI configuration)
1565
-
1566
2562
  DESCRIPTION
1567
- List knowledge bases in an organization
2563
+ List a source's syncs
1568
2564
 
1569
- EXAMPLES
1570
- List knowledge bases, selecting the organization interactively
1571
-
1572
- $ sanity context list
2565
+ Lists the syncs of a source, newest first. Results are cursor-paginated.
1573
2566
 
1574
- List knowledge bases in a specific organization
2567
+ EXAMPLES
2568
+ List a source's syncs
1575
2569
 
1576
- $ sanity context list --organization org-abc123
2570
+ $ sanity context sources syncs list <knowledgeBaseId> <sourceId>
1577
2571
 
1578
- Output knowledge bases as JSON
2572
+ List a source's syncs, as JSON
1579
2573
 
1580
- $ sanity context list --organization org-abc123 --json
2574
+ $ sanity context sources syncs list <knowledgeBaseId> <sourceId> --json
1581
2575
  ```
1582
2576
 
1583
- ## `sanity context query QUERY`
2577
+ ## `sanity context sources upload KNOWLEDGEBASEID SOURCEID`
1584
2578
 
1585
- Query an organization's Context documents with GROQ
2579
+ Upload a file to a source
1586
2580
 
1587
2581
  ```
1588
2582
  USAGE
1589
- $ sanity context query QUERY [--json] [--organization <id>] [--params <json>]
2583
+ $ sanity context sources upload KNOWLEDGEBASEID SOURCEID --file <path> [--json] [--watch] [--content-type <type>]
1590
2584
 
1591
2585
  ARGUMENTS
1592
- QUERY GROQ query to run against the organization's Context documents
2586
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2587
+ SOURCEID The source's ID.
1593
2588
 
1594
2589
  FLAGS
1595
- --params=<json> Query parameters as a JSON object
2590
+ --content-type=<type> MIME type of the file, inferred from the file extension when omitted
2591
+ --file=<path> (required) Local file to upload: a document, or a zip, tar or gzip archive of them
2592
+ --watch Wait for the sync to settle, exiting non-zero unless it completes: when it fails, is cancelled
2593
+ or is held for confirmation
1596
2594
 
1597
2595
  GLOBAL FLAGS
1598
2596
  --json Format output as json.
1599
2597
 
1600
- OVERRIDE FLAGS
1601
- --organization=<id> Organization to query (overrides CLI configuration)
1602
-
1603
2598
  DESCRIPTION
1604
- Query an organization's Context documents with GROQ
2599
+ Upload a file to a source
2600
+
2601
+ Upload a new file to a files source, replacing the one it holds, and sync it
1605
2602
 
1606
2603
  EXAMPLES
1607
- List open issues across all knowledge bases
2604
+ Replace the file a source holds
1608
2605
 
1609
- $ sanity context query '*[_type == "sanity.context.issue" && status == "open"]{_id, knowledgeBaseId}'
2606
+ $ sanity context sources upload kb-abc123 source-def456 --file ./handbook.pdf
1610
2607
 
1611
- List the entry paths of one knowledge base as plain JSON
2608
+ Replace the file and wait for its sync to finish
1612
2609
 
1613
- $ sanity context query '*[_type == "sanity.context.entry" && knowledgeBaseId == $kb].path' --params '{"kb": \
1614
- "kb-abc123"}' --json
2610
+ $ sanity context sources upload kb-abc123 source-def456 --file ./handbook.pdf --watch
1615
2611
  ```
1616
2612
 
1617
- ## `sanity context refresh KNOWLEDGEBASEID`
2613
+ ## `sanity context sync KNOWLEDGEBASEID`
1618
2614
 
1619
- Refresh a knowledge base: re-check sources and apply what changed
2615
+ Sync every source
1620
2616
 
1621
2617
  ```
1622
2618
  USAGE
1623
- $ sanity context refresh KNOWLEDGEBASEID
2619
+ $ sanity context sync KNOWLEDGEBASEID [--json]
1624
2620
 
1625
2621
  ARGUMENTS
1626
- KNOWLEDGEBASEID Knowledge base ID
2622
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
2623
+
2624
+ GLOBAL FLAGS
2625
+ --json Format output as json.
1627
2626
 
1628
2627
  DESCRIPTION
1629
- Refresh a knowledge base: re-check sources and apply what changed
2628
+ Sync every source
2629
+
2630
+ Queues a sync of every website and dataset source, which starts once any sync of the source that is running ends.
2631
+ `files` sources sync when you upload a file.
1630
2632
 
1631
2633
  EXAMPLES
1632
- Start an incremental refresh
2634
+ Sync every source
1633
2635
 
1634
- $ sanity context refresh kb-abc123
2636
+ $ sanity context sync <knowledgeBaseId>
2637
+
2638
+ Sync every source, as JSON
2639
+
2640
+ $ sanity context sync <knowledgeBaseId> --json
1635
2641
  ```
1636
2642
 
1637
2643
  ## `sanity context update KNOWLEDGEBASEID`
@@ -1640,34 +2646,36 @@ Update a knowledge base
1640
2646
 
1641
2647
  ```
1642
2648
  USAGE
1643
- $ sanity context update KNOWLEDGEBASEID [--description <value>] [--refresh-enabled] [--refresh-frequency
1644
- weekly|monthly] [--title <value>]
2649
+ $ sanity context update KNOWLEDGEBASEID [--json] [--title <value>] [--description <value>] [--draft]
1645
2650
 
1646
2651
  ARGUMENTS
1647
- KNOWLEDGEBASEID Knowledge base ID
2652
+ KNOWLEDGEBASEID The knowledge base's ID (`kb...`), its `publicId`. Its UUID `id` is also accepted.
1648
2653
 
1649
2654
  FLAGS
1650
- --description=<value> New knowledge base description
1651
- --[no-]refresh-enabled Enable scheduled refresh (--no-refresh-enabled to disable)
1652
- --refresh-frequency=<option> How often scheduled refresh runs
1653
- <options: weekly|monthly>
1654
- --title=<value> New knowledge base title
2655
+ --description=<value> The knowledge base's new description.
2656
+ --[no-]draft Set to `false` to finish a draft, so it can be built and is listed with your other knowledge
2657
+ bases. The knowledge base needs a title, sent here or set before. Ignored when the knowledge
2658
+ base isn't a draft. A finished knowledge base can't become a draft again.
2659
+ --title=<value> The knowledge base's new title.
2660
+
2661
+ GLOBAL FLAGS
2662
+ --json Format output as json.
1655
2663
 
1656
2664
  DESCRIPTION
1657
2665
  Update a knowledge base
1658
2666
 
1659
- EXAMPLES
1660
- Rename a knowledge base
1661
-
1662
- $ sanity context update kb-abc123 --title "New title"
2667
+ Updates the title or the description, or finishes a draft (`draft: false`). Fields equal to their current value are
2668
+ ignored, so sending the current values changes nothing. Finishing a draft with no title returns `422` with code
2669
+ `draftTitleRequired`. How often a website or dataset syncs is set on the source, with `PATCH .../sources/{sourceId}`.
1663
2670
 
1664
- Enable weekly scheduled refresh
2671
+ EXAMPLES
2672
+ Update a knowledge base
1665
2673
 
1666
- $ sanity context update kb-abc123 --refresh-enabled --refresh-frequency weekly
2674
+ $ sanity context update <knowledgeBaseId>
1667
2675
 
1668
- Disable scheduled refresh
2676
+ Update a knowledge base, as JSON
1669
2677
 
1670
- $ sanity context update kb-abc123 --no-refresh-enabled
2678
+ $ sanity context update <knowledgeBaseId> --json
1671
2679
  ```
1672
2680
 
1673
2681
  ## `sanity cors add ORIGIN`
@@ -2789,8 +3797,8 @@ Add a Function to your Blueprint
2789
3797
  USAGE
2790
3798
  $ sanity functions add [--json] [--example <value> | -n <value> | --type
2791
3799
  document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
2792
- te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
2793
- --helpers | --installer skip|npm|pnpm|yarn | -i]
3800
+ te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate|durable-function... | --language ts|js
3801
+ | --javascript | --helpers | --installer skip|npm|pnpm|yarn | -i]
2794
3802
 
2795
3803
  FLAGS
2796
3804
  -i, --install Shortcut for --installer npm
@@ -2807,7 +3815,7 @@ FLAGS
2807
3815
  by specifying this flag multiple times
2808
3816
  <options: document-publish|document-create|document-delete|document-update|media-library-ass
2809
3817
  et-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-function|s
2810
- ync-tag-invalidate>
3818
+ ync-tag-invalidate|durable-function>
2811
3819
 
2812
3820
  DESCRIPTION
2813
3821
  Add a Function to your Blueprint
@@ -4794,17 +5802,20 @@ Abort an in-flight workflow instance — a hard stop: pending effects are cancel
4794
5802
 
4795
5803
  ```
4796
5804
  USAGE
4797
- $ sanity workflows abort INSTANCEID [--deployment <value> | --tag <value>] [--reason <value>]
5805
+ $ sanity workflows abort INSTANCEID [--path <file|dir>] [--deployment <value> | --partition <value>] [--reason
5806
+ <value>]
4798
5807
 
4799
5808
  ARGUMENTS
4800
5809
  INSTANCEID Workflow instance id.
4801
5810
 
4802
5811
  FLAGS
4803
- --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
5812
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the
4804
5813
  partition still comes from the loaded instance.
5814
+ --partition=<value> Workflow environment partition (e.g. prod, test) — narrows which resources are searched for the
5815
+ instance; the instance's stored partition is what the command uses.
5816
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
5817
+ Defaults to the current directory.
4805
5818
  --reason=<value> Reason for aborting (recorded in history).
4806
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4807
- resources are searched; omit to span them all.
4808
5819
 
4809
5820
  DESCRIPTION
4810
5821
  Abort an in-flight workflow instance — a hard stop: pending effects are cancelled, stage guards removed, and the
@@ -4816,17 +5827,19 @@ EXAMPLES
4816
5827
  $ sanity workflows abort wf-instance.abc123 --reason 'superseded by relaunch'
4817
5828
  ```
4818
5829
 
4819
- ## `sanity workflows blueprint generate`
5830
+ ## `sanity workflows blueprints generate`
4820
5831
 
4821
5832
  Experimental: generate the Sanity Blueprints runtime the definitions require, next to sanity.workflow.ts. Writes the workflow resources, one function per derived need, the effect-handler registry, and a handler stub per declared effect. Covers every deployment in the config, because the emitted resources module declares them all. These flags and this output may change before the Blueprints backend accepts the sanity.workflow resource.
4822
5833
 
4823
5834
  ```
4824
5835
  USAGE
4825
- $ sanity workflows blueprint generate [--check]
5836
+ $ sanity workflows blueprints generate [--path <file|dir>] [--check]
4826
5837
 
4827
5838
  FLAGS
4828
- --check Experimental: verify the tree on disk still matches the definitions; write nothing and exit non-zero on any
4829
- difference. The CI drift gate.
5839
+ --check Experimental: verify the tree on disk still matches the definitions; write nothing and exit
5840
+ non-zero on any difference. The CI drift gate.
5841
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents. Defaults
5842
+ to the current directory.
4830
5843
 
4831
5844
  DESCRIPTION
4832
5845
  Experimental: generate the Sanity Blueprints runtime the definitions require, next to sanity.workflow.ts. Writes the
@@ -4835,19 +5848,19 @@ DESCRIPTION
4835
5848
  this output may change before the Blueprints backend accepts the sanity.workflow resource.
4836
5849
 
4837
5850
  EXAMPLES
4838
- $ sanity workflows blueprint generate
5851
+ $ sanity workflows blueprints generate
4839
5852
 
4840
- $ sanity workflows blueprint generate --check
5853
+ $ sanity workflows blueprints generate --check
4841
5854
  ```
4842
5855
 
4843
- ## `sanity workflows definition delete NAME`
5856
+ ## `sanity workflows definitions delete NAME`
4844
5857
 
4845
5858
  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.
4846
5859
 
4847
5860
  ```
4848
5861
  USAGE
4849
- $ sanity workflows definition delete NAME [--deployment <value> | --tag <value>] [--version <value>] [--cascade] [--reason
4850
- <value>]
5862
+ $ sanity workflows definitions delete NAME [--path <file|dir>] [--deployment <value> | --partition <value>] [--version <value>]
5863
+ [--cascade] [--reason <value>]
4851
5864
 
4852
5865
  ARGUMENTS
4853
5866
  NAME Workflow definition name.
@@ -4855,9 +5868,11 @@ ARGUMENTS
4855
5868
  FLAGS
4856
5869
  --cascade Abort every non-terminal instance pinned to the targeted versions, then delete.
4857
5870
  --deployment=<value> Deployment name — the unique identity of one deployment in the config.
5871
+ --partition=<value> Workflow environment partition (e.g. prod, test) — selects the deployment to act on while the
5872
+ partition names exactly one; pass --deployment when it spans several.
5873
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
5874
+ Defaults to the current directory.
4858
5875
  --reason=<value> Free-text reason — recorded on each cascade-abort history entry.
4859
- --tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
4860
- names exactly one; pass --deployment when it spans several.
4861
5876
  --version=<value> Delete only this deployed version (default: every version).
4862
5877
 
4863
5878
  DESCRIPTION
@@ -4865,97 +5880,148 @@ DESCRIPTION
4865
5880
  exist unless --cascade aborts them first — instances are aborted in place, never deleted.
4866
5881
 
4867
5882
  EXAMPLES
4868
- $ sanity workflows definition delete my-workflow
5883
+ $ sanity workflows definitions delete my-workflow
4869
5884
 
4870
- $ sanity workflows definition delete my-workflow --version 2
5885
+ $ sanity workflows definitions delete my-workflow --version 2
4871
5886
 
4872
- $ sanity workflows definition delete my-workflow --cascade --reason 'workflow retired'
5887
+ $ sanity workflows definitions delete my-workflow --cascade --reason 'workflow retired'
4873
5888
  ```
4874
5889
 
4875
- ## `sanity workflows definition diff NAME`
5890
+ ## `sanity workflows definitions diff NAME`
4876
5891
 
4877
5892
  Diff an in-code definition against the deployed version (latest by default).
4878
5893
 
4879
5894
  ```
4880
5895
  USAGE
4881
- $ sanity workflows definition diff NAME [--deployment <value> | --tag <value>] [--version <value>]
5896
+ $ sanity workflows definitions diff NAME [--path <file|dir>] [--deployment <value> | --partition <value>] [--version
5897
+ <value>]
4882
5898
 
4883
5899
  ARGUMENTS
4884
5900
  NAME Workflow definition name.
4885
5901
 
4886
5902
  FLAGS
4887
5903
  --deployment=<value> Deployment name — the unique identity of one deployment in the config.
4888
- --tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
4889
- names exactly one; pass --deployment when it spans several.
5904
+ --partition=<value> Workflow environment partition (e.g. prod, test) — selects the deployment to act on while the
5905
+ partition names exactly one; pass --deployment when it spans several.
5906
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
5907
+ Defaults to the current directory.
4890
5908
  --version=<value> Deployed version to diff against (default: latest).
4891
5909
 
4892
5910
  DESCRIPTION
4893
5911
  Diff an in-code definition against the deployed version (latest by default).
4894
5912
 
4895
5913
  EXAMPLES
4896
- $ sanity workflows definition diff productLaunch
5914
+ $ sanity workflows definitions diff productLaunch
4897
5915
 
4898
- $ sanity workflows definition diff productLaunch --version 2
5916
+ $ sanity workflows definitions diff productLaunch --version 2
4899
5917
  ```
4900
5918
 
4901
- ## `sanity workflows definition list`
5919
+ ## `sanity workflows definitions list`
4902
5920
 
4903
5921
  List deployed workflow definitions.
4904
5922
 
4905
5923
  ```
4906
5924
  USAGE
4907
- $ sanity workflows definition list [--tag <value>] [--limit <value>] [--name <value>] [--json]
5925
+ $ sanity workflows definitions list [--media-library-id <id> | [-p <id> -d <name>] | | --path <file|dir> | [--deployment
5926
+ <value> | --partition <value>]] [--limit <value>] [--name <value>] [--json]
4908
5927
 
4909
5928
  FLAGS
4910
- --json Emit structured JSON instead of rendered output.
4911
- --limit=<value> [default: 100] The maximum number of definitions to return.
4912
- --name=<value> Filter to a single workflow definition name (e.g. product-launch).
4913
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4914
- resources are searched; omit to span them all.
5929
+ --deployment=<value> Deployment name — read only the resource and partition that deployment targets.
5930
+ --json Emit structured JSON instead of rendered output.
5931
+ --limit=<value> [default: 100] The maximum number of definitions to return.
5932
+ --name=<value> Filter to a single workflow definition name (e.g. product-launch).
5933
+ --partition=<value> Workflow environment partition (e.g. prod, test) — an optional query filter that also narrows
5934
+ which resources are searched; omit to span them all.
5935
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
5936
+ Defaults to the current directory.
5937
+
5938
+ OVERRIDE FLAGS
5939
+ -d, --dataset=<name> Dataset to read (overrides sanity.workflow.ts)
5940
+ -p, --project-id=<id> Project ID of the dataset to read (overrides sanity.workflow.ts)
5941
+ --media-library-id=<id> Media library to read (overrides sanity.workflow.ts)
4915
5942
 
4916
5943
  DESCRIPTION
4917
5944
  List deployed workflow definitions.
4918
5945
 
4919
5946
  EXAMPLES
4920
- $ sanity workflows definition list
5947
+ $ sanity workflows definitions list
4921
5948
 
4922
- $ sanity workflows definition list --tag prod
5949
+ $ sanity workflows definitions list --partition prod
4923
5950
 
4924
- $ sanity workflows definition list --json
5951
+ $ sanity workflows definitions list --json
4925
5952
  ```
4926
5953
 
4927
- ## `sanity workflows definition show NAME`
5954
+ ## `sanity workflows definitions show NAME`
4928
5955
 
4929
5956
  Show a deployed workflow definition.
4930
5957
 
4931
5958
  ```
4932
5959
  USAGE
4933
- $ sanity workflows definition show NAME [--tag <value>] [--version <value>] [--json]
5960
+ $ sanity workflows definitions show NAME [--media-library-id <id> | [-p <id> -d <name>] | | --path <file|dir> | [--deployment
5961
+ <value> | --partition <value>]] [--version <value>] [--json]
4934
5962
 
4935
5963
  ARGUMENTS
4936
5964
  NAME Workflow definition name.
4937
5965
 
4938
5966
  FLAGS
4939
- --json Emit structured JSON instead of rendered output.
4940
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
4941
- resources are searched; omit to span them all.
4942
- --version=<value> Specific version (default: latest).
5967
+ --deployment=<value> Deployment name — read only the resource and partition that deployment targets.
5968
+ --json Emit structured JSON instead of rendered output.
5969
+ --partition=<value> Workflow environment partition (e.g. prod, test) — an optional query filter that also narrows
5970
+ which resources are searched; omit to span them all.
5971
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
5972
+ Defaults to the current directory.
5973
+ --version=<value> Specific version (default: latest).
5974
+
5975
+ OVERRIDE FLAGS
5976
+ -d, --dataset=<name> Dataset to read (overrides sanity.workflow.ts)
5977
+ -p, --project-id=<id> Project ID of the dataset to read (overrides sanity.workflow.ts)
5978
+ --media-library-id=<id> Media library to read (overrides sanity.workflow.ts)
4943
5979
 
4944
5980
  DESCRIPTION
4945
5981
  Show a deployed workflow definition.
4946
5982
  ```
4947
5983
 
5984
+ ## `sanity workflows definitions validate FILE`
5985
+
5986
+ Validate workflow definitions in JSON files without a config, login, or network access. Checks shape, cross-field rules, and GROQ syntax; deploy additionally checks duplicate names, spawn dependencies, resource bindings, project roles, and the reader-model acknowledgement. Exits non-zero when any definition is invalid. A file that cannot be read, is not valid JSON, or does not hold definition objects stops the command with an error message instead of a report, including with --json.
5987
+
5988
+ ```
5989
+ USAGE
5990
+ $ sanity workflows definitions validate FILE... [--json]
5991
+
5992
+ ARGUMENTS
5993
+ FILE... JSON file holding one definition or an array of them. Pass several files to validate a parent and its child
5994
+ workflows together.
5995
+
5996
+ FLAGS
5997
+ --json Emit structured JSON instead of rendered output.
5998
+
5999
+ DESCRIPTION
6000
+ Validate workflow definitions in JSON files without a config, login, or network access. Checks shape, cross-field
6001
+ rules, and GROQ syntax; deploy additionally checks duplicate names, spawn dependencies, resource bindings, project
6002
+ roles, and the reader-model acknowledgement. Exits non-zero when any definition is invalid. A file that cannot be
6003
+ read, is not valid JSON, or does not hold definition objects stops the command with an error message instead of a
6004
+ report, including with --json.
6005
+
6006
+ EXAMPLES
6007
+ $ sanity workflows definitions validate review.json
6008
+
6009
+ $ sanity workflows definitions validate parent.json child.json
6010
+
6011
+ $ sanity workflows definitions validate review.json --json
6012
+ ```
6013
+
4948
6014
  ## `sanity workflows deploy`
4949
6015
 
4950
- Validate workflow definitions, check any generated runtime beside the config against them, then diff and deploy to the resource bound by the selected deployment. A generated runtime that no longer matches the definitions fails the deploy before anything is written; regenerate it with `sanity-workflows blueprint generate`.
6016
+ Validate workflow definitions, check any generated runtime beside the config against them, then diff and deploy to the resource bound by the selected deployment. A generated runtime that no longer matches the definitions fails the deploy before anything is written; regenerate it with `sanity-workflows blueprints generate`.
4951
6017
 
4952
6018
  ```
4953
6019
  USAGE
4954
- $ sanity workflows deploy [--all-tags | | [--deployment <value> | --tag <value>]] [--dry-run] [--check] [--only
4955
- <value>] [--share-defs]
6020
+ $ sanity workflows deploy [--path <file|dir>] [--all-partitions | | [--deployment <value> | --partition <value>]]
6021
+ [--dry-run] [--check] [--verbose] [--only <value>] [--share-defs]
4956
6022
 
4957
6023
  FLAGS
4958
- --all-tags Deploy every deployment in the config, not just a selection.
6024
+ --all-partitions Deploy every deployment in the config, not just a selection.
4959
6025
  --check Validate definitions and check any generated runtime against them; do not contact the dataset.
4960
6026
  --deployment=<value> Deployment name — the unique identity of one deployment in the config.
4961
6027
  --dry-run Validate definitions, check any generated runtime against them, and diff against the deployed
@@ -4963,30 +6029,36 @@ FLAGS
4963
6029
  --only=<value> Limit deploy/check/diff to a single workflow definition by name (deployments are selected with
4964
6030
  --deployment). Every targeted deployment must contain it. The generated-runtime check still
4965
6031
  covers the whole config, because the generated tree declares every deployment in it.
6032
+ --partition=<value> Workflow partition (e.g. prod, test) — deploys every deployment using that partition across
6033
+ configured resources.
6034
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6035
+ Defaults to the current directory.
4966
6036
  --[no-]share-defs Share the definition documents newly created by this deploy with Sanity — the full document,
4967
6037
  verbatim (structure, names, filters, effect configuration, seeded values), plus its deployment
4968
6038
  coordinates (project and dataset, or resource id); never content documents, instances, or your
4969
6039
  Sanity auth token. Sharing is the default in every environment, including CI / non-TTY /
4970
6040
  DO_NOT_TRACK. Use --no-share-defs to opt out.
4971
- --tag=<value> Workflow environment tag (e.g. prod, test) — deploys every deployment carrying the tag (a tag is
4972
- an environment group).
6041
+ --verbose When no generated runtime is here, print the full report of the Sanity Functions the selected
6042
+ deployments need, in place of the summary.
4973
6043
 
4974
6044
  DESCRIPTION
4975
6045
  Validate workflow definitions, check any generated runtime beside the config against them, then diff and deploy to the
4976
6046
  resource bound by the selected deployment. A generated runtime that no longer matches the definitions fails the deploy
4977
- before anything is written; regenerate it with `sanity-workflows blueprint generate`.
6047
+ before anything is written; regenerate it with `sanity-workflows blueprints generate`.
4978
6048
 
4979
6049
  EXAMPLES
4980
6050
  $ sanity workflows deploy --deployment review-prod
4981
6051
 
4982
- $ sanity workflows deploy --tag prod
6052
+ $ sanity workflows deploy --partition prod
4983
6053
 
4984
- $ sanity workflows deploy --all-tags
6054
+ $ sanity workflows deploy --all-partitions
4985
6055
 
4986
6056
  $ sanity workflows deploy --check
4987
6057
 
4988
6058
  $ sanity workflows deploy --dry-run
4989
6059
 
6060
+ $ sanity workflows deploy --check --verbose
6061
+
4990
6062
  $ sanity workflows deploy --only productLaunch
4991
6063
  ```
4992
6064
 
@@ -4996,17 +6068,25 @@ Explain why a workflow instance is or isn't progressing, and what would unstick
4996
6068
 
4997
6069
  ```
4998
6070
  USAGE
4999
- $ sanity workflows diagnose INSTANCEID [--deployment <value> | --tag <value>] [--json]
6071
+ $ sanity workflows diagnose INSTANCEID [--media-library-id <id> | [-p <id> -d <name>] | | --path <file|dir> |
6072
+ [--deployment <value> | --partition <value>]] [--json]
5000
6073
 
5001
6074
  ARGUMENTS
5002
6075
  INSTANCEID Workflow instance id.
5003
6076
 
5004
6077
  FLAGS
5005
- --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
6078
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the
5006
6079
  partition still comes from the loaded instance.
5007
6080
  --json Emit structured JSON instead of rendered output.
5008
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
5009
- resources are searched; omit to span them all.
6081
+ --partition=<value> Workflow environment partition (e.g. prod, test) — narrows which resources are searched for the
6082
+ instance; the instance's stored partition is what the command uses.
6083
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6084
+ Defaults to the current directory.
6085
+
6086
+ OVERRIDE FLAGS
6087
+ -d, --dataset=<name> Dataset to read (overrides sanity.workflow.ts)
6088
+ -p, --project-id=<id> Project ID of the dataset to read (overrides sanity.workflow.ts)
6089
+ --media-library-id=<id> Media library to read (overrides sanity.workflow.ts)
5010
6090
 
5011
6091
  DESCRIPTION
5012
6092
  Explain why a workflow instance is or isn't progressing, and what would unstick it.
@@ -5014,7 +6094,7 @@ DESCRIPTION
5014
6094
  EXAMPLES
5015
6095
  $ sanity workflows diagnose wf-instance.abc123
5016
6096
 
5017
- $ sanity workflows diagnose wf-instance.abc123 --tag prod
6097
+ $ sanity workflows diagnose wf-instance.abc123 --partition prod
5018
6098
 
5019
6099
  $ sanity workflows diagnose wf-instance.abc123 --json
5020
6100
  ```
@@ -5025,8 +6105,8 @@ Fire an action on an instance to unstick a waiting activity — the write acts a
5025
6105
 
5026
6106
  ```
5027
6107
  USAGE
5028
- $ sanity workflows fire-action INSTANCEID [--deployment <value> | --tag <value>] [--activity <value>] [--action <value>]
5029
- [--param <value>...] [--json]
6108
+ $ sanity workflows fire-action INSTANCEID [--path <file|dir>] [--deployment <value> | --partition <value>] [--activity
6109
+ <value>] [--action <value>] [--param <value>...] [--json]
5030
6110
 
5031
6111
  ARGUMENTS
5032
6112
  INSTANCEID Workflow instance id.
@@ -5034,13 +6114,15 @@ ARGUMENTS
5034
6114
  FLAGS
5035
6115
  --action=<value> Action to fire. Omit to list the actions available on the instance.
5036
6116
  --activity=<value> Activity the action belongs to. Required to fire; omit --action to list.
5037
- --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
6117
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the
5038
6118
  partition still comes from the loaded instance.
5039
6119
  --json Emit structured JSON instead of rendered output.
5040
6120
  --param=<value>... [default: ] Action param as key=value (repeatable). Values are JSON-parsed, falling back to a
5041
6121
  string.
5042
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
5043
- resources are searched; omit to span them all.
6122
+ --partition=<value> Workflow environment partition (e.g. prod, test) — narrows which resources are searched for the
6123
+ instance; the instance's stored partition is what the command uses.
6124
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6125
+ Defaults to the current directory.
5044
6126
 
5045
6127
  DESCRIPTION
5046
6128
  Fire an action on an instance to unstick a waiting activity — the write acts as the configured token. Omit --action to
@@ -5056,13 +6138,14 @@ EXAMPLES
5056
6138
 
5057
6139
  ## `sanity workflows list`
5058
6140
 
5059
- List workflow instances in the configured dataset (in-flight by default).
6141
+ List workflow instances (in-flight by default) across the resources sanity.workflow.ts declares, or in the one resource --project-id/--dataset or --media-library-id names.
5060
6142
 
5061
6143
  ```
5062
6144
  USAGE
5063
- $ sanity workflows list [--tag <value>] [--include-completed] [--failed] [--definition <value>] [--document
5064
- <value>] [--assignment-user <value>] [--assignment-role <value>...] [--assignment-state unrouted|routed|held...]
5065
- [--limit <value>] [--json]
6145
+ $ sanity workflows list [--media-library-id <id> | [-p <id> -d <name>] | | --path <file|dir> | [--deployment
6146
+ <value> | --partition <value>]] [--include-completed] [--failed] [--definition <value>] [--document <value>]
6147
+ [--assignment-user <value>] [--assignment-role <value>...] [--assignment-state unrouted|routed|held...] [--limit
6148
+ <value>] [--json]
5066
6149
 
5067
6150
  FLAGS
5068
6151
  --assignment-role=<value>... A literal project role held by --assignment-user. Repeat for multiple roles.
@@ -5072,17 +6155,26 @@ FLAGS
5072
6155
  --assignment-user=<value> Account-global user id used for viewer-scoped assignment filtering and counts.
5073
6156
  --definition=<value> Only instances of this workflow definition (its `name`; the instance's `definition`
5074
6157
  field).
6158
+ --deployment=<value> Deployment name — read only the resource and partition that deployment targets.
5075
6159
  --document=<value> Only instances that reference this document (resource-qualified GDR URI, e.g.
5076
6160
  "dataset:proj:ds:article-1").
5077
6161
  --failed Only instances with at least one failed activity.
5078
6162
  --include-completed Include completed/aborted instances (default: in-flight only).
5079
6163
  --json Emit structured JSON instead of rendered output.
5080
6164
  --limit=<value> [default: 50] Maximum rows to return.
5081
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also
6165
+ --partition=<value> Workflow environment partition (e.g. prod, test) — an optional query filter that also
5082
6166
  narrows which resources are searched; omit to span them all.
6167
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its
6168
+ parents. Defaults to the current directory.
6169
+
6170
+ OVERRIDE FLAGS
6171
+ -d, --dataset=<name> Dataset to read (overrides sanity.workflow.ts)
6172
+ -p, --project-id=<id> Project ID of the dataset to read (overrides sanity.workflow.ts)
6173
+ --media-library-id=<id> Media library to read (overrides sanity.workflow.ts)
5083
6174
 
5084
6175
  DESCRIPTION
5085
- List workflow instances in the configured dataset (in-flight by default).
6176
+ List workflow instances (in-flight by default) across the resources sanity.workflow.ts declares, or in the one
6177
+ resource --project-id/--dataset or --media-library-id names.
5086
6178
 
5087
6179
  EXAMPLES
5088
6180
  $ sanity workflows list
@@ -5095,39 +6187,42 @@ EXAMPLES
5095
6187
 
5096
6188
  $ sanity workflows list --assignment-user gAda --assignment-role legal --assignment-state routed
5097
6189
 
5098
- $ sanity workflows list --tag prod
6190
+ $ sanity workflows list --partition prod
5099
6191
 
5100
6192
  $ sanity workflows list --json
5101
6193
  ```
5102
6194
 
5103
6195
  ## `sanity workflows nuke`
5104
6196
 
5105
- Delete engine-owned documents — a whole deployment tag, or a single instance.
6197
+ Delete engine-owned documents — a whole deployment partition, or a single instance.
5106
6198
 
5107
6199
  ```
5108
6200
  USAGE
5109
- $ sanity workflows nuke [--deployment <value>] [--tag <value>] [--instance <value>] [--force]
6201
+ $ sanity workflows nuke [--path <file|dir>] [--deployment <value>] [--partition <value>] [--instance <value>]
6202
+ [--force]
5110
6203
 
5111
6204
  FLAGS
5112
6205
  --deployment=<value> The deployment name to reset. With --instance, narrows which deployment the instance is looked
5113
- up in when its tag spans several.
6206
+ up in when its partition spans several.
5114
6207
  --force Skip the confirmation prompt (for scripts/CI). The plan still prints.
5115
- --instance=<value> Delete a single terminal instance by id, plus its guard docs, instead of a tag.
5116
- --tag=<value> The deployment tag to reset (while it names exactly one deployment). Not valid with --instance,
5117
- which reads its tag from the instance id.
6208
+ --instance=<value> Delete a single terminal instance by id, plus its guard docs, instead of a partition.
6209
+ --partition=<value> The deployment partition to reset (while it names exactly one deployment). Not valid with
6210
+ --instance, which reads its partition from the stored instance.
6211
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6212
+ Defaults to the current directory.
5118
6213
 
5119
6214
  DESCRIPTION
5120
- Delete engine-owned documents — a whole deployment tag, or a single instance.
6215
+ Delete engine-owned documents — a whole deployment partition, or a single instance.
5121
6216
 
5122
- The reset for a dataset holding engine documents the versioned upgrade framework cannot yet migrate: deletes the tag's
5123
- instances, definitions, and guards (across every alias-bound resource). --instance <id> instead deletes one terminal
5124
- instance plus its guards. Content documents are never touched. Prints a dry-run plan, then confirms (--force skips the
5125
- prompt; the plan still prints).
6217
+ The reset for a dataset holding engine documents the versioned upgrade framework cannot yet migrate: deletes the
6218
+ partition's instances, definitions, and guards (across every alias-bound resource). --instance <id> instead deletes
6219
+ one terminal instance plus its guards. Content documents are never touched. Prints a dry-run plan, then confirms
6220
+ (--force skips the prompt; the plan still prints).
5126
6221
 
5127
6222
  EXAMPLES
5128
6223
  $ sanity workflows nuke --deployment plugin-dev
5129
6224
 
5130
- $ sanity workflows nuke --tag plugin-dev --force
6225
+ $ sanity workflows nuke --partition plugin-dev --force
5131
6226
 
5132
6227
  $ sanity workflows nuke --instance plugin-dev.wf-instance.abc123
5133
6228
  ```
@@ -5138,18 +6233,21 @@ Reset a failed activity on an in-flight instance — back to active to re-run it
5138
6233
 
5139
6234
  ```
5140
6235
  USAGE
5141
- $ sanity workflows reset-activity INSTANCEID ACTIVITY [--deployment <value> | --tag <value>] [--skip]
6236
+ $ sanity workflows reset-activity INSTANCEID ACTIVITY [--path <file|dir>] [--deployment <value> | --partition <value>]
6237
+ [--skip]
5142
6238
 
5143
6239
  ARGUMENTS
5144
6240
  INSTANCEID Workflow instance id.
5145
6241
  ACTIVITY Activity name within the current stage.
5146
6242
 
5147
6243
  FLAGS
5148
- --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
6244
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the
5149
6245
  partition still comes from the loaded instance.
6246
+ --partition=<value> Workflow environment partition (e.g. prod, test) — narrows which resources are searched for the
6247
+ instance; the instance's stored partition is what the command uses.
6248
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6249
+ Defaults to the current directory.
5150
6250
  --skip Bypass the activity (mark it skipped) instead of re-running it (back to active).
5151
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
5152
- resources are searched; omit to span them all.
5153
6251
 
5154
6252
  DESCRIPTION
5155
6253
  Reset a failed activity on an in-flight instance — back to active to re-run it, or --skip to bypass it (mark it
@@ -5167,17 +6265,20 @@ Force an instance into a stage, regardless of its declared transitions and filte
5167
6265
 
5168
6266
  ```
5169
6267
  USAGE
5170
- $ sanity workflows set-stage INSTANCEID [--deployment <value> | --tag <value>] [--to <value>] [--reason <value>]
6268
+ $ sanity workflows set-stage INSTANCEID [--path <file|dir>] [--deployment <value> | --partition <value>] [--to <value>]
6269
+ [--reason <value>]
5171
6270
 
5172
6271
  ARGUMENTS
5173
6272
  INSTANCEID Workflow instance id to move.
5174
6273
 
5175
6274
  FLAGS
5176
- --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the tag
6275
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the
5177
6276
  partition still comes from the loaded instance.
6277
+ --partition=<value> Workflow environment partition (e.g. prod, test) — narrows which resources are searched for the
6278
+ instance; the instance's stored partition is what the command uses.
6279
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6280
+ Defaults to the current directory.
5178
6281
  --reason=<value> Free-text reason — recorded on the history entry for audit.
5179
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
5180
- resources are searched; omit to span them all.
5181
6282
  --to=<value> Target stage name. Omit on an interactive terminal to pick from the workflow’s stages.
5182
6283
 
5183
6284
  DESCRIPTION
@@ -5199,18 +6300,28 @@ Show the state, activities, and effects of a workflow instance.
5199
6300
 
5200
6301
  ```
5201
6302
  USAGE
5202
- $ sanity workflows show INSTANCEID [--tag <value>] [--include history...] [--json]
6303
+ $ sanity workflows show INSTANCEID [--media-library-id <id> | [-p <id> -d <name>] | | --path <file|dir> |
6304
+ [--deployment <value> | --partition <value>]] [--include history...] [--json]
5203
6305
 
5204
6306
  ARGUMENTS
5205
6307
  INSTANCEID Workflow instance document id.
5206
6308
 
5207
6309
  FLAGS
6310
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the
6311
+ partition still comes from the loaded instance.
5208
6312
  --include=<option>... [default: ] Optional sections to include in rendered output (--json always carries the full
5209
6313
  document).
5210
6314
  <options: history>
5211
6315
  --json Emit structured JSON instead of rendered output.
5212
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which
5213
- resources are searched; omit to span them all.
6316
+ --partition=<value> Workflow environment partition (e.g. prod, test) — narrows which resources are searched for the
6317
+ instance; the instance's stored partition is what the command uses.
6318
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6319
+ Defaults to the current directory.
6320
+
6321
+ OVERRIDE FLAGS
6322
+ -d, --dataset=<name> Dataset to read (overrides sanity.workflow.ts)
6323
+ -p, --project-id=<id> Project ID of the dataset to read (overrides sanity.workflow.ts)
6324
+ --media-library-id=<id> Media library to read (overrides sanity.workflow.ts)
5214
6325
 
5215
6326
  DESCRIPTION
5216
6327
  Show the state, activities, and effects of a workflow instance.
@@ -5229,8 +6340,8 @@ Start a workflow instance from a deployed definition. Supply values for the work
5229
6340
 
5230
6341
  ```
5231
6342
  USAGE
5232
- $ sanity workflows start NAME [--deployment <value> | --tag <value>] [--version <value>] [--field <value>...]
5233
- [--instance-id <value>] [--json]
6343
+ $ sanity workflows start NAME [--path <file|dir>] [--deployment <value> | --partition <value>] [--version <value>]
6344
+ [--field <value>...] [--instance-id <value>] [--json]
5234
6345
 
5235
6346
  ARGUMENTS
5236
6347
  NAME Workflow definition name.
@@ -5244,8 +6355,10 @@ FLAGS
5244
6355
  of a start that failed partway and the engine resumes it instead of creating a duplicate (an
5245
6356
  already-settled start replays as a no-op). Omit to mint a fresh id.
5246
6357
  --json Emit structured JSON instead of rendered output.
5247
- --tag=<value> Workflow environment tag (e.g. prod, test) — selects the deployment to act on while the tag
5248
- names exactly one; pass --deployment when it spans several.
6358
+ --partition=<value> Workflow environment partition (e.g. prod, test) — selects the deployment to act on while the
6359
+ partition names exactly one; pass --deployment when it spans several.
6360
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6361
+ Defaults to the current directory.
5249
6362
  --version=<value> Definition version to start from (default: highest deployed).
5250
6363
 
5251
6364
  DESCRIPTION
@@ -5257,7 +6370,7 @@ EXAMPLES
5257
6370
 
5258
6371
  $ sanity workflows start article-review --field subject='{"id":"dataset:proj:ds:article-1","type":"article"}'
5259
6372
 
5260
- $ sanity workflows start productLaunch --version 2 --tag prod
6373
+ $ sanity workflows start productLaunch --version 2 --partition prod
5261
6374
 
5262
6375
  $ sanity workflows start productLaunch --instance-id prod.wf-instance.a1b2c3d4e5f6
5263
6376
  ```
@@ -5268,14 +6381,24 @@ Stream new history entries on a workflow instance as they land in the dataset.
5268
6381
 
5269
6382
  ```
5270
6383
  USAGE
5271
- $ sanity workflows tail INSTANCEID [--tag <value>]
6384
+ $ sanity workflows tail INSTANCEID [--media-library-id <id> | [-p <id> -d <name>] | | --path <file|dir> |
6385
+ [--deployment <value> | --partition <value>]]
5272
6386
 
5273
6387
  ARGUMENTS
5274
6388
  INSTANCEID Workflow instance id to tail.
5275
6389
 
5276
6390
  FLAGS
5277
- --tag=<value> Workflow environment tag (e.g. prod, test) — an optional query filter that also narrows which resources
5278
- are searched; omit to span them all.
6391
+ --deployment=<value> Deployment name — narrow the instance search to the resource that deployment targets; the
6392
+ partition still comes from the loaded instance.
6393
+ --partition=<value> Workflow environment partition (e.g. prod, test) — narrows which resources are searched for the
6394
+ instance; the instance's stored partition is what the command uses.
6395
+ --path=<file|dir> Path to a sanity.workflow file, or a directory to search from upward through its parents.
6396
+ Defaults to the current directory.
6397
+
6398
+ OVERRIDE FLAGS
6399
+ -d, --dataset=<name> Dataset to read (overrides sanity.workflow.ts)
6400
+ -p, --project-id=<id> Project ID of the dataset to read (overrides sanity.workflow.ts)
6401
+ --media-library-id=<id> Media library to read (overrides sanity.workflow.ts)
5279
6402
 
5280
6403
  DESCRIPTION
5281
6404
  Stream new history entries on a workflow instance as they land in the dataset.