@sanity/cli 6.4.0 → 6.5.1

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 (116) hide show
  1. package/README.md +201 -103
  2. package/dist/actions/build/buildApp.js +46 -17
  3. package/dist/actions/build/buildApp.js.map +1 -1
  4. package/dist/actions/build/buildStaticFiles.js +3 -1
  5. package/dist/actions/build/buildStaticFiles.js.map +1 -1
  6. package/dist/actions/build/buildStudio.js +80 -30
  7. package/dist/actions/build/buildStudio.js.map +1 -1
  8. package/dist/actions/build/buildVendorDependencies.js +10 -9
  9. package/dist/actions/build/buildVendorDependencies.js.map +1 -1
  10. package/dist/actions/build/checkRequiredDependencies.js +6 -9
  11. package/dist/actions/build/checkRequiredDependencies.js.map +1 -1
  12. package/dist/actions/build/checkStudioDependencyVersions.js +10 -11
  13. package/dist/actions/build/checkStudioDependencyVersions.js.map +1 -1
  14. package/dist/actions/build/getAutoUpdatesImportMap.js +9 -0
  15. package/dist/actions/build/getAutoUpdatesImportMap.js.map +1 -1
  16. package/dist/actions/build/getViteConfig.js +4 -2
  17. package/dist/actions/build/getViteConfig.js.map +1 -1
  18. package/dist/actions/build/renderDocument.js.map +1 -1
  19. package/dist/actions/build/renderDocumentWorker/addTimestampImportMapScriptToHtml.js +34 -14
  20. package/dist/actions/build/renderDocumentWorker/addTimestampImportMapScriptToHtml.js.map +1 -1
  21. package/dist/actions/build/renderDocumentWorker/getDocumentHtml.js +2 -2
  22. package/dist/actions/build/renderDocumentWorker/getDocumentHtml.js.map +1 -1
  23. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js +2 -2
  24. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js.map +1 -1
  25. package/dist/actions/codemods/reactIconsV3.js +3 -3
  26. package/dist/actions/codemods/reactIconsV3.js.map +1 -1
  27. package/dist/actions/deploy/deployApp.js +1 -1
  28. package/dist/actions/deploy/deployApp.js.map +1 -1
  29. package/dist/actions/deploy/deployStudio.js +1 -2
  30. package/dist/actions/deploy/deployStudio.js.map +1 -1
  31. package/dist/actions/dev/startStudioDevServer.js +3 -4
  32. package/dist/actions/dev/startStudioDevServer.js.map +1 -1
  33. package/dist/actions/doctor/types.js.map +1 -1
  34. package/dist/actions/graphql/resolveGraphQLApisFromWorkspaces.js.map +1 -1
  35. package/dist/actions/init/bootstrapTemplate.js.map +1 -1
  36. package/dist/actions/init/checkNextJsReactCompatibility.js +3 -3
  37. package/dist/actions/init/checkNextJsReactCompatibility.js.map +1 -1
  38. package/dist/actions/init/initAction.js +287 -0
  39. package/dist/actions/init/initAction.js.map +1 -0
  40. package/dist/actions/init/initApp.js +7 -16
  41. package/dist/actions/init/initApp.js.map +1 -1
  42. package/dist/actions/init/initError.js +10 -0
  43. package/dist/actions/init/initError.js.map +1 -0
  44. package/dist/actions/init/initHelpers.js +3 -12
  45. package/dist/actions/init/initHelpers.js.map +1 -1
  46. package/dist/actions/init/initNextJs.js +17 -20
  47. package/dist/actions/init/initNextJs.js.map +1 -1
  48. package/dist/actions/init/initStudio.js +11 -20
  49. package/dist/actions/init/initStudio.js.map +1 -1
  50. package/dist/actions/init/plan/getPlan.js +15 -0
  51. package/dist/actions/init/plan/getPlan.js.map +1 -0
  52. package/dist/actions/init/plan/verifyCoupon.js +35 -0
  53. package/dist/actions/init/plan/verifyCoupon.js.map +1 -0
  54. package/dist/actions/init/plan/verifyPlan.js +34 -0
  55. package/dist/actions/init/plan/verifyPlan.js.map +1 -0
  56. package/dist/actions/init/project/createProjectFromName.js +44 -0
  57. package/dist/actions/init/project/createProjectFromName.js.map +1 -0
  58. package/dist/actions/init/project/getOrCreateDataset.js +126 -0
  59. package/dist/actions/init/project/getOrCreateDataset.js.map +1 -0
  60. package/dist/actions/init/project/getOrCreateProject.js +128 -0
  61. package/dist/actions/init/project/getOrCreateProject.js.map +1 -0
  62. package/dist/actions/init/project/getProjectDetails.js +87 -0
  63. package/dist/actions/init/project/getProjectDetails.js.map +1 -0
  64. package/dist/actions/init/project/getProjectOutputPath.js +17 -0
  65. package/dist/actions/init/project/getProjectOutputPath.js.map +1 -0
  66. package/dist/actions/init/project/promptForAppTemplateSetup.js +112 -0
  67. package/dist/actions/init/project/promptForAppTemplateSetup.js.map +1 -0
  68. package/dist/actions/init/project/promptForProjectCreation.js +40 -0
  69. package/dist/actions/init/project/promptForProjectCreation.js.map +1 -0
  70. package/dist/actions/init/project/promptUserForNewOrganization.js +12 -0
  71. package/dist/actions/init/project/promptUserForNewOrganization.js.map +1 -0
  72. package/dist/actions/init/project/promptUserForOrganization.js +38 -0
  73. package/dist/actions/init/project/promptUserForOrganization.js.map +1 -0
  74. package/dist/actions/init/scaffoldTemplate.js +23 -29
  75. package/dist/actions/init/scaffoldTemplate.js.map +1 -1
  76. package/dist/actions/init/types.js +47 -1
  77. package/dist/actions/init/types.js.map +1 -1
  78. package/dist/actions/manifest/extractAppManifest.js +3 -2
  79. package/dist/actions/manifest/extractAppManifest.js.map +1 -1
  80. package/dist/actions/manifest/types.js +9 -1
  81. package/dist/actions/manifest/types.js.map +1 -1
  82. package/dist/actions/manifest/writeManifestFile.js +1 -2
  83. package/dist/actions/manifest/writeManifestFile.js.map +1 -1
  84. package/dist/actions/schema/uploadSchemaToLexicon.js +1 -2
  85. package/dist/actions/schema/uploadSchemaToLexicon.js.map +1 -1
  86. package/dist/actions/versions/buildPackageArray.js +3 -3
  87. package/dist/actions/versions/buildPackageArray.js.map +1 -1
  88. package/dist/actions/versions/findSanityModulesVersions.js +3 -3
  89. package/dist/actions/versions/findSanityModulesVersions.js.map +1 -1
  90. package/dist/commands/datasets/copy.js.map +1 -1
  91. package/dist/commands/init.js +11 -911
  92. package/dist/commands/init.js.map +1 -1
  93. package/dist/constants.js +8 -0
  94. package/dist/constants.js.map +1 -0
  95. package/dist/server/previewServer.js +1 -1
  96. package/dist/server/previewServer.js.map +1 -1
  97. package/dist/server/vite/plugin-sanity-build-entries.js +2 -1
  98. package/dist/server/vite/plugin-sanity-build-entries.js.map +1 -1
  99. package/dist/services/datasets.js.map +1 -1
  100. package/dist/services/userApplications.js.map +1 -1
  101. package/dist/telemetry/init.telemetry.js.map +1 -1
  102. package/dist/util/compareDependencyVersions.js +5 -6
  103. package/dist/util/compareDependencyVersions.js.map +1 -1
  104. package/dist/util/createExpiringConfig.js +1 -1
  105. package/dist/util/createExpiringConfig.js.map +1 -1
  106. package/dist/util/packageManager/installationInfo/analyzeIssues.js +7 -7
  107. package/dist/util/packageManager/installationInfo/analyzeIssues.js.map +1 -1
  108. package/dist/util/packageManager/installationInfo/types.js.map +1 -1
  109. package/dist/util/packageManager/packageManagerChoice.js +2 -2
  110. package/dist/util/packageManager/packageManagerChoice.js.map +1 -1
  111. package/dist/util/packageManager/preferredPm.js +106 -0
  112. package/dist/util/packageManager/preferredPm.js.map +1 -0
  113. package/oclif.manifest.json +526 -526
  114. package/package.json +27 -26
  115. package/dist/util/getLocalPackageVersion.js +0 -55
  116. package/dist/util/getLocalPackageVersion.js.map +0 -1
