@sanity/cli 5.9.0-next.8 → 6.0.0-alpha.11

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 (919) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3212 -2
  3. package/bin/run.cmd +3 -0
  4. package/bin/run.js +33 -0
  5. package/codemods/deskRename.js +115 -96
  6. package/codemods/partsTypeDirective.js +7 -7
  7. package/codemods/reactIconsV3.js +78 -51
  8. package/dist/SanityHelp.js +43 -0
  9. package/dist/SanityHelp.js.map +1 -0
  10. package/dist/actions/auth/authServer.js +153 -0
  11. package/dist/actions/auth/authServer.js.map +1 -0
  12. package/dist/actions/auth/getProviderName.js +15 -0
  13. package/dist/actions/auth/getProviderName.js.map +1 -0
  14. package/dist/actions/auth/login/getProvider.js +54 -0
  15. package/dist/actions/auth/login/getProvider.js.map +1 -0
  16. package/dist/actions/auth/login/getSSOProvider.js +30 -0
  17. package/dist/actions/auth/login/getSSOProvider.js.map +1 -0
  18. package/dist/actions/auth/login/login.js +101 -0
  19. package/dist/actions/auth/login/login.js.map +1 -0
  20. package/dist/actions/auth/login/promptProviders.js +23 -0
  21. package/dist/actions/auth/login/promptProviders.js.map +1 -0
  22. package/dist/actions/auth/login/samlProviderToLoginProvider.js +15 -0
  23. package/dist/actions/auth/login/samlProviderToLoginProvider.js.map +1 -0
  24. package/dist/actions/auth/types.js +7 -0
  25. package/dist/actions/auth/types.js.map +1 -0
  26. package/dist/actions/backup/archiveDir.js +43 -0
  27. package/dist/actions/backup/archiveDir.js.map +1 -0
  28. package/dist/actions/backup/assertDatasetExist.js +16 -0
  29. package/dist/actions/backup/assertDatasetExist.js.map +1 -0
  30. package/dist/actions/backup/backupDownloadDebug.js +4 -0
  31. package/dist/actions/backup/backupDownloadDebug.js.map +1 -0
  32. package/dist/actions/backup/cleanupTmpDir.js +19 -0
  33. package/dist/actions/backup/cleanupTmpDir.js.map +1 -0
  34. package/dist/actions/backup/constants.js +3 -0
  35. package/dist/actions/backup/constants.js.map +1 -0
  36. package/dist/actions/backup/downloadAsset.js +54 -0
  37. package/dist/actions/backup/downloadAsset.js.map +1 -0
  38. package/dist/actions/backup/downloadDocument.js +32 -0
  39. package/dist/actions/backup/downloadDocument.js.map +1 -0
  40. package/dist/actions/backup/fetchNextBackupPage.js +48 -0
  41. package/dist/actions/backup/fetchNextBackupPage.js.map +1 -0
  42. package/dist/actions/backup/progressSpinner.js +40 -0
  43. package/dist/actions/backup/progressSpinner.js.map +1 -0
  44. package/dist/actions/build/buildApp.js +159 -0
  45. package/dist/actions/build/buildApp.js.map +1 -0
  46. package/dist/actions/build/buildDebug.js +4 -0
  47. package/dist/actions/build/buildDebug.js.map +1 -0
  48. package/dist/actions/build/buildStaticFiles.js +82 -0
  49. package/dist/actions/build/buildStaticFiles.js.map +1 -0
  50. package/dist/actions/build/buildStudio.js +202 -0
  51. package/dist/actions/build/buildStudio.js.map +1 -0
  52. package/dist/actions/build/buildVendorDependencies.js +179 -0
  53. package/dist/actions/build/buildVendorDependencies.js.map +1 -0
  54. package/dist/actions/build/checkRequiredDependencies.js +122 -0
  55. package/dist/actions/build/checkRequiredDependencies.js.map +1 -0
  56. package/dist/actions/build/checkStudioDependencyVersions.js +154 -0
  57. package/dist/actions/build/checkStudioDependencyVersions.js.map +1 -0
  58. package/dist/actions/build/createExternalFromImportMap.js +11 -0
  59. package/dist/actions/build/createExternalFromImportMap.js.map +1 -0
  60. package/dist/actions/build/decorateIndexWithAutoGeneratedWarning.js +13 -0
  61. package/dist/actions/build/decorateIndexWithAutoGeneratedWarning.js.map +1 -0
  62. package/dist/actions/build/decorateIndexWithBridgeScript.js +17 -0
  63. package/dist/actions/build/decorateIndexWithBridgeScript.js.map +1 -0
  64. package/dist/actions/build/determineBasePath.js +20 -0
  65. package/dist/actions/build/determineBasePath.js.map +1 -0
  66. package/dist/actions/build/generateWebManifest.js +27 -0
  67. package/dist/actions/build/generateWebManifest.js.map +1 -0
  68. package/dist/actions/build/getAppEnvVars.js +9 -0
  69. package/dist/actions/build/getAppEnvVars.js.map +1 -0
  70. package/dist/actions/build/getAutoUpdatesImportMap.js +57 -0
  71. package/dist/actions/build/getAutoUpdatesImportMap.js.map +1 -0
  72. package/dist/actions/build/getEntryModule.js +46 -0
  73. package/dist/actions/build/getEntryModule.js.map +1 -0
  74. package/dist/actions/build/getPossibleDocumentComponentLocations.js +11 -0
  75. package/dist/actions/build/getPossibleDocumentComponentLocations.js.map +1 -0
  76. package/dist/actions/build/getStudioEnvVars.js +9 -0
  77. package/dist/actions/build/getStudioEnvVars.js.map +1 -0
  78. package/dist/actions/build/getStudioEnvironmentVariables.js +58 -0
  79. package/dist/actions/build/getStudioEnvironmentVariables.js.map +1 -0
  80. package/dist/actions/build/getViteConfig.js +180 -0
  81. package/dist/actions/build/getViteConfig.js.map +1 -0
  82. package/dist/actions/build/normalizeBasePath.js +9 -0
  83. package/dist/actions/build/normalizeBasePath.js.map +1 -0
  84. package/dist/actions/build/renderDocument.js +54 -0
  85. package/dist/actions/build/renderDocument.js.map +1 -0
  86. package/dist/actions/build/renderDocument.worker.js +9 -0
  87. package/dist/actions/build/renderDocument.worker.js.map +1 -0
  88. package/dist/actions/build/renderDocumentWorker/addTimestampImportMapScriptToHtml.js +59 -0
  89. package/dist/actions/build/renderDocumentWorker/addTimestampImportMapScriptToHtml.js.map +1 -0
  90. package/dist/actions/build/renderDocumentWorker/components/BasicDocument.js +61 -0
  91. package/dist/actions/build/renderDocumentWorker/components/BasicDocument.js.map +1 -0
  92. package/dist/actions/build/renderDocumentWorker/components/DefaultDocument.js +165 -0
  93. package/dist/actions/build/renderDocumentWorker/components/DefaultDocument.js.map +1 -0
  94. package/dist/actions/build/renderDocumentWorker/components/Favicons.js +28 -0
  95. package/dist/actions/build/renderDocumentWorker/components/Favicons.js.map +1 -0
  96. package/dist/actions/build/renderDocumentWorker/components/GlobalErrorHandler.js +177 -0
  97. package/dist/actions/build/renderDocumentWorker/components/GlobalErrorHandler.js.map +1 -0
  98. package/dist/actions/build/renderDocumentWorker/components/NoJavascript.js +51 -0
  99. package/dist/actions/build/renderDocumentWorker/components/NoJavascript.js.map +1 -0
  100. package/dist/actions/build/renderDocumentWorker/getDocumentComponent.js +41 -0
  101. package/dist/actions/build/renderDocumentWorker/getDocumentComponent.js.map +1 -0
  102. package/dist/actions/build/renderDocumentWorker/getDocumentHtml.js +55 -0
  103. package/dist/actions/build/renderDocumentWorker/getDocumentHtml.js.map +1 -0
  104. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js +31 -0
  105. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js.map +1 -0
  106. package/dist/actions/build/renderDocumentWorker/tryLoadDocumentComponent.js +30 -0
  107. package/dist/actions/build/renderDocumentWorker/tryLoadDocumentComponent.js.map +1 -0
  108. package/dist/actions/build/renderDocumentWorker/types.js +5 -0
  109. package/dist/actions/build/renderDocumentWorker/types.js.map +1 -0
  110. package/dist/actions/build/shouldAutoUpdate.js +35 -0
  111. package/dist/actions/build/shouldAutoUpdate.js.map +1 -0
  112. package/dist/actions/build/types.js +3 -0
  113. package/dist/actions/build/types.js.map +1 -0
  114. package/dist/actions/build/writeFavicons.js +26 -0
  115. package/dist/actions/build/writeFavicons.js.map +1 -0
  116. package/dist/actions/build/writeSanityRuntime.js +61 -0
  117. package/dist/actions/build/writeSanityRuntime.js.map +1 -0
  118. package/dist/actions/build/writeWebManifest.js +12 -0
  119. package/dist/actions/build/writeWebManifest.js.map +1 -0
  120. package/dist/actions/codemods/deskRename.js +18 -0
  121. package/dist/actions/codemods/deskRename.js.map +1 -0
  122. package/dist/actions/codemods/index.js +10 -0
  123. package/dist/actions/codemods/index.js.map +1 -0
  124. package/dist/actions/codemods/partsTypeDirective.js +27 -0
  125. package/dist/actions/codemods/partsTypeDirective.js.map +1 -0
  126. package/dist/actions/codemods/reactIconsV3.js +30 -0
  127. package/dist/actions/codemods/reactIconsV3.js.map +1 -0
  128. package/dist/actions/codemods/types.js +3 -0
  129. package/dist/actions/codemods/types.js.map +1 -0
  130. package/dist/actions/cors/filterAndValidateOrigin.js +38 -0
  131. package/dist/actions/cors/filterAndValidateOrigin.js.map +1 -0
  132. package/dist/actions/dataset/create.js +46 -0
  133. package/dist/actions/dataset/create.js.map +1 -0
  134. package/dist/actions/dataset/determineDatasetAclMode.js +36 -0
  135. package/dist/actions/dataset/determineDatasetAclMode.js.map +1 -0
  136. package/dist/actions/dataset/processAliasName.js +20 -0
  137. package/dist/actions/dataset/processAliasName.js.map +1 -0
  138. package/dist/actions/dataset/validateDatasetAliasName.js +28 -0
  139. package/dist/actions/dataset/validateDatasetAliasName.js.map +1 -0
  140. package/dist/actions/dataset/validateDatasetName.js +39 -0
  141. package/dist/actions/dataset/validateDatasetName.js.map +1 -0
  142. package/dist/actions/debug/gatherDebugInfo.js +104 -0
  143. package/dist/actions/debug/gatherDebugInfo.js.map +1 -0
  144. package/dist/actions/debug/getGlobalConfigLocation.js +7 -0
  145. package/dist/actions/debug/getGlobalConfigLocation.js.map +1 -0
  146. package/dist/actions/debug/types.js +3 -0
  147. package/dist/actions/debug/types.js.map +1 -0
  148. package/dist/actions/deploy/checkDir.js +31 -0
  149. package/dist/actions/deploy/checkDir.js.map +1 -0
  150. package/dist/actions/deploy/createStudioUserApplication.js +59 -0
  151. package/dist/actions/deploy/createStudioUserApplication.js.map +1 -0
  152. package/dist/actions/deploy/createUserApplicationForApp.js +56 -0
  153. package/dist/actions/deploy/createUserApplicationForApp.js.map +1 -0
  154. package/dist/actions/deploy/deployApp.js +162 -0
  155. package/dist/actions/deploy/deployApp.js.map +1 -0
  156. package/dist/actions/deploy/deployDebug.js +4 -0
  157. package/dist/actions/deploy/deployDebug.js.map +1 -0
  158. package/dist/actions/deploy/deployStudio.js +134 -0
  159. package/dist/actions/deploy/deployStudio.js.map +1 -0
  160. package/dist/actions/deploy/findUserApplicationForApp.js +110 -0
  161. package/dist/actions/deploy/findUserApplicationForApp.js.map +1 -0
  162. package/dist/actions/deploy/findUserApplicationForStudio.js +143 -0
  163. package/dist/actions/deploy/findUserApplicationForStudio.js.map +1 -0
  164. package/dist/actions/deploy/types.js +3 -0
  165. package/dist/actions/deploy/types.js.map +1 -0
  166. package/dist/actions/dev/devAction.js +7 -0
  167. package/dist/actions/dev/devAction.js.map +1 -0
  168. package/dist/actions/dev/devDebug.js +4 -0
  169. package/dist/actions/dev/devDebug.js.map +1 -0
  170. package/dist/actions/dev/getCoreAppUrl.js +10 -0
  171. package/dist/actions/dev/getCoreAppUrl.js.map +1 -0
  172. package/dist/actions/dev/getDevServerConfig.js +28 -0
  173. package/dist/actions/dev/getDevServerConfig.js.map +1 -0
  174. package/dist/actions/dev/startAppDevServer.js +57 -0
  175. package/dist/actions/dev/startAppDevServer.js.map +1 -0
  176. package/dist/actions/dev/startStudioDevServer.js +154 -0
  177. package/dist/actions/dev/startStudioDevServer.js.map +1 -0
  178. package/dist/actions/dev/types.js +3 -0
  179. package/dist/actions/dev/types.js.map +1 -0
  180. package/dist/actions/docs/normalizeDocsPath.js +15 -0
  181. package/dist/actions/docs/normalizeDocsPath.js.map +1 -0
  182. package/dist/actions/documents/constants.js +3 -0
  183. package/dist/actions/documents/constants.js.map +1 -0
  184. package/dist/actions/documents/editor.js +26 -0
  185. package/dist/actions/documents/editor.js.map +1 -0
  186. package/dist/actions/documents/types.js +3 -0
  187. package/dist/actions/documents/types.js.map +1 -0
  188. package/dist/actions/documents/validate.js +60 -0
  189. package/dist/actions/documents/validate.js.map +1 -0
  190. package/dist/actions/documents/validateDocuments.worker.js +251 -0
  191. package/dist/actions/documents/validateDocuments.worker.js.map +1 -0
  192. package/dist/actions/documents/validation/reporters/index.js +10 -0
  193. package/dist/actions/documents/validation/reporters/index.js.map +1 -0
  194. package/dist/actions/documents/validation/reporters/jsonReporter.js +25 -0
  195. package/dist/actions/documents/validation/reporters/jsonReporter.js.map +1 -0
  196. package/dist/actions/documents/validation/reporters/ndjsonReporter.js +18 -0
  197. package/dist/actions/documents/validation/reporters/ndjsonReporter.js.map +1 -0
  198. package/dist/actions/documents/validation/reporters/prettyReporter/formatDocumentValidation.js +62 -0
  199. package/dist/actions/documents/validation/reporters/prettyReporter/formatDocumentValidation.js.map +1 -0
  200. package/dist/actions/documents/validation/reporters/prettyReporter/index.js +3 -0
  201. package/dist/actions/documents/validation/reporters/prettyReporter/index.js.map +1 -0
  202. package/dist/actions/documents/validation/reporters/prettyReporter/prettyReporter.js +92 -0
  203. package/dist/actions/documents/validation/reporters/prettyReporter/prettyReporter.js.map +1 -0
  204. package/dist/actions/documents/validation/reporters/prettyReporter/util.js +45 -0
  205. package/dist/actions/documents/validation/reporters/prettyReporter/util.js.map +1 -0
  206. package/dist/actions/exec/configClient.worker.js +9 -0
  207. package/dist/actions/exec/configClient.worker.js.map +1 -0
  208. package/dist/actions/exec/execScript.js +77 -0
  209. package/dist/actions/exec/execScript.js.map +1 -0
  210. package/dist/actions/exec/registerBrowserEnv.worker.js +17 -0
  211. package/dist/actions/exec/registerBrowserEnv.worker.js.map +1 -0
  212. package/dist/actions/graphql/SchemaError.js +37 -0
  213. package/dist/actions/graphql/SchemaError.js.map +1 -0
  214. package/dist/actions/graphql/extractFromSanitySchema.js +659 -0
  215. package/dist/actions/graphql/extractFromSanitySchema.js.map +1 -0
  216. package/dist/actions/graphql/gen1/generateTypeFilters.js +226 -0
  217. package/dist/actions/graphql/gen1/generateTypeFilters.js.map +1 -0
  218. package/dist/actions/graphql/gen1/generateTypeQueries.js +85 -0
  219. package/dist/actions/graphql/gen1/generateTypeQueries.js.map +1 -0
  220. package/dist/actions/graphql/gen1/index.js +19 -0
  221. package/dist/actions/graphql/gen1/index.js.map +1 -0
  222. package/dist/actions/graphql/gen2/filters/booleanFilters.js +26 -0
  223. package/dist/actions/graphql/gen2/filters/booleanFilters.js.map +1 -0
  224. package/dist/actions/graphql/gen2/filters/dateFilters.js +46 -0
  225. package/dist/actions/graphql/gen2/filters/dateFilters.js.map +1 -0
  226. package/dist/actions/graphql/gen2/filters/dateTimeFilters.js +46 -0
  227. package/dist/actions/graphql/gen2/filters/dateTimeFilters.js.map +1 -0
  228. package/dist/actions/graphql/gen2/filters/documentFilters.js +21 -0
  229. package/dist/actions/graphql/gen2/filters/documentFilters.js.map +1 -0
  230. package/dist/actions/graphql/gen2/filters/floatFilters.js +46 -0
  231. package/dist/actions/graphql/gen2/filters/floatFilters.js.map +1 -0
  232. package/dist/actions/graphql/gen2/filters/idFilters.js +44 -0
  233. package/dist/actions/graphql/gen2/filters/idFilters.js.map +1 -0
  234. package/dist/actions/graphql/gen2/filters/integerFilters.js +46 -0
  235. package/dist/actions/graphql/gen2/filters/integerFilters.js.map +1 -0
  236. package/dist/actions/graphql/gen2/filters/stringFilters.js +49 -0
  237. package/dist/actions/graphql/gen2/filters/stringFilters.js.map +1 -0
  238. package/dist/actions/graphql/gen2/generateTypeFilters.js +85 -0
  239. package/dist/actions/graphql/gen2/generateTypeFilters.js.map +1 -0
  240. package/dist/actions/graphql/gen2/generateTypeQueries.js +107 -0
  241. package/dist/actions/graphql/gen2/generateTypeQueries.js.map +1 -0
  242. package/dist/actions/graphql/gen2/generateTypeSortings.js +70 -0
  243. package/dist/actions/graphql/gen2/generateTypeSortings.js.map +1 -0
  244. package/dist/actions/graphql/gen2/index.js +22 -0
  245. package/dist/actions/graphql/gen2/index.js.map +1 -0
  246. package/dist/actions/graphql/gen3/filters/documentFilters.js +21 -0
  247. package/dist/actions/graphql/gen3/filters/documentFilters.js.map +1 -0
  248. package/dist/actions/graphql/gen3/generateTypeFilters.js +101 -0
  249. package/dist/actions/graphql/gen3/generateTypeFilters.js.map +1 -0
  250. package/dist/actions/graphql/gen3/generateTypeQueries.js +104 -0
  251. package/dist/actions/graphql/gen3/generateTypeQueries.js.map +1 -0
  252. package/dist/actions/graphql/gen3/generateTypeSortings.js +70 -0
  253. package/dist/actions/graphql/gen3/generateTypeSortings.js.map +1 -0
  254. package/dist/actions/graphql/gen3/index.js +31 -0
  255. package/dist/actions/graphql/gen3/index.js.map +1 -0
  256. package/dist/actions/graphql/gen3/utils.js +12 -0
  257. package/dist/actions/graphql/gen3/utils.js.map +1 -0
  258. package/dist/actions/graphql/getGraphQLAPIs.js +65 -0
  259. package/dist/actions/graphql/getGraphQLAPIs.js.map +1 -0
  260. package/dist/actions/graphql/getGraphQLAPIs.worker.js +126 -0
  261. package/dist/actions/graphql/getGraphQLAPIs.worker.js.map +1 -0
  262. package/dist/actions/graphql/graphqlDebug.js +4 -0
  263. package/dist/actions/graphql/graphqlDebug.js.map +1 -0
  264. package/dist/actions/graphql/helpUrls.js +3 -0
  265. package/dist/actions/graphql/helpUrls.js.map +1 -0
  266. package/dist/actions/graphql/helpers.js +11 -0
  267. package/dist/actions/graphql/helpers.js.map +1 -0
  268. package/dist/actions/graphql/resolveApiGeneration.js +43 -0
  269. package/dist/actions/graphql/resolveApiGeneration.js.map +1 -0
  270. package/dist/actions/graphql/types.js +3 -0
  271. package/dist/actions/graphql/types.js.map +1 -0
  272. package/dist/actions/hook/constants.js +3 -0
  273. package/dist/actions/hook/constants.js.map +1 -0
  274. package/dist/actions/hook/formatFailure.js +29 -0
  275. package/dist/actions/hook/formatFailure.js.map +1 -0
  276. package/dist/actions/hook/types.js +3 -0
  277. package/dist/actions/hook/types.js.map +1 -0
  278. package/dist/actions/init/bootstrapLocalTemplate.js +137 -0
  279. package/dist/actions/init/bootstrapLocalTemplate.js.map +1 -0
  280. package/dist/actions/init/bootstrapRemoteTemplate.js +109 -0
  281. package/dist/actions/init/bootstrapRemoteTemplate.js.map +1 -0
  282. package/dist/actions/init/bootstrapTemplate.js +32 -0
  283. package/dist/actions/init/bootstrapTemplate.js.map +1 -0
  284. package/dist/actions/init/checkNextJsReactCompatibility.js +21 -0
  285. package/dist/actions/init/checkNextJsReactCompatibility.js.map +1 -0
  286. package/dist/actions/init/constants.js +3 -0
  287. package/dist/actions/init/constants.js.map +1 -0
  288. package/dist/actions/init/countNestedFolders.js +6 -0
  289. package/dist/actions/init/countNestedFolders.js.map +1 -0
  290. package/dist/actions/init/createAppCliConfig.js +19 -0
  291. package/dist/actions/init/createAppCliConfig.js.map +1 -0
  292. package/dist/actions/init/createCliConfig.js +27 -0
  293. package/dist/actions/init/createCliConfig.js.map +1 -0
  294. package/dist/actions/init/createPackageManifest.js +86 -0
  295. package/dist/actions/init/createPackageManifest.js.map +1 -0
  296. package/dist/actions/init/createStudioConfig.js +41 -0
  297. package/dist/actions/init/createStudioConfig.js.map +1 -0
  298. package/dist/actions/init/determineAppTemplate.js +16 -0
  299. package/dist/actions/init/determineAppTemplate.js.map +1 -0
  300. package/dist/actions/init/env/createOrAppendEnvVars.js +25 -0
  301. package/dist/actions/init/env/createOrAppendEnvVars.js.map +1 -0
  302. package/dist/actions/init/env/parseAndUpdateEnvVars.js +42 -0
  303. package/dist/actions/init/env/parseAndUpdateEnvVars.js.map +1 -0
  304. package/dist/actions/init/env/writeEnvVarsToFile.js +49 -0
  305. package/dist/actions/init/env/writeEnvVarsToFile.js.map +1 -0
  306. package/dist/actions/init/fetchPostInitPrompt.js +30 -0
  307. package/dist/actions/init/fetchPostInitPrompt.js.map +1 -0
  308. package/dist/actions/init/git.js +65 -0
  309. package/dist/actions/init/git.js.map +1 -0
  310. package/dist/actions/init/processTemplate.js +56 -0
  311. package/dist/actions/init/processTemplate.js.map +1 -0
  312. package/dist/actions/init/remoteTemplate.js +211 -0
  313. package/dist/actions/init/remoteTemplate.js.map +1 -0
  314. package/dist/actions/init/resolvePackageManager.js +20 -0
  315. package/dist/actions/init/resolvePackageManager.js.map +1 -0
  316. package/dist/actions/init/templates/appQuickstart.js +28 -0
  317. package/dist/actions/init/templates/appQuickstart.js.map +1 -0
  318. package/dist/actions/init/templates/appSanityUi.js +30 -0
  319. package/dist/actions/init/templates/appSanityUi.js.map +1 -0
  320. package/dist/actions/init/templates/blog.js +4 -0
  321. package/dist/actions/init/templates/blog.js.map +1 -0
  322. package/dist/actions/init/templates/clean.js +4 -0
  323. package/dist/actions/init/templates/clean.js.map +1 -0
  324. package/dist/actions/init/templates/getStarted.js +35 -0
  325. package/dist/actions/init/templates/getStarted.js.map +1 -0
  326. package/dist/actions/init/templates/index.js +23 -0
  327. package/dist/actions/init/templates/index.js.map +1 -0
  328. package/dist/actions/init/templates/moviedb.js +34 -0
  329. package/dist/actions/init/templates/moviedb.js.map +1 -0
  330. package/dist/actions/init/templates/nextjs/index.js +213 -0
  331. package/dist/actions/init/templates/nextjs/index.js.map +1 -0
  332. package/dist/actions/init/templates/nextjs/schemaTypes/blog.js +247 -0
  333. package/dist/actions/init/templates/nextjs/schemaTypes/blog.js.map +1 -0
  334. package/dist/actions/init/templates/quickstart.js +4 -0
  335. package/dist/actions/init/templates/quickstart.js.map +1 -0
  336. package/dist/actions/init/templates/shopify.js +77 -0
  337. package/dist/actions/init/templates/shopify.js.map +1 -0
  338. package/dist/actions/init/templates/shopifyOnline.js +49 -0
  339. package/dist/actions/init/templates/shopifyOnline.js.map +1 -0
  340. package/dist/actions/init/types.js +3 -0
  341. package/dist/actions/init/types.js.map +1 -0
  342. package/dist/actions/init/updateInitialTemplateMetadata.js +17 -0
  343. package/dist/actions/init/updateInitialTemplateMetadata.js.map +1 -0
  344. package/dist/actions/manifest/SchemaIcon.js +21 -0
  345. package/dist/actions/manifest/SchemaIcon.js.map +1 -0
  346. package/dist/actions/manifest/extractAppManifest.js +51 -0
  347. package/dist/actions/manifest/extractAppManifest.js.map +1 -0
  348. package/dist/actions/manifest/extractManifest.js +93 -0
  349. package/dist/actions/manifest/extractManifest.js.map +1 -0
  350. package/dist/actions/manifest/extractWorkspaceManifest.js +406 -0
  351. package/dist/actions/manifest/extractWorkspaceManifest.js.map +1 -0
  352. package/dist/actions/manifest/purifyConfig.js +307 -0
  353. package/dist/actions/manifest/purifyConfig.js.map +1 -0
  354. package/dist/actions/manifest/schemaTypeHelpers.js +110 -0
  355. package/dist/actions/manifest/schemaTypeHelpers.js.map +1 -0
  356. package/dist/actions/manifest/types.js +5 -0
  357. package/dist/actions/manifest/types.js.map +1 -0
  358. package/dist/actions/mcp/detectAvailableEditors.js +75 -0
  359. package/dist/actions/mcp/detectAvailableEditors.js.map +1 -0
  360. package/dist/actions/mcp/editorConfigs.js +147 -0
  361. package/dist/actions/mcp/editorConfigs.js.map +1 -0
  362. package/dist/actions/mcp/promptForMCPSetup.js +24 -0
  363. package/dist/actions/mcp/promptForMCPSetup.js.map +1 -0
  364. package/dist/actions/mcp/setupMCP.js +88 -0
  365. package/dist/actions/mcp/setupMCP.js.map +1 -0
  366. package/dist/actions/mcp/types.js +3 -0
  367. package/dist/actions/mcp/types.js.map +1 -0
  368. package/dist/actions/mcp/writeMCPConfig.js +41 -0
  369. package/dist/actions/mcp/writeMCPConfig.js.map +1 -0
  370. package/dist/actions/media/__tests__/createMockClient.js +32 -0
  371. package/dist/actions/media/__tests__/createMockClient.js.map +1 -0
  372. package/dist/actions/media/getMediaLibraryConfig.js +5 -0
  373. package/dist/actions/media/getMediaLibraryConfig.js.map +1 -0
  374. package/dist/actions/media/importAspects.js +112 -0
  375. package/dist/actions/media/importAspects.js.map +1 -0
  376. package/dist/actions/media/importMedia.js +213 -0
  377. package/dist/actions/media/importMedia.js.map +1 -0
  378. package/dist/actions/media/importMediaDebug.js +4 -0
  379. package/dist/actions/media/importMediaDebug.js.map +1 -0
  380. package/dist/actions/organizations/getOrganization.js +67 -0
  381. package/dist/actions/organizations/getOrganization.js.map +1 -0
  382. package/dist/actions/organizations/getOrganizationChoices.js +23 -0
  383. package/dist/actions/organizations/getOrganizationChoices.js.map +1 -0
  384. package/dist/actions/organizations/getOrganizationsWithAttachGrantInfo.js +9 -0
  385. package/dist/actions/organizations/getOrganizationsWithAttachGrantInfo.js.map +1 -0
  386. package/dist/actions/organizations/hasProjectAttachGrant.js +24 -0
  387. package/dist/actions/organizations/hasProjectAttachGrant.js.map +1 -0
  388. package/dist/actions/organizations/validateOrganizationName.js +10 -0
  389. package/dist/actions/organizations/validateOrganizationName.js.map +1 -0
  390. package/dist/actions/preview/getPreviewServerConfig.js +16 -0
  391. package/dist/actions/preview/getPreviewServerConfig.js.map +1 -0
  392. package/dist/actions/preview/previewAction.js +20 -0
  393. package/dist/actions/preview/previewAction.js.map +1 -0
  394. package/dist/actions/preview/types.js +3 -0
  395. package/dist/actions/preview/types.js.map +1 -0
  396. package/dist/actions/projects/getManageUrl.js +7 -0
  397. package/dist/actions/projects/getManageUrl.js.map +1 -0
  398. package/dist/actions/projects/validateProjectName.js +11 -0
  399. package/dist/actions/projects/validateProjectName.js.map +1 -0
  400. package/dist/actions/schema/deleteSchemaAction.js +101 -0
  401. package/dist/actions/schema/deleteSchemaAction.js.map +1 -0
  402. package/dist/actions/schema/deploySchemas.js +98 -0
  403. package/dist/actions/schema/deploySchemas.js.map +1 -0
  404. package/dist/actions/schema/extractSanitySchema.worker.js +38 -0
  405. package/dist/actions/schema/extractSanitySchema.worker.js.map +1 -0
  406. package/dist/actions/schema/extractSchema.js +77 -0
  407. package/dist/actions/schema/extractSchema.js.map +1 -0
  408. package/dist/actions/schema/formatSchemaValidation.js +74 -0
  409. package/dist/actions/schema/formatSchemaValidation.js.map +1 -0
  410. package/dist/actions/schema/listSchemas.js +119 -0
  411. package/dist/actions/schema/listSchemas.js.map +1 -0
  412. package/dist/actions/schema/metafile.js +51 -0
  413. package/dist/actions/schema/metafile.js.map +1 -0
  414. package/dist/actions/schema/schemaStoreTypes.js +19 -0
  415. package/dist/actions/schema/schemaStoreTypes.js.map +1 -0
  416. package/dist/actions/schema/types.js +9 -0
  417. package/dist/actions/schema/types.js.map +1 -0
  418. package/dist/actions/schema/utils/debug.js +6 -0
  419. package/dist/actions/schema/utils/debug.js.map +1 -0
  420. package/dist/actions/schema/utils/extractValidationFromSchemaError.js +12 -0
  421. package/dist/actions/schema/utils/extractValidationFromSchemaError.js.map +1 -0
  422. package/dist/actions/schema/utils/manifestExtractor.js +33 -0
  423. package/dist/actions/schema/utils/manifestExtractor.js.map +1 -0
  424. package/dist/actions/schema/utils/manifestReader.js +71 -0
  425. package/dist/actions/schema/utils/manifestReader.js.map +1 -0
  426. package/dist/actions/schema/utils/schemaStoreOutStrings.js +11 -0
  427. package/dist/actions/schema/utils/schemaStoreOutStrings.js.map +1 -0
  428. package/dist/actions/schema/utils/schemaStoreValidation.js +108 -0
  429. package/dist/actions/schema/utils/schemaStoreValidation.js.map +1 -0
  430. package/dist/actions/schema/utils/uniqByProjectIdDataset.js +9 -0
  431. package/dist/actions/schema/utils/uniqByProjectIdDataset.js.map +1 -0
  432. package/dist/actions/schema/utils/workspaceSchemaId.js +23 -0
  433. package/dist/actions/schema/utils/workspaceSchemaId.js.map +1 -0
  434. package/dist/actions/schema/validateAction.js +71 -0
  435. package/dist/actions/schema/validateAction.js.map +1 -0
  436. package/dist/actions/schema/validateSchema.worker.js +124 -0
  437. package/dist/actions/schema/validateSchema.worker.js.map +1 -0
  438. package/dist/actions/telemetry/getLearnMoreMessage.js +15 -0
  439. package/dist/actions/telemetry/getLearnMoreMessage.js.map +1 -0
  440. package/dist/actions/telemetry/getStatusDisplay.js +26 -0
  441. package/dist/actions/telemetry/getStatusDisplay.js.map +1 -0
  442. package/dist/actions/telemetry/getStatusMessage.js +36 -0
  443. package/dist/actions/telemetry/getStatusMessage.js.map +1 -0
  444. package/dist/actions/telemetry/resolveConsent.js +48 -0
  445. package/dist/actions/telemetry/resolveConsent.js.map +1 -0
  446. package/dist/actions/telemetry/setConsent.js +83 -0
  447. package/dist/actions/telemetry/setConsent.js.map +1 -0
  448. package/dist/actions/telemetry/telemetryDebug.js +4 -0
  449. package/dist/actions/telemetry/telemetryDebug.js.map +1 -0
  450. package/dist/actions/telemetry/telemetryDisclosure.js +33 -0
  451. package/dist/actions/telemetry/telemetryDisclosure.js.map +1 -0
  452. package/dist/actions/telemetry/telemetryLearnMoreMessage.js +15 -0
  453. package/dist/actions/telemetry/telemetryLearnMoreMessage.js.map +1 -0
  454. package/dist/actions/tokens/constants.js +5 -0
  455. package/dist/actions/tokens/constants.js.map +1 -0
  456. package/dist/actions/tokens/types.js +3 -0
  457. package/dist/actions/tokens/types.js.map +1 -0
  458. package/dist/actions/tokens/validateRole.js +23 -0
  459. package/dist/actions/tokens/validateRole.js.map +1 -0
  460. package/dist/actions/undeploy/getStudioOrAppUserApplication.js +36 -0
  461. package/dist/actions/undeploy/getStudioOrAppUserApplication.js.map +1 -0
  462. package/dist/actions/users/getMembersForProject.js +47 -0
  463. package/dist/actions/users/getMembersForProject.js.map +1 -0
  464. package/dist/actions/users/getPendingInvitations.js +15 -0
  465. package/dist/actions/users/getPendingInvitations.js.map +1 -0
  466. package/dist/actions/users/types.js +3 -0
  467. package/dist/actions/users/types.js.map +1 -0
  468. package/dist/actions/users/usersDebug.js +4 -0
  469. package/dist/actions/users/usersDebug.js.map +1 -0
  470. package/dist/actions/users/validateEmail.js +14 -0
  471. package/dist/actions/users/validateEmail.js.map +1 -0
  472. package/dist/actions/versions/buildPackageArray.js +44 -0
  473. package/dist/actions/versions/buildPackageArray.js.map +1 -0
  474. package/dist/actions/versions/filterSanityModules.js +20 -0
  475. package/dist/actions/versions/filterSanityModules.js.map +1 -0
  476. package/dist/actions/versions/findSanityModulesVersions.js +47 -0
  477. package/dist/actions/versions/findSanityModulesVersions.js.map +1 -0
  478. package/dist/actions/versions/getFormatters.js +30 -0
  479. package/dist/actions/versions/getFormatters.js.map +1 -0
  480. package/dist/actions/versions/tryFindLatestVersion.js +21 -0
  481. package/dist/actions/versions/tryFindLatestVersion.js.map +1 -0
  482. package/dist/actions/versions/types.js +5 -0
  483. package/dist/actions/versions/types.js.map +1 -0
  484. package/dist/actions/versions/versionsDebug.js +4 -0
  485. package/dist/actions/versions/versionsDebug.js.map +1 -0
  486. package/dist/commands/backup/disable.js +94 -0
  487. package/dist/commands/backup/disable.js.map +1 -0
  488. package/dist/commands/backup/download.js +291 -0
  489. package/dist/commands/backup/download.js.map +1 -0
  490. package/dist/commands/backup/enable.js +99 -0
  491. package/dist/commands/backup/enable.js.map +1 -0
  492. package/dist/commands/backup/list.js +187 -0
  493. package/dist/commands/backup/list.js.map +1 -0
  494. package/dist/commands/build.js +82 -0
  495. package/dist/commands/build.js.map +1 -0
  496. package/dist/commands/codemod.js +141 -0
  497. package/dist/commands/codemod.js.map +1 -0
  498. package/dist/commands/cors/add.js +154 -0
  499. package/dist/commands/cors/add.js.map +1 -0
  500. package/dist/commands/cors/delete.js +90 -0
  501. package/dist/commands/cors/delete.js.map +1 -0
  502. package/dist/commands/cors/list.js +40 -0
  503. package/dist/commands/cors/list.js.map +1 -0
  504. package/dist/commands/dataset/alias/create.js +118 -0
  505. package/dist/commands/dataset/alias/create.js.map +1 -0
  506. package/dist/commands/dataset/alias/delete.js +88 -0
  507. package/dist/commands/dataset/alias/delete.js.map +1 -0
  508. package/dist/commands/dataset/alias/link.js +137 -0
  509. package/dist/commands/dataset/alias/link.js.map +1 -0
  510. package/dist/commands/dataset/alias/unlink.js +98 -0
  511. package/dist/commands/dataset/alias/unlink.js.map +1 -0
  512. package/dist/commands/dataset/copy.js +369 -0
  513. package/dist/commands/dataset/copy.js.map +1 -0
  514. package/dist/commands/dataset/create.js +106 -0
  515. package/dist/commands/dataset/create.js.map +1 -0
  516. package/dist/commands/dataset/delete.js +104 -0
  517. package/dist/commands/dataset/delete.js.map +1 -0
  518. package/dist/commands/dataset/export.js +271 -0
  519. package/dist/commands/dataset/export.js.map +1 -0
  520. package/dist/commands/dataset/import.js +3 -0
  521. package/dist/commands/dataset/import.js.map +1 -0
  522. package/dist/commands/dataset/list.js +50 -0
  523. package/dist/commands/dataset/list.js.map +1 -0
  524. package/dist/commands/dataset/visibility/get.js +55 -0
  525. package/dist/commands/dataset/visibility/get.js.map +1 -0
  526. package/dist/commands/dataset/visibility/set.js +88 -0
  527. package/dist/commands/dataset/visibility/set.js.map +1 -0
  528. package/dist/commands/debug.js +93 -0
  529. package/dist/commands/debug.js.map +1 -0
  530. package/dist/commands/deploy.js +115 -0
  531. package/dist/commands/deploy.js.map +1 -0
  532. package/dist/commands/dev.js +65 -0
  533. package/dist/commands/dev.js.map +1 -0
  534. package/dist/commands/docs/browse.js +15 -0
  535. package/dist/commands/docs/browse.js.map +1 -0
  536. package/dist/commands/docs/read.js +81 -0
  537. package/dist/commands/docs/read.js.map +1 -0
  538. package/dist/commands/docs/search.js +111 -0
  539. package/dist/commands/docs/search.js.map +1 -0
  540. package/dist/commands/documents/create.js +338 -0
  541. package/dist/commands/documents/create.js.map +1 -0
  542. package/dist/commands/documents/delete.js +104 -0
  543. package/dist/commands/documents/delete.js.map +1 -0
  544. package/dist/commands/documents/get.js +85 -0
  545. package/dist/commands/documents/get.js.map +1 -0
  546. package/dist/commands/documents/query.js +105 -0
  547. package/dist/commands/documents/query.js.map +1 -0
  548. package/dist/commands/documents/validate.js +142 -0
  549. package/dist/commands/documents/validate.js.map +1 -0
  550. package/dist/commands/exec.js +54 -0
  551. package/dist/commands/exec.js.map +1 -0
  552. package/dist/commands/graphql/deploy.js +429 -0
  553. package/dist/commands/graphql/deploy.js.map +1 -0
  554. package/dist/commands/graphql/list.js +53 -0
  555. package/dist/commands/graphql/list.js.map +1 -0
  556. package/dist/commands/graphql/undeploy.js +143 -0
  557. package/dist/commands/graphql/undeploy.js.map +1 -0
  558. package/dist/commands/hook/attempt.js +66 -0
  559. package/dist/commands/hook/attempt.js.map +1 -0
  560. package/dist/commands/hook/create.js +46 -0
  561. package/dist/commands/hook/create.js.map +1 -0
  562. package/dist/commands/hook/delete.js +86 -0
  563. package/dist/commands/hook/delete.js.map +1 -0
  564. package/dist/commands/hook/list.js +46 -0
  565. package/dist/commands/hook/list.js.map +1 -0
  566. package/dist/commands/hook/logs.js +184 -0
  567. package/dist/commands/hook/logs.js.map +1 -0
  568. package/dist/commands/init.js +1389 -0
  569. package/dist/commands/init.js.map +1 -0
  570. package/dist/commands/install.js +43 -0
  571. package/dist/commands/install.js.map +1 -0
  572. package/dist/commands/learn.js +15 -0
  573. package/dist/commands/learn.js.map +1 -0
  574. package/dist/commands/login.js +50 -0
  575. package/dist/commands/login.js.map +1 -0
  576. package/dist/commands/logout.js +37 -0
  577. package/dist/commands/logout.js.map +1 -0
  578. package/dist/commands/manage.js +29 -0
  579. package/dist/commands/manage.js.map +1 -0
  580. package/dist/commands/manifest/extract.js +43 -0
  581. package/dist/commands/manifest/extract.js.map +1 -0
  582. package/dist/commands/mcp/configure.js +28 -0
  583. package/dist/commands/mcp/configure.js.map +1 -0
  584. package/dist/commands/media/create-aspect.js +88 -0
  585. package/dist/commands/media/create-aspect.js.map +1 -0
  586. package/dist/commands/media/delete-aspect.js +85 -0
  587. package/dist/commands/media/delete-aspect.js.map +1 -0
  588. package/dist/commands/media/deploy-aspect.js +151 -0
  589. package/dist/commands/media/deploy-aspect.js.map +1 -0
  590. package/dist/commands/media/export.js +210 -0
  591. package/dist/commands/media/export.js.map +1 -0
  592. package/dist/commands/media/import.js +160 -0
  593. package/dist/commands/media/import.js.map +1 -0
  594. package/dist/commands/openapi/get.js +83 -0
  595. package/dist/commands/openapi/get.js.map +1 -0
  596. package/dist/commands/openapi/list.js +80 -0
  597. package/dist/commands/openapi/list.js.map +1 -0
  598. package/dist/commands/preview.js +60 -0
  599. package/dist/commands/preview.js.map +1 -0
  600. package/dist/commands/projects/create.js +181 -0
  601. package/dist/commands/projects/create.js.map +1 -0
  602. package/dist/commands/projects/list.js +76 -0
  603. package/dist/commands/projects/list.js.map +1 -0
  604. package/dist/commands/schema/delete.js +91 -0
  605. package/dist/commands/schema/delete.js.map +1 -0
  606. package/dist/commands/schema/deploy.js +98 -0
  607. package/dist/commands/schema/deploy.js.map +1 -0
  608. package/dist/commands/schema/extract.js +46 -0
  609. package/dist/commands/schema/extract.js.map +1 -0
  610. package/dist/commands/schema/list.js +104 -0
  611. package/dist/commands/schema/list.js.map +1 -0
  612. package/dist/commands/schema/validate.js +73 -0
  613. package/dist/commands/schema/validate.js.map +1 -0
  614. package/dist/commands/telemetry/disable.js +33 -0
  615. package/dist/commands/telemetry/disable.js.map +1 -0
  616. package/dist/commands/telemetry/enable.js +33 -0
  617. package/dist/commands/telemetry/enable.js.map +1 -0
  618. package/dist/commands/telemetry/status.js +25 -0
  619. package/dist/commands/telemetry/status.js.map +1 -0
  620. package/dist/commands/tokens/add.js +135 -0
  621. package/dist/commands/tokens/add.js.map +1 -0
  622. package/dist/commands/tokens/delete.js +107 -0
  623. package/dist/commands/tokens/delete.js.map +1 -0
  624. package/dist/commands/tokens/list.js +92 -0
  625. package/dist/commands/tokens/list.js.map +1 -0
  626. package/dist/commands/undeploy.js +93 -0
  627. package/dist/commands/undeploy.js.map +1 -0
  628. package/dist/commands/users/invite.js +100 -0
  629. package/dist/commands/users/invite.js.map +1 -0
  630. package/dist/commands/users/list.js +101 -0
  631. package/dist/commands/users/list.js.map +1 -0
  632. package/dist/commands/versions.js +27 -0
  633. package/dist/commands/versions.js.map +1 -0
  634. package/dist/config/createCliConfig.js +9 -0
  635. package/dist/config/createCliConfig.js.map +1 -0
  636. package/dist/config/defineCliConfig.js +5 -0
  637. package/dist/config/defineCliConfig.js.map +1 -0
  638. package/dist/hooks/prerun/flushTelemetry.worker.js +22 -0
  639. package/dist/hooks/prerun/flushTelemetry.worker.js.map +1 -0
  640. package/dist/hooks/prerun/injectEnvVariables.js +31 -0
  641. package/dist/hooks/prerun/injectEnvVariables.js.map +1 -0
  642. package/dist/hooks/prerun/setupTelemetry.js +72 -0
  643. package/dist/hooks/prerun/setupTelemetry.js.map +1 -0
  644. package/dist/hooks/prerun/warnings.js +6 -0
  645. package/dist/hooks/prerun/warnings.js.map +1 -0
  646. package/dist/index.d.ts +2326 -0
  647. package/dist/index.js +6 -0
  648. package/dist/index.js.map +1 -0
  649. package/dist/prompts/init/nextjs.js +56 -0
  650. package/dist/prompts/init/nextjs.js.map +1 -0
  651. package/dist/prompts/init/promptForTypescript.js +9 -0
  652. package/dist/prompts/init/promptForTypescript.js.map +1 -0
  653. package/dist/prompts/promptForDataset.js +32 -0
  654. package/dist/prompts/promptForDataset.js.map +1 -0
  655. package/dist/prompts/promptForDatasetAclMode.js +27 -0
  656. package/dist/prompts/promptForDatasetAclMode.js.map +1 -0
  657. package/dist/prompts/promptForDatasetAliasName.js +17 -0
  658. package/dist/prompts/promptForDatasetAliasName.js.map +1 -0
  659. package/dist/prompts/promptForDatasetName.js +20 -0
  660. package/dist/prompts/promptForDatasetName.js.map +1 -0
  661. package/dist/prompts/promptForDefaultConfig.js +12 -0
  662. package/dist/prompts/promptForDefaultConfig.js.map +1 -0
  663. package/dist/prompts/promptForMediaLibrary.js +37 -0
  664. package/dist/prompts/promptForMediaLibrary.js.map +1 -0
  665. package/dist/prompts/promptForOrganizationName.js +11 -0
  666. package/dist/prompts/promptForOrganizationName.js.map +1 -0
  667. package/dist/prompts/promptForProjectName.js +11 -0
  668. package/dist/prompts/promptForProjectName.js.map +1 -0
  669. package/dist/prompts/selectDataset.js +12 -0
  670. package/dist/prompts/selectDataset.js.map +1 -0
  671. package/dist/prompts/selectMediaLibrary.js +34 -0
  672. package/dist/prompts/selectMediaLibrary.js.map +1 -0
  673. package/dist/server/devServer.js +53 -0
  674. package/dist/server/devServer.js.map +1 -0
  675. package/dist/server/gracefulServerDeath.js +12 -0
  676. package/dist/server/gracefulServerDeath.js.map +1 -0
  677. package/dist/server/previewServer.js +93 -0
  678. package/dist/server/previewServer.js.map +1 -0
  679. package/dist/server/serverDebug.js +4 -0
  680. package/dist/server/serverDebug.js.map +1 -0
  681. package/dist/server/vite/plugin-sanity-basepath-redirect.js +25 -0
  682. package/dist/server/vite/plugin-sanity-basepath-redirect.js.map +1 -0
  683. package/dist/server/vite/plugin-sanity-build-entries.js +65 -0
  684. package/dist/server/vite/plugin-sanity-build-entries.js.map +1 -0
  685. package/dist/server/vite/plugin-sanity-favicons.js +72 -0
  686. package/dist/server/vite/plugin-sanity-favicons.js.map +1 -0
  687. package/dist/server/vite/plugin-sanity-runtime-rewrite.js +18 -0
  688. package/dist/server/vite/plugin-sanity-runtime-rewrite.js.map +1 -0
  689. package/dist/services/auth.js +13 -0
  690. package/dist/services/auth.js.map +1 -0
  691. package/dist/services/backup.js +51 -0
  692. package/dist/services/backup.js.map +1 -0
  693. package/dist/services/cors.js +38 -0
  694. package/dist/services/cors.js.map +1 -0
  695. package/dist/services/datasetAliases.js +64 -0
  696. package/dist/services/datasetAliases.js.map +1 -0
  697. package/dist/services/datasets.js +153 -0
  698. package/dist/services/datasets.js.map +1 -0
  699. package/dist/services/docs.js +46 -0
  700. package/dist/services/docs.js.map +1 -0
  701. package/dist/services/documents.js +56 -0
  702. package/dist/services/documents.js.map +1 -0
  703. package/dist/services/getProjectFeatures.js +16 -0
  704. package/dist/services/getProjectFeatures.js.map +1 -0
  705. package/dist/services/getUrlHeaders.js +36 -0
  706. package/dist/services/getUrlHeaders.js.map +1 -0
  707. package/dist/services/graphql.js +96 -0
  708. package/dist/services/graphql.js.map +1 -0
  709. package/dist/services/hooks.js +59 -0
  710. package/dist/services/hooks.js.map +1 -0
  711. package/dist/services/mcp.js +50 -0
  712. package/dist/services/mcp.js.map +1 -0
  713. package/dist/services/mediaLibraries.js +74 -0
  714. package/dist/services/mediaLibraries.js.map +1 -0
  715. package/dist/services/organizations.js +42 -0
  716. package/dist/services/organizations.js.map +1 -0
  717. package/dist/services/plans.js +37 -0
  718. package/dist/services/plans.js.map +1 -0
  719. package/dist/services/projects.js +119 -0
  720. package/dist/services/projects.js.map +1 -0
  721. package/dist/services/schemas.js +40 -0
  722. package/dist/services/schemas.js.map +1 -0
  723. package/dist/services/telemetry.js +80 -0
  724. package/dist/services/telemetry.js.map +1 -0
  725. package/dist/services/tokens.js +72 -0
  726. package/dist/services/tokens.js.map +1 -0
  727. package/dist/services/user.js +35 -0
  728. package/dist/services/user.js.map +1 -0
  729. package/dist/services/userApplications.js +164 -0
  730. package/dist/services/userApplications.js.map +1 -0
  731. package/dist/studioDependencies.js +24 -0
  732. package/dist/studioDependencies.js.map +1 -0
  733. package/dist/telemetry/build.telemetry.js +13 -0
  734. package/dist/telemetry/build.telemetry.js.map +1 -0
  735. package/dist/telemetry/cli.telemetry.js +8 -0
  736. package/dist/telemetry/cli.telemetry.js.map +1 -0
  737. package/dist/telemetry/extractSchema.telemetry.js +8 -0
  738. package/dist/telemetry/extractSchema.telemetry.js.map +1 -0
  739. package/dist/telemetry/init.telemetry.js +8 -0
  740. package/dist/telemetry/init.telemetry.js.map +1 -0
  741. package/dist/telemetry/login.telemetry.js +8 -0
  742. package/dist/telemetry/login.telemetry.js.map +1 -0
  743. package/dist/telemetry/mcp.telemetry.js +8 -0
  744. package/dist/telemetry/mcp.telemetry.js.map +1 -0
  745. package/dist/types.js +5 -0
  746. package/dist/types.js.map +1 -0
  747. package/dist/typings/deepSortObject.d.js +2 -0
  748. package/dist/typings/deepSortObject.d.js.map +1 -0
  749. package/dist/util/absolutify.js +26 -0
  750. package/dist/util/absolutify.js.map +1 -0
  751. package/dist/util/appId.js +58 -0
  752. package/dist/util/appId.js.map +1 -0
  753. package/dist/util/canLaunchBrowser.js +14 -0
  754. package/dist/util/canLaunchBrowser.js.map +1 -0
  755. package/dist/util/cliClient.js +41 -0
  756. package/dist/util/cliClient.js.map +1 -0
  757. package/dist/util/compareDependencyVersions.js +73 -0
  758. package/dist/util/compareDependencyVersions.js.map +1 -0
  759. package/dist/util/copy.js +37 -0
  760. package/dist/util/copy.js.map +1 -0
  761. package/dist/util/copyDir.js +63 -0
  762. package/dist/util/copyDir.js.map +1 -0
  763. package/dist/util/detectRuntime.js +20 -0
  764. package/dist/util/detectRuntime.js.map +1 -0
  765. package/dist/util/determineIsApp.js +9 -0
  766. package/dist/util/determineIsApp.js.map +1 -0
  767. package/dist/util/dirIsEmptyOrNonExistent.js +18 -0
  768. package/dist/util/dirIsEmptyOrNonExistent.js.map +1 -0
  769. package/dist/util/ensureTrailingSlash.js +12 -0
  770. package/dist/util/ensureTrailingSlash.js.map +1 -0
  771. package/dist/util/errorMessages.js +6 -0
  772. package/dist/util/errorMessages.js.map +1 -0
  773. package/dist/util/extractDocumentsFromNdjsonOrTarball.js +88 -0
  774. package/dist/util/extractDocumentsFromNdjsonOrTarball.js.map +1 -0
  775. package/dist/util/findNdjsonEntry.js +21 -0
  776. package/dist/util/findNdjsonEntry.js.map +1 -0
  777. package/dist/util/formatSize.js +10 -0
  778. package/dist/util/formatSize.js.map +1 -0
  779. package/dist/util/frameworkPort.js +61 -0
  780. package/dist/util/frameworkPort.js.map +1 -0
  781. package/dist/util/fsUtils.js +34 -0
  782. package/dist/util/fsUtils.js.map +1 -0
  783. package/dist/util/getCliVersion.js +28 -0
  784. package/dist/util/getCliVersion.js.map +1 -0
  785. package/dist/util/getErrorMessage.js +19 -0
  786. package/dist/util/getErrorMessage.js.map +1 -0
  787. package/dist/util/getLocalPackageVersion.js +32 -0
  788. package/dist/util/getLocalPackageVersion.js.map +1 -0
  789. package/dist/util/getProjectDefaults.js +77 -0
  790. package/dist/util/getProjectDefaults.js.map +1 -0
  791. package/dist/util/getSanityEnv.js +3 -0
  792. package/dist/util/getSanityEnv.js.map +1 -0
  793. package/dist/util/getSharedServerConfig.js +31 -0
  794. package/dist/util/getSharedServerConfig.js.map +1 -0
  795. package/dist/util/getWorkspace.js +18 -0
  796. package/dist/util/getWorkspace.js.map +1 -0
  797. package/dist/util/humanFileSize.js +12 -0
  798. package/dist/util/humanFileSize.js.map +1 -0
  799. package/dist/util/importStudioConfig.js +40 -0
  800. package/dist/util/importStudioConfig.js.map +1 -0
  801. package/dist/util/isPathDirName.js +6 -0
  802. package/dist/util/isPathDirName.js.map +1 -0
  803. package/dist/util/isSanityDocumentish.js +20 -0
  804. package/dist/util/isSanityDocumentish.js.map +1 -0
  805. package/dist/util/loadEnv.js +3 -0
  806. package/dist/util/loadEnv.js.map +1 -0
  807. package/dist/util/moduleFormatUtils.js +18 -0
  808. package/dist/util/moduleFormatUtils.js.map +1 -0
  809. package/dist/util/packageManager/installPackages.js +87 -0
  810. package/dist/util/packageManager/installPackages.js.map +1 -0
  811. package/dist/util/packageManager/packageManagerChoice.js +181 -0
  812. package/dist/util/packageManager/packageManagerChoice.js.map +1 -0
  813. package/dist/util/packageManager/upgradePackages.js +69 -0
  814. package/dist/util/packageManager/upgradePackages.js.map +1 -0
  815. package/dist/util/parseArguments.js +42 -0
  816. package/dist/util/parseArguments.js.map +1 -0
  817. package/dist/util/pluralize.js +11 -0
  818. package/dist/util/pluralize.js.map +1 -0
  819. package/dist/util/readModuleVersion.js +15 -0
  820. package/dist/util/readModuleVersion.js.map +1 -0
  821. package/dist/util/readPackageJson.js +44 -0
  822. package/dist/util/readPackageJson.js.map +1 -0
  823. package/dist/util/readPackageManifest.js +46 -0
  824. package/dist/util/readPackageManifest.js.map +1 -0
  825. package/dist/util/readdirRecursive.js +24 -0
  826. package/dist/util/readdirRecursive.js.map +1 -0
  827. package/dist/util/resolveLatestVersions.js +21 -0
  828. package/dist/util/resolveLatestVersions.js.map +1 -0
  829. package/dist/util/toInt.js +9 -0
  830. package/dist/util/toInt.js.map +1 -0
  831. package/dist/util/trimHashFromVersion.js +8 -0
  832. package/dist/util/trimHashFromVersion.js.map +1 -0
  833. package/dist/util/uniqBy.js +14 -0
  834. package/dist/util/uniqBy.js.map +1 -0
  835. package/dist/util/validation/validateDocumentsUtils.js +33 -0
  836. package/dist/util/validation/validateDocumentsUtils.js.map +1 -0
  837. package/dist/util/warnAboutMissingAppId.js +15 -0
  838. package/dist/util/warnAboutMissingAppId.js.map +1 -0
  839. package/dist/util/warnOnNonProductionEnvironment.js +18 -0
  840. package/dist/util/warnOnNonProductionEnvironment.js.map +1 -0
  841. package/dist/util/workerChannels.js +172 -0
  842. package/dist/util/workerChannels.js.map +1 -0
  843. package/oclif.config.js +21 -0
  844. package/oclif.manifest.json +4154 -0
  845. package/package.json +138 -98
  846. package/templates/app-quickstart/src/App.css +3 -1
  847. package/templates/app-quickstart/src/App.tsx +1 -1
  848. package/templates/app-sanity-ui/src/App.tsx +2 -2
  849. package/templates/app-sanity-ui/src/ExampleComponent.tsx +2 -1
  850. package/templates/get-started/plugins/sanity-plugin-tutorial/GetStartedTutorial.tsx +3 -3
  851. package/templates/get-started/plugins/sanity-plugin-tutorial/index.ts +2 -2
  852. package/templates/shopify/components/hotspots/ProductTooltip.tsx +1 -1
  853. package/templates/shopify/components/icons/Shopify.tsx +0 -2
  854. package/templates/shopify/components/inputs/CollectionHidden.tsx +0 -1
  855. package/templates/shopify/components/media/ColorTheme.tsx +1 -1
  856. package/templates/shopify/constants.ts +4 -4
  857. package/templates/shopify/plugins/customDocumentActions/index.ts +2 -2
  858. package/templates/shopify/plugins/customDocumentActions/shopifyDelete.tsx +1 -1
  859. package/templates/shopify/schemaTypes/documents/collection.tsx +1 -2
  860. package/templates/shopify/schemaTypes/documents/page.ts +1 -1
  861. package/templates/shopify/schemaTypes/documents/product.tsx +1 -1
  862. package/templates/shopify/schemaTypes/documents/productVariant.tsx +2 -3
  863. package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionColorObjectType.tsx +0 -1
  864. package/templates/shopify/schemaTypes/objects/hotspot/productHotspotsType.tsx +1 -3
  865. package/templates/shopify/schemaTypes/objects/module/collectionReferenceType.tsx +0 -1
  866. package/templates/shopify/schemaTypes/objects/shopify/placeholderStringType.ts +2 -3
  867. package/templates/shopify/schemaTypes/objects/shopify/productWithVariantType.tsx +1 -1
  868. package/templates/shopify/schemaTypes/objects/shopify/shopifyCollectionType.ts +1 -2
  869. package/templates/shopify/schemaTypes/objects/shopify/shopifyProductType.ts +1 -2
  870. package/templates/shopify/schemaTypes/portableText/portableTextType.tsx +7 -7
  871. package/templates/shopify/schemaTypes/singletons/homeType.ts +8 -8
  872. package/templates/shopify/structure/collectionStructure.ts +4 -1
  873. package/templates/shopify/structure/colorThemeStructure.ts +1 -1
  874. package/templates/shopify/structure/homeStructure.ts +2 -2
  875. package/templates/shopify/structure/index.ts +1 -1
  876. package/templates/shopify/structure/pageStructure.ts +2 -2
  877. package/templates/shopify/structure/productStructure.ts +7 -7
  878. package/templates/shopify/structure/settingStructure.ts +1 -1
  879. package/templates/shopify/utils/defineStructure.ts +1 -1
  880. package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/index.ts +1 -1
  881. package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/shopifyDelete.tsx +1 -1
  882. package/templates/shopify-online-storefront/structure/collectionStructure.ts +4 -1
  883. package/templates/shopify-online-storefront/structure/productStructure.ts +4 -4
  884. package/templates/shopify-online-storefront/utils/defineStructure.ts +1 -1
  885. package/bin/dev.js +0 -30
  886. package/bin/sanity +0 -14
  887. package/lib/_chunks-cjs/cli.js +0 -70870
  888. package/lib/_chunks-cjs/cli.js.map +0 -1
  889. package/lib/_chunks-cjs/cliWorker.js +0 -19
  890. package/lib/_chunks-cjs/cliWorker.js.map +0 -1
  891. package/lib/_chunks-cjs/generateAction.js +0 -128
  892. package/lib/_chunks-cjs/generateAction.js.map +0 -1
  893. package/lib/_chunks-cjs/getCliConfig.js +0 -89
  894. package/lib/_chunks-cjs/getCliConfig.js.map +0 -1
  895. package/lib/_chunks-cjs/index.js +0 -31
  896. package/lib/_chunks-cjs/index.js.map +0 -1
  897. package/lib/_chunks-cjs/journeyConfig.js +0 -113
  898. package/lib/_chunks-cjs/journeyConfig.js.map +0 -1
  899. package/lib/_chunks-cjs/loadEnv.js +0 -347
  900. package/lib/_chunks-cjs/loadEnv.js.map +0 -1
  901. package/lib/_chunks-dts/types.d.ts +0 -432
  902. package/lib/cli.d.ts +0 -7
  903. package/lib/cli.js +0 -10
  904. package/lib/cli.js.map +0 -1
  905. package/lib/index.d.ts +0 -44
  906. package/lib/index.js +0 -46
  907. package/lib/index.js.map +0 -1
  908. package/lib/run.d.ts +0 -1
  909. package/lib/run.js +0 -8
  910. package/lib/run.js.map +0 -1
  911. package/lib/workers/getAndWriteJourneySchema.d.ts +0 -1
  912. package/lib/workers/getAndWriteJourneySchema.js +0 -4
  913. package/lib/workers/getAndWriteJourneySchema.js.map +0 -1
  914. package/lib/workers/getCliConfig.d.ts +0 -1
  915. package/lib/workers/getCliConfig.js +0 -10
  916. package/lib/workers/getCliConfig.js.map +0 -1
  917. package/lib/workers/typegenGenerate.d.ts +0 -18
  918. package/lib/workers/typegenGenerate.js +0 -47
  919. package/lib/workers/typegenGenerate.js.map +0 -1
