@sanity/cli 6.0.0-alpha.5 → 6.0.0-alpha.7

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