package/README.md CHANGED
@@ -24,7 +24,9 @@ Code for sanity cli
24
24
  - [`sanity blueprints info`](#sanity-blueprints-info)
25
25
  - [`sanity blueprints init [DIR]`](#sanity-blueprints-init-dir)
26
26
  - [`sanity blueprints logs`](#sanity-blueprints-logs)
27
+ - [`sanity blueprints mint-deploy-token`](#sanity-blueprints-mint-deploy-token)
27
28
  - [`sanity blueprints plan`](#sanity-blueprints-plan)
29
+ - [`sanity blueprints promote`](#sanity-blueprints-promote)
28
30
  - [`sanity blueprints stacks`](#sanity-blueprints-stacks)
29
31
  - [`sanity build [OUTPUTDIR]`](#sanity-build-outputdir)
30
32
  - [`sanity codemod [CODEMODNAME]`](#sanity-codemod-codemodname)
@@ -251,11 +253,11 @@ EXAMPLES
251
253
 
252
254
  ## `sanity blueprints add TYPE`
253
255
 
254
- Add a function resource to a Blueprint
256
+ [deprecated] Use "functions add" instead
255
257
 
256
258
  ```
257
259
  USAGE
258
- $ sanity blueprints add TYPE [--json] [--validate-resources] [--example <value> | -n <value> | --fn-type
260
+ $ sanity blueprints add TYPE [--json] [--example <value> | -n <value> | --fn-type
259
261
  document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
260
262
  te|media-library-asset-update|scheduled-function|sync-tag-invalidate... | --language ts|js | --javascript |
261
263
  --fn-helpers | --fn-installer skip|npm|pnpm|yarn] [-i | ]
@@ -264,31 +266,31 @@ ARGUMENTS
264
266
  TYPE (function) Type of resource to add (only "function" is supported)
265
267
 
266
268
  FLAGS
267
- -i, --install Shortcut for --fn-installer npm
268
- -n, --name=<value> Name of the resource to add
269
- --example=<value> Example to use for the function resource. Discover examples at
270
- https://www.sanity.io/exchange/type=recipes/by=sanity
271
- --[no-]fn-helpers Add helpers to the new function
272
- --fn-installer=<option> Which package manager to use when installing the @sanity/functions helpers
273
- <options: skip|npm|pnpm|yarn>
274
- --fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
275
- events by specifying this flag multiple times
276
- <options: document-publish|document-create|document-delete|document-update|media-librar
277
- y-asset-create|media-library-asset-delete|media-library-asset-update|scheduled-function
278
- |sync-tag-invalidate>
279
- --javascript Use JavaScript instead of TypeScript
280
- --json Format output as json
281
- --language=<option> [default: ts] Language of the new function
282
- <options: ts|js>
283
- --[no-]validate-resources Validate resources
269
+ -i, --install Shortcut for --fn-installer npm
270
+ -n, --name=<value> Name of the resource to add
271
+ --example=<value> Example to use for the function resource. Discover examples at
272
+ https://www.sanity.io/exchange/type=recipes/by=sanity
273
+ --[no-]fn-helpers Add helpers to the new function
274
+ --fn-installer=<option> Which package manager to use when installing the @sanity/functions helpers
275
+ <options: skip|npm|pnpm|yarn>
276
+ --fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
277
+ events by specifying this flag multiple times
278
+ <options: document-publish|document-create|document-delete|document-update|media-library-
279
+ asset-create|media-library-asset-delete|media-library-asset-update|scheduled-function|syn
280
+ c-tag-invalidate>
281
+ --javascript Use JavaScript instead of TypeScript
282
+ --json Format output as json
283
+ --language=<option> [default: ts] Language of the new function
284
+ <options: ts|js>
284
285
 
285
286
  DESCRIPTION
286
- Add a function resource to a Blueprint
287
+ [deprecated] Use "functions add" instead
287
288
 
288
- Scaffolds a new Sanity Function in your Blueprint. Functions are serverless handlers triggered by document events
289
- (create, update, delete, publish) or media library events.
289
+ This command is deprecated. Use "functions add" instead.
290
290
 
291
- After adding a function, use 'functions dev' to test locally, then 'blueprints deploy' to publish it.
291
+ Equivalent usage:
292
+ $ sanity functions add
293
+ $ sanity functions add --name my-function --type document-create
292
294
 
293
295
  EXAMPLES
294
296
  $ sanity blueprints add function
@@ -308,8 +310,7 @@ View or edit the local Blueprint configuration
308
310
 
309
311
  ```
310
312
  USAGE
311
- $ sanity blueprints config [--json] [--validate-resources] [--stack <value> -e] [--project-id <value> ]
312
- [--organization-id <value> ]
313
+ $ sanity blueprints config [--json] [--stack <value> -e] [--project-id <value> ] [--organization-id <value> ]
313
314
 
314
315
  FLAGS
315
316
  -e, --edit Modify the configuration interactively, or directly when combined with ID flags.
@@ -317,7 +318,6 @@ FLAGS
317
318
  --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
318
319
  --project-id=<value> Sanity project ID used to scope Blueprint and Stack
319
320
  --stack=<value> Stack name or ID to set in the configuration. Requires --edit flag
320
- --[no-]validate-resources Validate resources
321
321
 
322
322
  DESCRIPTION
323
323
  View or edit the local Blueprint configuration
@@ -345,14 +345,17 @@ Deploy the local Blueprint to the remote Stack
345
345
 
346
346
  ```
347
347
  USAGE
348
- $ sanity blueprints deploy [--json] [--validate-resources] [--stack <value>] [-m <value>] [--no-wait]
348
+ $ sanity blueprints deploy [--json] [--stack <value>] [--project-id <value> | --organization-id <value>] [-m <value>]
349
+ [--no-wait] [--new-stack-name <value>]
349
350
 
350
351
  FLAGS
351
352
  -m, --message=<value> Message describing the deployment (e.g. reason for change)
352
353
  --json Format output as json
354
+ --new-stack-name=<value> Set a new name for the Stack
353
355
  --no-wait Do not wait for Stack deployment to complete
356
+ --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
357
+ --project-id=<value> Sanity project ID used to scope Blueprint and Stack
354
358
  --stack=<value> Stack name or ID to use instead of the locally configured Stack
355
- --[no-]validate-resources Validate resources
356
359
 
357
360
  DESCRIPTION
358
361
  Deploy the local Blueprint to the remote Stack
@@ -377,6 +380,12 @@ EXAMPLES
377
380
  $ sanity blueprints deploy --no-wait
378
381
 
379
382
  $ sanity blueprints deploy --fn-installer npm
383
+
384
+ $ sanity blueprints deploy --stack <name-or-id>
385
+
386
+ $ sanity blueprints deploy --organization-id <orgId> --stack <name-or-id>
387
+
388
+ $ sanity blueprints deploy --new-stack-name <new-name>
380
389
  ```
381
390
 
382
391
  ## `sanity blueprints destroy`
@@ -385,8 +394,8 @@ Destroy a remote Stack deployment and its resources
385
394
 
386
395
  ```
387
396
  USAGE
388
- $ sanity blueprints destroy [--json] [--validate-resources] [--project-id <value> --stack <value> --force]
389
- [--organization-id <value> ] [--no-wait]
397
+ $ sanity blueprints destroy [--json] [--project-id <value> --stack <value> --force] [--organization-id <value> ]
398
+ [--no-wait]
390
399
 
391
400
  FLAGS
392
401
  --force Force Stack destruction (skip confirmation)
@@ -395,7 +404,6 @@ FLAGS
395
404
  --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
396
405
  --project-id=<value> Sanity project ID used to scope Blueprint and Stack
397
406
  --stack=<value> Stack name or ID to destroy (defaults to the locally configured Stack)
398
- --[no-]validate-resources Validate resources
399
407
 
400
408
  DESCRIPTION
401
409
  Destroy a remote Stack deployment and its resources
@@ -419,14 +427,13 @@ Diagnose potential issues with local Blueprint and remote Stack configuration
419
427
 
420
428
  ```
421
429
  USAGE
422
- $ sanity blueprints doctor [--json] [-p <value>] [--validate-resources] [--verbose] [--fix]
430
+ $ sanity blueprints doctor [--json] [-p <value>] [--verbose] [--fix]
423
431
 
424
432
  FLAGS
425
- -p, --path=<value> [env: SANITY_BLUEPRINT_PATH] Path to a Blueprint file or directory containing one
426
- --fix Interactively fix configuration issues
427
- --json Format output as json
428
- --[no-]validate-resources Validate resources
429
- --[no-]verbose Verbose output; defaults to true
433
+ -p, --path=<value> [env: SANITY_BLUEPRINT_PATH] Path to a Blueprint file or directory containing one
434
+ --fix Interactively fix configuration issues
435
+ --json Format output as json
436
+ --[no-]verbose Verbose output; defaults to true
430
437
 
431
438
  DESCRIPTION
432
439
  Diagnose potential issues with local Blueprint and remote Stack configuration
@@ -449,13 +456,13 @@ Display the status and resources of the remote Stack deployment
449
456
 
450
457
  ```
451
458
  USAGE
452
- $ sanity blueprints info [--json] [--validate-resources] [--stack <value>] [--project-id <value>]
459
+ $ sanity blueprints info [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
453
460
 
454
461
  FLAGS
455
462
  --json Format output as json
463
+ --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
456
464
  --project-id=<value> Sanity project ID used to scope Blueprint and Stack
457
465
  --stack=<value> Stack name or ID
458
- --[no-]validate-resources Validate resources
459
466
 
460
467
  DESCRIPTION
461
468
  Display the status and resources of the remote Stack deployment
@@ -474,6 +481,8 @@ EXAMPLES
474
481
  $ sanity blueprints info --stack <name-or-id>
475
482
 
476
483
  $ sanity blueprints info --project-id <id> --stack <name-or-id>
484
+
485
+ $ sanity blueprints info --organization-id <orgId> --stack <name-or-id>
477
486
  ```
478
487
 
479
488
  ## `sanity blueprints init [DIR]`
@@ -482,9 +491,8 @@ Initialize a Blueprint and create a remote Stack
482
491
 
483
492
  ```
484
493
  USAGE
485
- $ sanity blueprints init [DIR] [--json] [--validate-resources] [--verbose] [--dir <value>] [--example <value> |
486
- --blueprint-type json|js|ts | --stack-id <value> | --stack-name <value>] [--project-id <value>] [--organization-id
487
- <value>]
494
+ $ sanity blueprints init [DIR] [--json] [--dir <value>] [--example <value> | --blueprint-type json|js|ts |
495
+ --stack-id <value> | --stack-name <value>] [--project-id <value> | --organization-id <value>]
488
496
 
489
497
  ARGUMENTS
490
498
  [DIR] Directory to create the local Blueprint in
@@ -499,8 +507,6 @@ FLAGS
499
507
  --project-id=<value> Sanity project ID used to scope Blueprint and Stack
500
508
  --stack-id=<value> Existing Stack ID used to scope local Blueprint
501
509
  --stack-name=<value> Name to use for a new Stack provisioned during initialization
502
- --[no-]validate-resources Validate resources
503
- --verbose Verbose output
504
510
 
505
511
  DESCRIPTION
506
512
  Initialize a Blueprint and create a remote Stack
@@ -534,20 +540,27 @@ Display logs for the current Blueprint's Stack deployment
534
540
 
535
541
  ```
536
542
  USAGE
537
- $ sanity blueprints logs [--json] [--validate-resources] [--stack <value>] [-w]
543
+ $ sanity blueprints logs [--json] [--stack <value>] [--project-id <value> | --organization-id <value>] [-l <value>
544
+ | -w] [--since <value> | ] [--before <value> | ]
538
545
 
539
546
  FLAGS
540
- -w, --watch Watch for new Stack logs (streaming mode)
547
+ -l, --limit=<value> Maximum number of log entries to retrieve (1-500)
548
+ -w, --watch Watch for new Stack logs
549
+ --before=<value> Only show logs before this ISO 8601 timestamp
541
550
  --json Format output as json
551
+ --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
552
+ --project-id=<value> Sanity project ID used to scope Blueprint and Stack
553
+ --since=<value> Only show logs after this ISO 8601 timestamp
542
554
  --stack=<value> Stack name or ID to use instead of the locally configured Stack
543
- --[no-]validate-resources Validate resources
544
555
 
545
556
  DESCRIPTION
546
557
  Display logs for the current Blueprint's Stack deployment
547
558
 
548
559
  Retrieves Stack deployment logs, useful for debugging and monitoring deployment activity.
549
560
 
550
- Use --watch (-w) to stream logs in real-time.
561
+ Use --watch (-w) to tail logs in real-time.
562
+
563
+ Use --limit, --since, or --before to narrow the result set when not watching.
551
564
 
552
565
  If you're not seeing expected logs, verify your Stack is deployed with 'blueprints info'.
553
566
 
@@ -555,6 +568,57 @@ EXAMPLES
555
568
  $ sanity blueprints logs
556
569
 
557
570
  $ sanity blueprints logs --watch
571
+
572
+ $ sanity blueprints logs --stack <name-or-id>
573
+
574
+ $ sanity blueprints logs --limit 500
575
+
576
+ $ sanity blueprints logs --since 2026-05-01T00:00:00Z
577
+
578
+ $ sanity blueprints logs --before 2026-05-01T00:00:00Z
579
+ ```
580
+
581
+ ## `sanity blueprints mint-deploy-token`
582
+
583
+ Create a robot API token for deploying Blueprints from CI/CD
584
+
585
+ ```
586
+ USAGE
587
+ $ sanity blueprints mint-deploy-token [--project-id <value> | --organization-id <value>] [--label <value>] [-P |
588
+ --json]
589
+
590
+ FLAGS
591
+ -P, --print Print only the raw token to stdout (suitable for shell substitution)
592
+ --json Format output as json
593
+ --label=<value> Human-readable label for the robot. Defaults to a generated value.
594
+ --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
595
+ --project-id=<value> Sanity project ID used to scope Blueprint and Stack
596
+
597
+ DESCRIPTION
598
+ Create a robot API token for deploying Blueprints from CI/CD
599
+
600
+ Mints a long-lived robot token with the role required to plan, deploy, and destroy Blueprints in this project or
601
+ organization.
602
+
603
+ By default the command runs interactively and asks how you want to receive the token (clipboard, print, or exit). Use
604
+ --print to emit only the raw token for shell pipelines, or --json for full API output.
605
+
606
+ The minted token is also visible in your Sanity Manage UI under Robots, where it can be revoked.
607
+
608
+ EXAMPLES
609
+ $ sanity blueprints mint-deploy-token
610
+
611
+ $ sanity blueprints mint-deploy-token --label "ci-deploy"
612
+
613
+ $ sanity blueprints mint-deploy-token --print
614
+
615
+ export SANITY_AUTH_TOKEN=$(sanity blueprints mint-deploy-token --print)
616
+
617
+ $ sanity blueprints mint-deploy-token --json
618
+
619
+ $ sanity blueprints mint-deploy-token --project-id <projectId>
620
+
621
+ $ sanity blueprints mint-deploy-token --organization-id <orgId>
558
622
  ```
559
623
 
560
624
  ## `sanity blueprints plan`
@@ -563,12 +627,13 @@ Preview changes that will be applied to the remote Stack
563
627
 
564
628
  ```
565
629
  USAGE
566
- $ sanity blueprints plan [--json] [--validate-resources] [--stack <value>]
630
+ $ sanity blueprints plan [--json] [--stack <value>] [--project-id <value> | --organization-id <value>]
567
631
 
568
632
  FLAGS
569
633
  --json Format output as json
634
+ --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
635
+ --project-id=<value> Sanity project ID used to scope Blueprint and Stack
570
636
  --stack=<value> Stack name or ID to use instead of the locally configured Stack
571
- --[no-]validate-resources Validate resources
572
637
 
573
638
  DESCRIPTION
574
639
  Preview changes that will be applied to the remote Stack
@@ -581,6 +646,43 @@ DESCRIPTION
581
646
 
582
647
  EXAMPLES
583
648
  $ sanity blueprints plan
649
+
650
+ $ sanity blueprints plan --stack <name-or-id>
651
+
652
+ $ sanity blueprints plan --organization-id <orgId> --stack <name-or-id>
653
+ ```
654
+
655
+ ## `sanity blueprints promote`
656
+
657
+ Promote a Stack from project scope to organization scope
658
+
659
+ ```
660
+ USAGE
661
+ $ sanity blueprints promote [--json] [--stack <value>] [--project-id <value> | ] [--force] [--new-stack-name <value>]
662
+
663
+ FLAGS
664
+ --force Skip confirmation prompt
665
+ --json Format output as json
666
+ --new-stack-name=<value> Set a new name for the Stack while promoting
667
+ --project-id=<value> Sanity project ID used to scope Blueprint and Stack
668
+ --stack=<value> Stack name or ID to promote
669
+
670
+ DESCRIPTION
671
+ Promote a Stack from project scope to organization scope
672
+
673
+ Promotes a deployed Stack to organization scope, enabling management of org-level resources. Promotion cannot be
674
+ reversed.
675
+
676
+ Your local Blueprint configuration will be updated to reflect the new scope.
677
+
678
+ EXAMPLES
679
+ $ sanity blueprints promote
680
+
681
+ $ sanity blueprints promote --stack <name-or-id>
682
+
683
+ $ sanity blueprints promote --project-id <projectId> --stack <name-or-id>
684
+
685
+ $ sanity blueprints promote --new-stack-name <new-name>
584
686
  ```
585
687
 
586
688
  ## `sanity blueprints stacks`
@@ -589,13 +691,13 @@ List remote Stack deployments for your project or organization
589
691
 
590
692
  ```
591
693
  USAGE
592
- $ sanity blueprints stacks [--json] [--validate-resources] [--project-id <value> | --organization-id <value>]
694
+ $ sanity blueprints stacks [--json] [--project-id <value> | --organization-id <value> | --include-projects]
593
695
 
594
696
  FLAGS
697
+ --include-projects Include Stacks from all projects within the organization. Requires --organization-id.
595
698
  --json Format output as json
596
699
  --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
597
700
  --project-id=<value> Sanity project ID used to scope Blueprint and Stack
598
- --[no-]validate-resources Validate resources
599
701
 
600
702
  DESCRIPTION
601
703
  List remote Stack deployments for your project or organization
@@ -605,12 +707,16 @@ DESCRIPTION
605
707
  Use this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to
606
708
  audit what's deployed across your project.
607
709
 
710
+ Use --include-projects with --organization-id to also list Stacks from all projects within the organization.
711
+
608
712
  EXAMPLES
609
713
  $ sanity blueprints stacks
610
714
 
611
715
  $ sanity blueprints stacks --project-id <projectId>
612
716
 
613
717
  $ sanity blueprints stacks --organization-id <organizationId>
718
+
719
+ $ sanity blueprints stacks --organization-id <organizationId> --include-projects
614
720
  ```
615
721
 
616
722
  ## `sanity build [OUTPUTDIR]`
@@ -1756,28 +1862,27 @@ Add a Function to your Blueprint
1756
1862
 
1757
1863
  ```
1758
1864
  USAGE
1759
- $ sanity functions add [--json] [--validate-resources] [--example <value> | -n <value> | | --language ts|js |
1760
- --javascript | | ] [--type document-publish|document-create|document-delete|document-update|media-library-asset-cre
1761
- ate|media-library-asset-delete|media-library-asset-update|scheduled-function|sync-tag-invalidate... ] [--helpers]
1762
- [--installer skip|npm|pnpm|yarn] [-i | ]
1865
+ $ sanity functions add [--json] [--example <value> | -n <value> | | --language ts|js | --javascript | | ]
1866
+ [--type document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-as
1867
+ set-delete|media-library-asset-update|scheduled-function|sync-tag-invalidate... ] [--helpers] [--installer
1868
+ skip|npm|pnpm|yarn] [-i | ]
1763
1869
 
1764
1870
  FLAGS
1765
- -i, --install Shortcut for --fn-installer npm
1766
- -n, --name=<value> Name of the Function to add
1767
- --example=<value> Example to use for the Function
1768
- --[no-]helpers Add helpers to the new Function
1769
- --installer=<option> How to install the @sanity/functions helpers
1770
- <options: skip|npm|pnpm|yarn>
1771
- --javascript Use JavaScript instead of TypeScript
1772
- --json Format output as json
1773
- --language=<option> [default: ts] Language of the new Function
1774
- <options: ts|js>
1775
- --type=<option>... Document change event(s) that should trigger the function; you can specify multiple
1776
- events by specifying this flag multiple times
1777
- <options: document-publish|document-create|document-delete|document-update|media-librar
1778
- y-asset-create|media-library-asset-delete|media-library-asset-update|scheduled-function
1779
- |sync-tag-invalidate>
1780
- --[no-]validate-resources Validate resources
1871
+ -i, --install Shortcut for --fn-installer npm
1872
+ -n, --name=<value> Name of the Function to add
1873
+ --example=<value> Example to use for the Function
1874
+ --[no-]helpers Add helpers to the new Function
1875
+ --installer=<option> How to install the @sanity/functions helpers
1876
+ <options: skip|npm|pnpm|yarn>
1877
+ --javascript Use JavaScript instead of TypeScript
1878
+ --json Format output as json
1879
+ --language=<option> [default: ts] Language of the new Function
1880
+ <options: ts|js>
1881
+ --type=<option>... Document change event(s) that should trigger the function; you can specify multiple events
1882
+ by specifying this flag multiple times
1883
+ <options: document-publish|document-create|document-delete|document-update|media-library-ass
1884
+ et-create|media-library-asset-delete|media-library-asset-update|scheduled-function|sync-tag-
1885
+ invalidate>
1781
1886
 
1782
1887
  DESCRIPTION
1783
1888
  Add a Function to your Blueprint
@@ -1807,15 +1912,14 @@ Start the Sanity Function emulator
1807
1912
 
1808
1913
  ```
1809
1914
  USAGE
1810
- $ sanity functions dev [--json] [--validate-resources] [-h <value>] [-p <value>] [-t <value>]
1915
+ $ sanity functions dev [--json] [-h <value>] [-p <value>] [-t <value>]
1811
1916
 
1812
1917
  FLAGS
1813
- -h, --host=<value> The local network interface at which to listen. [default: "localhost"]
1814
- -p, --port=<value> TCP port to start emulator on. [default: 8080]
1815
- -t, --timeout=<value> Maximum execution time for all functions, in seconds. Takes precedence over
1816
- function-specific `timeout`
1817
- --json Format output as json
1818
- --[no-]validate-resources Validate resources
1918
+ -h, --host=<value> The local network interface at which to listen. [default: "localhost"]
1919
+ -p, --port=<value> TCP port to start emulator on. [default: 8080]
1920
+ -t, --timeout=<value> Maximum execution time for all functions, in seconds. Takes precedence over function-specific
1921
+ `timeout`
1922
+ --json Format output as json
1819
1923
 
1820
1924
  DESCRIPTION
1821
1925
  Start the Sanity Function emulator
@@ -1841,7 +1945,7 @@ Add or set an environment variable for a deployed function
1841
1945
 
1842
1946
  ```
1843
1947
  USAGE
1844
- $ sanity functions env add NAME KEY VALUE [--json] [--validate-resources]
1948
+ $ sanity functions env add NAME KEY VALUE [--json]
1845
1949
 
1846
1950
  ARGUMENTS
1847
1951
  NAME The name of the Sanity Function
@@ -1849,8 +1953,7 @@ ARGUMENTS
1849
1953
  VALUE The value of the environment variable
1850
1954
 
1851
1955
  FLAGS
1852
- --json Format output as json
1853
- --[no-]validate-resources Validate resources
1956
+ --json Format output as json
1854
1957
 
1855
1958
  DESCRIPTION
1856
1959
  Add or set an environment variable for a deployed function
@@ -1870,14 +1973,13 @@ List environment variables for a deployed function
1870
1973
 
1871
1974
  ```
1872
1975
  USAGE
1873
- $ sanity functions env list NAME [--json] [--validate-resources]
1976
+ $ sanity functions env list NAME [--json]
1874
1977
 
1875
1978
  ARGUMENTS
1876
1979
  NAME The name of the Sanity Function
1877
1980
 
1878
1981
  FLAGS
1879
- --json Format output as json
1880
- --[no-]validate-resources Validate resources
1982
+ --json Format output as json
1881
1983
 
1882
1984
  DESCRIPTION
1883
1985
  List environment variables for a deployed function
@@ -1896,15 +1998,14 @@ Remove an environment variable from a deployed function
1896
1998
 
1897
1999
  ```
1898
2000
  USAGE
1899
- $ sanity functions env remove NAME KEY [--json] [--validate-resources]
2001
+ $ sanity functions env remove NAME KEY [--json]
1900
2002
 
1901
2003
  ARGUMENTS
1902
2004
  NAME The name of the Sanity Function
1903
2005
  KEY The name of the environment variable
1904
2006
 
1905
2007
  FLAGS
1906
- --json Format output as json
1907
- --[no-]validate-resources Validate resources
2008
+ --json Format output as json
1908
2009
 
1909
2010
  DESCRIPTION
1910
2011
  Remove an environment variable from a deployed function
@@ -1924,20 +2025,19 @@ Retrieve or delete logs for a Sanity Function
1924
2025
 
1925
2026
  ```
1926
2027
  USAGE
1927
- $ sanity functions logs [NAME] [--validate-resources] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w]
2028
+ $ sanity functions logs [NAME] [--stack <value>] [-u] [-f [-d | -l <value> | --json]] [-w]
1928
2029
 
1929
2030
  ARGUMENTS
1930
2031
  [NAME] The name of the Sanity Function
1931
2032
 
1932
2033
  FLAGS
1933
- -d, --delete Delete all logs for the function
1934
- -f, --force Skip confirmation for deleting logs
1935
- -l, --limit=<value> [default: 50] Total number of log entries to retrieve
1936
- -u, --utc Show dates in UTC time zone
1937
- -w, --watch Watch for new logs (streaming mode)
1938
- --json Format output as json
1939
- --stack=<value> Stack name or ID to use instead of the locally configured Stack
1940
- --[no-]validate-resources Validate resources
2034
+ -d, --delete Delete all logs for the function
2035
+ -f, --force Skip confirmation for deleting logs
2036
+ -l, --limit=<value> [default: 50] Total number of log entries to retrieve
2037
+ -u, --utc Show dates in UTC time zone
2038
+ -w, --watch Watch for new logs (streaming mode)
2039
+ --json Format output as json
2040
+ --stack=<value> Stack name or ID to use instead of the locally configured Stack
1941
2041
 
1942
2042
  DESCRIPTION
1943
2043
  Retrieve or delete logs for a Sanity Function
@@ -1963,11 +2063,10 @@ Invoke a local Sanity Function
1963
2063
 
1964
2064
  ```
1965
2065
  USAGE
1966
- $ sanity functions test [NAME] [--json] [--validate-resources] [--organization-id <value>] [--data-before <value>
1967
- | [-d <value> | -f <value> | --document-id <value>] | | | --file-before <value> | --file-after <value> |
1968
- --document-id-before <value> | --document-id-after <value>] [--data-after <value> | | | | | | | ] [-e
1969
- create|update|delete] [-t <value>] [-a <value>] [--with-user-token] [--media-library-id <value> | --project-id
1970
- <value> | --dataset <value>]
2066
+ $ sanity functions test [NAME] [--json] [--data-before <value> | [-d <value> | -f <value> | --document-id <value>]
2067
+ | | | --file-before <value> | --file-after <value> | --document-id-before <value> | --document-id-after <value>]
2068
+ [--data-after <value> | | | | | | | ] [-e create|update|delete] [-t <value>] [-a <value>] [--with-user-token]
2069
+ [--media-library-id <value> | [--project-id <value> | --organization-id <value>] | --dataset <value>]
1971
2070
 
1972
2071
  ARGUMENTS
1973
2072
  [NAME] The name of the Sanity Function
@@ -1991,7 +2090,6 @@ FLAGS
1991
2090
  --media-library-id=<value> Sanity Media Library ID to use
1992
2091
  --organization-id=<value> Sanity organization ID used to scope Blueprint and Stack
1993
2092
  --project-id=<value> Sanity project ID used to scope Blueprint and Stack
1994
- --[no-]validate-resources Validate resources
1995
2093
  --with-user-token Prime access token from CLI config
1996
2094
 
1997
2095
  DESCRIPTION