package/README.md CHANGED
@@ -1,3 +1,3213 @@
1
- # cli
1
+ # @sanity/cli
2
2
 
3
- Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets
3
+ Code for sanity cli
4
+
5
+ <!-- toc -->
6
+
7
+ - [@sanity/cli](#sanitycli)
8
+ - [Commands](#commands)
9
+ <!-- tocstop -->
10
+
11
+ # Commands
12
+
13
+ <!-- commands -->
14
+
15
+ - [`sanity backup disable [DATASET]`](#sanity-backup-disable-dataset)
16
+ - [`sanity backup download [DATASET]`](#sanity-backup-download-dataset)
17
+ - [`sanity backup enable [DATASET]`](#sanity-backup-enable-dataset)
18
+ - [`sanity backup list [DATASET]`](#sanity-backup-list-dataset)
19
+ - [`sanity blueprints add TYPE`](#sanity-blueprints-add-type)
20
+ - [`sanity blueprints config`](#sanity-blueprints-config)
21
+ - [`sanity blueprints deploy`](#sanity-blueprints-deploy)
22
+ - [`sanity blueprints destroy`](#sanity-blueprints-destroy)
23
+ - [`sanity blueprints doctor`](#sanity-blueprints-doctor)
24
+ - [`sanity blueprints info`](#sanity-blueprints-info)
25
+ - [`sanity blueprints init [DIR]`](#sanity-blueprints-init-dir)
26
+ - [`sanity blueprints logs`](#sanity-blueprints-logs)
27
+ - [`sanity blueprints plan`](#sanity-blueprints-plan)
28
+ - [`sanity blueprints stacks`](#sanity-blueprints-stacks)
29
+ - [`sanity build [OUTPUTDIR]`](#sanity-build-outputdir)
30
+ - [`sanity codemod [CODEMODNAME]`](#sanity-codemod-codemodname)
31
+ - [`sanity cors add ORIGIN`](#sanity-cors-add-origin)
32
+ - [`sanity cors delete [ORIGIN]`](#sanity-cors-delete-origin)
33
+ - [`sanity cors list`](#sanity-cors-list)
34
+ - [`sanity dataset alias create [ALIASNAME] [TARGETDATASET]`](#sanity-dataset-alias-create-aliasname-targetdataset)
35
+ - [`sanity dataset alias delete ALIASNAME`](#sanity-dataset-alias-delete-aliasname)
36
+ - [`sanity dataset alias link [ALIASNAME] [TARGETDATASET]`](#sanity-dataset-alias-link-aliasname-targetdataset)
37
+ - [`sanity dataset alias unlink [ALIASNAME]`](#sanity-dataset-alias-unlink-aliasname)
38
+ - [`sanity dataset copy [SOURCE] [TARGET]`](#sanity-dataset-copy-source-target)
39
+ - [`sanity dataset create [NAME]`](#sanity-dataset-create-name)
40
+ - [`sanity dataset delete DATASETNAME`](#sanity-dataset-delete-datasetname)
41
+ - [`sanity dataset export [NAME] [DESTINATION]`](#sanity-dataset-export-name-destination)
42
+ - [`sanity dataset import SOURCE`](#sanity-dataset-import-source)
43
+ - [`sanity dataset list`](#sanity-dataset-list)
44
+ - [`sanity dataset visibility get DATASET`](#sanity-dataset-visibility-get-dataset)
45
+ - [`sanity dataset visibility set DATASET MODE`](#sanity-dataset-visibility-set-dataset-mode)
46
+ - [`sanity debug`](#sanity-debug)
47
+ - [`sanity deploy [SOURCEDIR]`](#sanity-deploy-sourcedir)
48
+ - [`sanity dev`](#sanity-dev)
49
+ - [`sanity docs browse`](#sanity-docs-browse)
50
+ - [`sanity docs read PATH`](#sanity-docs-read-path)
51
+ - [`sanity docs search QUERY`](#sanity-docs-search-query)
52
+ - [`sanity documents create [FILE]`](#sanity-documents-create-file)
53
+ - [`sanity documents delete ID [IDS]`](#sanity-documents-delete-id-ids)
54
+ - [`sanity documents get DOCUMENTID`](#sanity-documents-get-documentid)
55
+ - [`sanity documents query QUERY`](#sanity-documents-query-query)
56
+ - [`sanity documents validate`](#sanity-documents-validate)
57
+ - [`sanity exec SCRIPT`](#sanity-exec-script)
58
+ - [`sanity functions add`](#sanity-functions-add)
59
+ - [`sanity functions dev`](#sanity-functions-dev)
60
+ - [`sanity functions env add NAME KEY VALUE`](#sanity-functions-env-add-name-key-value)
61
+ - [`sanity functions env list NAME`](#sanity-functions-env-list-name)
62
+ - [`sanity functions env remove NAME KEY`](#sanity-functions-env-remove-name-key)
63
+ - [`sanity functions logs [NAME]`](#sanity-functions-logs-name)
64
+ - [`sanity functions test [NAME]`](#sanity-functions-test-name)
65
+ - [`sanity graphql deploy`](#sanity-graphql-deploy)
66
+ - [`sanity graphql list`](#sanity-graphql-list)
67
+ - [`sanity graphql undeploy`](#sanity-graphql-undeploy)
68
+ - [`sanity help [COMMAND]`](#sanity-help-command)
69
+ - [`sanity hook attempt ATTEMPTID`](#sanity-hook-attempt-attemptid)
70
+ - [`sanity hook create`](#sanity-hook-create)
71
+ - [`sanity hook delete [NAME]`](#sanity-hook-delete-name)
72
+ - [`sanity hook list`](#sanity-hook-list)
73
+ - [`sanity hook logs [NAME]`](#sanity-hook-logs-name)
74
+ - [`sanity init`](#sanity-init)
75
+ - [`sanity install [PACKAGES]`](#sanity-install-packages)
76
+ - [`sanity learn`](#sanity-learn)
77
+ - [`sanity login`](#sanity-login)
78
+ - [`sanity logout`](#sanity-logout)
79
+ - [`sanity manage`](#sanity-manage)
80
+ - [`sanity manifest extract`](#sanity-manifest-extract)
81
+ - [`sanity mcp configure`](#sanity-mcp-configure)
82
+ - [`sanity media create-aspect`](#sanity-media-create-aspect)
83
+ - [`sanity media delete-aspect ASPECTNAME`](#sanity-media-delete-aspect-aspectname)
84
+ - [`sanity media deploy-aspect [ASPECTNAME]`](#sanity-media-deploy-aspect-aspectname)
85
+ - [`sanity media export [DESTINATION]`](#sanity-media-export-destination)
86
+ - [`sanity media import SOURCE`](#sanity-media-import-source)
87
+ - [`sanity migration create [TITLE]`](#sanity-migration-create-title)
88
+ - [`sanity migration list`](#sanity-migration-list)
89
+ - [`sanity migration run [ID]`](#sanity-migration-run-id)
90
+ - [`sanity openapi get SLUG`](#sanity-openapi-get-slug)
91
+ - [`sanity openapi list`](#sanity-openapi-list)
92
+ - [`sanity preview [OUTPUTDIR]`](#sanity-preview-outputdir)
93
+ - [`sanity projects create [PROJECTNAME]`](#sanity-projects-create-projectname)
94
+ - [`sanity projects list`](#sanity-projects-list)
95
+ - [`sanity schema delete`](#sanity-schema-delete)
96
+ - [`sanity schema deploy`](#sanity-schema-deploy)
97
+ - [`sanity schema extract`](#sanity-schema-extract)
98
+ - [`sanity schema list`](#sanity-schema-list)
99
+ - [`sanity schema validate`](#sanity-schema-validate)
100
+ - [`sanity start [OUTPUTDIR]`](#sanity-start-outputdir)
101
+ - [`sanity telemetry disable`](#sanity-telemetry-disable)
102
+ - [`sanity telemetry enable`](#sanity-telemetry-enable)
103
+ - [`sanity telemetry status`](#sanity-telemetry-status)
104
+ - [`sanity tokens add [LABEL]`](#sanity-tokens-add-label)
105
+ - [`sanity tokens delete [TOKENID]`](#sanity-tokens-delete-tokenid)
106
+ - [`sanity tokens list`](#sanity-tokens-list)
107
+ - [`sanity typegen generate`](#sanity-typegen-generate)
108
+ - [`sanity undeploy`](#sanity-undeploy)
109
+ - [`sanity users invite [EMAIL]`](#sanity-users-invite-email)
110
+ - [`sanity users list`](#sanity-users-list)
111
+ - [`sanity versions`](#sanity-versions)
112
+
113
+ ## `sanity backup disable [DATASET]`
114
+
115
+ Disable backup for a dataset.
116
+
117
+ ```
118
+ USAGE
119
+ $ sanity backup disable [DATASET]
120
+
121
+ ARGUMENTS
122
+ [DATASET] Dataset name to disable backup for
123
+
124
+ DESCRIPTION
125
+ Disable backup for a dataset.
126
+
127
+ EXAMPLES
128
+ Interactively disable backup for a dataset
129
+
130
+ $ sanity backup disable
131
+
132
+ Disable backup for the production dataset
133
+
134
+ $ sanity backup disable production
135
+ ```
136
+
137
+ _See code: [src/commands/backup/disable.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/backup/disable.ts)_
138
+
139
+ ## `sanity backup download [DATASET]`
140
+
141
+ Download a dataset backup to a local file.
142
+
143
+ ```
144
+ USAGE
145
+ $ sanity backup download [DATASET] [--backup-id <value>] [--concurrency <value>] [--out <value>] [--overwrite]
146
+
147
+ ARGUMENTS
148
+ [DATASET] Dataset name to download backup from
149
+
150
+ FLAGS
151
+ --backup-id=<value> The backup ID to download
152
+ --concurrency=<value> [default: 10] Concurrent number of backup item downloads (max: 24)
153
+ --out=<value> The file or directory path the backup should download to
154
+ --overwrite Allows overwriting of existing backup file
155
+
156
+ DESCRIPTION
157
+ Download a dataset backup to a local file.
158
+
159
+ EXAMPLES
160
+ Interactively download a backup
161
+
162
+ $ sanity backup download
163
+
164
+ Download a specific backup for the production dataset
165
+
166
+ $ sanity backup download production --backup-id 2024-01-01-backup-1
167
+
168
+ Download backup to a specific file
169
+
170
+ $ sanity backup download production --backup-id 2024-01-01-backup-2 --out /path/to/file
171
+
172
+ Download backup and overwrite existing file
173
+
174
+ $ sanity backup download production --backup-id 2024-01-01-backup-3 --out /path/to/file --overwrite
175
+ ```
176
+
177
+ _See code: [src/commands/backup/download.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/backup/download.ts)_
178
+
179
+ ## `sanity backup enable [DATASET]`
180
+
181
+ Enable backup for a dataset.
182
+
183
+ ```
184
+ USAGE
185
+ $ sanity backup enable [DATASET]
186
+
187
+ ARGUMENTS
188
+ [DATASET] Dataset name to enable backup for
189
+
190
+ DESCRIPTION
191
+ Enable backup for a dataset.
192
+
193
+ EXAMPLES
194
+ Interactively enable backup for a dataset
195
+
196
+ $ sanity backup enable
197
+
198
+ Enable backup for the production dataset
199
+
200
+ $ sanity backup enable production
201
+ ```
202
+
203
+ _See code: [src/commands/backup/enable.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/backup/enable.ts)_
204
+
205
+ ## `sanity backup list [DATASET]`
206
+
207
+ List available backups for a dataset.
208
+
209
+ ```
210
+ USAGE
211
+ $ sanity backup list [DATASET] [--after <value>] [--before <value>] [-l <value>]
212
+
213
+ ARGUMENTS
214
+ [DATASET] Dataset name to list backups for
215
+
216
+ FLAGS
217
+ -l, --limit=<value> [default: 30] Maximum number of backups returned
218
+ --after=<value> Only return backups after this date (inclusive, YYYY-MM-DD format)
219
+ --before=<value> Only return backups before this date (exclusive, YYYY-MM-DD format)
220
+
221
+ DESCRIPTION
222
+ List available backups for a dataset.
223
+
224
+ EXAMPLES
225
+ List backups for a dataset interactively
226
+
227
+ $ sanity backup list
228
+
229
+ List backups for the production dataset
230
+
231
+ $ sanity backup list production
232
+
233
+ List up to 50 backups for the production dataset
234
+
235
+ $ sanity backup list production --limit 50
236
+
237
+ List up to 10 backups created after 2024-01-31
238
+
239
+ $ sanity backup list production --after 2024-01-31 --limit 10
240
+ ```
241
+
242
+ _See code: [src/commands/backup/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/backup/list.ts)_
243
+
244
+ ## `sanity blueprints add TYPE`
245
+
246
+ Add a function resource to a Blueprint
247
+
248
+ ```
249
+ USAGE
250
+ $ sanity blueprints add TYPE [--example <value> | -n <value> | --fn-type
251
+ document-create|document-delete|document-update|document-publish|media-library-asset-create|media-library-asset-upda
252
+ te|media-library-asset-delete... | --language ts|js | --javascript | --fn-helpers | --fn-installer
253
+ skip|npm|pnpm|yarn] [-i | ]
254
+
255
+ ARGUMENTS
256
+ TYPE (function) Type of resource to add (only "function" is supported)
257
+
258
+ FLAGS
259
+ -i, --install Shortcut for --fn-installer npm
260
+ -n, --name=<value> Name of the resource to add
261
+ --example=<value> Example to use for the function resource. Discover examples at
262
+ https://www.sanity.io/exchange/type=recipes/by=sanity
263
+ --[no-]fn-helpers Add helpers to the new function
264
+ --fn-installer=<option> Which package manager to use when installing the @sanity/functions helpers
265
+ <options: skip|npm|pnpm|yarn>
266
+ --fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
267
+ events by specifying this flag multiple times
268
+ <options: document-create|document-delete|document-update|document-publish|media-library-
269
+ asset-create|media-library-asset-update|media-library-asset-delete>
270
+ --javascript Use JavaScript instead of TypeScript
271
+ --language=<option> [default: ts] Language of the new function
272
+ <options: ts|js>
273
+
274
+ DESCRIPTION
275
+ Add a function resource to a Blueprint
276
+
277
+ Scaffolds a new Sanity Function in your Blueprint. Functions are serverless handlers triggered by document events
278
+ (create, update, delete, publish) or media library events.
279
+
280
+ After adding a function, use 'functions dev' to test locally, then 'blueprints deploy' to publish it.
281
+
282
+ EXAMPLES
283
+ $ sanity blueprints add function
284
+
285
+ $ sanity blueprints add function --helpers
286
+
287
+ $ sanity blueprints add function --name my-function
288
+
289
+ $ sanity blueprints add function --name my-function --fn-type document-create
290
+
291
+ $ sanity blueprints add function --name my-function --fn-type document-create --fn-type document-update --lang js
292
+ ```
293
+
294
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/add.ts)_
295
+
296
+ ## `sanity blueprints config`
297
+
298
+ View or edit the local Blueprint configuration
299
+
300
+ ```
301
+ USAGE
302
+ $ sanity blueprints config [--project-id <value> -e] [--stack-id <value> ]
303
+
304
+ FLAGS
305
+ -e, --edit Modify the configuration interactively, or directly when combined with ID flags.
306
+ --project-id=<value> Directly set the project ID in the configuration. Requires --edit flag
307
+ --stack-id=<value> Directly set the Stack ID in the configuration. Requires --edit flag
308
+
309
+ DESCRIPTION
310
+ View or edit the local Blueprint configuration
311
+
312
+ Manages the local Blueprint configuration, which links your Blueprint to a Sanity project and Stack.
313
+
314
+ Without flags, displays the current configuration. Use --edit to interactively modify settings, or combine --edit with
315
+ ID flags to update values directly (useful for scripting and automation).
316
+
317
+ If you need to switch your Blueprint to a different Stack, use --edit --stack-id.
318
+
319
+ EXAMPLES
320
+ $ sanity blueprints config
321
+
322
+ $ sanity blueprints config --edit
323
+
324
+ $ sanity blueprints config --edit --project-id <projectId>
325
+
326
+ $ sanity blueprints config --edit --project-id <projectId> --stack-id <stackId>
327
+ ```
328
+
329
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/config.ts)_
330
+
331
+ ## `sanity blueprints deploy`
332
+
333
+ Deploy the local Blueprint to the remote Stack
334
+
335
+ ```
336
+ USAGE
337
+ $ sanity blueprints deploy [--no-wait]
338
+
339
+ FLAGS
340
+ --no-wait Do not wait for Stack deployment to complete
341
+
342
+ DESCRIPTION
343
+ Deploy the local Blueprint to the remote Stack
344
+
345
+ Pushes your local Blueprint configuration to the remote Stack; provisioning, updating, or destroying resources as
346
+ needed. This is the primary command for applying infrastructure changes.
347
+
348
+ Before deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack
349
+ status or 'blueprints logs' to monitor activity.
350
+
351
+ Use --no-wait to queue the deployment and return immediately without waiting for completion.
352
+
353
+ EXAMPLES
354
+ $ sanity blueprints deploy
355
+
356
+ $ sanity blueprints deploy --no-wait
357
+ ```
358
+
359
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/deploy.ts)_
360
+
361
+ ## `sanity blueprints destroy`
362
+
363
+ Destroy the remote Stack deployment and its resources (will not delete local files)
364
+
365
+ ```
366
+ USAGE
367
+ $ sanity blueprints destroy [--project-id <value> --stack-id <value> --force] [--no-wait]
368
+
369
+ FLAGS
370
+ --force Force Stack destruction (skip confirmation)
371
+ --no-wait Do not wait for Stack destruction to complete
372
+ --project-id=<value> Project associated with the Stack
373
+ --stack-id=<value> Stack ID to destroy (defaults to current Stack)
374
+
375
+ DESCRIPTION
376
+ Destroy the remote Stack deployment and its resources (will not delete local files)
377
+
378
+ Permanently removes the remote Stack and all its provisioned resources. Your local Blueprint files remain untouched,
379
+ allowing you to redeploy later with 'blueprints init' + 'blueprints deploy'.
380
+
381
+ This is a destructive operation. You will be prompted to confirm unless --force is specified.
382
+
383
+ Use this to clean up test environments or decommission a Stack you no longer need.
384
+
385
+ EXAMPLES
386
+ $ sanity blueprints destroy
387
+
388
+ $ sanity blueprints destroy --stack-id <stackId> --project-id <projectId> --force --no-wait
389
+ ```
390
+
391
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/destroy.ts)_
392
+
393
+ ## `sanity blueprints doctor`
394
+
395
+ Diagnose potential issues with local Blueprint and remote Stack configuration
396
+
397
+ ```
398
+ USAGE
399
+ $ sanity blueprints doctor [--json] [--path <value>] [--verbose] [--fix]
400
+
401
+ FLAGS
402
+ --fix Interactively fix configuration issues
403
+ --json Format output as json.
404
+ --path=<value> Path to the directory containing the Blueprint
405
+ --verbose Verbose output
406
+
407
+ DESCRIPTION
408
+ Diagnose potential issues with local Blueprint and remote Stack configuration
409
+
410
+ Analyzes your local Blueprint and remote Stack configuration for common issues, such as missing authentication,
411
+ invalid project references, or misconfigured resources.
412
+
413
+ Run this command when encountering errors with other Blueprint commands. Use --fix to interactively resolve detected
414
+ issues.
415
+ ```
416
+
417
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/doctor.ts)_
418
+
419
+ ## `sanity blueprints info`
420
+
421
+ Show information about the local Blueprint's remote Stack deployment
422
+
423
+ ```
424
+ USAGE
425
+ $ sanity blueprints info [--id <value>]
426
+
427
+ FLAGS
428
+ --id=<value> Stack ID to show info for (defaults to the current Stack)
429
+
430
+ DESCRIPTION
431
+ Show information about the local Blueprint's remote Stack deployment
432
+
433
+ Displays the current state and metadata of your remote Stack deployment, including deployed resources, status, and
434
+ configuration.
435
+
436
+ Use this command to verify a deployment succeeded, check what resources are live, or confirm which Stack your local
437
+ Blueprint is connected to.
438
+
439
+ Run 'blueprints stacks' to see all available Stacks in your project or organization.
440
+
441
+ EXAMPLES
442
+ $ sanity blueprints info
443
+
444
+ $ sanity blueprints info --id <stackId>
445
+ ```
446
+
447
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/info.ts)_
448
+
449
+ ## `sanity blueprints init [DIR]`
450
+
451
+ Initialize a local Blueprint and optionally provision a remote Stack deployment
452
+
453
+ ```
454
+ USAGE
455
+ $ sanity blueprints init [DIR] [--verbose] [--dir <value>] [--example <value> | --blueprint-type json|js|ts |
456
+ --stack-id <value> | --stack-name <value>] [--project-id <value>]
457
+
458
+ ARGUMENTS
459
+ [DIR] Directory to create the local Blueprint in
460
+
461
+ FLAGS
462
+ --blueprint-type=<option> Blueprint manifest type to use for the local Blueprint
463
+ <options: json|js|ts>
464
+ --dir=<value> Directory to create the local Blueprint in
465
+ --example=<value> Example to use for the local Blueprint
466
+ --project-id=<value> Sanity project ID used to scope local Blueprint and remote Stack
467
+ --stack-id=<value> Existing Stack ID used to scope local Blueprint
468
+ --stack-name=<value> Name to use for a new Stack provisioned during initialization
469
+ --verbose Verbose output
470
+
471
+ DESCRIPTION
472
+ Initialize a local Blueprint and optionally provision a remote Stack deployment
473
+
474
+ A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions,
475
+ etc.). A Stack is the remote deployment target where your Blueprint is applied.
476
+ [NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]
477
+
478
+ This is typically the first command you run in a new project. It creates a local Blueprint manifest file
479
+ (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.
480
+ Additionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is
481
+ .gitignored by default.
482
+
483
+ After initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.
484
+
485
+ EXAMPLES
486
+ $ sanity blueprints init
487
+
488
+ $ sanity blueprints init [directory]
489
+
490
+ $ sanity blueprints init --blueprint-type <json|js|ts>
491
+
492
+ $ sanity blueprints init --blueprint-type <json|js|ts> --project-id <projectId> --stack-id <stackId>
493
+
494
+ $ sanity blueprints init --blueprint-type <json|js|ts> --stack-name <stackName>
495
+ ```
496
+
497
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/init.ts)_
498
+
499
+ ## `sanity blueprints logs`
500
+
501
+ Display logs for the current Blueprint's Stack deployment
502
+
503
+ ```
504
+ USAGE
505
+ $ sanity blueprints logs [-w]
506
+
507
+ FLAGS
508
+ -w, --watch Watch for new Stack logs (streaming mode)
509
+
510
+ DESCRIPTION
511
+ Display logs for the current Blueprint's Stack deployment
512
+
513
+ Retrieves Stack deployment logs, useful for debugging and monitoring deployment activity.
514
+
515
+ Use --watch (-w) to stream logs in real-time.
516
+
517
+ If you're not seeing expected logs, verify your Stack is deployed with 'blueprints info'.
518
+
519
+ EXAMPLES
520
+ $ sanity blueprints logs
521
+
522
+ $ sanity blueprints logs --watch
523
+ ```
524
+
525
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/logs.ts)_
526
+
527
+ ## `sanity blueprints plan`
528
+
529
+ Enumerate resources to be deployed to the remote Stack - will not modify any resources
530
+
531
+ ```
532
+ USAGE
533
+ $ sanity blueprints plan
534
+
535
+ DESCRIPTION
536
+ Enumerate resources to be deployed to the remote Stack - will not modify any resources
537
+
538
+ Use this command to preview what changes will be applied to your remote Stack before deploying. This is a safe,
539
+ read-only operation—no resources are created, modified, or deleted.
540
+
541
+ Run 'blueprints plan' after making local changes to your Blueprint manifest to verify the expected diff. When ready,
542
+ run 'blueprints deploy' to apply changes.
543
+
544
+ EXAMPLES
545
+ $ sanity blueprints plan
546
+ ```
547
+
548
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/plan.ts)_
549
+
550
+ ## `sanity blueprints stacks`
551
+
552
+ List all remote Stack deployments (defaults to the current Blueprint's project scope)
553
+
554
+ ```
555
+ USAGE
556
+ $ sanity blueprints stacks [--project-id <value> | ]
557
+
558
+ FLAGS
559
+ --project-id=<value> Project ID to show Stack deployments for
560
+
561
+ DESCRIPTION
562
+ List all remote Stack deployments (defaults to the current Blueprint's project scope)
563
+
564
+ Shows all Stacks associated with a project or organization. By default, lists Stacks scoped to the local Blueprint.
565
+
566
+ Use this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to
567
+ audit what's deployed across your project.
568
+
569
+ EXAMPLES
570
+ $ sanity blueprints stacks
571
+
572
+ $ sanity blueprints stacks --project-id <projectId>
573
+
574
+ $ sanity blueprints stacks --organization-id <organizationId>
575
+ ```
576
+
577
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/blueprints/stacks.ts)_
578
+
579
+ ## `sanity build [OUTPUTDIR]`
580
+
581
+ Builds the Sanity Studio configuration into a static bundle
582
+
583
+ ```
584
+ USAGE
585
+ $ sanity build [OUTPUTDIR] [--auto-updates] [--minify] [--source-maps] [--stats] [-y]
586
+
587
+ ARGUMENTS
588
+ [OUTPUTDIR] Output directory
589
+
590
+ FLAGS
591
+ -y, --yes Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
592
+ --[no-]auto-updates Enable/disable auto updates of studio versions
593
+ --[no-]minify Enable/disable minifying of built bundles
594
+ --[no-]source-maps Enable source maps for built bundles (increases size of bundle)
595
+ --stats Show stats about the built bundles
596
+
597
+ DESCRIPTION
598
+ Builds the Sanity Studio configuration into a static bundle
599
+
600
+ EXAMPLES
601
+ $ sanity build
602
+
603
+ $ sanity build --no-minify --source-maps
604
+ ```
605
+
606
+ _See code: [src/commands/build.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/build.ts)_
607
+
608
+ ## `sanity codemod [CODEMODNAME]`
609
+
610
+ Updates Sanity Studio codebase with a code modification script
611
+
612
+ ```
613
+ USAGE
614
+ $ sanity codemod [CODEMODNAME] [--dry] [--extensions <value>] [--no-verify]
615
+
616
+ ARGUMENTS
617
+ [CODEMODNAME] Name of the codemod to run
618
+
619
+ FLAGS
620
+ --dry Dry run (no changes are made to files)
621
+ --extensions=<value> [default: js,ts,tsx] Transform files with these file extensions (comma separated)
622
+ --no-verify Skip verification steps before running codemod
623
+
624
+ DESCRIPTION
625
+ Updates Sanity Studio codebase with a code modification script
626
+
627
+ EXAMPLES
628
+ Show available code mods
629
+
630
+ $ sanity codemod
631
+
632
+ Run codemod to transform react-icons imports (dry run)
633
+
634
+ $ sanity codemod reactIconsV3 --dry
635
+ ```
636
+
637
+ _See code: [src/commands/codemod.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/codemod.ts)_
638
+
639
+ ## `sanity cors add ORIGIN`
640
+
641
+ Allow a new origin to use your project API through CORS
642
+
643
+ ```
644
+ USAGE
645
+ $ sanity cors add ORIGIN [--credentials]
646
+
647
+ ARGUMENTS
648
+ ORIGIN Origin to allow (e.g., https://example.com)
649
+
650
+ FLAGS
651
+ --[no-]credentials Allow credentials (token/cookie) to be sent from this origin
652
+
653
+ DESCRIPTION
654
+ Allow a new origin to use your project API through CORS
655
+
656
+ EXAMPLES
657
+ Interactively add a CORS origin
658
+
659
+ $ sanity cors add
660
+
661
+ Add a localhost origin without credentials
662
+
663
+ $ sanity cors add http://localhost:3000 --no-credentials
664
+
665
+ Add a production origin with credentials allowed
666
+
667
+ $ sanity cors add https://myapp.com --credentials
668
+ ```
669
+
670
+ _See code: [src/commands/cors/add.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/cors/add.ts)_
671
+
672
+ ## `sanity cors delete [ORIGIN]`
673
+
674
+ Delete an existing CORS origin from your project
675
+
676
+ ```
677
+ USAGE
678
+ $ sanity cors delete [ORIGIN]
679
+
680
+ ARGUMENTS
681
+ [ORIGIN] Origin to delete (will prompt if not provided)
682
+
683
+ DESCRIPTION
684
+ Delete an existing CORS origin from your project
685
+
686
+ EXAMPLES
687
+ Interactively select and delete a CORS origin
688
+
689
+ $ sanity cors delete
690
+
691
+ Delete a specific CORS origin
692
+
693
+ $ sanity cors delete https://example.com
694
+ ```
695
+
696
+ _See code: [src/commands/cors/delete.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/cors/delete.ts)_
697
+
698
+ ## `sanity cors list`
699
+
700
+ List all origins allowed to access the API for this project
701
+
702
+ ```
703
+ USAGE
704
+ $ sanity cors list
705
+
706
+ DESCRIPTION
707
+ List all origins allowed to access the API for this project
708
+
709
+ EXAMPLES
710
+ List CORS origins for the current project
711
+
712
+ $ sanity cors list
713
+ ```
714
+
715
+ _See code: [src/commands/cors/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/cors/list.ts)_
716
+
717
+ ## `sanity dataset alias create [ALIASNAME] [TARGETDATASET]`
718
+
719
+ Create a dataset alias within your project
720
+
721
+ ```
722
+ USAGE
723
+ $ sanity dataset alias create [ALIASNAME] [TARGETDATASET]
724
+
725
+ ARGUMENTS
726
+ [ALIASNAME] Dataset alias name to create
727
+ [TARGETDATASET] Target dataset name to link the alias to
728
+
729
+ DESCRIPTION
730
+ Create a dataset alias within your project
731
+
732
+ EXAMPLES
733
+ Create an alias with interactive prompts
734
+
735
+ $ sanity dataset alias create
736
+
737
+ Create alias named "conference" with interactive dataset selection
738
+
739
+ $ sanity dataset alias create conference
740
+
741
+ Create alias "conference" linked to "conf-2025" dataset
742
+
743
+ $ sanity dataset alias create conference conf-2025
744
+
745
+ Create alias with explicit ~ prefix
746
+
747
+ $ sanity dataset alias create ~conference conf-2025
748
+ ```
749
+
750
+ _See code: [src/commands/dataset/alias/create.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/alias/create.ts)_
751
+
752
+ ## `sanity dataset alias delete ALIASNAME`
753
+
754
+ Delete a dataset alias within your project
755
+
756
+ ```
757
+ USAGE
758
+ $ sanity dataset alias delete ALIASNAME [--force]
759
+
760
+ ARGUMENTS
761
+ ALIASNAME Dataset alias name to delete
762
+
763
+ FLAGS
764
+ --force Skip confirmation prompt and delete immediately
765
+
766
+ DESCRIPTION
767
+ Delete a dataset alias within your project
768
+
769
+ EXAMPLES
770
+ Delete alias named "conference" with confirmation prompt
771
+
772
+ $ sanity dataset alias delete conference
773
+
774
+ Delete alias with explicit ~ prefix
775
+
776
+ $ sanity dataset alias delete ~conference
777
+
778
+ Delete alias named "conference" without confirmation prompt
779
+
780
+ $ sanity dataset alias delete conference --force
781
+ ```
782
+
783
+ _See code: [src/commands/dataset/alias/delete.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/alias/delete.ts)_
784
+
785
+ ## `sanity dataset alias link [ALIASNAME] [TARGETDATASET]`
786
+
787
+ Link a dataset alias to a dataset within your project
788
+
789
+ ```
790
+ USAGE
791
+ $ sanity dataset alias link [ALIASNAME] [TARGETDATASET] [--force]
792
+
793
+ ARGUMENTS
794
+ [ALIASNAME] Dataset alias name to link
795
+ [TARGETDATASET] Target dataset name to link the alias to
796
+
797
+ FLAGS
798
+ --force Skip confirmation prompt when relinking existing alias
799
+
800
+ DESCRIPTION
801
+ Link a dataset alias to a dataset within your project
802
+
803
+ EXAMPLES
804
+ Link an alias with interactive prompts
805
+
806
+ $ sanity dataset alias link
807
+
808
+ Link alias named "conference" with interactive dataset selection
809
+
810
+ $ sanity dataset alias link conference
811
+
812
+ Link alias "conference" to "conf-2025" dataset
813
+
814
+ $ sanity dataset alias link conference conf-2025
815
+
816
+ Link alias with explicit ~ prefix
817
+
818
+ $ sanity dataset alias link ~conference conf-2025
819
+
820
+ Force link without confirmation (skip relink prompt)
821
+
822
+ $ sanity dataset alias link conference conf-2025 --force
823
+ ```
824
+
825
+ _See code: [src/commands/dataset/alias/link.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/alias/link.ts)_
826
+
827
+ ## `sanity dataset alias unlink [ALIASNAME]`
828
+
829
+ Unlink a dataset alias from its dataset within your project
830
+
831
+ ```
832
+ USAGE
833
+ $ sanity dataset alias unlink [ALIASNAME] [--force]
834
+
835
+ ARGUMENTS
836
+ [ALIASNAME] Dataset alias name to unlink
837
+
838
+ FLAGS
839
+ --force Skip confirmation prompt and unlink immediately
840
+
841
+ DESCRIPTION
842
+ Unlink a dataset alias from its dataset within your project
843
+
844
+ EXAMPLES
845
+ Unlink an alias with interactive selection
846
+
847
+ $ sanity dataset alias unlink
848
+
849
+ Unlink alias "conference" with confirmation prompt
850
+
851
+ $ sanity dataset alias unlink conference
852
+
853
+ Unlink alias with explicit ~ prefix
854
+
855
+ $ sanity dataset alias unlink ~conference
856
+
857
+ Unlink alias "conference" without confirmation prompt
858
+
859
+ $ sanity dataset alias unlink conference --force
860
+ ```
861
+
862
+ _See code: [src/commands/dataset/alias/unlink.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/alias/unlink.ts)_
863
+
864
+ ## `sanity dataset copy [SOURCE] [TARGET]`
865
+
866
+ Manages dataset copying, including starting a new copy job, listing copy jobs and following the progress of a running copy job
867
+
868
+ ```
869
+ USAGE
870
+ $ sanity dataset copy [SOURCE] [TARGET] [--attach <value> | --list | --detach | --skip-history] [--limit <value>
871
+ ] [--offset <value> ]
872
+
873
+ ARGUMENTS
874
+ [SOURCE] Name of the dataset to copy from
875
+ [TARGET] Name of the dataset to copy to
876
+
877
+ FLAGS
878
+ --attach=<value> Attach to the running copy process to show progress
879
+ --detach Start the copy without waiting for it to finish
880
+ --limit=<value> Maximum number of jobs returned (default 10, max 1000)
881
+ --list Lists all dataset copy jobs
882
+ --offset=<value> Start position in the list of jobs (default 0)
883
+ --skip-history Don't preserve document history on copy
884
+
885
+ DESCRIPTION
886
+ Manages dataset copying, including starting a new copy job, listing copy jobs and following the progress of a running
887
+ copy job
888
+
889
+ EXAMPLES
890
+ Interactively copy a dataset
891
+
892
+ $ sanity dataset copy
893
+
894
+ Copy from source-dataset (prompts for target)
895
+
896
+ $ sanity dataset copy source-dataset
897
+
898
+ Copy from source-dataset to target-dataset
899
+
900
+ $ sanity dataset copy source-dataset target-dataset
901
+
902
+ Copy without preserving document history (faster for large datasets)
903
+
904
+ $ sanity dataset copy --skip-history source target
905
+
906
+ Start copy job without waiting for completion
907
+
908
+ $ sanity dataset copy --detach source target
909
+
910
+ Attach to a running copy job to follow progress
911
+
912
+ $ sanity dataset copy --attach <job-id>
913
+
914
+ List all dataset copy jobs
915
+
916
+ $ sanity dataset copy --list
917
+
918
+ List copy jobs with pagination
919
+
920
+ $ sanity dataset copy --list --offset 2 --limit 10
921
+ ```
922
+
923
+ _See code: [src/commands/dataset/copy.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/copy.ts)_
924
+
925
+ ## `sanity dataset create [NAME]`
926
+
927
+ Create a new dataset within your project
928
+
929
+ ```
930
+ USAGE
931
+ $ sanity dataset create [NAME] [--visibility custom|private|public]
932
+
933
+ ARGUMENTS
934
+ [NAME] Name of the dataset to create
935
+
936
+ FLAGS
937
+ --visibility=<option> Set visibility for this dataset (custom/private/public)
938
+ <options: custom|private|public>
939
+
940
+ DESCRIPTION
941
+ Create a new dataset within your project
942
+
943
+ EXAMPLES
944
+ Interactively create a dataset
945
+
946
+ $ sanity dataset create
947
+
948
+ Create a dataset named "my-dataset"
949
+
950
+ $ sanity dataset create my-dataset
951
+
952
+ Create a private dataset named "my-dataset"
953
+
954
+ $ sanity dataset create my-dataset --visibility private
955
+ ```
956
+
957
+ _See code: [src/commands/dataset/create.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/create.ts)_
958
+
959
+ ## `sanity dataset delete DATASETNAME`
960
+
961
+ Delete a dataset within your project
962
+
963
+ ```
964
+ USAGE
965
+ $ sanity dataset delete DATASETNAME [--force]
966
+
967
+ ARGUMENTS
968
+ DATASETNAME Dataset name to delete
969
+
970
+ FLAGS
971
+ --force Do not prompt for delete confirmation - forcefully delete
972
+
973
+ DESCRIPTION
974
+ Delete a dataset within your project
975
+
976
+ EXAMPLES
977
+ Delete a specific dataset
978
+
979
+ $ sanity dataset delete my-dataset
980
+
981
+ Delete a specific dataset without confirmation
982
+
983
+ $ sanity dataset delete my-dataset --force
984
+ ```
985
+
986
+ _See code: [src/commands/dataset/delete.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/delete.ts)_
987
+
988
+ ## `sanity dataset export [NAME] [DESTINATION]`
989
+
990
+ Export dataset to local filesystem as a gzipped tarball. Assets failing with HTTP status codes 401, 403 and 404 upon download are ignored and excluded from export.
991
+
992
+ ```
993
+ USAGE
994
+ $ sanity dataset export [NAME] [DESTINATION] [--asset-concurrency <value>] [--mode stream|cursor] [--no-assets]
995
+ [--no-compress] [--no-drafts] [--overwrite] [--raw] [--types <value>]
996
+
997
+ ARGUMENTS
998
+ [NAME] Name of the dataset to export
999
+ [DESTINATION] Output destination file path
1000
+
1001
+ FLAGS
1002
+ --asset-concurrency=<value> [default: 8] Concurrent number of asset downloads
1003
+ --mode=<option> [default: stream] Mode to export documents with `cursor` might be more performant for
1004
+ larger datasets, but might not be as accurate if the dataset is being modified during
1005
+ export
1006
+ <options: stream|cursor>
1007
+ --no-assets Export only non-asset documents and remove references to image assets
1008
+ --no-compress Skips compressing tarball entries (still generates a gzip file)
1009
+ --no-drafts Export only published versions of documents
1010
+ --overwrite Overwrite any file with the same name
1011
+ --raw Extract only documents, without rewriting asset references
1012
+ --types=<value> Defines which document types to export (comma-separated)
1013
+
1014
+ DESCRIPTION
1015
+ Export dataset to local filesystem as a gzipped tarball. Assets failing with HTTP status codes 401, 403 and 404 upon
1016
+ download are ignored and excluded from export.
1017
+
1018
+ EXAMPLES
1019
+ Export dataset "moviedb" to localPath.tar.gz
1020
+
1021
+ $ sanity dataset export moviedb localPath.tar.gz
1022
+
1023
+ Export dataset without assets
1024
+
1025
+ $ sanity dataset export moviedb assetless.tar.gz --no-assets
1026
+
1027
+ Export raw documents without asset reference rewriting
1028
+
1029
+ $ sanity dataset export staging staging.tar.gz --raw
1030
+
1031
+ Export specific document types
1032
+
1033
+ $ sanity dataset export staging staging.tar.gz --types products,shops
1034
+ ```
1035
+
1036
+ _See code: [src/commands/dataset/export.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/export.ts)_
1037
+
1038
+ ## `sanity dataset import SOURCE`
1039
+
1040
+ Import documents to a Sanity dataset
1041
+
1042
+ ```
1043
+ USAGE
1044
+ $ sanity dataset import SOURCE -p <value> -d <value> [-t <value>] [--replace | --missing] [--allow-failing-assets]
1045
+ [--allow-assets-in-different-dataset] [--replace-assets] [--skip-cross-dataset-references]
1046
+ [--allow-replacement-characters] [--allow-system-documents] [--asset-concurrency <value>]
1047
+
1048
+ ARGUMENTS
1049
+ SOURCE Source file (use "-" for stdin)
1050
+
1051
+ FLAGS
1052
+ -d, --dataset=<value> (required) Dataset to import to
1053
+ -p, --project=<value> (required) Project ID to import to
1054
+ -t, --token=<value> [env: SANITY_IMPORT_TOKEN] Token to authenticate with
1055
+ --allow-assets-in-different-dataset Allow asset documents to reference different project/dataset
1056
+ --allow-failing-assets Skip assets that cannot be fetched/uploaded
1057
+ --allow-replacement-characters Allow unicode replacement characters in imported documents
1058
+ --allow-system-documents Imports system documents
1059
+ --asset-concurrency=<value> Number of parallel asset imports
1060
+ --missing Skip documents that already exist
1061
+ --replace Replace documents with the same IDs
1062
+ --replace-assets Skip reuse of existing assets
1063
+ --skip-cross-dataset-references Skips references to other datasets
1064
+
1065
+ DESCRIPTION
1066
+ Import documents to a Sanity dataset
1067
+
1068
+ EXAMPLES
1069
+ Import "./my-dataset.ndjson" into dataset "staging"
1070
+
1071
+ $ sanity dataset import -p myPrOj -d staging -t someSecretToken my-dataset.ndjson
1072
+
1073
+ Import into dataset "test" from stdin, read token from env var
1074
+
1075
+ cat my-dataset.ndjson | sanity dataset import -p myPrOj -d test -
1076
+ ```
1077
+
1078
+ _See code: [src/commands/dataset/import.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/import.ts)_
1079
+
1080
+ ## `sanity dataset list`
1081
+
1082
+ List datasets of your project
1083
+
1084
+ ```
1085
+ USAGE
1086
+ $ sanity dataset list
1087
+
1088
+ DESCRIPTION
1089
+ List datasets of your project
1090
+
1091
+ EXAMPLES
1092
+ List datasets of your project
1093
+
1094
+ $ sanity dataset list
1095
+ ```
1096
+
1097
+ _See code: [src/commands/dataset/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/list.ts)_
1098
+
1099
+ ## `sanity dataset visibility get DATASET`
1100
+
1101
+ Get the visibility of a dataset
1102
+
1103
+ ```
1104
+ USAGE
1105
+ $ sanity dataset visibility get DATASET
1106
+
1107
+ ARGUMENTS
1108
+ DATASET The name of the dataset to get visibility for
1109
+
1110
+ DESCRIPTION
1111
+ Get the visibility of a dataset
1112
+
1113
+ EXAMPLES
1114
+ Check the visibility of a dataset
1115
+
1116
+ $ sanity dataset visibility get my-dataset
1117
+ ```
1118
+
1119
+ _See code: [src/commands/dataset/visibility/get.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/visibility/get.ts)_
1120
+
1121
+ ## `sanity dataset visibility set DATASET MODE`
1122
+
1123
+ Set the visibility of a dataset
1124
+
1125
+ ```
1126
+ USAGE
1127
+ $ sanity dataset visibility set DATASET MODE
1128
+
1129
+ ARGUMENTS
1130
+ DATASET The name of the dataset to set visibility for
1131
+ MODE (public|private) The visibility mode to set
1132
+
1133
+ DESCRIPTION
1134
+ Set the visibility of a dataset
1135
+
1136
+ EXAMPLES
1137
+ Make a dataset private
1138
+
1139
+ $ sanity dataset visibility set my-dataset private
1140
+
1141
+ Make a dataset public
1142
+
1143
+ $ sanity dataset visibility set my-dataset public
1144
+ ```
1145
+
1146
+ _See code: [src/commands/dataset/visibility/set.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dataset/visibility/set.ts)_
1147
+
1148
+ ## `sanity debug`
1149
+
1150
+ Provides diagnostic info for Sanity Studio troubleshooting
1151
+
1152
+ ```
1153
+ USAGE
1154
+ $ sanity debug [--secrets]
1155
+
1156
+ FLAGS
1157
+ --secrets Include API keys in output
1158
+
1159
+ DESCRIPTION
1160
+ Provides diagnostic info for Sanity Studio troubleshooting
1161
+
1162
+ EXAMPLES
1163
+ $ sanity debug
1164
+
1165
+ $ sanity debug --secrets
1166
+ ```
1167
+
1168
+ _See code: [src/commands/debug.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/debug.ts)_
1169
+
1170
+ ## `sanity deploy [SOURCEDIR]`
1171
+
1172
+ Builds and deploys Sanity Studio or application to Sanity hosting
1173
+
1174
+ ```
1175
+ USAGE
1176
+ $ sanity deploy [SOURCEDIR] [--auto-updates] [--build] [--minify] [--schema-required] [--source-maps]
1177
+ [--verbose] [-y]
1178
+
1179
+ ARGUMENTS
1180
+ [SOURCEDIR] Source directory
1181
+
1182
+ FLAGS
1183
+ -y, --yes Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
1184
+ --[no-]auto-updates Automatically update the studio to the latest version
1185
+ --[no-]build Don't build the studio prior to deploy, instead deploying the version currently in `dist/`
1186
+ --[no-]minify Skip minifying built JavaScript (speeds up build, increases size of bundle)
1187
+ --schema-required Fail-fast deployment if schema store fails
1188
+ --source-maps Enable source maps for built bundles (increases size of bundle)
1189
+ --verbose Enable verbose logging
1190
+
1191
+ DESCRIPTION
1192
+ Builds and deploys Sanity Studio or application to Sanity hosting
1193
+
1194
+ EXAMPLES
1195
+ Build the studio
1196
+
1197
+ $ sanity deploy
1198
+
1199
+ Deploys non-minified build with source maps
1200
+
1201
+ $ sanity deploy --no-minify --source-maps
1202
+
1203
+ Fail fast on schema store fails - for when other services rely on the stored schema
1204
+
1205
+ $ sanity deploy --schema-required
1206
+ ```
1207
+
1208
+ _See code: [src/commands/deploy.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/deploy.ts)_
1209
+
1210
+ ## `sanity dev`
1211
+
1212
+ Starts a local development server for Sanity Studio with live reloading
1213
+
1214
+ ```
1215
+ USAGE
1216
+ $ sanity dev [--auto-updates] [--host <value>] [--load-in-dashboard] [--port <value>]
1217
+
1218
+ FLAGS
1219
+ --[no-]auto-updates Automatically update Sanity Studio dependencies.
1220
+ --host=<value> [default: localhost] The local network interface at which to listen.
1221
+ --[no-]load-in-dashboard Load the app/studio in the Sanity dashboard.
1222
+ --port=<value> [default: 3333] TCP port to start server on.
1223
+
1224
+ DESCRIPTION
1225
+ Starts a local development server for Sanity Studio with live reloading
1226
+
1227
+ EXAMPLES
1228
+ $ sanity dev --host=0.0.0.0
1229
+
1230
+ $ sanity dev --port=1942
1231
+
1232
+ $ sanity dev --load-in-dashboard
1233
+ ```
1234
+
1235
+ _See code: [src/commands/dev.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/dev.ts)_
1236
+
1237
+ ## `sanity docs browse`
1238
+
1239
+ Open Sanity docs in a web browser
1240
+
1241
+ ```
1242
+ USAGE
1243
+ $ sanity docs browse
1244
+
1245
+ DESCRIPTION
1246
+ Open Sanity docs in a web browser
1247
+ ```
1248
+
1249
+ _See code: [src/commands/docs/browse.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/docs/browse.ts)_
1250
+
1251
+ ## `sanity docs read PATH`
1252
+
1253
+ Read an article in terminal
1254
+
1255
+ ```
1256
+ USAGE
1257
+ $ sanity docs read PATH [--web]
1258
+
1259
+ ARGUMENTS
1260
+ PATH Path or URL to article, found in search results and docs content as links
1261
+
1262
+ FLAGS
1263
+ --web Open in a web browser
1264
+
1265
+ DESCRIPTION
1266
+ Read an article in terminal
1267
+
1268
+ EXAMPLES
1269
+ Read as markdown in terminal
1270
+
1271
+ $ sanity docs read /docs/studio/installation
1272
+
1273
+ Read using full URL
1274
+
1275
+ $ sanity docs read https://www.sanity.io/docs/studio/installation
1276
+
1277
+ Open in web browser
1278
+
1279
+ $ sanity docs read /docs/studio/installation --web
1280
+
1281
+ Open using full URL in web browser
1282
+
1283
+ $ sanity docs read https://www.sanity.io/docs/studio/installation -w
1284
+ ```
1285
+
1286
+ _See code: [src/commands/docs/read.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/docs/read.ts)_
1287
+
1288
+ ## `sanity docs search QUERY`
1289
+
1290
+ Search Sanity docs
1291
+
1292
+ ```
1293
+ USAGE
1294
+ $ sanity docs search QUERY [--limit <value>]
1295
+
1296
+ ARGUMENTS
1297
+ QUERY Search query for documentation
1298
+
1299
+ FLAGS
1300
+ --limit=<value> [default: 10] Maximum number of results to return
1301
+
1302
+ DESCRIPTION
1303
+ Search Sanity docs
1304
+
1305
+ EXAMPLES
1306
+ Search for documentation about schemas
1307
+
1308
+ $ sanity docs search schema
1309
+
1310
+ Search with phrase
1311
+
1312
+ $ sanity docs search "groq functions"
1313
+
1314
+ Limit search results
1315
+
1316
+ $ sanity docs search "deployment" --limit=5
1317
+ ```
1318
+
1319
+ _See code: [src/commands/docs/search.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/docs/search.ts)_
1320
+
1321
+ ## `sanity documents create [FILE]`
1322
+
1323
+ Create one or more documents
1324
+
1325
+ ```
1326
+ USAGE
1327
+ $ sanity documents create [FILE] [-d <value>] [--id <value>] [--json5] [--missing] [--replace] [--watch]
1328
+
1329
+ ARGUMENTS
1330
+ [FILE] JSON file to create document(s) from
1331
+
1332
+ FLAGS
1333
+ -d, --dataset=<value> Dataset to create document(s) in (overrides config)
1334
+ --id=<value> Specify a document ID to use. Will fetch remote document ID and populate editor.
1335
+ --json5 Use JSON5 file type to allow a "simplified" version of JSON
1336
+ --missing On duplicate document IDs, don't modify the target document(s)
1337
+ --replace On duplicate document IDs, replace existing document with specified document(s)
1338
+ --watch Write the documents whenever the target file or buffer changes
1339
+
1340
+ DESCRIPTION
1341
+ Create one or more documents
1342
+
1343
+ EXAMPLES
1344
+ Create the document specified in "myDocument.json"
1345
+
1346
+ $ sanity documents create myDocument.json
1347
+
1348
+ Open configured $EDITOR and create the specified document(s)
1349
+
1350
+ $ sanity documents create
1351
+
1352
+ Fetch document with the ID "myDocId" and open configured $EDITOR with the current document content (if any). Replace
1353
+ document with the edited version when the editor closes
1354
+
1355
+ $ sanity documents create --id myDocId --replace
1356
+
1357
+ Open configured $EDITOR and replace the document with the given content on each save. Use JSON5 file extension and
1358
+ parser for simplified syntax.
1359
+
1360
+ $ sanity documents create --id myDocId --watch --replace --json5
1361
+ ```
1362
+
1363
+ _See code: [src/commands/documents/create.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/documents/create.ts)_
1364
+
1365
+ ## `sanity documents delete ID [IDS]`
1366
+
1367
+ Delete one or more documents from the projects configured dataset
1368
+
1369
+ ```
1370
+ USAGE
1371
+ $ sanity documents delete ID... [IDS...] [--dataset <value>]
1372
+
1373
+ ARGUMENTS
1374
+ ID... Document ID to delete
1375
+ [IDS...] Additional document IDs to delete
1376
+
1377
+ FLAGS
1378
+ --dataset=<value> NAME to override dataset
1379
+
1380
+ DESCRIPTION
1381
+ Delete one or more documents from the projects configured dataset
1382
+
1383
+ EXAMPLES
1384
+ Delete the document with the ID "myDocId"
1385
+
1386
+ $ sanity documents delete myDocId
1387
+
1388
+ ID wrapped in double or single quote works equally well
1389
+
1390
+ $ sanity documents delete 'myDocId'
1391
+
1392
+ Delete document with ID "someDocId" from dataset "blog"
1393
+
1394
+ $ sanity documents delete --dataset=blog someDocId
1395
+
1396
+ Delete the document with ID "doc1" and "doc2"
1397
+
1398
+ $ sanity documents delete doc1 doc2
1399
+ ```
1400
+
1401
+ _See code: [src/commands/documents/delete.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/documents/delete.ts)_
1402
+
1403
+ ## `sanity documents get DOCUMENTID`
1404
+
1405
+ Get and print a document by ID
1406
+
1407
+ ```
1408
+ USAGE
1409
+ $ sanity documents get DOCUMENTID [-d <value>] [--pretty]
1410
+
1411
+ ARGUMENTS
1412
+ DOCUMENTID Document ID to retrieve
1413
+
1414
+ FLAGS
1415
+ -d, --dataset=<value> Dataset to get document from (overrides config)
1416
+ --pretty Colorize JSON output
1417
+
1418
+ DESCRIPTION
1419
+ Get and print a document by ID
1420
+
1421
+ EXAMPLES
1422
+ Get the document with ID "myDocId"
1423
+
1424
+ $ sanity documents get myDocId
1425
+
1426
+ Get document with colorized JSON output
1427
+
1428
+ $ sanity documents get myDocId --pretty
1429
+
1430
+ Get document from a specific dataset
1431
+
1432
+ $ sanity documents get myDocId --dataset production
1433
+ ```
1434
+
1435
+ _See code: [src/commands/documents/get.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/documents/get.ts)_
1436
+
1437
+ ## `sanity documents query QUERY`
1438
+
1439
+ Query for documents
1440
+
1441
+ ```
1442
+ USAGE
1443
+ $ sanity documents query QUERY [--anonymous] [--api-version <value>] [-d <value>] [--pretty] [-p <value>]
1444
+
1445
+ ARGUMENTS
1446
+ QUERY GROQ query to run against the dataset
1447
+
1448
+ FLAGS
1449
+ -d, --dataset=<value> Dataset to query (overrides config)
1450
+ -p, --project=<value> Project ID to query (overrides config)
1451
+ --anonymous Send the query without any authorization token
1452
+ --api-version=<value> [env: SANITY_CLI_QUERY_API_VERSION] API version to use (defaults to 2025-08-15)
1453
+ --pretty Colorize JSON output
1454
+
1455
+ DESCRIPTION
1456
+ Query for documents
1457
+
1458
+ EXAMPLES
1459
+ Fetch 5 documents of type "movie"
1460
+
1461
+ $ sanity documents query '*[_type == "movie"][0..4]'
1462
+
1463
+ Fetch title of the oldest movie in the dataset named "staging"
1464
+
1465
+ $ sanity documents query '*[_type == "movie"]|order(releaseDate asc)[0]{title}' --dataset staging
1466
+
1467
+ Use API version v2021-06-07 and do a query
1468
+
1469
+ $ sanity documents query '*[_id == "header"] { "headerText": pt::text(body) }' --api-version v2021-06-07
1470
+ ```
1471
+
1472
+ _See code: [src/commands/documents/query.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/documents/query.ts)_
1473
+
1474
+ ## `sanity documents validate`
1475
+
1476
+ Validate documents in a dataset against the studio schema
1477
+
1478
+ ```
1479
+ USAGE
1480
+ $ sanity documents validate [-d <value>] [--file <value>] [--format <value>] [--level error|warning|info]
1481
+ [--max-custom-validation-concurrency <value>] [--max-fetch-concurrency <value>] [--workspace <value>] [-y]
1482
+
1483
+ FLAGS
1484
+ -d, --dataset=<value> Override the dataset used. By default, this is derived from the given
1485
+ workspace
1486
+ -y, --yes Skips the first confirmation prompt
1487
+ --file=<value> Provide a path to either an .ndjson file or a tarball containing an
1488
+ .ndjson file
1489
+ --format=<value> The output format used to print the found validation markers and
1490
+ report progress
1491
+ --level=<option> [default: warning] The minimum level reported out. Defaults to
1492
+ warning
1493
+ <options: error|warning|info>
1494
+ --max-custom-validation-concurrency=<value> [default: 5] Specify how many custom validators can run concurrently
1495
+ --max-fetch-concurrency=<value> [default: 25] Specify how many `client.fetch` requests are allow
1496
+ concurrency at once
1497
+ --workspace=<value> The name of the workspace to use when downloading and validating all
1498
+ documents
1499
+
1500
+ DESCRIPTION
1501
+ Validate documents in a dataset against the studio schema
1502
+
1503
+ EXAMPLES
1504
+ Validates all documents in a Sanity project with more than one workspace
1505
+
1506
+ $ sanity documents validate --workspace default
1507
+
1508
+ Override the dataset specified in the workspace
1509
+
1510
+ $ sanity documents validate --workspace default --dataset staging
1511
+
1512
+ Save the results of the report into a file
1513
+
1514
+ $ sanity documents validate --yes > report.txt
1515
+
1516
+ Report out info level validation markers too
1517
+
1518
+ $ sanity documents validate --level info
1519
+ ```
1520
+
1521
+ _See code: [src/commands/documents/validate.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/documents/validate.ts)_
1522
+
1523
+ ## `sanity exec SCRIPT`
1524
+
1525
+ Executes a script within the Sanity Studio context
1526
+
1527
+ ```
1528
+ USAGE
1529
+ $ sanity exec SCRIPT... [--mock-browser-env] [--with-user-token]
1530
+
1531
+ ARGUMENTS
1532
+ SCRIPT... Path to the script to execute
1533
+
1534
+ FLAGS
1535
+ --mock-browser-env Mocks a browser-like environment using jsdom
1536
+ --with-user-token Prime access token from CLI config into getCliClient()
1537
+
1538
+ DESCRIPTION
1539
+ Executes a script within the Sanity Studio context
1540
+
1541
+ EXAMPLES
1542
+ Run the script at some/script.js in Sanity context
1543
+
1544
+ $ sanity exec some/script.js
1545
+
1546
+ Run the script at migrations/fullname.ts and configure `getCliClient()` from `sanity/cli` to include the current
1547
+ user's token
1548
+
1549
+ $ sanity exec migrations/fullname.ts --with-user-token
1550
+
1551
+ Run the script at scripts/browserScript.js in a mock browser environment
1552
+
1553
+ $ sanity exec scripts/browserScript.js --mock-browser-env
1554
+
1555
+ Pass arbitrary arguments to scripts by separating them with a `--`. Arguments are available in `process.argv` as
1556
+ they would in regular node scripts (eg the following command would yield a `process.argv` of: `['/path/to/node',
1557
+ '/path/to/myscript.js', '--dry-run', 'positional-argument']`)
1558
+
1559
+ $ sanity exec --mock-browser-env myscript.js -- --dry-run positional-argument
1560
+ ```
1561
+
1562
+ _See code: [src/commands/exec.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/exec.ts)_
1563
+
1564
+ ## `sanity functions add`
1565
+
1566
+ Add a Function to your Blueprint
1567
+
1568
+ ```
1569
+ USAGE
1570
+ $ sanity functions add [--example <value> | -n <value> | | --language ts|js | --javascript | | ] [--type
1571
+ document-create|document-delete|document-update|document-publish|media-library-asset-create|media-library-asset-upda
1572
+ te|media-library-asset-delete... ] [--helpers] [--installer skip|npm|pnpm|yarn] [-i | ]
1573
+
1574
+ FLAGS
1575
+ -i, --install Shortcut for --fn-installer npm
1576
+ -n, --name=<value> Name of the Function to add
1577
+ --example=<value> Example to use for the Function
1578
+ --[no-]helpers Add helpers to the new Function
1579
+ --installer=<option> How to install the @sanity/functions helpers
1580
+ <options: skip|npm|pnpm|yarn>
1581
+ --javascript Use JavaScript instead of TypeScript
1582
+ --language=<option> [default: ts] Language of the new Function
1583
+ <options: ts|js>
1584
+ --type=<option>... Document change event(s) that should trigger the function; you can specify multiple events
1585
+ by specifying this flag multiple times
1586
+ <options: document-create|document-delete|document-update|document-publish|media-library-ass
1587
+ et-create|media-library-asset-update|media-library-asset-delete>
1588
+
1589
+ DESCRIPTION
1590
+ Add a Function to your Blueprint
1591
+
1592
+ Scaffolds a new Function in the functions/ folder and templates a resource for your Blueprint manifest.
1593
+
1594
+ Functions are serverless handlers triggered by document events (create, update, delete, publish) or media library
1595
+ events.
1596
+
1597
+ After adding, use 'functions dev' to test locally, then 'blueprints deploy' to publish.
1598
+
1599
+ EXAMPLES
1600
+ $ sanity functions add
1601
+
1602
+ $ sanity functions add --helpers
1603
+
1604
+ $ sanity functions add --name my-function
1605
+
1606
+ $ sanity functions add --name my-function --type document-create
1607
+
1608
+ $ sanity functions add --name my-function --type document-create --type document-update --lang js
1609
+ ```
1610
+
1611
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/functions/add.ts)_
1612
+
1613
+ ## `sanity functions dev`
1614
+
1615
+ Start the Sanity Function emulator
1616
+
1617
+ ```
1618
+ USAGE
1619
+ $ sanity functions dev [-h <value>] [-p <value>] [-t <value>]
1620
+
1621
+ FLAGS
1622
+ -h, --host=<value> The local network interface at which to listen. [default: "localhost"]
1623
+ -p, --port=<value> TCP port to start emulator on. [default: 8080]
1624
+ -t, --timeout=<value> Maximum execution time for all functions, in seconds. Takes precedence over function-specific
1625
+ `timeout`
1626
+
1627
+ DESCRIPTION
1628
+ Start the Sanity Function emulator
1629
+
1630
+ Runs a local, web-based development server to test your functions before deploying.
1631
+
1632
+ Open the emulator in your browser to interactively test your functions with the payload editor.
1633
+
1634
+ Optionally, set the host and port with the --host and --port flags. Function timeout can be configured with the
1635
+ --timeout flag.
1636
+
1637
+ To invoke a function with the CLI, use 'functions test'.
1638
+
1639
+ EXAMPLES
1640
+ $ sanity functions dev --host 127.0.0.1 --port 8974
1641
+
1642
+ $ sanity functions dev --timeout 60
1643
+ ```
1644
+
1645
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/functions/dev.ts)_
1646
+
1647
+ ## `sanity functions env add NAME KEY VALUE`
1648
+
1649
+ Add or set an environment variable for a deployed function
1650
+
1651
+ ```
1652
+ USAGE
1653
+ $ sanity functions env add NAME KEY VALUE
1654
+
1655
+ ARGUMENTS
1656
+ NAME The name of the Sanity Function
1657
+ KEY The name of the environment variable
1658
+ VALUE The value of the environment variable
1659
+
1660
+ DESCRIPTION
1661
+ Add or set an environment variable for a deployed function
1662
+
1663
+ Sets an environment variable in a deployed Sanity Function. If the variable already exists, its value is updated.
1664
+
1665
+ Environment variables are useful for API keys, configuration values, and other secrets that shouldn't be hardcoded.
1666
+ Changes take effect on the next function invocation.
1667
+
1668
+ EXAMPLES
1669
+ $ sanity functions env add MyFunction API_URL https://api.example.com/
1670
+ ```
1671
+
1672
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/functions/env/add.ts)_
1673
+
1674
+ ## `sanity functions env list NAME`
1675
+
1676
+ List environment variables for a deployed function
1677
+
1678
+ ```
1679
+ USAGE
1680
+ $ sanity functions env list NAME
1681
+
1682
+ ARGUMENTS
1683
+ NAME The name of the Sanity Function
1684
+
1685
+ DESCRIPTION
1686
+ List environment variables for a deployed function
1687
+
1688
+ Displays all environment variables (keys only) configured in a deployed Sanity Function.
1689
+
1690
+ Use 'functions env add' to set variables or 'functions env remove' to delete them.
1691
+
1692
+ EXAMPLES
1693
+ $ sanity functions env list MyFunction
1694
+ ```
1695
+
1696
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/functions/env/list.ts)_
1697
+
1698
+ ## `sanity functions env remove NAME KEY`
1699
+
1700
+ Remove an environment variable from a deployed function
1701
+
1702
+ ```
1703
+ USAGE
1704
+ $ sanity functions env remove NAME KEY
1705
+
1706
+ ARGUMENTS
1707
+ NAME The name of the Sanity Function
1708
+ KEY The name of the environment variable
1709
+
1710
+ DESCRIPTION
1711
+ Remove an environment variable from a deployed function
1712
+
1713
+ Deletes an environment variable from a deployed Sanity Function. The change takes effect on the next function
1714
+ invocation.
1715
+
1716
+ Use 'functions env list' to see current variables before removing.
1717
+
1718
+ EXAMPLES
1719
+ $ sanity functions env remove MyFunction API_URL
1720
+ ```
1721
+
1722
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/functions/env/remove.ts)_
1723
+
1724
+ ## `sanity functions logs [NAME]`
1725
+
1726
+ Retrieve or delete logs for a Sanity Function
1727
+
1728
+ ```
1729
+ USAGE
1730
+ $ sanity functions logs [NAME] [-u] [-f [-d | -l <value> | -j]] [-w]
1731
+
1732
+ ARGUMENTS
1733
+ [NAME] The name of the Sanity Function
1734
+
1735
+ FLAGS
1736
+ -d, --delete Delete all logs for the function
1737
+ -f, --force Skip confirmation for deleting logs
1738
+ -j, --json Return logs in JSON format
1739
+ -l, --limit=<value> [default: 50] Total number of log entries to retrieve
1740
+ -u, --utc Show dates in UTC time zone
1741
+ -w, --watch Watch for new logs (streaming mode)
1742
+
1743
+ DESCRIPTION
1744
+ Retrieve or delete logs for a Sanity Function
1745
+
1746
+ Fetches execution logs from a deployed function, useful for debugging production issues or monitoring activity.
1747
+
1748
+ Use --watch (-w) to stream logs in real-time. Use --delete to clear all logs for a function (requires confirmation
1749
+ unless --force is specified).
1750
+
1751
+ EXAMPLES
1752
+ $ sanity functions logs <name>
1753
+
1754
+ $ sanity functions logs <name> --json
1755
+
1756
+ $ sanity functions logs <name> --limit 100
1757
+
1758
+ $ sanity functions logs <name> --delete
1759
+ ```
1760
+
1761
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/functions/logs.ts)_
1762
+
1763
+ ## `sanity functions test [NAME]`
1764
+
1765
+ Invoke a local Sanity Function
1766
+
1767
+ ```
1768
+ USAGE
1769
+ $ sanity functions test [NAME] [--data-before <value> | [-d <value> | -f <value> | --document-id <value>] | | |
1770
+ --file-before <value> | --file-after <value> | --document-id-before <value> | --document-id-after <value>]
1771
+ [--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>] [-a <value>] [--with-user-token]
1772
+ [--media-library-id <value> | --project-id <value> | --dataset <value>]
1773
+
1774
+ ARGUMENTS
1775
+ [NAME] The name of the Sanity Function
1776
+
1777
+ FLAGS
1778
+ -a, --api=<value> Sanity API Version to use
1779
+ -d, --data=<value> Data to send to the function
1780
+ -e, --event=<option> Type of event (create, update, delete)
1781
+ <options: create|update|delete>
1782
+ -f, --file=<value> Read data from file and send to the function
1783
+ -t, --timeout=<value> Execution timeout value in seconds
1784
+ --data-after=<value> Current document
1785
+ --data-before=<value> Original document
1786
+ --dataset=<value> The Sanity dataset to use
1787
+ --document-id=<value> Document to fetch and send to function
1788
+ --document-id-after=<value> Current document
1789
+ --document-id-before=<value> Original document
1790
+ --file-after=<value> Current document
1791
+ --file-before=<value> Original document
1792
+ --media-library-id=<value> Sanity Media Library ID to use
1793
+ --project-id=<value> Sanity Project ID to use
1794
+ --with-user-token Prime access token from CLI config
1795
+
1796
+ DESCRIPTION
1797
+ Invoke a local Sanity Function
1798
+
1799
+ Executes a function locally with the provided payload, simulating how it would run when deployed. Use this to test
1800
+ your function logic before deploying.
1801
+
1802
+ Provide test data via --data (inline JSON), --file (JSON file), or --document-id (fetch from Sanity). For update
1803
+ events, use the before/after flag pairs to simulate document changes.
1804
+
1805
+ EXAMPLES
1806
+ $ sanity functions test <name> --data '{ "id": 1 }'
1807
+
1808
+ $ sanity functions test <name> --file 'payload.json'
1809
+
1810
+ $ sanity functions test <name> --data '{ "id": 1 }' --timeout 60
1811
+
1812
+ $ sanity functions test <name> --event update --data-before '{ "title": "before" }' --data-after '{ "title": "after" }'
1813
+ ```
1814
+
1815
+ _See code: [@sanity/runtime-cli](https://github.com/sanity-io/runtime-cli/blob/v13.2.0/src/commands/functions/test.ts)_
1816
+
1817
+ ## `sanity graphql deploy`
1818
+
1819
+ Deploy a GraphQL API from the current Sanity schema
1820
+
1821
+ ```
1822
+ USAGE
1823
+ $ sanity graphql deploy [--api <value>...] [--dataset <value>] [--dry-run] [--force] [--generation gen1|gen2|gen3]
1824
+ [--non-null-document-fields] [--playground] [--tag <value>] [--with-union-cache]
1825
+
1826
+ FLAGS
1827
+ --api=<value>... Only deploy API with this ID. Can be specified multiple times.
1828
+ --dataset=<value> Deploy API for the given dataset
1829
+ --dry-run Validate defined GraphQL APIs, check for breaking changes, skip deploy
1830
+ --force Deploy API without confirming breaking changes
1831
+ --generation=<option> API generation to deploy (defaults to "gen3")
1832
+ <options: gen1|gen2|gen3>
1833
+ --non-null-document-fields Use non-null document fields (_id, _type etc)
1834
+ --[no-]playground Enable GraphQL playground for easier debugging
1835
+ --tag=<value> Deploy API(s) to given tag (defaults to "default")
1836
+ --with-union-cache Enable union cache that optimizes schema generation for schemas with many self referencing
1837
+ types
1838
+
1839
+ DESCRIPTION
1840
+ Deploy a GraphQL API from the current Sanity schema
1841
+
1842
+ EXAMPLES
1843
+ Deploy all defined GraphQL APIs
1844
+
1845
+ $ sanity graphql deploy
1846
+
1847
+ Validate defined GraphQL APIs, check for breaking changes, skip deploy
1848
+
1849
+ $ sanity graphql deploy --dry-run
1850
+
1851
+ Deploy only the GraphQL APIs with the IDs "staging" and "ios"
1852
+
1853
+ $ sanity graphql deploy --api staging --api ios
1854
+
1855
+ Deploy all defined GraphQL APIs, overriding any playground setting
1856
+
1857
+ $ sanity graphql deploy --playground
1858
+ ```
1859
+
1860
+ _See code: [src/commands/graphql/deploy.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/graphql/deploy.ts)_
1861
+
1862
+ ## `sanity graphql list`
1863
+
1864
+ List all GraphQL endpoints deployed for this project
1865
+
1866
+ ```
1867
+ USAGE
1868
+ $ sanity graphql list
1869
+
1870
+ DESCRIPTION
1871
+ List all GraphQL endpoints deployed for this project
1872
+
1873
+ EXAMPLES
1874
+ List GraphQL endpoints for the current project
1875
+
1876
+ $ sanity graphql list
1877
+ ```
1878
+
1879
+ _See code: [src/commands/graphql/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/graphql/list.ts)_
1880
+
1881
+ ## `sanity graphql undeploy`
1882
+
1883
+ Remove a deployed GraphQL API
1884
+
1885
+ ```
1886
+ USAGE
1887
+ $ sanity graphql undeploy [--api <value>] [--dataset <value>] [--force] [--project <value>] [--tag <value>]
1888
+
1889
+ FLAGS
1890
+ --api=<value> Undeploy API with this ID (project, dataset and tag flags take precedence)
1891
+ --dataset=<value> Dataset to undeploy GraphQL API from
1892
+ --force Skip confirmation prompt
1893
+ --project=<value> Project ID to delete GraphQL API for
1894
+ --tag=<value> [default: default] Tag to undeploy GraphQL API from
1895
+
1896
+ DESCRIPTION
1897
+ Remove a deployed GraphQL API
1898
+
1899
+ EXAMPLES
1900
+ Undeploy GraphQL API for current project and dataset
1901
+
1902
+ $ sanity graphql undeploy
1903
+
1904
+ Undeploy API with ID "ios"
1905
+
1906
+ $ sanity graphql undeploy --api ios
1907
+
1908
+ Undeploy GraphQL API for staging dataset
1909
+
1910
+ $ sanity graphql undeploy --dataset staging
1911
+
1912
+ Undeploy GraphQL API for staging dataset with "next" tag
1913
+
1914
+ $ sanity graphql undeploy --dataset staging --tag next
1915
+
1916
+ Undeploy GraphQL API without confirmation prompt
1917
+
1918
+ $ sanity graphql undeploy --force
1919
+ ```
1920
+
1921
+ _See code: [src/commands/graphql/undeploy.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/graphql/undeploy.ts)_
1922
+
1923
+ ## `sanity help [COMMAND]`
1924
+
1925
+ Display help for sanity.
1926
+
1927
+ ```
1928
+ USAGE
1929
+ $ sanity help [COMMAND...] [-n]
1930
+
1931
+ ARGUMENTS
1932
+ [COMMAND...] Command to show help for.
1933
+
1934
+ FLAGS
1935
+ -n, --nested-commands Include all nested commands in the output.
1936
+
1937
+ DESCRIPTION
1938
+ Display help for sanity.
1939
+ ```
1940
+
1941
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.37/src/commands/help.ts)_
1942
+
1943
+ ## `sanity hook attempt ATTEMPTID`
1944
+
1945
+ Print details of a given webhook delivery attempt
1946
+
1947
+ ```
1948
+ USAGE
1949
+ $ sanity hook attempt ATTEMPTID
1950
+
1951
+ ARGUMENTS
1952
+ ATTEMPTID The delivery attempt ID to get details for
1953
+
1954
+ DESCRIPTION
1955
+ Print details of a given webhook delivery attempt
1956
+
1957
+ EXAMPLES
1958
+ Print details of webhook delivery attempt with ID abc123
1959
+
1960
+ $ sanity hook attempt abc123
1961
+ ```
1962
+
1963
+ _See code: [src/commands/hook/attempt.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/hook/attempt.ts)_
1964
+
1965
+ ## `sanity hook create`
1966
+
1967
+ Create a new webhook for the current project
1968
+
1969
+ ```
1970
+ USAGE
1971
+ $ sanity hook create
1972
+
1973
+ DESCRIPTION
1974
+ Create a new webhook for the current project
1975
+
1976
+ EXAMPLES
1977
+ Create a new webhook for the current project
1978
+
1979
+ $ sanity hook create
1980
+ ```
1981
+
1982
+ _See code: [src/commands/hook/create.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/hook/create.ts)_
1983
+
1984
+ ## `sanity hook delete [NAME]`
1985
+
1986
+ Delete a hook within your project
1987
+
1988
+ ```
1989
+ USAGE
1990
+ $ sanity hook delete [NAME]
1991
+
1992
+ ARGUMENTS
1993
+ [NAME] Name of hook to delete (will prompt if not provided)
1994
+
1995
+ DESCRIPTION
1996
+ Delete a hook within your project
1997
+
1998
+ EXAMPLES
1999
+ Interactively select and delete a hook
2000
+
2001
+ $ sanity hook delete
2002
+
2003
+ Delete a specific hook by name
2004
+
2005
+ $ sanity hook delete my-hook
2006
+ ```
2007
+
2008
+ _See code: [src/commands/hook/delete.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/hook/delete.ts)_
2009
+
2010
+ ## `sanity hook list`
2011
+
2012
+ List hooks for a given project
2013
+
2014
+ ```
2015
+ USAGE
2016
+ $ sanity hook list
2017
+
2018
+ DESCRIPTION
2019
+ List hooks for a given project
2020
+
2021
+ EXAMPLES
2022
+ List hooks for a given project
2023
+
2024
+ $ sanity hook list
2025
+ ```
2026
+
2027
+ _See code: [src/commands/hook/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/hook/list.ts)_
2028
+
2029
+ ## `sanity hook logs [NAME]`
2030
+
2031
+ List latest log entries for a given hook
2032
+
2033
+ ```
2034
+ USAGE
2035
+ $ sanity hook logs [NAME] [--detailed]
2036
+
2037
+ ARGUMENTS
2038
+ [NAME] Name of the hook to show logs for
2039
+
2040
+ FLAGS
2041
+ --detailed Include detailed payload and attempts
2042
+
2043
+ DESCRIPTION
2044
+ List latest log entries for a given hook
2045
+
2046
+ EXAMPLES
2047
+ List latest log entries for a given hook
2048
+
2049
+ $ sanity hook logs
2050
+
2051
+ List latest log entries for a specific hook by name
2052
+
2053
+ $ sanity hook logs [NAME]
2054
+ ```
2055
+
2056
+ _See code: [src/commands/hook/logs.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/hook/logs.ts)_
2057
+
2058
+ ## `sanity init`
2059
+
2060
+ Initialize a new Sanity Studio, project and/or app
2061
+
2062
+ ```
2063
+ USAGE
2064
+ $ sanity init [--json] [--auto-updates | --bare] [--coupon <code> | --project-plan <name>] [--dataset
2065
+ <name> | --dataset-default] [--env <filename> | ] [--git <message> | ] [--mcp] [--nextjs-add-config-files]
2066
+ [--nextjs-append-env] [--nextjs-embed-studio] [--organization <id>] [--output-path <path> | ] [--overwrite-files]
2067
+ [--package-manager <manager> | ] [--project <id> | --create-project <name>] [--provider <provider>] [--template
2068
+ <template> | ] [--typescript | ] [--visibility <mode>] [-y]
2069
+
2070
+ FLAGS
2071
+ -y, --yes Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
2072
+ --[no-]auto-updates Enable auto updates of studio versions
2073
+ --bare Skip the Studio initialization and only print the selected project ID and dataset
2074
+ name to stdout
2075
+ --coupon=<code> Optionally select a coupon for a new project (cannot be used with --project-plan)
2076
+ --create-project=<name> Create a new project with the given name
2077
+ --dataset=<name> Dataset name for the studio
2078
+ --dataset-default Set up a project with a public dataset named "production"
2079
+ --env=<filename> Write environment variables to file
2080
+ --[no-]git=<message> Specify a commit message for initial commit, or disable git init
2081
+ --[no-]mcp Enable AI editor integration (MCP) setup
2082
+ --organization=<id> Organization ID to use for the project
2083
+ --output-path=<path> Path to write studio project to
2084
+ --[no-]overwrite-files Overwrite existing files
2085
+ --package-manager=<manager> Specify which package manager to use [allowed: npm, yarn, pnpm]
2086
+ --project=<id> Project ID to use for the studio
2087
+ --project-plan=<name> Optionally select a plan for a new project
2088
+ --provider=<provider> Login provider to use
2089
+ --template=<template> Project template to use [default: "clean"]
2090
+ --[no-]typescript Enable TypeScript support
2091
+ --visibility=<mode> Visibility mode for dataset
2092
+
2093
+ GLOBAL FLAGS
2094
+ --json Format output as json.
2095
+
2096
+ NEXT.JS FLAGS
2097
+ --[no-]nextjs-add-config-files Add config files to Next.js project
2098
+ --[no-]nextjs-append-env Append project ID and dataset to .env file
2099
+ --[no-]nextjs-embed-studio Embed the Studio in Next.js application
2100
+
2101
+ DESCRIPTION
2102
+ Initialize a new Sanity Studio, project and/or app
2103
+
2104
+ EXAMPLES
2105
+ $ sanity init
2106
+
2107
+ Initialize a new project with a public dataset named "production"
2108
+
2109
+ $ sanity init --dataset-default
2110
+
2111
+ Initialize a project with the given project ID and dataset to the given path
2112
+
2113
+ $ sanity init -y --project abc123 --dataset production --output-path ~/myproj
2114
+
2115
+ Initialize a project with the given project ID and dataset using the moviedb template to the given path
2116
+
2117
+ $ sanity init -y --project abc123 --dataset staging --template moviedb --output-path .
2118
+
2119
+ Create a brand new project with name "Movies Unlimited"
2120
+
2121
+ $ sanity init -y --create-project "Movies Unlimited" --dataset moviedb --visibility private --template moviedb \
2122
+ --output-path /Users/espenh/movies-unlimited
2123
+ ```
2124
+
2125
+ _See code: [src/commands/init.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/init.ts)_
2126
+
2127
+ ## `sanity install [PACKAGES]`
2128
+
2129
+ Installs dependencies for Sanity Studio project
2130
+
2131
+ ```
2132
+ USAGE
2133
+ $ sanity install [PACKAGES...]
2134
+
2135
+ ARGUMENTS
2136
+ [PACKAGES...] Packages to install
2137
+
2138
+ DESCRIPTION
2139
+ Installs dependencies for Sanity Studio project
2140
+
2141
+ EXAMPLES
2142
+ $ sanity install
2143
+
2144
+ $ sanity install @sanity/vision
2145
+
2146
+ $ sanity install some-package another-package
2147
+ ```
2148
+
2149
+ _See code: [src/commands/install.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/install.ts)_
2150
+
2151
+ ## `sanity learn`
2152
+
2153
+ Opens Sanity Learn in your web browser
2154
+
2155
+ ```
2156
+ USAGE
2157
+ $ sanity learn
2158
+
2159
+ DESCRIPTION
2160
+ Opens Sanity Learn in your web browser
2161
+ ```
2162
+
2163
+ _See code: [src/commands/learn.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/learn.ts)_
2164
+
2165
+ ## `sanity login`
2166
+
2167
+ Authenticates the CLI for access to Sanity projects
2168
+
2169
+ ```
2170
+ USAGE
2171
+ $ sanity login [--open] [--provider <providerId>] [--sso <slug>]
2172
+
2173
+ FLAGS
2174
+ --[no-]open Open a browser window to log in (`--no-open` only prints URL)
2175
+ --provider=<providerId> Log in using the given provider
2176
+ --sso=<slug> Log in using Single Sign-On, using the given organization slug
2177
+
2178
+ DESCRIPTION
2179
+ Authenticates the CLI for access to Sanity projects
2180
+
2181
+ EXAMPLES
2182
+ Log in using default settings
2183
+
2184
+ $ sanity login
2185
+
2186
+ Log in using Single Sign-On with the "my-organization" slug
2187
+
2188
+ $ sanity login --sso my-organization
2189
+
2190
+ Login with GitHub provider, but do not open a browser window automatically
2191
+
2192
+ $ sanity login --provider github --no-open
2193
+ ```
2194
+
2195
+ _See code: [src/commands/login.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/login.ts)_
2196
+
2197
+ ## `sanity logout`
2198
+
2199
+ Logs out the CLI from the current user session
2200
+
2201
+ ```
2202
+ USAGE
2203
+ $ sanity logout
2204
+
2205
+ DESCRIPTION
2206
+ Logs out the CLI from the current user session
2207
+ ```
2208
+
2209
+ _See code: [src/commands/logout.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/logout.ts)_
2210
+
2211
+ ## `sanity manage`
2212
+
2213
+ Opens project management interface in your web browser
2214
+
2215
+ ```
2216
+ USAGE
2217
+ $ sanity manage
2218
+
2219
+ DESCRIPTION
2220
+ Opens project management interface in your web browser
2221
+ ```
2222
+
2223
+ _See code: [src/commands/manage.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/manage.ts)_
2224
+
2225
+ ## `sanity manifest extract`
2226
+
2227
+ Extracts the studio configuration as one or more JSON manifest files.
2228
+
2229
+ ```
2230
+ USAGE
2231
+ $ sanity manifest extract [--path <value>]
2232
+
2233
+ FLAGS
2234
+ --path=<value> [default: /dist/static] Optional path to specify destination directory of the manifest files
2235
+
2236
+ DESCRIPTION
2237
+ Extracts the studio configuration as one or more JSON manifest files.
2238
+
2239
+ **Note**: This command is experimental and subject to change. It is currently intended for use with Create only.
2240
+
2241
+ EXAMPLES
2242
+ Extracts manifests
2243
+
2244
+ $ sanity manifest extract
2245
+
2246
+ Extracts manifests into /public/static
2247
+
2248
+ $ sanity manifest extract --path /public/static
2249
+ ```
2250
+
2251
+ _See code: [src/commands/manifest/extract.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/manifest/extract.ts)_
2252
+
2253
+ ## `sanity mcp configure`
2254
+
2255
+ Configure Sanity MCP server for AI editors (Cursor, VS Code, Claude Code)
2256
+
2257
+ ```
2258
+ USAGE
2259
+ $ sanity mcp configure
2260
+
2261
+ DESCRIPTION
2262
+ Configure Sanity MCP server for AI editors (Cursor, VS Code, Claude Code)
2263
+
2264
+ EXAMPLES
2265
+ Configure Sanity MCP server for detected AI editors
2266
+
2267
+ $ sanity mcp configure
2268
+ ```
2269
+
2270
+ _See code: [src/commands/mcp/configure.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/mcp/configure.ts)_
2271
+
2272
+ ## `sanity media create-aspect`
2273
+
2274
+ Create a new aspect definition file
2275
+
2276
+ ```
2277
+ USAGE
2278
+ $ sanity media create-aspect
2279
+
2280
+ DESCRIPTION
2281
+ Create a new aspect definition file
2282
+
2283
+ EXAMPLES
2284
+ Create a new aspect definition file
2285
+
2286
+ $ sanity media create-aspect
2287
+ ```
2288
+
2289
+ _See code: [src/commands/media/create-aspect.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/media/create-aspect.ts)_
2290
+
2291
+ ## `sanity media delete-aspect ASPECTNAME`
2292
+
2293
+ Undeploy an aspect
2294
+
2295
+ ```
2296
+ USAGE
2297
+ $ sanity media delete-aspect ASPECTNAME [--media-library-id <value>] [--yes]
2298
+
2299
+ ARGUMENTS
2300
+ ASPECTNAME Name of the aspect to delete
2301
+
2302
+ FLAGS
2303
+ --media-library-id=<value> The id of the target media library
2304
+ --yes Skip confirmation prompt
2305
+
2306
+ DESCRIPTION
2307
+ Undeploy an aspect
2308
+
2309
+ EXAMPLES
2310
+ Delete the aspect named "someAspect"
2311
+
2312
+ $ sanity media delete-aspect someAspect
2313
+ ```
2314
+
2315
+ _See code: [src/commands/media/delete-aspect.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/media/delete-aspect.ts)_
2316
+
2317
+ ## `sanity media deploy-aspect [ASPECTNAME]`
2318
+
2319
+ Deploy an aspect
2320
+
2321
+ ```
2322
+ USAGE
2323
+ $ sanity media deploy-aspect [ASPECTNAME] [--all] [--media-library-id <value>]
2324
+
2325
+ ARGUMENTS
2326
+ [ASPECTNAME] Name of the aspect to deploy
2327
+
2328
+ FLAGS
2329
+ --all Deploy all aspects
2330
+ --media-library-id=<value> The id of the target media library
2331
+
2332
+ DESCRIPTION
2333
+ Deploy an aspect
2334
+
2335
+ EXAMPLES
2336
+ Deploy the aspect named "someAspect"
2337
+
2338
+ $ sanity media deploy-aspect someAspect
2339
+
2340
+ Deploy all aspects
2341
+
2342
+ $ sanity media deploy-aspect --all
2343
+ ```
2344
+
2345
+ _See code: [src/commands/media/deploy-aspect.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/media/deploy-aspect.ts)_
2346
+
2347
+ ## `sanity media export [DESTINATION]`
2348
+
2349
+ Export an archive of all file and image assets including their aspect data from the target media library. Video assets are excluded from the export.
2350
+
2351
+ ```
2352
+ USAGE
2353
+ $ sanity media export [DESTINATION] [--asset-concurrency <value>] [--media-library-id <value>] [--no-compress]
2354
+ [--overwrite]
2355
+
2356
+ ARGUMENTS
2357
+ [DESTINATION] Output destination file path
2358
+
2359
+ FLAGS
2360
+ --asset-concurrency=<value> [default: 8] Concurrent number of asset downloads
2361
+ --media-library-id=<value> The id of the target media library
2362
+ --no-compress Skips compressing tarball entries (still generates a gzip file)
2363
+ --overwrite Overwrite any file with the same name
2364
+
2365
+ DESCRIPTION
2366
+ Export an archive of all file and image assets including their aspect data from the target media library. Video assets
2367
+ are excluded from the export.
2368
+
2369
+ EXAMPLES
2370
+ Export media library interactively
2371
+
2372
+ $ sanity media export
2373
+
2374
+ Export media library to output.tar.gz
2375
+
2376
+ $ sanity media export output.tar.gz
2377
+
2378
+ Export specific media library
2379
+
2380
+ $ sanity media export --media-library-id my-library-id
2381
+ ```
2382
+
2383
+ _See code: [src/commands/media/export.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/media/export.ts)_
2384
+
2385
+ ## `sanity media import SOURCE`
2386
+
2387
+ Import a set of assets to the target media library.
2388
+
2389
+ ```
2390
+ USAGE
2391
+ $ sanity media import SOURCE [--media-library-id <value>] [--replace-aspects]
2392
+
2393
+ ARGUMENTS
2394
+ SOURCE Image file or folder to import from
2395
+
2396
+ FLAGS
2397
+ --media-library-id=<value> The id of the target media library
2398
+ --replace-aspects Replace existing aspect data. All versions will be replaced (e.g. published and draft
2399
+ aspect data)
2400
+
2401
+ DESCRIPTION
2402
+ Import a set of assets to the target media library.
2403
+
2404
+ EXAMPLES
2405
+ Import all assets from the "products" directory
2406
+
2407
+ $ sanity media import products
2408
+
2409
+ Import all assets from "gallery" archive
2410
+
2411
+ $ sanity media import gallery.tar.gz
2412
+
2413
+ Import all assets from the "products" directory and replace aspects
2414
+
2415
+ $ sanity media import products --replace-aspects
2416
+ ```
2417
+
2418
+ _See code: [src/commands/media/import.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/media/import.ts)_
2419
+
2420
+ ## `sanity migration create [TITLE]`
2421
+
2422
+ Create a new migration within your project
2423
+
2424
+ ```
2425
+ USAGE
2426
+ $ sanity migration create [TITLE]
2427
+
2428
+ ARGUMENTS
2429
+ [TITLE] Title of migration
2430
+
2431
+ DESCRIPTION
2432
+ Create a new migration within your project
2433
+
2434
+ EXAMPLES
2435
+ Create a new migration, prompting for title and options
2436
+
2437
+ $ sanity migration create
2438
+
2439
+ Create a new migration with the provided title, prompting for options
2440
+
2441
+ $ sanity migration create "Rename field from location to address"
2442
+ ```
2443
+
2444
+ _See code: [@sanity/migrate](https://github.com/sanity-io/migrate/blob/v5.2.3/src/commands/migration/create.ts)_
2445
+
2446
+ ## `sanity migration list`
2447
+
2448
+ List available migrations
2449
+
2450
+ ```
2451
+ USAGE
2452
+ $ sanity migration list
2453
+
2454
+ DESCRIPTION
2455
+ List available migrations
2456
+
2457
+ EXAMPLES
2458
+ List all available migrations in the project
2459
+
2460
+ $ sanity migration list
2461
+ ```
2462
+
2463
+ _See code: [@sanity/migrate](https://github.com/sanity-io/migrate/blob/v5.2.3/src/commands/migration/list.ts)_
2464
+
2465
+ ## `sanity migration run [ID]`
2466
+
2467
+ Run a migration against a dataset
2468
+
2469
+ ```
2470
+ USAGE
2471
+ $ sanity migration run [ID] [--api-version <value>] [--concurrency <value>] [--confirm] [--dataset <value>]
2472
+ [--dry-run] [--from-export <value>] [--progress] [--project <value>]
2473
+
2474
+ ARGUMENTS
2475
+ [ID] ID
2476
+
2477
+ FLAGS
2478
+ --api-version=<value> API version to use when migrating. Defaults to v2024-01-29.
2479
+ --concurrency=<value> [default: 6] How many mutation requests to run in parallel. Must be between 1 and 10. Default:
2480
+ 6.
2481
+ --[no-]confirm Prompt for confirmation before running the migration (default: true). Use --no-confirm to skip.
2482
+ --dataset=<value> Dataset to migrate. Defaults to the dataset configured in your Sanity CLI config.
2483
+ --[no-]dry-run By default the migration runs in dry mode. Use --no-dry-run to migrate dataset.
2484
+ --from-export=<value> Use a local dataset export as source for migration instead of calling the Sanity API. Note:
2485
+ this is only supported for dry runs.
2486
+ --[no-]progress Display progress during migration (default: true). Use --no-progress to hide output.
2487
+ --project=<value> Project ID of the dataset to migrate. Defaults to the projectId configured in your Sanity CLI
2488
+ config.
2489
+
2490
+ DESCRIPTION
2491
+ Run a migration against a dataset
2492
+
2493
+ EXAMPLES
2494
+ dry run the migration
2495
+
2496
+ $ sanity migration run <id>
2497
+
2498
+ execute the migration against a dataset
2499
+
2500
+ $ sanity migration run <id> --no-dry-run --project xyz --dataset staging
2501
+
2502
+ execute the migration using a dataset export as the source
2503
+
2504
+ $ sanity migration run <id> --from-export=production.tar.gz --no-dry-run --project xyz --dataset staging
2505
+ ```
2506
+
2507
+ _See code: [@sanity/migrate](https://github.com/sanity-io/migrate/blob/v5.2.3/src/commands/migration/run.ts)_
2508
+
2509
+ ## `sanity openapi get SLUG`
2510
+
2511
+ Get an OpenAPI specification by slug
2512
+
2513
+ ```
2514
+ USAGE
2515
+ $ sanity openapi get SLUG [--format yaml|json] [-w]
2516
+
2517
+ ARGUMENTS
2518
+ SLUG Slug of the OpenAPI specification to retrieve
2519
+
2520
+ FLAGS
2521
+ -w, --web Open in web browser
2522
+ --format=<option> [default: yaml] Output format: yaml (default), json
2523
+ <options: yaml|json>
2524
+
2525
+ DESCRIPTION
2526
+ Get an OpenAPI specification by slug
2527
+
2528
+ EXAMPLES
2529
+ Get a specification (YAML format, default)
2530
+
2531
+ $ sanity openapi get query
2532
+
2533
+ Get specification in JSON format
2534
+
2535
+ $ sanity openapi get query --format=json
2536
+
2537
+ Open specification in browser
2538
+
2539
+ $ sanity openapi get query --web
2540
+
2541
+ Pipe to file
2542
+
2543
+ $ sanity openapi get query > query-api.yaml
2544
+ ```
2545
+
2546
+ _See code: [src/commands/openapi/get.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/openapi/get.ts)_
2547
+
2548
+ ## `sanity openapi list`
2549
+
2550
+ List all available OpenAPI specifications
2551
+
2552
+ ```
2553
+ USAGE
2554
+ $ sanity openapi list [--json] [-w]
2555
+
2556
+ FLAGS
2557
+ -w, --web Open HTTP Reference in web browser
2558
+ --json Output JSON
2559
+
2560
+ DESCRIPTION
2561
+ List all available OpenAPI specifications
2562
+
2563
+ EXAMPLES
2564
+ List all available OpenAPI specs
2565
+
2566
+ $ sanity openapi list
2567
+
2568
+ List with JSON output
2569
+
2570
+ $ sanity openapi list --json
2571
+
2572
+ Open HTTP Reference in browser
2573
+
2574
+ $ sanity openapi list --web
2575
+ ```
2576
+
2577
+ _See code: [src/commands/openapi/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/openapi/list.ts)_
2578
+
2579
+ ## `sanity preview [OUTPUTDIR]`
2580
+
2581
+ Starts a server to preview a production build
2582
+
2583
+ ```
2584
+ USAGE
2585
+ $ sanity preview [OUTPUTDIR] [--host <value>] [--port <value>]
2586
+
2587
+ ARGUMENTS
2588
+ [OUTPUTDIR] Output directory
2589
+
2590
+ FLAGS
2591
+ --host=<value> [default: localhost] The local network interface at which to listen.
2592
+ --port=<value> [default: 3333] TCP port to start server on.
2593
+
2594
+ DESCRIPTION
2595
+ Starts a server to preview a production build
2596
+
2597
+ ALIASES
2598
+ $ sanity start
2599
+
2600
+ EXAMPLES
2601
+ $ sanity preview --host=0.0.0.0
2602
+
2603
+ $ sanity preview --port=1942
2604
+
2605
+ $ sanity preview some/build-output-dir
2606
+ ```
2607
+
2608
+ _See code: [src/commands/preview.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/preview.ts)_
2609
+
2610
+ ## `sanity projects create [PROJECTNAME]`
2611
+
2612
+ Create a new Sanity project
2613
+
2614
+ ```
2615
+ USAGE
2616
+ $ sanity projects create [PROJECTNAME] [--dataset <value>] [--dataset-visibility private|public] [--json]
2617
+ [--organization <slug|id>] [-y]
2618
+
2619
+ ARGUMENTS
2620
+ [PROJECTNAME] Name of the project to create
2621
+
2622
+ FLAGS
2623
+ -y, --yes Skip prompts and use defaults (project: "My Sanity Project", dataset: production,
2624
+ visibility: public)
2625
+ --dataset=<value> Create a dataset. Prompts for visibility unless specified or --yes used
2626
+ --dataset-visibility=<option> Dataset visibility: public or private
2627
+ <options: private|public>
2628
+ --json Output in JSON format
2629
+ --organization=<slug|id> Organization to create the project in
2630
+
2631
+ DESCRIPTION
2632
+ Create a new Sanity project
2633
+
2634
+ EXAMPLES
2635
+ Interactively create a project
2636
+
2637
+ $ sanity projects create
2638
+
2639
+ Create a project named "My New Project"
2640
+
2641
+ $ sanity projects create "My New Project"
2642
+
2643
+ Create a project in a specific organization
2644
+
2645
+ $ sanity projects create "My Project" --organization=my-org
2646
+
2647
+ Create a project with a private dataset named "staging"
2648
+
2649
+ $ sanity projects create "My Project" --dataset=staging --dataset-visibility=private
2650
+
2651
+ Create a project non-interactively with JSON output
2652
+
2653
+ $ sanity projects create "CI Project" --yes --json
2654
+ ```
2655
+
2656
+ _See code: [src/commands/projects/create.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/projects/create.ts)_
2657
+
2658
+ ## `sanity projects list`
2659
+
2660
+ Lists projects connected to your user
2661
+
2662
+ ```
2663
+ USAGE
2664
+ $ sanity projects list [--order asc|desc] [--sort id|members|name|url|created]
2665
+
2666
+ FLAGS
2667
+ --order=<option> [default: desc]
2668
+ <options: asc|desc>
2669
+ --sort=<option> [default: created]
2670
+ <options: id|members|name|url|created>
2671
+
2672
+ DESCRIPTION
2673
+ Lists projects connected to your user
2674
+
2675
+ EXAMPLES
2676
+ List projects
2677
+
2678
+ $ sanity projects list
2679
+
2680
+ List all users of the project, but exclude pending invitations and robots
2681
+
2682
+ $ sanity projects list --sort=members --order=asc
2683
+ ```
2684
+
2685
+ _See code: [src/commands/projects/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/projects/list.ts)_
2686
+
2687
+ ## `sanity schema delete`
2688
+
2689
+ Delete schema documents by id
2690
+
2691
+ ```
2692
+ USAGE
2693
+ $ sanity schema delete --ids <value> [--dataset <value>] [--extract-manifest] [--manifest-dir <value>] [--verbose]
2694
+
2695
+ FLAGS
2696
+ --dataset=<value> Delete schemas from a specific dataset
2697
+ --[no-]extract-manifest Generate manifest file (disable with --no-extract-manifest)
2698
+ --ids=<value> (required) Comma-separated list of schema ids to delete
2699
+ --manifest-dir=<value> [default: ./dist/static] Directory containing manifest file
2700
+ --verbose Enable verbose logging
2701
+
2702
+ DESCRIPTION
2703
+ Delete schema documents by id
2704
+
2705
+ EXAMPLES
2706
+ Delete a single schema
2707
+
2708
+ $ sanity schema delete --ids sanity.workspace.schema.workspaceName
2709
+
2710
+ Delete multiple schemas
2711
+
2712
+ $ sanity schema delete --ids sanity.workspace.schema.workspaceName,prefix.sanity.workspace.schema.otherWorkspace
2713
+
2714
+ Delete using a pre-existing manifest file (config changes in sanity.config will not be picked up)
2715
+
2716
+ $ sanity schema delete --no-extract-manifest --ids sanity.workspace.schema.workspaceName
2717
+ ```
2718
+
2719
+ _See code: [src/commands/schema/delete.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/schema/delete.ts)_
2720
+
2721
+ ## `sanity schema deploy`
2722
+
2723
+ Deploy schema documents into workspace datasets.
2724
+
2725
+ ```
2726
+ USAGE
2727
+ $ sanity schema deploy [--extract-manifest] [--manifest-dir <directory>] [--tag <tag>] [--verbose] [--workspace
2728
+ <name>]
2729
+
2730
+ FLAGS
2731
+ --[no-]extract-manifest Disables manifest generation - the command will fail if no manifest exists
2732
+ --manifest-dir=<directory> [default: ./dist/static] Directory containing manifest file
2733
+ --tag=<tag> Add a tag suffix to the schema id
2734
+ --verbose Print detailed information during deployment
2735
+ --workspace=<name> The name of the workspace to deploy a schema for
2736
+
2737
+ DESCRIPTION
2738
+ Deploy schema documents into workspace datasets.
2739
+
2740
+ **Note**: This command is experimental and subject to change.
2741
+
2742
+ This operation (re-)generates a manifest file describing the sanity config workspace by default.
2743
+ To re-use an existing manifest file, use --no-extract-manifest.
2744
+
2745
+ EXAMPLES
2746
+ Deploy all workspace schemas
2747
+
2748
+ $ sanity schema deploy
2749
+
2750
+ Deploy the schema for only the workspace "default"
2751
+
2752
+ $ sanity schema deploy --workspace default
2753
+
2754
+ Runs using a pre-existing manifest file. Config changes in sanity.config will not be picked up in this case.
2755
+
2756
+ $ sanity schema deploy --no-extract-manifest
2757
+ ```
2758
+
2759
+ _See code: [src/commands/schema/deploy.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/schema/deploy.ts)_
2760
+
2761
+ ## `sanity schema extract`
2762
+
2763
+ Extracts a JSON representation of a Sanity schema within a Studio context.
2764
+
2765
+ ```
2766
+ USAGE
2767
+ $ sanity schema extract [--enforce-required-fields] [--format <format>] [--path <value>] [--workspace <name>]
2768
+
2769
+ FLAGS
2770
+ --enforce-required-fields Makes the schema generated treat fields marked as required as non-optional
2771
+ --format=<format> [default: groq-type-nodes] Format the schema as GROQ type nodes. Only available format at
2772
+ the moment.
2773
+ --path=<value> Optional path to specify destination of the schema file
2774
+ --workspace=<name> The name of the workspace to generate a schema for
2775
+
2776
+ DESCRIPTION
2777
+ Extracts a JSON representation of a Sanity schema within a Studio context.
2778
+
2779
+ **Note**: This command is experimental and subject to change.
2780
+
2781
+ EXAMPLES
2782
+ Extracts schema types in a Sanity project with more than one workspace
2783
+
2784
+ $ sanity schema extract --workspace default
2785
+ ```
2786
+
2787
+ _See code: [src/commands/schema/extract.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/schema/extract.ts)_
2788
+
2789
+ ## `sanity schema list`
2790
+
2791
+ Lists all schemas in the current dataset.
2792
+
2793
+ ```
2794
+ USAGE
2795
+ $ sanity schema list [--extract-manifest] [--id <schema_id>] [--json] [--manifest-dir <directory>]
2796
+
2797
+ FLAGS
2798
+ --[no-]extract-manifest Disables manifest generation - the command will fail if no manifest exists
2799
+ --id=<schema_id> Fetch a single schema by id
2800
+ --json Get schema as json
2801
+ --manifest-dir=<directory> [default: ./dist/static] Directory containing manifest file
2802
+
2803
+ DESCRIPTION
2804
+ Lists all schemas in the current dataset.
2805
+
2806
+ **Note**: This command is experimental and subject to change.
2807
+
2808
+ This operation (re-)generates a manifest file describing the sanity config workspace by default.
2809
+ To re-use an existing manifest file, use --no-extract-manifest.
2810
+
2811
+ EXAMPLES
2812
+ List all schemas found in any workspace dataset in a table
2813
+
2814
+ $ sanity schema list
2815
+
2816
+ Get a schema for a given id
2817
+
2818
+ $ sanity schema list --id _.schemas.workspaceName
2819
+
2820
+ Get stored schemas as pretty-printed json-array
2821
+
2822
+ $ sanity schema list --json
2823
+
2824
+ Get singular stored schema as pretty-printed json-object
2825
+
2826
+ $ sanity schema list --json --id _.schemas.workspaceName
2827
+
2828
+ Runs using a pre-existing manifest file. Config changes in sanity.config will not be picked up in this case.
2829
+
2830
+ $ sanity schema list --no-extract-manifest
2831
+ ```
2832
+
2833
+ _See code: [src/commands/schema/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/schema/list.ts)_
2834
+
2835
+ ## `sanity schema validate`
2836
+
2837
+ Validates all schema types specified in a workspace
2838
+
2839
+ ```
2840
+ USAGE
2841
+ $ sanity schema validate [--debug-metafile-path <value>] [--format pretty|ndjson|json] [--level error|warning]
2842
+ [--workspace <value>]
2843
+
2844
+ FLAGS
2845
+ --format=<option> [default: pretty] The output format used to print schema errors and warnings
2846
+ <options: pretty|ndjson|json>
2847
+ --level=<option> [default: warning] The minimum level reported out
2848
+ <options: error|warning>
2849
+ --workspace=<value> The name of the workspace to use when validating all schema types
2850
+
2851
+ DEBUG FLAGS
2852
+ --debug-metafile-path=<value> Optional path where a metafile will be written for build analysis. Only written on
2853
+ successful validation. Can be analyzed at https://esbuild.github.io/analyze/
2854
+
2855
+ DESCRIPTION
2856
+ Validates all schema types specified in a workspace
2857
+
2858
+ EXAMPLES
2859
+ Validates all schema types in a Sanity project with more than one workspace
2860
+
2861
+ $ sanity schema validate --workspace default
2862
+
2863
+ Save the results of the report into a file
2864
+
2865
+ $ sanity schema validate > report.txt
2866
+
2867
+ Report out only errors
2868
+
2869
+ $ sanity schema validate --level error
2870
+
2871
+ Generate a report which can be analyzed with https://esbuild.github.io/analyze/
2872
+
2873
+ $ sanity schema validate --debug-metafile-path metafile.json
2874
+ ```
2875
+
2876
+ _See code: [src/commands/schema/validate.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/schema/validate.ts)_
2877
+
2878
+ ## `sanity start [OUTPUTDIR]`
2879
+
2880
+ Starts a server to preview a production build
2881
+
2882
+ ```
2883
+ USAGE
2884
+ $ sanity start [OUTPUTDIR] [--host <value>] [--port <value>]
2885
+
2886
+ ARGUMENTS
2887
+ [OUTPUTDIR] Output directory
2888
+
2889
+ FLAGS
2890
+ --host=<value> [default: localhost] The local network interface at which to listen.
2891
+ --port=<value> [default: 3333] TCP port to start server on.
2892
+
2893
+ DESCRIPTION
2894
+ Starts a server to preview a production build
2895
+
2896
+ ALIASES
2897
+ $ sanity start
2898
+
2899
+ EXAMPLES
2900
+ $ sanity start --host=0.0.0.0
2901
+
2902
+ $ sanity start --port=1942
2903
+
2904
+ $ sanity start some/build-output-dir
2905
+ ```
2906
+
2907
+ ## `sanity telemetry disable`
2908
+
2909
+ Disable telemetry for your logged in user
2910
+
2911
+ ```
2912
+ USAGE
2913
+ $ sanity telemetry disable
2914
+
2915
+ DESCRIPTION
2916
+ Disable telemetry for your logged in user
2917
+
2918
+ EXAMPLES
2919
+ Disable telemetry for your logged in user
2920
+
2921
+ $ sanity telemetry telemetry disable
2922
+ ```
2923
+
2924
+ _See code: [src/commands/telemetry/disable.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/telemetry/disable.ts)_
2925
+
2926
+ ## `sanity telemetry enable`
2927
+
2928
+ Enable telemetry for your logged in user
2929
+
2930
+ ```
2931
+ USAGE
2932
+ $ sanity telemetry enable
2933
+
2934
+ DESCRIPTION
2935
+ Enable telemetry for your logged in user
2936
+
2937
+ EXAMPLES
2938
+ Enable telemetry for your logged in user
2939
+
2940
+ $ sanity telemetry telemetry enable
2941
+ ```
2942
+
2943
+ _See code: [src/commands/telemetry/enable.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/telemetry/enable.ts)_
2944
+
2945
+ ## `sanity telemetry status`
2946
+
2947
+ Check telemetry consent status for your logged in user
2948
+
2949
+ ```
2950
+ USAGE
2951
+ $ sanity telemetry status
2952
+
2953
+ DESCRIPTION
2954
+ Check telemetry consent status for your logged in user
2955
+
2956
+ EXAMPLES
2957
+ Check telemetry consent status for your logged in user
2958
+
2959
+ $ sanity telemetry telemetry status
2960
+ ```
2961
+
2962
+ _See code: [src/commands/telemetry/status.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/telemetry/status.ts)_
2963
+
2964
+ ## `sanity tokens add [LABEL]`
2965
+
2966
+ Create a new API token for this project
2967
+
2968
+ ```
2969
+ USAGE
2970
+ $ sanity tokens add [LABEL] [--json] [--role viewer] [-y]
2971
+
2972
+ ARGUMENTS
2973
+ [LABEL] Label for the new token
2974
+
2975
+ FLAGS
2976
+ -y, --yes Skip prompts and use defaults (unattended mode)
2977
+ --json Output as JSON
2978
+ --role=viewer Role to assign to the token
2979
+
2980
+ DESCRIPTION
2981
+ Create a new API token for this project
2982
+
2983
+ EXAMPLES
2984
+ Create a token with a label
2985
+
2986
+ $ sanity tokens add "My API Token"
2987
+
2988
+ Create a token with editor role
2989
+
2990
+ $ sanity tokens add "My API Token" --role=editor
2991
+
2992
+ Create a token in unattended mode
2993
+
2994
+ $ sanity tokens add "CI Token" --role=editor --yes
2995
+
2996
+ Output token information as JSON
2997
+
2998
+ $ sanity tokens add "API Token" --json
2999
+ ```
3000
+
3001
+ _See code: [src/commands/tokens/add.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/tokens/add.ts)_
3002
+
3003
+ ## `sanity tokens delete [TOKENID]`
3004
+
3005
+ Delete an API token from this project
3006
+
3007
+ ```
3008
+ USAGE
3009
+ $ sanity tokens delete [TOKENID] [--yes]
3010
+
3011
+ ARGUMENTS
3012
+ [TOKENID] Token ID to delete (will prompt if not provided)
3013
+
3014
+ FLAGS
3015
+ --yes Skip confirmation prompt (unattended mode)
3016
+
3017
+ DESCRIPTION
3018
+ Delete an API token from this project
3019
+
3020
+ EXAMPLES
3021
+ Interactively select and delete a token
3022
+
3023
+ $ sanity tokens delete
3024
+
3025
+ Delete a specific token by ID
3026
+
3027
+ $ sanity tokens delete silJ2lFmK6dONB
3028
+
3029
+ Delete a specific token without confirmation prompt
3030
+
3031
+ $ sanity tokens delete silJ2lFmK6dONB --yes
3032
+ ```
3033
+
3034
+ _See code: [src/commands/tokens/delete.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/tokens/delete.ts)_
3035
+
3036
+ ## `sanity tokens list`
3037
+
3038
+ List API tokens for the current project
3039
+
3040
+ ```
3041
+ USAGE
3042
+ $ sanity tokens list [--json]
3043
+
3044
+ FLAGS
3045
+ --json Output tokens in JSON format
3046
+
3047
+ DESCRIPTION
3048
+ List API tokens for the current project
3049
+
3050
+ EXAMPLES
3051
+ List tokens for the current project
3052
+
3053
+ $ sanity tokens list
3054
+
3055
+ List tokens in JSON format
3056
+
3057
+ $ sanity tokens list --json
3058
+ ```
3059
+
3060
+ _See code: [src/commands/tokens/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/tokens/list.ts)_
3061
+
3062
+ ## `sanity typegen generate`
3063
+
3064
+ Sanity TypeGen (Beta)
3065
+
3066
+ ```
3067
+ USAGE
3068
+ $ sanity typegen generate [--config-path <value>] [--watch]
3069
+
3070
+ FLAGS
3071
+ --config-path=<value> [Default: sanity-typegen.json] Specifies the path to the typegen configuration file. This file
3072
+ should be a JSON file that contains settings for the type generation process.
3073
+ --watch [Default: false] Run the typegen in watch mode
3074
+
3075
+ DESCRIPTION
3076
+ Sanity TypeGen (Beta)
3077
+ This command is currently in beta and may undergo significant changes. Feedback is welcome!
3078
+
3079
+ Configuration:
3080
+ This command can utilize configuration settings defined in a `sanity-typegen.json` file. These settings include:
3081
+
3082
+ - "path": Specifies a glob pattern to locate your TypeScript or JavaScript files.
3083
+ Default: "./src/**/*.{ts,tsx,js,jsx}"
3084
+
3085
+ - "schema": Defines the path to your Sanity schema file. This file should be generated using the `sanity schema
3086
+ extract` command.
3087
+ Default: "schema.json"
3088
+
3089
+ - "generates": Indicates the path where the generated TypeScript type definitions will be saved.
3090
+ Default: "./sanity.types.ts"
3091
+
3092
+ The default configuration values listed above are used if not overridden in your `sanity-typegen.json` configuration
3093
+ file. To customize the behavior of the type generation, adjust these properties in the configuration file according to
3094
+ your project's needs.
3095
+
3096
+ Note:
3097
+ - The `sanity schema extract` command is a prerequisite for extracting your Sanity Studio schema into a `schema.json`
3098
+ file, which is then used by the `sanity typegen generate` command to generate type definitions.
3099
+ - While this tool is in beta, we encourage you to experiment with these configurations and provide feedback to help
3100
+ improve its functionality and usability.
3101
+
3102
+ EXAMPLES
3103
+ Generate TypeScript type definitions from a Sanity Studio schema extracted using the `sanity schema extract`
3104
+ command.
3105
+
3106
+ $ sanity typegen generate
3107
+ ```
3108
+
3109
+ _See code: [@sanity/codegen](https://github.com/sanity-io/codegen/blob/v5.9.2/src/commands/typegen/generate.ts)_
3110
+
3111
+ ## `sanity undeploy`
3112
+
3113
+ Removes the deployed Sanity Studio/App from Sanity hosting
3114
+
3115
+ ```
3116
+ USAGE
3117
+ $ sanity undeploy [-y]
3118
+
3119
+ FLAGS
3120
+ -y, --yes Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
3121
+
3122
+ DESCRIPTION
3123
+ Removes the deployed Sanity Studio/App from Sanity hosting
3124
+ ```
3125
+
3126
+ _See code: [src/commands/undeploy.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/undeploy.ts)_
3127
+
3128
+ ## `sanity users invite [EMAIL]`
3129
+
3130
+ Invite a new user to the project
3131
+
3132
+ ```
3133
+ USAGE
3134
+ $ sanity users invite [EMAIL] [--role <value>]
3135
+
3136
+ ARGUMENTS
3137
+ [EMAIL] Email address to invite
3138
+
3139
+ FLAGS
3140
+ --role=<value> Role to invite the user as
3141
+
3142
+ DESCRIPTION
3143
+ Invite a new user to the project
3144
+
3145
+ EXAMPLES
3146
+ Invite a new user to the project (prompt for details)
3147
+
3148
+ $ sanity users invite
3149
+
3150
+ Send a new user invite to the email "pippi@sanity.io", prompt for role
3151
+
3152
+ $ sanity users invite pippi@sanity.io
3153
+
3154
+ Send a new user invite to the email "pippi@sanity.io", as administrator
3155
+
3156
+ $ sanity users invite pippi@sanity.io --role administrator
3157
+ ```
3158
+
3159
+ _See code: [src/commands/users/invite.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/users/invite.ts)_
3160
+
3161
+ ## `sanity users list`
3162
+
3163
+ List all users of the project
3164
+
3165
+ ```
3166
+ USAGE
3167
+ $ sanity users list [--invitations] [--order asc|desc] [--robots] [--sort id|name|role|date]
3168
+
3169
+ FLAGS
3170
+ --[no-]invitations Includes or excludes pending invitations
3171
+ --order=<option> [default: asc] Sort output ascending/descending
3172
+ <options: asc|desc>
3173
+ --[no-]robots Includes or excludes robots (token users)
3174
+ --sort=<option> [default: date] Sort users by specified column
3175
+ <options: id|name|role|date>
3176
+
3177
+ DESCRIPTION
3178
+ List all users of the project
3179
+
3180
+ EXAMPLES
3181
+ List all users of the project
3182
+
3183
+ $ sanity users list
3184
+
3185
+ List all users of the project, but exclude pending invitations and robots
3186
+
3187
+ $ sanity users list --no-invitations --no-robots
3188
+
3189
+ List all users, sorted by role
3190
+
3191
+ $ sanity users list --sort role
3192
+ ```
3193
+
3194
+ _See code: [src/commands/users/list.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/users/list.ts)_
3195
+
3196
+ ## `sanity versions`
3197
+
3198
+ Shows installed versions of Sanity Studio and components
3199
+
3200
+ ```
3201
+ USAGE
3202
+ $ sanity versions
3203
+
3204
+ DESCRIPTION
3205
+ Shows installed versions of Sanity Studio and components
3206
+
3207
+ EXAMPLES
3208
+ $ sanity versions
3209
+ ```
3210
+
3211
+ _See code: [src/commands/versions.ts](https://github.com/sanity-io/cli/blob/v6.0.0-alpha.8/src/commands/versions.ts)_
3212
+
3213
+ <!-- commandsstop -->