@sanity/runtime-cli 17.3.0-blueprinit.gaf4f184 → 17.3.0-blueprinit.gb1c5e1e

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.
@@ -15,15 +15,6 @@
15
15
  "allowNo": false,
16
16
  "type": "boolean"
17
17
  },
18
- "llms": {
19
- "aliases": [
20
- "skill"
21
- ],
22
- "description": "Show agent-oriented guidance for this command",
23
- "name": "llms",
24
- "allowNo": false,
25
- "type": "boolean"
26
- },
27
18
  "path": {
28
19
  "aliases": [
29
20
  "blueprint-path"
@@ -58,6 +49,15 @@
58
49
  "allowNo": false,
59
50
  "type": "boolean"
60
51
  },
52
+ "llms": {
53
+ "aliases": [
54
+ "skill"
55
+ ],
56
+ "description": "Show agent-oriented guidance for this command",
57
+ "name": "llms",
58
+ "allowNo": false,
59
+ "type": "boolean"
60
+ },
61
61
  "yes": {
62
62
  "char": "y",
63
63
  "description": "Skip confirmation prompts",
@@ -106,16 +106,28 @@
106
106
  "blueprinit.js"
107
107
  ]
108
108
  },
109
- "functions:add": {
109
+ "blueprints:add": {
110
110
  "aliases": [],
111
- "args": {},
112
- "description": "Scaffolds a new Function in the functions/ folder and templates a resource for your Blueprint manifest.\n\nFunctions are serverless handlers triggered by document, live content or media-library events (create, update, delete, publish).\n\nAfter adding, use 'functions dev' to test locally, then 'blueprints deploy' to publish.",
111
+ "args": {
112
+ "type": {
113
+ "description": "Type of resource to add (only \"function\" is supported)",
114
+ "name": "type",
115
+ "options": [
116
+ "function"
117
+ ],
118
+ "required": true
119
+ }
120
+ },
121
+ "deprecationOptions": {
122
+ "to": "functions add"
123
+ },
124
+ "description": "This command is deprecated. Use \"functions add\" instead.\n\nEquivalent usage:\n $ <%= config.bin %> functions add\n $ <%= config.bin %> functions add --name my-function --type document-create",
113
125
  "examples": [
114
- "<%= config.bin %> <%= command.id %>",
115
- "<%= config.bin %> <%= command.id %> --helpers",
116
- "<%= config.bin %> <%= command.id %> --name my-function",
117
- "<%= config.bin %> <%= command.id %> --name my-function --type document-create",
118
- "<%= config.bin %> <%= command.id %> --name my-function --type document-create --type document-update --lang js"
126
+ "<%= config.bin %> <%= command.id %> function",
127
+ "<%= config.bin %> <%= command.id %> function --helpers",
128
+ "<%= config.bin %> <%= command.id %> function --name my-function",
129
+ "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create",
130
+ "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create --fn-type document-update --lang js"
119
131
  ],
120
132
  "flags": {
121
133
  "json": {
@@ -124,16 +136,6 @@
124
136
  "allowNo": false,
125
137
  "type": "boolean"
126
138
  },
127
- "llms": {
128
- "aliases": [
129
- "skill"
130
- ],
131
- "description": "Show agent-oriented guidance for this command",
132
- "hidden": true,
133
- "name": "llms",
134
- "allowNo": false,
135
- "type": "boolean"
136
- },
137
139
  "path": {
138
140
  "aliases": [
139
141
  "blueprint-path"
@@ -211,7 +213,7 @@
211
213
  "aliases": [
212
214
  "recipe"
213
215
  ],
214
- "description": "Example to use for the Function",
216
+ "description": "Example to use for the function resource. Discover examples at https://www.sanity.io/exchange/type=recipes/by=sanity",
215
217
  "exclusive": [
216
218
  "name",
217
219
  "fn-type",
@@ -227,18 +229,21 @@
227
229
  },
228
230
  "name": {
229
231
  "char": "n",
230
- "description": "Name of the Function to add",
232
+ "description": "Name of the resource to add",
231
233
  "name": "name",
232
234
  "hasDynamicHelp": false,
233
235
  "multiple": false,
234
236
  "type": "option"
235
237
  },
236
- "type": {
238
+ "fn-type": {
239
+ "aliases": [
240
+ "function-type"
241
+ ],
237
242
  "dependsOn": [
238
243
  "name"
239
244
  ],
240
245
  "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
241
- "name": "type",
246
+ "name": "fn-type",
242
247
  "hasDynamicHelp": false,
243
248
  "multiple": true,
244
249
  "options": [
@@ -256,9 +261,11 @@
256
261
  },
257
262
  "language": {
258
263
  "aliases": [
264
+ "function-language",
265
+ "fn-language",
259
266
  "lang"
260
267
  ],
261
- "description": "Language of the new Function",
268
+ "description": "Language of the new function",
262
269
  "name": "language",
263
270
  "default": "ts",
264
271
  "hasDynamicHelp": false,
@@ -281,15 +288,23 @@
281
288
  "allowNo": false,
282
289
  "type": "boolean"
283
290
  },
284
- "helpers": {
285
- "description": "Add helpers to the new Function",
286
- "name": "helpers",
291
+ "fn-helpers": {
292
+ "aliases": [
293
+ "function-helpers",
294
+ "helpers"
295
+ ],
296
+ "description": "Add helpers to the new function",
297
+ "name": "fn-helpers",
287
298
  "allowNo": true,
288
299
  "type": "boolean"
289
300
  },
290
- "installer": {
291
- "description": "How to install the @sanity/functions helpers",
292
- "name": "installer",
301
+ "fn-installer": {
302
+ "aliases": [
303
+ "function-installer",
304
+ "installer"
305
+ ],
306
+ "description": "Which package manager to use when installing the @sanity/functions helpers",
307
+ "name": "fn-installer",
293
308
  "hasDynamicHelp": false,
294
309
  "multiple": false,
295
310
  "options": [
@@ -313,12 +328,13 @@
313
328
  },
314
329
  "hasDynamicHelp": false,
315
330
  "hiddenAliases": [],
316
- "id": "functions:add",
331
+ "id": "blueprints:add",
317
332
  "pluginAlias": "@sanity/runtime-cli",
318
333
  "pluginName": "@sanity/runtime-cli",
319
334
  "pluginType": "core",
335
+ "state": "deprecated",
320
336
  "strict": true,
321
- "summary": "Add a Function to your Blueprint",
337
+ "summary": "[deprecated] Use \"functions add\" instead",
322
338
  "enableJsonFlag": true,
323
339
  "needs": [
324
340
  "blueprint"
@@ -327,19 +343,20 @@
327
343
  "relativePath": [
328
344
  "dist",
329
345
  "commands",
330
- "functions",
346
+ "blueprints",
331
347
  "add.js"
332
348
  ]
333
349
  },
334
- "functions:build": {
350
+ "blueprints:config": {
335
351
  "aliases": [],
336
- "args": {
337
- "name": {
338
- "description": "The name of the Sanity Function",
339
- "name": "name",
340
- "required": false
341
- }
342
- },
352
+ "args": {},
353
+ "description": "Manages the local Blueprint configuration, which links your Blueprint to a Sanity project and Stack.\n\nWithout flags, displays the current configuration. Use --edit to interactively modify settings, or combine --edit with ID flags to update values directly (useful for scripting and automation).\n\nIf you need to switch your Blueprint to a different Stack, use --edit --stack.",
354
+ "examples": [
355
+ "<%= config.bin %> <%= command.id %>",
356
+ "<%= config.bin %> <%= command.id %> --edit",
357
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
358
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack <name-or-id>"
359
+ ],
343
360
  "flags": {
344
361
  "json": {
345
362
  "description": "Format output as json",
@@ -347,16 +364,6 @@
347
364
  "allowNo": false,
348
365
  "type": "boolean"
349
366
  },
350
- "llms": {
351
- "aliases": [
352
- "skill"
353
- ],
354
- "description": "Show agent-oriented guidance for this command",
355
- "hidden": true,
356
- "name": "llms",
357
- "allowNo": false,
358
- "type": "boolean"
359
- },
360
367
  "path": {
361
368
  "aliases": [
362
369
  "blueprint-path"
@@ -392,8 +399,14 @@
392
399
  "type": "boolean"
393
400
  },
394
401
  "stack": {
395
- "description": "Stack name or ID to use instead of the locally configured Stack",
396
- "hidden": true,
402
+ "aliases": [
403
+ "stack-id",
404
+ "stackId"
405
+ ],
406
+ "dependsOn": [
407
+ "edit"
408
+ ],
409
+ "description": "Stack name or ID to set in the configuration. Requires --edit flag",
397
410
  "name": "stack",
398
411
  "hasDynamicHelp": false,
399
412
  "multiple": false,
@@ -404,11 +417,13 @@
404
417
  "project",
405
418
  "projectId"
406
419
  ],
420
+ "dependsOn": [
421
+ "edit"
422
+ ],
407
423
  "description": "Sanity project ID used to scope Blueprint and Stack",
408
424
  "exclusive": [
409
425
  "organization-id"
410
426
  ],
411
- "hidden": true,
412
427
  "name": "project-id",
413
428
  "hasDynamicHelp": false,
414
429
  "multiple": false,
@@ -420,70 +435,59 @@
420
435
  "organizationId",
421
436
  "org"
422
437
  ],
438
+ "dependsOn": [
439
+ "edit"
440
+ ],
423
441
  "description": "Sanity organization ID used to scope Blueprint and Stack",
424
442
  "exclusive": [
425
443
  "project-id"
426
444
  ],
427
- "hidden": true,
428
445
  "name": "organization-id",
429
446
  "hasDynamicHelp": false,
430
447
  "multiple": false,
431
448
  "type": "option"
432
449
  },
433
- "fn-installer": {
434
- "aliases": [
435
- "function-installer",
436
- "installer"
437
- ],
438
- "description": "Which package manager to use when building Functions",
439
- "hidden": true,
440
- "name": "fn-installer",
441
- "hasDynamicHelp": false,
442
- "multiple": false,
443
- "options": [
444
- "npm",
445
- "pnpm",
446
- "yarn"
447
- ],
448
- "type": "option"
449
- },
450
- "out-dir": {
451
- "char": "o",
452
- "description": "Output directory for zip files",
453
- "name": "out-dir",
454
- "hasDynamicHelp": false,
455
- "multiple": false,
456
- "type": "option"
450
+ "edit": {
451
+ "char": "e",
452
+ "description": "Modify the configuration interactively, or directly when combined with ID flags.",
453
+ "name": "edit",
454
+ "allowNo": false,
455
+ "type": "boolean"
457
456
  }
458
457
  },
459
458
  "hasDynamicHelp": false,
460
- "hidden": true,
461
459
  "hiddenAliases": [],
462
- "id": "functions:build",
460
+ "id": "blueprints:config",
463
461
  "pluginAlias": "@sanity/runtime-cli",
464
462
  "pluginName": "@sanity/runtime-cli",
465
463
  "pluginType": "core",
466
464
  "strict": true,
467
- "summary": "Build Sanity Function(s) to zip archives",
465
+ "summary": "View or edit the local Blueprint configuration",
468
466
  "enableJsonFlag": true,
469
467
  "needs": [
468
+ "token",
470
469
  "blueprint"
471
470
  ],
472
471
  "isESM": true,
473
472
  "relativePath": [
474
473
  "dist",
475
474
  "commands",
476
- "functions",
477
- "build.js"
475
+ "blueprints",
476
+ "config.js"
478
477
  ]
479
478
  },
480
- "functions:dev": {
479
+ "blueprints:deploy": {
481
480
  "aliases": [],
482
481
  "args": {},
483
- "description": "Runs a local, web-based development server to test your functions before deploying.\n\nOpen the emulator in your browser to interactively test your functions with the payload editor.\n\nOptionally, set the host and port with the --host and --port flags. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
482
+ "description": "Applies your local Blueprint to the remote Stack, creating, updating, or removing resources as needed. This is the primary command for applying infrastructure changes.\n\nBefore deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack status or 'blueprints logs' to monitor activity.\n\nUse --no-wait to queue the deployment and return immediately without waiting for completion.\n\nUse --fn-installer to force which package manager to use when deploying functions.\n\nSet SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
484
483
  "examples": [
485
- "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974",
486
- "<%= config.bin %> <%= command.id %> --timeout 60"
484
+ "<%= config.bin %> <%= command.id %>",
485
+ "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
486
+ "<%= config.bin %> <%= command.id %> --no-wait",
487
+ "<%= config.bin %> <%= command.id %> --fn-installer npm",
488
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
489
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>",
490
+ "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
487
491
  ],
488
492
  "flags": {
489
493
  "json": {
@@ -492,16 +496,6 @@
492
496
  "allowNo": false,
493
497
  "type": "boolean"
494
498
  },
495
- "llms": {
496
- "aliases": [
497
- "skill"
498
- ],
499
- "description": "Show agent-oriented guidance for this command",
500
- "hidden": true,
501
- "name": "llms",
502
- "allowNo": false,
503
- "type": "boolean"
504
- },
505
499
  "path": {
506
500
  "aliases": [
507
501
  "blueprint-path"
@@ -538,7 +532,6 @@
538
532
  },
539
533
  "stack": {
540
534
  "description": "Stack name or ID to use instead of the locally configured Stack",
541
- "hidden": true,
542
535
  "name": "stack",
543
536
  "hasDynamicHelp": false,
544
537
  "multiple": false,
@@ -553,7 +546,6 @@
553
546
  "exclusive": [
554
547
  "organization-id"
555
548
  ],
556
- "hidden": true,
557
549
  "name": "project-id",
558
550
  "hasDynamicHelp": false,
559
551
  "multiple": false,
@@ -569,35 +561,45 @@
569
561
  "exclusive": [
570
562
  "project-id"
571
563
  ],
572
- "hidden": true,
573
564
  "name": "organization-id",
574
565
  "hasDynamicHelp": false,
575
566
  "multiple": false,
576
567
  "type": "option"
577
568
  },
578
- "host": {
579
- "char": "h",
580
- "description": "The local network interface at which to listen. [default: \"localhost\"]",
581
- "name": "host",
582
- "required": false,
569
+ "message": {
570
+ "char": "m",
571
+ "description": "Message describing the deployment (e.g. reason for change)",
572
+ "name": "message",
583
573
  "hasDynamicHelp": false,
584
574
  "multiple": false,
585
575
  "type": "option"
586
576
  },
587
- "port": {
588
- "char": "p",
589
- "description": "TCP port to start emulator on. [default: 8080]",
590
- "name": "port",
591
- "required": false,
577
+ "fn-installer": {
578
+ "aliases": [
579
+ "function-installer",
580
+ "installer"
581
+ ],
582
+ "description": "Which package manager to use when installing Function dependencies",
583
+ "hidden": true,
584
+ "name": "fn-installer",
592
585
  "hasDynamicHelp": false,
593
586
  "multiple": false,
587
+ "options": [
588
+ "npm",
589
+ "pnpm",
590
+ "yarn"
591
+ ],
594
592
  "type": "option"
595
593
  },
596
- "timeout": {
597
- "char": "t",
598
- "description": "Maximum execution time for all functions, in seconds. Takes precedence over function-specific `timeout`",
599
- "name": "timeout",
600
- "required": false,
594
+ "no-wait": {
595
+ "description": "Do not wait for Stack deployment to complete",
596
+ "name": "no-wait",
597
+ "allowNo": false,
598
+ "type": "boolean"
599
+ },
600
+ "new-stack-name": {
601
+ "description": "Set a new name for the Stack",
602
+ "name": "new-stack-name",
601
603
  "hasDynamicHelp": false,
602
604
  "multiple": false,
603
605
  "type": "option"
@@ -605,39 +607,32 @@
605
607
  },
606
608
  "hasDynamicHelp": false,
607
609
  "hiddenAliases": [],
608
- "id": "functions:dev",
610
+ "id": "blueprints:deploy",
609
611
  "pluginAlias": "@sanity/runtime-cli",
610
612
  "pluginName": "@sanity/runtime-cli",
611
613
  "pluginType": "core",
612
614
  "strict": true,
613
- "summary": "Start the Sanity Function emulator",
615
+ "summary": "Deploy the local Blueprint to the remote Stack",
614
616
  "enableJsonFlag": true,
615
617
  "needs": [
618
+ "deployedStack",
616
619
  "blueprint"
617
620
  ],
618
621
  "isESM": true,
619
622
  "relativePath": [
620
623
  "dist",
621
624
  "commands",
622
- "functions",
623
- "dev.js"
625
+ "blueprints",
626
+ "deploy.js"
624
627
  ]
625
628
  },
626
- "functions:logs": {
629
+ "blueprints:destroy": {
627
630
  "aliases": [],
628
- "args": {
629
- "name": {
630
- "description": "The name of the Sanity Function",
631
- "name": "name",
632
- "required": false
633
- }
634
- },
635
- "description": "Fetches execution logs from a deployed function, useful for debugging production issues or monitoring activity.\n\nUse --watch (-w) to stream logs in real-time. Use --delete to clear all logs for a function (requires confirmation unless --force is specified).",
631
+ "args": {},
632
+ "description": "Permanently removes the remote Stack and all its provisioned resources. Your Blueprint manifest and resource files remain intact; \"stackId\" is unset in your local config.\n\nThis is a destructive operation. You will be prompted to confirm unless --force is specified.\n\nUse this to clean up test environments or decommission a Stack you no longer need.\n\nExit codes: 0 destroyed, 2 destruction failed, 75 destruction accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
636
633
  "examples": [
637
- "<%= config.bin %> <%= command.id %> <name>",
638
- "<%= config.bin %> <%= command.id %> <name> --json",
639
- "<%= config.bin %> <%= command.id %> <name> --limit 100",
640
- "<%= config.bin %> <%= command.id %> <name> --delete"
634
+ "<%= config.bin %> <%= command.id %>",
635
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
641
636
  ],
642
637
  "flags": {
643
638
  "json": {
@@ -646,16 +641,6 @@
646
641
  "allowNo": false,
647
642
  "type": "boolean"
648
643
  },
649
- "llms": {
650
- "aliases": [
651
- "skill"
652
- ],
653
- "description": "Show agent-oriented guidance for this command",
654
- "hidden": true,
655
- "name": "llms",
656
- "allowNo": false,
657
- "type": "boolean"
658
- },
659
644
  "path": {
660
645
  "aliases": [
661
646
  "blueprint-path"
@@ -691,7 +676,11 @@
691
676
  "type": "boolean"
692
677
  },
693
678
  "stack": {
694
- "description": "Stack name or ID to use instead of the locally configured Stack",
679
+ "aliases": [
680
+ "stack-id",
681
+ "stackId"
682
+ ],
683
+ "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
695
684
  "name": "stack",
696
685
  "hasDynamicHelp": false,
697
686
  "multiple": false,
@@ -702,11 +691,14 @@
702
691
  "project",
703
692
  "projectId"
704
693
  ],
694
+ "dependsOn": [
695
+ "stack",
696
+ "force"
697
+ ],
705
698
  "description": "Sanity project ID used to scope Blueprint and Stack",
706
699
  "exclusive": [
707
700
  "organization-id"
708
701
  ],
709
- "hidden": true,
710
702
  "name": "project-id",
711
703
  "hasDynamicHelp": false,
712
704
  "multiple": false,
@@ -718,104 +710,62 @@
718
710
  "organizationId",
719
711
  "org"
720
712
  ],
713
+ "dependsOn": [
714
+ "stack",
715
+ "force"
716
+ ],
721
717
  "description": "Sanity organization ID used to scope Blueprint and Stack",
722
718
  "exclusive": [
723
719
  "project-id"
724
720
  ],
725
- "hidden": true,
726
721
  "name": "organization-id",
727
722
  "hasDynamicHelp": false,
728
723
  "multiple": false,
729
724
  "type": "option"
730
725
  },
731
- "limit": {
732
- "char": "l",
733
- "description": "Total number of log entries to retrieve",
734
- "name": "limit",
735
- "required": false,
736
- "default": 50,
737
- "hasDynamicHelp": false,
738
- "multiple": false,
739
- "type": "option"
740
- },
741
- "utc": {
742
- "char": "u",
743
- "description": "Show dates in UTC time zone",
744
- "name": "utc",
745
- "required": false,
746
- "allowNo": false,
747
- "type": "boolean"
748
- },
749
- "delete": {
750
- "char": "d",
751
- "description": "Delete all logs for the function",
752
- "exclusive": [
753
- "limit",
754
- "json"
755
- ],
756
- "name": "delete",
757
- "required": false,
758
- "allowNo": false,
759
- "type": "boolean"
760
- },
761
726
  "force": {
762
- "char": "f",
763
- "dependsOn": [
764
- "delete"
727
+ "aliases": [
728
+ "f"
765
729
  ],
766
- "description": "Skip confirmation for deleting logs",
730
+ "description": "Force Stack destruction (skip confirmation)",
767
731
  "name": "force",
768
- "required": false,
769
732
  "allowNo": false,
770
733
  "type": "boolean"
771
734
  },
772
- "watch": {
773
- "aliases": [
774
- "follow"
775
- ],
776
- "char": "w",
777
- "description": "Watch for new logs (streaming mode)",
778
- "name": "watch",
735
+ "no-wait": {
736
+ "description": "Do not wait for Stack destruction to complete",
737
+ "name": "no-wait",
779
738
  "allowNo": false,
780
739
  "type": "boolean"
781
740
  }
782
741
  },
783
742
  "hasDynamicHelp": false,
784
743
  "hiddenAliases": [],
785
- "id": "functions:logs",
744
+ "id": "blueprints:destroy",
786
745
  "pluginAlias": "@sanity/runtime-cli",
787
746
  "pluginName": "@sanity/runtime-cli",
788
747
  "pluginType": "core",
789
748
  "strict": true,
790
- "summary": "Retrieve or delete logs for a Sanity Function",
749
+ "summary": "Destroy a remote Stack deployment and its resources",
791
750
  "enableJsonFlag": true,
792
751
  "needs": [
793
- "deployedStack",
794
- "blueprint"
752
+ "scope"
795
753
  ],
796
754
  "isESM": true,
797
755
  "relativePath": [
798
756
  "dist",
799
757
  "commands",
800
- "functions",
801
- "logs.js"
758
+ "blueprints",
759
+ "destroy.js"
802
760
  ]
803
761
  },
804
- "functions:test": {
762
+ "blueprints:doctor": {
805
763
  "aliases": [],
806
- "args": {
807
- "name": {
808
- "description": "The name of the Sanity Function",
809
- "name": "name",
810
- "required": false
811
- }
812
- },
813
- "description": "Executes a function locally with the provided payload, simulating how it would run when deployed. Use this to test your function logic before deploying.\n\nProvide test data via --data (inline JSON), --file (JSON file), or --document-id (fetch from Sanity). For update events, use the before/after flag pairs to simulate document changes.",
764
+ "args": {},
765
+ "description": "Analyzes your local Blueprint and remote Stack configuration for common issues, such as missing authentication, invalid project references, or misconfigured resources.\n\nRun this command when encountering errors with other Blueprint commands. Use --fix to interactively resolve detected issues.\n\nSupports --json for programmatic consumption of diagnostic results.",
814
766
  "examples": [
815
- "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }'",
816
- "<%= config.bin %> <%= command.id %> <name> --file 'payload.json'",
817
- "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }' --timeout 60",
818
- "<%= config.bin %> <%= command.id %> <name> --event update --data-before '{ \"title\": \"before\" }' --data-after '{ \"title\": \"after\" }'"
767
+ "<%= config.bin %> <%= command.id %>",
768
+ "<%= config.bin %> <%= command.id %> --fix"
819
769
  ],
820
770
  "flags": {
821
771
  "json": {
@@ -824,16 +774,6 @@
824
774
  "allowNo": false,
825
775
  "type": "boolean"
826
776
  },
827
- "llms": {
828
- "aliases": [
829
- "skill"
830
- ],
831
- "description": "Show agent-oriented guidance for this command",
832
- "hidden": true,
833
- "name": "llms",
834
- "allowNo": false,
835
- "type": "boolean"
836
- },
837
777
  "path": {
838
778
  "aliases": [
839
779
  "blueprint-path"
@@ -841,7 +781,6 @@
841
781
  "char": "p",
842
782
  "description": "Path to a Blueprint file or directory containing one",
843
783
  "env": "SANITY_BLUEPRINT_PATH",
844
- "hidden": true,
845
784
  "name": "path",
846
785
  "hasDynamicHelp": false,
847
786
  "multiple": false,
@@ -868,529 +807,161 @@
868
807
  "allowNo": false,
869
808
  "type": "boolean"
870
809
  },
871
- "stack": {
872
- "description": "Stack name or ID to use instead of the locally configured Stack",
873
- "hidden": true,
874
- "name": "stack",
875
- "hasDynamicHelp": false,
876
- "multiple": false,
877
- "type": "option"
878
- },
879
- "project-id": {
880
- "aliases": [
881
- "project",
882
- "projectId"
883
- ],
884
- "description": "Sanity project ID used to scope Blueprint and Stack",
885
- "exclusive": [
886
- "organization-id"
887
- ],
888
- "name": "project-id",
889
- "hasDynamicHelp": false,
890
- "multiple": false,
891
- "type": "option"
810
+ "fix": {
811
+ "description": "Interactively fix configuration issues",
812
+ "name": "fix",
813
+ "allowNo": false,
814
+ "type": "boolean"
815
+ }
816
+ },
817
+ "hasDynamicHelp": false,
818
+ "hiddenAliases": [],
819
+ "id": "blueprints:doctor",
820
+ "pluginAlias": "@sanity/runtime-cli",
821
+ "pluginName": "@sanity/runtime-cli",
822
+ "pluginType": "core",
823
+ "strict": true,
824
+ "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
825
+ "enableJsonFlag": true,
826
+ "isESM": true,
827
+ "relativePath": [
828
+ "dist",
829
+ "commands",
830
+ "blueprints",
831
+ "doctor.js"
832
+ ]
833
+ },
834
+ "blueprints:info": {
835
+ "aliases": [],
836
+ "args": {},
837
+ "description": "Displays the current state and metadata of your remote Stack deployment, including deployed resources, status, and configuration.\n\nUse this command to verify a deployment succeeded, check what resources are live, or confirm which Stack your local Blueprint is connected to.\n\nRun 'blueprints stacks' to see all available Stacks in your project or organization.",
838
+ "examples": [
839
+ "<%= config.bin %> <%= command.id %>",
840
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
841
+ "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
842
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
843
+ ],
844
+ "flags": {
845
+ "json": {
846
+ "description": "Format output as json",
847
+ "name": "json",
848
+ "allowNo": false,
849
+ "type": "boolean"
892
850
  },
893
- "organization-id": {
851
+ "path": {
894
852
  "aliases": [
895
- "organization",
896
- "organizationId",
897
- "org"
898
- ],
899
- "description": "Sanity organization ID used to scope Blueprint and Stack",
900
- "exclusive": [
901
- "project-id"
853
+ "blueprint-path"
902
854
  ],
903
- "name": "organization-id",
855
+ "char": "p",
856
+ "description": "Path to a Blueprint file or directory containing one",
857
+ "env": "SANITY_BLUEPRINT_PATH",
858
+ "hidden": true,
859
+ "name": "path",
904
860
  "hasDynamicHelp": false,
905
861
  "multiple": false,
906
862
  "type": "option"
907
863
  },
908
- "data": {
909
- "char": "d",
910
- "description": "Data to send to the function",
911
- "exclusive": [
912
- "file",
913
- "document-id"
914
- ],
915
- "name": "data",
916
- "required": false,
917
- "hasDynamicHelp": false,
918
- "multiple": false,
919
- "type": "option"
864
+ "trace": {
865
+ "description": "Trace output",
866
+ "hidden": true,
867
+ "name": "trace",
868
+ "allowNo": false,
869
+ "type": "boolean"
920
870
  },
921
- "data-before": {
922
- "description": "Original document",
923
- "exclusive": [
924
- "data",
925
- "file",
926
- "document-id",
927
- "file-before",
928
- "file-after",
929
- "document-id-before",
930
- "document-id-after"
931
- ],
932
- "name": "data-before",
933
- "required": false,
934
- "hasDynamicHelp": false,
935
- "multiple": false,
936
- "type": "option"
871
+ "validate-resources": {
872
+ "description": "Validate resources",
873
+ "hidden": true,
874
+ "name": "validate-resources",
875
+ "allowNo": true,
876
+ "type": "boolean"
937
877
  },
938
- "data-after": {
939
- "description": "Current document",
940
- "exclusive": [
941
- "data",
942
- "file",
943
- "document-id",
944
- "file-before",
945
- "file-after",
946
- "document-id-before",
947
- "document-id-after"
948
- ],
949
- "name": "data-after",
950
- "required": false,
951
- "hasDynamicHelp": false,
952
- "multiple": false,
953
- "type": "option"
954
- },
955
- "event": {
956
- "char": "e",
957
- "description": "Type of event (create, update, delete)",
958
- "name": "event",
959
- "required": false,
960
- "hasDynamicHelp": false,
961
- "multiple": false,
962
- "options": [
963
- "create",
964
- "update",
965
- "delete"
966
- ],
967
- "type": "option"
968
- },
969
- "file": {
970
- "char": "f",
971
- "description": "Read data from file and send to the function",
972
- "exclusive": [
973
- "data",
974
- "document-id"
975
- ],
976
- "name": "file",
977
- "required": false,
978
- "hasDynamicHelp": false,
979
- "multiple": false,
980
- "type": "option"
981
- },
982
- "file-before": {
983
- "description": "Original document",
984
- "exclusive": [
985
- "data",
986
- "file",
987
- "document-id",
988
- "data-before",
989
- "data-after",
990
- "document-id-before",
991
- "document-id-after"
992
- ],
993
- "name": "file-before",
994
- "required": false,
995
- "hasDynamicHelp": false,
996
- "multiple": false,
997
- "type": "option"
998
- },
999
- "file-after": {
1000
- "description": "Current document",
1001
- "exclusive": [
1002
- "data",
1003
- "file",
1004
- "document-id",
1005
- "data-before",
1006
- "data-after",
1007
- "document-id-before",
1008
- "document-id-after"
1009
- ],
1010
- "name": "file-after",
1011
- "required": false,
1012
- "hasDynamicHelp": false,
1013
- "multiple": false,
1014
- "type": "option"
1015
- },
1016
- "timeout": {
1017
- "char": "t",
1018
- "description": "Execution timeout value in seconds",
1019
- "name": "timeout",
1020
- "required": false,
1021
- "hasDynamicHelp": false,
1022
- "multiple": false,
1023
- "type": "option"
1024
- },
1025
- "api": {
1026
- "char": "a",
1027
- "description": "Sanity API Version to use",
1028
- "name": "api",
1029
- "required": false,
1030
- "hasDynamicHelp": false,
1031
- "multiple": false,
1032
- "type": "option"
1033
- },
1034
- "dataset": {
1035
- "description": "The Sanity dataset to use",
1036
- "name": "dataset",
1037
- "required": false,
1038
- "hasDynamicHelp": false,
1039
- "multiple": false,
1040
- "type": "option"
1041
- },
1042
- "document-id": {
1043
- "aliases": [
1044
- "doc",
1045
- "documentId"
1046
- ],
1047
- "description": "Document to fetch and send to function",
1048
- "exclusive": [
1049
- "data",
1050
- "file"
1051
- ],
1052
- "name": "document-id",
1053
- "required": false,
1054
- "hasDynamicHelp": false,
1055
- "multiple": false,
1056
- "type": "option"
1057
- },
1058
- "document-id-before": {
1059
- "description": "Original document",
1060
- "exclusive": [
1061
- "data",
1062
- "file",
1063
- "document-id",
1064
- "data-before",
1065
- "data-after",
1066
- "file-before",
1067
- "file-after"
1068
- ],
1069
- "name": "document-id-before",
1070
- "required": false,
1071
- "hasDynamicHelp": false,
1072
- "multiple": false,
1073
- "type": "option"
1074
- },
1075
- "document-id-after": {
1076
- "description": "Current document",
1077
- "exclusive": [
1078
- "data",
1079
- "file",
1080
- "document-id",
1081
- "data-before",
1082
- "data-after",
1083
- "file-before",
1084
- "file-after"
1085
- ],
1086
- "name": "document-id-after",
1087
- "required": false,
1088
- "hasDynamicHelp": false,
1089
- "multiple": false,
1090
- "type": "option"
1091
- },
1092
- "with-user-token": {
1093
- "description": "Prime access token from CLI config",
1094
- "name": "with-user-token",
1095
- "allowNo": false,
1096
- "type": "boolean"
1097
- },
1098
- "media-library-id": {
1099
- "aliases": [
1100
- "media"
1101
- ],
1102
- "description": "Sanity Media Library ID to use",
1103
- "exclusive": [
1104
- "project-id",
1105
- "dataset"
1106
- ],
1107
- "name": "media-library-id",
1108
- "required": false,
1109
- "hasDynamicHelp": false,
1110
- "multiple": false,
1111
- "type": "option"
1112
- }
1113
- },
1114
- "hasDynamicHelp": false,
1115
- "hiddenAliases": [],
1116
- "id": "functions:test",
1117
- "pluginAlias": "@sanity/runtime-cli",
1118
- "pluginName": "@sanity/runtime-cli",
1119
- "pluginType": "core",
1120
- "strict": true,
1121
- "summary": "Invoke a local Sanity Function",
1122
- "enableJsonFlag": true,
1123
- "needs": [
1124
- "blueprint"
1125
- ],
1126
- "isESM": true,
1127
- "relativePath": [
1128
- "dist",
1129
- "commands",
1130
- "functions",
1131
- "test.js"
1132
- ]
1133
- },
1134
- "blueprints:add": {
1135
- "aliases": [],
1136
- "args": {
1137
- "type": {
1138
- "description": "Type of resource to add (only \"function\" is supported)",
1139
- "name": "type",
1140
- "options": [
1141
- "function"
1142
- ],
1143
- "required": true
1144
- }
1145
- },
1146
- "deprecationOptions": {
1147
- "to": "functions add"
1148
- },
1149
- "description": "This command is deprecated. Use \"functions add\" instead.\n\nEquivalent usage:\n $ <%= config.bin %> functions add\n $ <%= config.bin %> functions add --name my-function --type document-create",
1150
- "examples": [
1151
- "<%= config.bin %> <%= command.id %> function",
1152
- "<%= config.bin %> <%= command.id %> function --helpers",
1153
- "<%= config.bin %> <%= command.id %> function --name my-function",
1154
- "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create",
1155
- "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create --fn-type document-update --lang js"
1156
- ],
1157
- "flags": {
1158
- "json": {
1159
- "description": "Format output as json",
1160
- "name": "json",
1161
- "allowNo": false,
1162
- "type": "boolean"
1163
- },
1164
- "llms": {
1165
- "aliases": [
1166
- "skill"
1167
- ],
1168
- "description": "Show agent-oriented guidance for this command",
1169
- "hidden": true,
1170
- "name": "llms",
1171
- "allowNo": false,
1172
- "type": "boolean"
1173
- },
1174
- "path": {
1175
- "aliases": [
1176
- "blueprint-path"
1177
- ],
1178
- "char": "p",
1179
- "description": "Path to a Blueprint file or directory containing one",
1180
- "env": "SANITY_BLUEPRINT_PATH",
1181
- "hidden": true,
1182
- "name": "path",
1183
- "hasDynamicHelp": false,
1184
- "multiple": false,
1185
- "type": "option"
1186
- },
1187
- "trace": {
1188
- "description": "Trace output",
1189
- "hidden": true,
1190
- "name": "trace",
1191
- "allowNo": false,
1192
- "type": "boolean"
1193
- },
1194
- "validate-resources": {
1195
- "description": "Validate resources",
1196
- "hidden": true,
1197
- "name": "validate-resources",
1198
- "allowNo": true,
1199
- "type": "boolean"
1200
- },
1201
- "verbose": {
1202
- "description": "Verbose output",
1203
- "hidden": true,
1204
- "name": "verbose",
1205
- "allowNo": false,
1206
- "type": "boolean"
1207
- },
1208
- "stack": {
1209
- "description": "Stack name or ID to use instead of the locally configured Stack",
1210
- "hidden": true,
1211
- "name": "stack",
1212
- "hasDynamicHelp": false,
1213
- "multiple": false,
1214
- "type": "option"
1215
- },
1216
- "project-id": {
1217
- "aliases": [
1218
- "project",
1219
- "projectId"
1220
- ],
1221
- "description": "Sanity project ID used to scope Blueprint and Stack",
1222
- "exclusive": [
1223
- "organization-id"
1224
- ],
1225
- "hidden": true,
1226
- "name": "project-id",
1227
- "hasDynamicHelp": false,
1228
- "multiple": false,
1229
- "type": "option"
1230
- },
1231
- "organization-id": {
1232
- "aliases": [
1233
- "organization",
1234
- "organizationId",
1235
- "org"
1236
- ],
1237
- "description": "Sanity organization ID used to scope Blueprint and Stack",
1238
- "exclusive": [
1239
- "project-id"
1240
- ],
1241
- "hidden": true,
1242
- "name": "organization-id",
1243
- "hasDynamicHelp": false,
1244
- "multiple": false,
1245
- "type": "option"
1246
- },
1247
- "example": {
1248
- "aliases": [
1249
- "recipe"
1250
- ],
1251
- "description": "Example to use for the function resource. Discover examples at https://www.sanity.io/exchange/type=recipes/by=sanity",
1252
- "exclusive": [
1253
- "name",
1254
- "fn-type",
1255
- "language",
1256
- "javascript",
1257
- "fn-helpers",
1258
- "fn-installer"
1259
- ],
1260
- "name": "example",
1261
- "hasDynamicHelp": false,
1262
- "multiple": false,
1263
- "type": "option"
1264
- },
1265
- "name": {
1266
- "char": "n",
1267
- "description": "Name of the resource to add",
1268
- "name": "name",
1269
- "hasDynamicHelp": false,
1270
- "multiple": false,
1271
- "type": "option"
1272
- },
1273
- "fn-type": {
1274
- "aliases": [
1275
- "function-type"
1276
- ],
1277
- "dependsOn": [
1278
- "name"
1279
- ],
1280
- "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
1281
- "name": "fn-type",
1282
- "hasDynamicHelp": false,
1283
- "multiple": true,
1284
- "options": [
1285
- "document-publish",
1286
- "document-create",
1287
- "document-delete",
1288
- "document-update",
1289
- "media-library-asset-create",
1290
- "media-library-asset-delete",
1291
- "media-library-asset-update",
1292
- "scheduled-function",
1293
- "sync-tag-invalidate"
1294
- ],
1295
- "type": "option"
878
+ "verbose": {
879
+ "description": "Verbose output",
880
+ "hidden": true,
881
+ "name": "verbose",
882
+ "allowNo": false,
883
+ "type": "boolean"
1296
884
  },
1297
- "language": {
885
+ "stack": {
1298
886
  "aliases": [
1299
- "function-language",
1300
- "fn-language",
1301
- "lang"
887
+ "id"
1302
888
  ],
1303
- "description": "Language of the new function",
1304
- "name": "language",
1305
- "default": "ts",
889
+ "description": "Stack name or ID",
890
+ "name": "stack",
1306
891
  "hasDynamicHelp": false,
1307
892
  "multiple": false,
1308
- "options": [
1309
- "ts",
1310
- "js"
1311
- ],
1312
893
  "type": "option"
1313
894
  },
1314
- "javascript": {
895
+ "project-id": {
1315
896
  "aliases": [
1316
- "js"
897
+ "project",
898
+ "projectId"
1317
899
  ],
1318
- "description": "Use JavaScript instead of TypeScript",
900
+ "description": "Sanity project ID used to scope Blueprint and Stack",
1319
901
  "exclusive": [
1320
- "language"
902
+ "organization-id"
1321
903
  ],
1322
- "name": "javascript",
1323
- "allowNo": false,
1324
- "type": "boolean"
904
+ "name": "project-id",
905
+ "hasDynamicHelp": false,
906
+ "multiple": false,
907
+ "type": "option"
1325
908
  },
1326
- "fn-helpers": {
909
+ "organization-id": {
1327
910
  "aliases": [
1328
- "function-helpers",
1329
- "helpers"
911
+ "organization",
912
+ "organizationId",
913
+ "org"
1330
914
  ],
1331
- "description": "Add helpers to the new function",
1332
- "name": "fn-helpers",
1333
- "allowNo": true,
1334
- "type": "boolean"
1335
- },
1336
- "fn-installer": {
1337
- "aliases": [
1338
- "function-installer",
1339
- "installer"
915
+ "description": "Sanity organization ID used to scope Blueprint and Stack",
916
+ "exclusive": [
917
+ "project-id"
1340
918
  ],
1341
- "description": "Which package manager to use when installing the @sanity/functions helpers",
1342
- "name": "fn-installer",
919
+ "name": "organization-id",
1343
920
  "hasDynamicHelp": false,
1344
921
  "multiple": false,
1345
- "options": [
1346
- "skip",
1347
- "npm",
1348
- "pnpm",
1349
- "yarn"
1350
- ],
1351
922
  "type": "option"
1352
- },
1353
- "install": {
1354
- "char": "i",
1355
- "description": "Shortcut for --fn-installer npm",
1356
- "exclusive": [
1357
- "fn-installer"
1358
- ],
1359
- "name": "install",
1360
- "allowNo": false,
1361
- "type": "boolean"
1362
923
  }
1363
924
  },
1364
925
  "hasDynamicHelp": false,
1365
926
  "hiddenAliases": [],
1366
- "id": "blueprints:add",
927
+ "id": "blueprints:info",
1367
928
  "pluginAlias": "@sanity/runtime-cli",
1368
929
  "pluginName": "@sanity/runtime-cli",
1369
930
  "pluginType": "core",
1370
- "state": "deprecated",
1371
931
  "strict": true,
1372
- "summary": "[deprecated] Use \"functions add\" instead",
932
+ "summary": "Display the status and resources of the remote Stack deployment",
1373
933
  "enableJsonFlag": true,
1374
934
  "needs": [
1375
- "blueprint"
935
+ "deployedStack"
1376
936
  ],
1377
937
  "isESM": true,
1378
938
  "relativePath": [
1379
939
  "dist",
1380
940
  "commands",
1381
941
  "blueprints",
1382
- "add.js"
942
+ "info.js"
1383
943
  ]
1384
944
  },
1385
- "blueprints:config": {
945
+ "blueprints:init": {
1386
946
  "aliases": [],
1387
- "args": {},
1388
- "description": "Manages the local Blueprint configuration, which links your Blueprint to a Sanity project and Stack.\n\nWithout flags, displays the current configuration. Use --edit to interactively modify settings, or combine --edit with ID flags to update values directly (useful for scripting and automation).\n\nIf you need to switch your Blueprint to a different Stack, use --edit --stack.",
947
+ "args": {
948
+ "dir": {
949
+ "description": "Directory to create the local Blueprint in (defaults to the current directory)",
950
+ "name": "dir"
951
+ }
952
+ },
953
+ "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
1389
954
  "examples": [
1390
955
  "<%= config.bin %> <%= command.id %>",
1391
- "<%= config.bin %> <%= command.id %> --edit",
1392
- "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
1393
- "<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack <name-or-id>"
956
+ "<%= config.bin %> <%= command.id %> .",
957
+ "<%= config.bin %> <%= command.id %> [directory]",
958
+ "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
959
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
960
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
961
+ "<%= config.bin %> <%= command.id %> --stack-name <newStackName>",
962
+ "<%= config.bin %> <%= command.id %> --stack-id <existingStackId>",
963
+ "<%= config.bin %> <%= command.id %> new-stack --type <json|js|ts> --org <organizationId> --name <newStackName>",
964
+ "<%= config.bin %> <%= command.id %> old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>"
1394
965
  ],
1395
966
  "flags": {
1396
967
  "json": {
@@ -1399,16 +970,6 @@
1399
970
  "allowNo": false,
1400
971
  "type": "boolean"
1401
972
  },
1402
- "llms": {
1403
- "aliases": [
1404
- "skill"
1405
- ],
1406
- "description": "Show agent-oriented guidance for this command",
1407
- "hidden": true,
1408
- "name": "llms",
1409
- "allowNo": false,
1410
- "type": "boolean"
1411
- },
1412
973
  "path": {
1413
974
  "aliases": [
1414
975
  "blueprint-path"
@@ -1443,18 +1004,41 @@
1443
1004
  "allowNo": false,
1444
1005
  "type": "boolean"
1445
1006
  },
1446
- "stack": {
1007
+ "dir": {
1008
+ "description": "Directory to create the local Blueprint in",
1009
+ "name": "dir",
1010
+ "hasDynamicHelp": false,
1011
+ "multiple": false,
1012
+ "type": "option"
1013
+ },
1014
+ "example": {
1447
1015
  "aliases": [
1016
+ "recipe"
1017
+ ],
1018
+ "description": "Example to use for the local Blueprint",
1019
+ "exclusive": [
1020
+ "blueprint-type",
1448
1021
  "stack-id",
1449
- "stackId"
1022
+ "stack-name"
1450
1023
  ],
1451
- "dependsOn": [
1452
- "edit"
1024
+ "name": "example",
1025
+ "hasDynamicHelp": false,
1026
+ "multiple": false,
1027
+ "type": "option"
1028
+ },
1029
+ "blueprint-type": {
1030
+ "aliases": [
1031
+ "type"
1453
1032
  ],
1454
- "description": "Stack name or ID to set in the configuration. Requires --edit flag",
1455
- "name": "stack",
1033
+ "description": "Blueprint manifest type to use for the local Blueprint",
1034
+ "name": "blueprint-type",
1456
1035
  "hasDynamicHelp": false,
1457
1036
  "multiple": false,
1037
+ "options": [
1038
+ "json",
1039
+ "js",
1040
+ "ts"
1041
+ ],
1458
1042
  "type": "option"
1459
1043
  },
1460
1044
  "project-id": {
@@ -1462,9 +1046,6 @@
1462
1046
  "project",
1463
1047
  "projectId"
1464
1048
  ],
1465
- "dependsOn": [
1466
- "edit"
1467
- ],
1468
1049
  "description": "Sanity project ID used to scope Blueprint and Stack",
1469
1050
  "exclusive": [
1470
1051
  "organization-id"
@@ -1480,9 +1061,6 @@
1480
1061
  "organizationId",
1481
1062
  "org"
1482
1063
  ],
1483
- "dependsOn": [
1484
- "edit"
1485
- ],
1486
1064
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1487
1065
  "exclusive": [
1488
1066
  "project-id"
@@ -1492,47 +1070,79 @@
1492
1070
  "multiple": false,
1493
1071
  "type": "option"
1494
1072
  },
1495
- "edit": {
1496
- "char": "e",
1497
- "description": "Modify the configuration interactively, or directly when combined with ID flags.",
1498
- "name": "edit",
1499
- "allowNo": false,
1500
- "type": "boolean"
1073
+ "stack-id": {
1074
+ "aliases": [
1075
+ "stackId"
1076
+ ],
1077
+ "description": "Existing Stack ID used to scope local Blueprint",
1078
+ "exclusive": [
1079
+ "stack-name"
1080
+ ],
1081
+ "name": "stack-id",
1082
+ "relationships": [
1083
+ {
1084
+ "type": "some",
1085
+ "flags": [
1086
+ "project-id",
1087
+ "organization-id"
1088
+ ]
1089
+ }
1090
+ ],
1091
+ "hasDynamicHelp": false,
1092
+ "multiple": false,
1093
+ "type": "option"
1094
+ },
1095
+ "stack-name": {
1096
+ "aliases": [
1097
+ "name"
1098
+ ],
1099
+ "description": "Name to use for a new Stack provisioned during initialization",
1100
+ "exclusive": [
1101
+ "stack-id"
1102
+ ],
1103
+ "name": "stack-name",
1104
+ "relationships": [
1105
+ {
1106
+ "type": "some",
1107
+ "flags": [
1108
+ "project-id",
1109
+ "organization-id"
1110
+ ]
1111
+ }
1112
+ ],
1113
+ "hasDynamicHelp": false,
1114
+ "multiple": false,
1115
+ "type": "option"
1501
1116
  }
1502
1117
  },
1503
1118
  "hasDynamicHelp": false,
1504
1119
  "hiddenAliases": [],
1505
- "id": "blueprints:config",
1120
+ "id": "blueprints:init",
1506
1121
  "pluginAlias": "@sanity/runtime-cli",
1507
1122
  "pluginName": "@sanity/runtime-cli",
1508
1123
  "pluginType": "core",
1509
1124
  "strict": true,
1510
- "summary": "View or edit the local Blueprint configuration",
1125
+ "summary": "Initialize a Blueprint and create a remote Stack",
1511
1126
  "enableJsonFlag": true,
1512
- "needs": [
1513
- "token",
1514
- "blueprint"
1515
- ],
1516
1127
  "isESM": true,
1517
1128
  "relativePath": [
1518
1129
  "dist",
1519
1130
  "commands",
1520
1131
  "blueprints",
1521
- "config.js"
1132
+ "init.js"
1522
1133
  ]
1523
1134
  },
1524
- "blueprints:deploy": {
1135
+ "blueprints:logs": {
1525
1136
  "aliases": [],
1526
1137
  "args": {},
1527
- "description": "Applies your local Blueprint to the remote Stack, creating, updating, or removing resources as needed. This is the primary command for applying infrastructure changes.\n\nBefore deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack status or 'blueprints logs' to monitor activity.\n\nUse --no-wait to queue the deployment and return immediately without waiting for completion.\n\nUse --fn-installer to force which package manager to use when deploying functions.\n\nSet SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
1138
+ "description": "Retrieves Stack deployment logs, useful for debugging and monitoring deployment activity.\n\nUse --watch (-w) to tail logs in real-time.\n\nUse --limit, --since, or --before to narrow the result set when not watching.\n\nIf you're not seeing expected logs, verify your Stack is deployed with 'blueprints info'.",
1528
1139
  "examples": [
1529
1140
  "<%= config.bin %> <%= command.id %>",
1530
- "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
1531
- "<%= config.bin %> <%= command.id %> --no-wait",
1532
- "<%= config.bin %> <%= command.id %> --fn-installer npm",
1141
+ "<%= config.bin %> <%= command.id %> --watch",
1533
1142
  "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1534
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>",
1535
- "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1143
+ "<%= config.bin %> <%= command.id %> --limit 500",
1144
+ "<%= config.bin %> <%= command.id %> --since 2026-05-01T00:00:00Z",
1145
+ "<%= config.bin %> <%= command.id %> --before 2026-05-01T00:00:00Z"
1536
1146
  ],
1537
1147
  "flags": {
1538
1148
  "json": {
@@ -1541,16 +1151,6 @@
1541
1151
  "allowNo": false,
1542
1152
  "type": "boolean"
1543
1153
  },
1544
- "llms": {
1545
- "aliases": [
1546
- "skill"
1547
- ],
1548
- "description": "Show agent-oriented guidance for this command",
1549
- "hidden": true,
1550
- "name": "llms",
1551
- "allowNo": false,
1552
- "type": "boolean"
1553
- },
1554
1154
  "path": {
1555
1155
  "aliases": [
1556
1156
  "blueprint-path"
@@ -1621,40 +1221,43 @@
1621
1221
  "multiple": false,
1622
1222
  "type": "option"
1623
1223
  },
1624
- "message": {
1625
- "char": "m",
1626
- "description": "Message describing the deployment (e.g. reason for change)",
1627
- "name": "message",
1224
+ "watch": {
1225
+ "aliases": [
1226
+ "follow"
1227
+ ],
1228
+ "char": "w",
1229
+ "description": "Watch for new Stack logs",
1230
+ "name": "watch",
1231
+ "allowNo": false,
1232
+ "type": "boolean"
1233
+ },
1234
+ "limit": {
1235
+ "char": "l",
1236
+ "description": "Maximum number of log entries to retrieve (1-500)",
1237
+ "exclusive": [
1238
+ "watch"
1239
+ ],
1240
+ "name": "limit",
1628
1241
  "hasDynamicHelp": false,
1629
1242
  "multiple": false,
1630
1243
  "type": "option"
1631
1244
  },
1632
- "fn-installer": {
1633
- "aliases": [
1634
- "function-installer",
1635
- "installer"
1245
+ "since": {
1246
+ "description": "Only show logs after this ISO 8601 timestamp",
1247
+ "exclusive": [
1248
+ "watch"
1636
1249
  ],
1637
- "description": "Which package manager to use when installing Function dependencies",
1638
- "hidden": true,
1639
- "name": "fn-installer",
1250
+ "name": "since",
1640
1251
  "hasDynamicHelp": false,
1641
1252
  "multiple": false,
1642
- "options": [
1643
- "npm",
1644
- "pnpm",
1645
- "yarn"
1646
- ],
1647
1253
  "type": "option"
1648
1254
  },
1649
- "no-wait": {
1650
- "description": "Do not wait for Stack deployment to complete",
1651
- "name": "no-wait",
1652
- "allowNo": false,
1653
- "type": "boolean"
1654
- },
1655
- "new-stack-name": {
1656
- "description": "Set a new name for the Stack",
1657
- "name": "new-stack-name",
1255
+ "before": {
1256
+ "description": "Only show logs before this ISO 8601 timestamp",
1257
+ "exclusive": [
1258
+ "watch"
1259
+ ],
1260
+ "name": "before",
1658
1261
  "hasDynamicHelp": false,
1659
1262
  "multiple": false,
1660
1263
  "type": "option"
@@ -1662,32 +1265,36 @@
1662
1265
  },
1663
1266
  "hasDynamicHelp": false,
1664
1267
  "hiddenAliases": [],
1665
- "id": "blueprints:deploy",
1268
+ "id": "blueprints:logs",
1666
1269
  "pluginAlias": "@sanity/runtime-cli",
1667
1270
  "pluginName": "@sanity/runtime-cli",
1668
1271
  "pluginType": "core",
1669
1272
  "strict": true,
1670
- "summary": "Deploy the local Blueprint to the remote Stack",
1273
+ "summary": "Display logs for the current Blueprint's Stack deployment",
1671
1274
  "enableJsonFlag": true,
1672
1275
  "needs": [
1673
- "deployedStack",
1674
- "blueprint"
1276
+ "deployedStack"
1675
1277
  ],
1676
1278
  "isESM": true,
1677
1279
  "relativePath": [
1678
1280
  "dist",
1679
1281
  "commands",
1680
1282
  "blueprints",
1681
- "deploy.js"
1283
+ "logs.js"
1682
1284
  ]
1683
1285
  },
1684
- "blueprints:destroy": {
1286
+ "blueprints:mint-deploy-token": {
1685
1287
  "aliases": [],
1686
1288
  "args": {},
1687
- "description": "Permanently removes the remote Stack and all its provisioned resources. Your Blueprint manifest and resource files remain intact; \"stackId\" is unset in your local config.\n\nThis is a destructive operation. You will be prompted to confirm unless --force is specified.\n\nUse this to clean up test environments or decommission a Stack you no longer need.\n\nExit codes: 0 destroyed, 2 destruction failed, 75 destruction accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
1289
+ "description": "Mints a long-lived robot token with the role required to plan, deploy, and destroy Blueprints in this project or organization.\n\nBy default the command runs interactively and asks how you want to receive the token (clipboard, print, or exit). Use --print to emit only the raw token for shell pipelines, or --json for full API output.\n\nThe minted token is also visible in your Sanity Manage UI under Robots, where it can be revoked.",
1688
1290
  "examples": [
1689
1291
  "<%= config.bin %> <%= command.id %>",
1690
- "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
1292
+ "<%= config.bin %> <%= command.id %> --label \"ci-deploy\"",
1293
+ "<%= config.bin %> <%= command.id %> --print",
1294
+ "export SANITY_AUTH_TOKEN=$(<%= config.bin %> <%= command.id %> --print)",
1295
+ "<%= config.bin %> <%= command.id %> --json",
1296
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1297
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId>"
1691
1298
  ],
1692
1299
  "flags": {
1693
1300
  "json": {
@@ -1696,16 +1303,6 @@
1696
1303
  "allowNo": false,
1697
1304
  "type": "boolean"
1698
1305
  },
1699
- "llms": {
1700
- "aliases": [
1701
- "skill"
1702
- ],
1703
- "description": "Show agent-oriented guidance for this command",
1704
- "hidden": true,
1705
- "name": "llms",
1706
- "allowNo": false,
1707
- "type": "boolean"
1708
- },
1709
1306
  "path": {
1710
1307
  "aliases": [
1711
1308
  "blueprint-path"
@@ -1741,11 +1338,8 @@
1741
1338
  "type": "boolean"
1742
1339
  },
1743
1340
  "stack": {
1744
- "aliases": [
1745
- "stack-id",
1746
- "stackId"
1747
- ],
1748
- "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
1341
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1342
+ "hidden": true,
1749
1343
  "name": "stack",
1750
1344
  "hasDynamicHelp": false,
1751
1345
  "multiple": false,
@@ -1756,10 +1350,6 @@
1756
1350
  "project",
1757
1351
  "projectId"
1758
1352
  ],
1759
- "dependsOn": [
1760
- "stack",
1761
- "force"
1762
- ],
1763
1353
  "description": "Sanity project ID used to scope Blueprint and Stack",
1764
1354
  "exclusive": [
1765
1355
  "organization-id"
@@ -1775,10 +1365,6 @@
1775
1365
  "organizationId",
1776
1366
  "org"
1777
1367
  ],
1778
- "dependsOn": [
1779
- "stack",
1780
- "force"
1781
- ],
1782
1368
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1783
1369
  "exclusive": [
1784
1370
  "project-id"
@@ -1788,30 +1374,32 @@
1788
1374
  "multiple": false,
1789
1375
  "type": "option"
1790
1376
  },
1791
- "force": {
1792
- "aliases": [
1793
- "f"
1794
- ],
1795
- "description": "Force Stack destruction (skip confirmation)",
1796
- "name": "force",
1797
- "allowNo": false,
1798
- "type": "boolean"
1377
+ "label": {
1378
+ "description": "Human-readable label for the robot. Defaults to a generated value.",
1379
+ "name": "label",
1380
+ "hasDynamicHelp": false,
1381
+ "multiple": false,
1382
+ "type": "option"
1799
1383
  },
1800
- "no-wait": {
1801
- "description": "Do not wait for Stack destruction to complete",
1802
- "name": "no-wait",
1384
+ "print": {
1385
+ "char": "P",
1386
+ "description": "Print only the raw token to stdout (suitable for shell substitution)",
1387
+ "exclusive": [
1388
+ "json"
1389
+ ],
1390
+ "name": "print",
1803
1391
  "allowNo": false,
1804
1392
  "type": "boolean"
1805
1393
  }
1806
1394
  },
1807
1395
  "hasDynamicHelp": false,
1808
1396
  "hiddenAliases": [],
1809
- "id": "blueprints:destroy",
1397
+ "id": "blueprints:mint-deploy-token",
1810
1398
  "pluginAlias": "@sanity/runtime-cli",
1811
1399
  "pluginName": "@sanity/runtime-cli",
1812
1400
  "pluginType": "core",
1813
1401
  "strict": true,
1814
- "summary": "Destroy a remote Stack deployment and its resources",
1402
+ "summary": "Create a robot API token for deploying Blueprints from CI/CD",
1815
1403
  "enableJsonFlag": true,
1816
1404
  "needs": [
1817
1405
  "scope"
@@ -1821,16 +1409,17 @@
1821
1409
  "dist",
1822
1410
  "commands",
1823
1411
  "blueprints",
1824
- "destroy.js"
1412
+ "mint-deploy-token.js"
1825
1413
  ]
1826
1414
  },
1827
- "blueprints:doctor": {
1415
+ "blueprints:plan": {
1828
1416
  "aliases": [],
1829
1417
  "args": {},
1830
- "description": "Analyzes your local Blueprint and remote Stack configuration for common issues, such as missing authentication, invalid project references, or misconfigured resources.\n\nRun this command when encountering errors with other Blueprint commands. Use --fix to interactively resolve detected issues.\n\nSupports --json for programmatic consumption of diagnostic results.",
1418
+ "description": "Use this command to preview what changes will be applied to your remote Stack before deploying. This is a safe, read-only operation—no resources are created, modified, or deleted.\n\nRun 'blueprints plan' after making local changes to your Blueprint manifest to verify the expected diff. When ready, run 'blueprints deploy' to apply changes.",
1831
1419
  "examples": [
1832
1420
  "<%= config.bin %> <%= command.id %>",
1833
- "<%= config.bin %> <%= command.id %> --fix"
1421
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1422
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1834
1423
  ],
1835
1424
  "flags": {
1836
1425
  "json": {
@@ -1839,16 +1428,6 @@
1839
1428
  "allowNo": false,
1840
1429
  "type": "boolean"
1841
1430
  },
1842
- "llms": {
1843
- "aliases": [
1844
- "skill"
1845
- ],
1846
- "description": "Show agent-oriented guidance for this command",
1847
- "hidden": true,
1848
- "name": "llms",
1849
- "allowNo": false,
1850
- "type": "boolean"
1851
- },
1852
1431
  "path": {
1853
1432
  "aliases": [
1854
1433
  "blueprint-path"
@@ -1856,6 +1435,7 @@
1856
1435
  "char": "p",
1857
1436
  "description": "Path to a Blueprint file or directory containing one",
1858
1437
  "env": "SANITY_BLUEPRINT_PATH",
1438
+ "hidden": true,
1859
1439
  "name": "path",
1860
1440
  "hasDynamicHelp": false,
1861
1441
  "multiple": false,
@@ -1882,39 +1462,73 @@
1882
1462
  "allowNo": false,
1883
1463
  "type": "boolean"
1884
1464
  },
1885
- "fix": {
1886
- "description": "Interactively fix configuration issues",
1887
- "name": "fix",
1888
- "allowNo": false,
1889
- "type": "boolean"
1465
+ "stack": {
1466
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1467
+ "name": "stack",
1468
+ "hasDynamicHelp": false,
1469
+ "multiple": false,
1470
+ "type": "option"
1471
+ },
1472
+ "project-id": {
1473
+ "aliases": [
1474
+ "project",
1475
+ "projectId"
1476
+ ],
1477
+ "description": "Sanity project ID used to scope Blueprint and Stack",
1478
+ "exclusive": [
1479
+ "organization-id"
1480
+ ],
1481
+ "name": "project-id",
1482
+ "hasDynamicHelp": false,
1483
+ "multiple": false,
1484
+ "type": "option"
1485
+ },
1486
+ "organization-id": {
1487
+ "aliases": [
1488
+ "organization",
1489
+ "organizationId",
1490
+ "org"
1491
+ ],
1492
+ "description": "Sanity organization ID used to scope Blueprint and Stack",
1493
+ "exclusive": [
1494
+ "project-id"
1495
+ ],
1496
+ "name": "organization-id",
1497
+ "hasDynamicHelp": false,
1498
+ "multiple": false,
1499
+ "type": "option"
1890
1500
  }
1891
1501
  },
1892
1502
  "hasDynamicHelp": false,
1893
1503
  "hiddenAliases": [],
1894
- "id": "blueprints:doctor",
1504
+ "id": "blueprints:plan",
1895
1505
  "pluginAlias": "@sanity/runtime-cli",
1896
1506
  "pluginName": "@sanity/runtime-cli",
1897
1507
  "pluginType": "core",
1898
1508
  "strict": true,
1899
- "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
1509
+ "summary": "Preview changes that will be applied to the remote Stack",
1900
1510
  "enableJsonFlag": true,
1511
+ "needs": [
1512
+ "token",
1513
+ "blueprint"
1514
+ ],
1901
1515
  "isESM": true,
1902
1516
  "relativePath": [
1903
1517
  "dist",
1904
1518
  "commands",
1905
1519
  "blueprints",
1906
- "doctor.js"
1520
+ "plan.js"
1907
1521
  ]
1908
1522
  },
1909
- "blueprints:info": {
1523
+ "blueprints:promote": {
1910
1524
  "aliases": [],
1911
1525
  "args": {},
1912
- "description": "Displays the current state and metadata of your remote Stack deployment, including deployed resources, status, and configuration.\n\nUse this command to verify a deployment succeeded, check what resources are live, or confirm which Stack your local Blueprint is connected to.\n\nRun 'blueprints stacks' to see all available Stacks in your project or organization.",
1526
+ "description": "Promotes a deployed Stack to organization scope, enabling management of org-level resources. Promotion cannot be reversed.\n\nYour local Blueprint configuration will be updated to reflect the new scope.",
1913
1527
  "examples": [
1914
1528
  "<%= config.bin %> <%= command.id %>",
1915
1529
  "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1916
- "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
1917
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1530
+ "<%= config.bin %> <%= command.id %> --project-id <projectId> --stack <name-or-id>",
1531
+ "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1918
1532
  ],
1919
1533
  "flags": {
1920
1534
  "json": {
@@ -1923,16 +1537,6 @@
1923
1537
  "allowNo": false,
1924
1538
  "type": "boolean"
1925
1539
  },
1926
- "llms": {
1927
- "aliases": [
1928
- "skill"
1929
- ],
1930
- "description": "Show agent-oriented guidance for this command",
1931
- "hidden": true,
1932
- "name": "llms",
1933
- "allowNo": false,
1934
- "type": "boolean"
1935
- },
1936
1540
  "path": {
1937
1541
  "aliases": [
1938
1542
  "blueprint-path"
@@ -1971,7 +1575,7 @@
1971
1575
  "aliases": [
1972
1576
  "id"
1973
1577
  ],
1974
- "description": "Stack name or ID",
1578
+ "description": "Stack name or ID to promote",
1975
1579
  "name": "stack",
1976
1580
  "hasDynamicHelp": false,
1977
1581
  "multiple": false,
@@ -2001,67 +1605,61 @@
2001
1605
  "exclusive": [
2002
1606
  "project-id"
2003
1607
  ],
1608
+ "hidden": true,
2004
1609
  "name": "organization-id",
2005
1610
  "hasDynamicHelp": false,
2006
1611
  "multiple": false,
2007
1612
  "type": "option"
1613
+ },
1614
+ "force": {
1615
+ "description": "Skip confirmation prompt",
1616
+ "name": "force",
1617
+ "allowNo": false,
1618
+ "type": "boolean"
1619
+ },
1620
+ "new-stack-name": {
1621
+ "description": "Set a new name for the Stack while promoting",
1622
+ "name": "new-stack-name",
1623
+ "hasDynamicHelp": false,
1624
+ "multiple": false,
1625
+ "type": "option"
2008
1626
  }
2009
1627
  },
2010
1628
  "hasDynamicHelp": false,
2011
1629
  "hiddenAliases": [],
2012
- "id": "blueprints:info",
1630
+ "id": "blueprints:promote",
2013
1631
  "pluginAlias": "@sanity/runtime-cli",
2014
1632
  "pluginName": "@sanity/runtime-cli",
2015
1633
  "pluginType": "core",
2016
1634
  "strict": true,
2017
- "summary": "Display the status and resources of the remote Stack deployment",
1635
+ "summary": "Promote a Stack from project scope to organization scope",
2018
1636
  "enableJsonFlag": true,
2019
1637
  "needs": [
2020
- "deployedStack"
1638
+ "deployedStack",
1639
+ "blueprint"
2021
1640
  ],
2022
1641
  "isESM": true,
2023
1642
  "relativePath": [
2024
1643
  "dist",
2025
1644
  "commands",
2026
1645
  "blueprints",
2027
- "info.js"
1646
+ "promote.js"
2028
1647
  ]
2029
1648
  },
2030
- "blueprints:init": {
1649
+ "blueprints:stacks": {
2031
1650
  "aliases": [],
2032
- "args": {
2033
- "dir": {
2034
- "description": "Directory to create the local Blueprint in (defaults to the current directory)",
2035
- "name": "dir"
2036
- }
2037
- },
2038
- "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
1651
+ "args": {},
1652
+ "description": "Shows all Stacks associated with a project or organization. By default, lists Stacks scoped to the local Blueprint.\n\nUse this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to audit what's deployed across your project.\n\nUse --include-projects with --organization-id to also list Stacks from all projects within the organization.",
2039
1653
  "examples": [
2040
1654
  "<%= config.bin %> <%= command.id %>",
2041
- "<%= config.bin %> <%= command.id %> .",
2042
- "<%= config.bin %> <%= command.id %> [directory]",
2043
- "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
2044
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
2045
1655
  "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2046
- "<%= config.bin %> <%= command.id %> --stack-name <newStackName>",
2047
- "<%= config.bin %> <%= command.id %> --stack-id <existingStackId>",
2048
- "<%= config.bin %> <%= command.id %> new-stack --type <json|js|ts> --org <organizationId> --name <newStackName>",
2049
- "<%= config.bin %> <%= command.id %> old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>"
1656
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
1657
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId> --include-projects"
2050
1658
  ],
2051
1659
  "flags": {
2052
1660
  "json": {
2053
- "description": "Format output as json",
2054
- "name": "json",
2055
- "allowNo": false,
2056
- "type": "boolean"
2057
- },
2058
- "llms": {
2059
- "aliases": [
2060
- "skill"
2061
- ],
2062
- "description": "Show agent-oriented guidance for this command",
2063
- "hidden": true,
2064
- "name": "llms",
1661
+ "description": "Format output as json",
1662
+ "name": "json",
2065
1663
  "allowNo": false,
2066
1664
  "type": "boolean"
2067
1665
  },
@@ -2099,41 +1697,12 @@
2099
1697
  "allowNo": false,
2100
1698
  "type": "boolean"
2101
1699
  },
2102
- "dir": {
2103
- "description": "Directory to create the local Blueprint in",
2104
- "name": "dir",
2105
- "hasDynamicHelp": false,
2106
- "multiple": false,
2107
- "type": "option"
2108
- },
2109
- "example": {
2110
- "aliases": [
2111
- "recipe"
2112
- ],
2113
- "description": "Example to use for the local Blueprint",
2114
- "exclusive": [
2115
- "blueprint-type",
2116
- "stack-id",
2117
- "stack-name"
2118
- ],
2119
- "name": "example",
2120
- "hasDynamicHelp": false,
2121
- "multiple": false,
2122
- "type": "option"
2123
- },
2124
- "blueprint-type": {
2125
- "aliases": [
2126
- "type"
2127
- ],
2128
- "description": "Blueprint manifest type to use for the local Blueprint",
2129
- "name": "blueprint-type",
1700
+ "stack": {
1701
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1702
+ "hidden": true,
1703
+ "name": "stack",
2130
1704
  "hasDynamicHelp": false,
2131
1705
  "multiple": false,
2132
- "options": [
2133
- "json",
2134
- "js",
2135
- "ts"
2136
- ],
2137
1706
  "type": "option"
2138
1707
  },
2139
1708
  "project-id": {
@@ -2143,7 +1712,8 @@
2143
1712
  ],
2144
1713
  "description": "Sanity project ID used to scope Blueprint and Stack",
2145
1714
  "exclusive": [
2146
- "organization-id"
1715
+ "organization-id",
1716
+ "include-projects"
2147
1717
  ],
2148
1718
  "name": "project-id",
2149
1719
  "hasDynamicHelp": false,
@@ -2165,79 +1735,46 @@
2165
1735
  "multiple": false,
2166
1736
  "type": "option"
2167
1737
  },
2168
- "stack-id": {
2169
- "aliases": [
2170
- "stackId"
2171
- ],
2172
- "description": "Existing Stack ID used to scope local Blueprint",
2173
- "exclusive": [
2174
- "stack-name"
2175
- ],
2176
- "name": "stack-id",
2177
- "relationships": [
2178
- {
2179
- "type": "some",
2180
- "flags": [
2181
- "project-id",
2182
- "organization-id"
2183
- ]
2184
- }
2185
- ],
2186
- "hasDynamicHelp": false,
2187
- "multiple": false,
2188
- "type": "option"
2189
- },
2190
- "stack-name": {
2191
- "aliases": [
2192
- "name"
2193
- ],
2194
- "description": "Name to use for a new Stack provisioned during initialization",
2195
- "exclusive": [
2196
- "stack-id"
2197
- ],
2198
- "name": "stack-name",
2199
- "relationships": [
2200
- {
2201
- "type": "some",
2202
- "flags": [
2203
- "project-id",
2204
- "organization-id"
2205
- ]
2206
- }
1738
+ "include-projects": {
1739
+ "dependsOn": [
1740
+ "organization-id"
2207
1741
  ],
2208
- "hasDynamicHelp": false,
2209
- "multiple": false,
2210
- "type": "option"
1742
+ "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
1743
+ "name": "include-projects",
1744
+ "allowNo": false,
1745
+ "type": "boolean"
2211
1746
  }
2212
1747
  },
2213
1748
  "hasDynamicHelp": false,
2214
1749
  "hiddenAliases": [],
2215
- "id": "blueprints:init",
1750
+ "id": "blueprints:stacks",
2216
1751
  "pluginAlias": "@sanity/runtime-cli",
2217
1752
  "pluginName": "@sanity/runtime-cli",
2218
1753
  "pluginType": "core",
2219
1754
  "strict": true,
2220
- "summary": "Initialize a Blueprint and create a remote Stack",
1755
+ "summary": "List remote Stack deployments for your project or organization",
2221
1756
  "enableJsonFlag": true,
1757
+ "needs": [
1758
+ "scope"
1759
+ ],
2222
1760
  "isESM": true,
2223
1761
  "relativePath": [
2224
1762
  "dist",
2225
1763
  "commands",
2226
1764
  "blueprints",
2227
- "init.js"
1765
+ "stacks.js"
2228
1766
  ]
2229
1767
  },
2230
- "blueprints:logs": {
1768
+ "functions:add": {
2231
1769
  "aliases": [],
2232
1770
  "args": {},
2233
- "description": "Retrieves Stack deployment logs, useful for debugging and monitoring deployment activity.\n\nUse --watch (-w) to tail logs in real-time.\n\nUse --limit, --since, or --before to narrow the result set when not watching.\n\nIf you're not seeing expected logs, verify your Stack is deployed with 'blueprints info'.",
1771
+ "description": "Scaffolds a new Function in the functions/ folder and templates a resource for your Blueprint manifest.\n\nFunctions are serverless handlers triggered by document, live content or media-library events (create, update, delete, publish).\n\nAfter adding, use 'functions dev' to test locally, then 'blueprints deploy' to publish.",
2234
1772
  "examples": [
2235
1773
  "<%= config.bin %> <%= command.id %>",
2236
- "<%= config.bin %> <%= command.id %> --watch",
2237
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2238
- "<%= config.bin %> <%= command.id %> --limit 500",
2239
- "<%= config.bin %> <%= command.id %> --since 2026-05-01T00:00:00Z",
2240
- "<%= config.bin %> <%= command.id %> --before 2026-05-01T00:00:00Z"
1774
+ "<%= config.bin %> <%= command.id %> --helpers",
1775
+ "<%= config.bin %> <%= command.id %> --name my-function",
1776
+ "<%= config.bin %> <%= command.id %> --name my-function --type document-create",
1777
+ "<%= config.bin %> <%= command.id %> --name my-function --type document-create --type document-update --lang js"
2241
1778
  ],
2242
1779
  "flags": {
2243
1780
  "json": {
@@ -2246,16 +1783,6 @@
2246
1783
  "allowNo": false,
2247
1784
  "type": "boolean"
2248
1785
  },
2249
- "llms": {
2250
- "aliases": [
2251
- "skill"
2252
- ],
2253
- "description": "Show agent-oriented guidance for this command",
2254
- "hidden": true,
2255
- "name": "llms",
2256
- "allowNo": false,
2257
- "type": "boolean"
2258
- },
2259
1786
  "path": {
2260
1787
  "aliases": [
2261
1788
  "blueprint-path"
@@ -2292,6 +1819,7 @@
2292
1819
  },
2293
1820
  "stack": {
2294
1821
  "description": "Stack name or ID to use instead of the locally configured Stack",
1822
+ "hidden": true,
2295
1823
  "name": "stack",
2296
1824
  "hasDynamicHelp": false,
2297
1825
  "multiple": false,
@@ -2306,6 +1834,7 @@
2306
1834
  "exclusive": [
2307
1835
  "organization-id"
2308
1836
  ],
1837
+ "hidden": true,
2309
1838
  "name": "project-id",
2310
1839
  "hasDynamicHelp": false,
2311
1840
  "multiple": false,
@@ -2321,86 +1850,145 @@
2321
1850
  "exclusive": [
2322
1851
  "project-id"
2323
1852
  ],
1853
+ "hidden": true,
2324
1854
  "name": "organization-id",
2325
1855
  "hasDynamicHelp": false,
2326
1856
  "multiple": false,
2327
1857
  "type": "option"
2328
1858
  },
2329
- "watch": {
1859
+ "example": {
2330
1860
  "aliases": [
2331
- "follow"
1861
+ "recipe"
2332
1862
  ],
2333
- "char": "w",
2334
- "description": "Watch for new Stack logs",
2335
- "name": "watch",
2336
- "allowNo": false,
2337
- "type": "boolean"
2338
- },
2339
- "limit": {
2340
- "char": "l",
2341
- "description": "Maximum number of log entries to retrieve (1-500)",
1863
+ "description": "Example to use for the Function",
2342
1864
  "exclusive": [
2343
- "watch"
1865
+ "name",
1866
+ "fn-type",
1867
+ "language",
1868
+ "javascript",
1869
+ "fn-helpers",
1870
+ "fn-installer"
2344
1871
  ],
2345
- "name": "limit",
1872
+ "name": "example",
2346
1873
  "hasDynamicHelp": false,
2347
1874
  "multiple": false,
2348
1875
  "type": "option"
2349
1876
  },
2350
- "since": {
2351
- "description": "Only show logs after this ISO 8601 timestamp",
2352
- "exclusive": [
2353
- "watch"
1877
+ "name": {
1878
+ "char": "n",
1879
+ "description": "Name of the Function to add",
1880
+ "name": "name",
1881
+ "hasDynamicHelp": false,
1882
+ "multiple": false,
1883
+ "type": "option"
1884
+ },
1885
+ "type": {
1886
+ "dependsOn": [
1887
+ "name"
2354
1888
  ],
2355
- "name": "since",
1889
+ "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
1890
+ "name": "type",
1891
+ "hasDynamicHelp": false,
1892
+ "multiple": true,
1893
+ "options": [
1894
+ "document-publish",
1895
+ "document-create",
1896
+ "document-delete",
1897
+ "document-update",
1898
+ "media-library-asset-create",
1899
+ "media-library-asset-delete",
1900
+ "media-library-asset-update",
1901
+ "scheduled-function",
1902
+ "sync-tag-invalidate"
1903
+ ],
1904
+ "type": "option"
1905
+ },
1906
+ "language": {
1907
+ "aliases": [
1908
+ "lang"
1909
+ ],
1910
+ "description": "Language of the new Function",
1911
+ "name": "language",
1912
+ "default": "ts",
2356
1913
  "hasDynamicHelp": false,
2357
1914
  "multiple": false,
1915
+ "options": [
1916
+ "ts",
1917
+ "js"
1918
+ ],
2358
1919
  "type": "option"
2359
1920
  },
2360
- "before": {
2361
- "description": "Only show logs before this ISO 8601 timestamp",
1921
+ "javascript": {
1922
+ "aliases": [
1923
+ "js"
1924
+ ],
1925
+ "description": "Use JavaScript instead of TypeScript",
2362
1926
  "exclusive": [
2363
- "watch"
1927
+ "language"
2364
1928
  ],
2365
- "name": "before",
1929
+ "name": "javascript",
1930
+ "allowNo": false,
1931
+ "type": "boolean"
1932
+ },
1933
+ "helpers": {
1934
+ "description": "Add helpers to the new Function",
1935
+ "name": "helpers",
1936
+ "allowNo": true,
1937
+ "type": "boolean"
1938
+ },
1939
+ "installer": {
1940
+ "description": "How to install the @sanity/functions helpers",
1941
+ "name": "installer",
2366
1942
  "hasDynamicHelp": false,
2367
1943
  "multiple": false,
1944
+ "options": [
1945
+ "skip",
1946
+ "npm",
1947
+ "pnpm",
1948
+ "yarn"
1949
+ ],
2368
1950
  "type": "option"
1951
+ },
1952
+ "install": {
1953
+ "char": "i",
1954
+ "description": "Shortcut for --fn-installer npm",
1955
+ "exclusive": [
1956
+ "fn-installer"
1957
+ ],
1958
+ "name": "install",
1959
+ "allowNo": false,
1960
+ "type": "boolean"
2369
1961
  }
2370
1962
  },
2371
1963
  "hasDynamicHelp": false,
2372
1964
  "hiddenAliases": [],
2373
- "id": "blueprints:logs",
1965
+ "id": "functions:add",
2374
1966
  "pluginAlias": "@sanity/runtime-cli",
2375
1967
  "pluginName": "@sanity/runtime-cli",
2376
1968
  "pluginType": "core",
2377
1969
  "strict": true,
2378
- "summary": "Display logs for the current Blueprint's Stack deployment",
1970
+ "summary": "Add a Function to your Blueprint",
2379
1971
  "enableJsonFlag": true,
2380
1972
  "needs": [
2381
- "deployedStack"
1973
+ "blueprint"
2382
1974
  ],
2383
1975
  "isESM": true,
2384
1976
  "relativePath": [
2385
1977
  "dist",
2386
- "commands",
2387
- "blueprints",
2388
- "logs.js"
2389
- ]
2390
- },
2391
- "blueprints:mint-deploy-token": {
2392
- "aliases": [],
2393
- "args": {},
2394
- "description": "Mints a long-lived robot token with the role required to plan, deploy, and destroy Blueprints in this project or organization.\n\nBy default the command runs interactively and asks how you want to receive the token (clipboard, print, or exit). Use --print to emit only the raw token for shell pipelines, or --json for full API output.\n\nThe minted token is also visible in your Sanity Manage UI under Robots, where it can be revoked.",
2395
- "examples": [
2396
- "<%= config.bin %> <%= command.id %>",
2397
- "<%= config.bin %> <%= command.id %> --label \"ci-deploy\"",
2398
- "<%= config.bin %> <%= command.id %> --print",
2399
- "export SANITY_AUTH_TOKEN=$(<%= config.bin %> <%= command.id %> --print)",
2400
- "<%= config.bin %> <%= command.id %> --json",
2401
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2402
- "<%= config.bin %> <%= command.id %> --organization-id <orgId>"
2403
- ],
1978
+ "commands",
1979
+ "functions",
1980
+ "add.js"
1981
+ ]
1982
+ },
1983
+ "functions:build": {
1984
+ "aliases": [],
1985
+ "args": {
1986
+ "name": {
1987
+ "description": "The name of the Sanity Function",
1988
+ "name": "name",
1989
+ "required": false
1990
+ }
1991
+ },
2404
1992
  "flags": {
2405
1993
  "json": {
2406
1994
  "description": "Format output as json",
@@ -2408,16 +1996,6 @@
2408
1996
  "allowNo": false,
2409
1997
  "type": "boolean"
2410
1998
  },
2411
- "llms": {
2412
- "aliases": [
2413
- "skill"
2414
- ],
2415
- "description": "Show agent-oriented guidance for this command",
2416
- "hidden": true,
2417
- "name": "llms",
2418
- "allowNo": false,
2419
- "type": "boolean"
2420
- },
2421
1999
  "path": {
2422
2000
  "aliases": [
2423
2001
  "blueprint-path"
@@ -2469,6 +2047,7 @@
2469
2047
  "exclusive": [
2470
2048
  "organization-id"
2471
2049
  ],
2050
+ "hidden": true,
2472
2051
  "name": "project-id",
2473
2052
  "hasDynamicHelp": false,
2474
2053
  "multiple": false,
@@ -2484,57 +2063,66 @@
2484
2063
  "exclusive": [
2485
2064
  "project-id"
2486
2065
  ],
2066
+ "hidden": true,
2487
2067
  "name": "organization-id",
2488
2068
  "hasDynamicHelp": false,
2489
2069
  "multiple": false,
2490
2070
  "type": "option"
2491
2071
  },
2492
- "label": {
2493
- "description": "Human-readable label for the robot. Defaults to a generated value.",
2494
- "name": "label",
2072
+ "fn-installer": {
2073
+ "aliases": [
2074
+ "function-installer",
2075
+ "installer"
2076
+ ],
2077
+ "description": "Which package manager to use when building Functions",
2078
+ "hidden": true,
2079
+ "name": "fn-installer",
2495
2080
  "hasDynamicHelp": false,
2496
2081
  "multiple": false,
2082
+ "options": [
2083
+ "npm",
2084
+ "pnpm",
2085
+ "yarn"
2086
+ ],
2497
2087
  "type": "option"
2498
2088
  },
2499
- "print": {
2500
- "char": "P",
2501
- "description": "Print only the raw token to stdout (suitable for shell substitution)",
2502
- "exclusive": [
2503
- "json"
2504
- ],
2505
- "name": "print",
2506
- "allowNo": false,
2507
- "type": "boolean"
2089
+ "out-dir": {
2090
+ "char": "o",
2091
+ "description": "Output directory for zip files",
2092
+ "name": "out-dir",
2093
+ "hasDynamicHelp": false,
2094
+ "multiple": false,
2095
+ "type": "option"
2508
2096
  }
2509
2097
  },
2510
2098
  "hasDynamicHelp": false,
2099
+ "hidden": true,
2511
2100
  "hiddenAliases": [],
2512
- "id": "blueprints:mint-deploy-token",
2101
+ "id": "functions:build",
2513
2102
  "pluginAlias": "@sanity/runtime-cli",
2514
2103
  "pluginName": "@sanity/runtime-cli",
2515
2104
  "pluginType": "core",
2516
2105
  "strict": true,
2517
- "summary": "Create a robot API token for deploying Blueprints from CI/CD",
2106
+ "summary": "Build Sanity Function(s) to zip archives",
2518
2107
  "enableJsonFlag": true,
2519
2108
  "needs": [
2520
- "scope"
2109
+ "blueprint"
2521
2110
  ],
2522
2111
  "isESM": true,
2523
2112
  "relativePath": [
2524
2113
  "dist",
2525
2114
  "commands",
2526
- "blueprints",
2527
- "mint-deploy-token.js"
2115
+ "functions",
2116
+ "build.js"
2528
2117
  ]
2529
2118
  },
2530
- "blueprints:plan": {
2119
+ "functions:dev": {
2531
2120
  "aliases": [],
2532
2121
  "args": {},
2533
- "description": "Use this command to preview what changes will be applied to your remote Stack before deploying. This is a safe, read-only operation—no resources are created, modified, or deleted.\n\nRun 'blueprints plan' after making local changes to your Blueprint manifest to verify the expected diff. When ready, run 'blueprints deploy' to apply changes.",
2122
+ "description": "Runs a local, web-based development server to test your functions before deploying.\n\nOpen the emulator in your browser to interactively test your functions with the payload editor.\n\nOptionally, set the host and port with the --host and --port flags. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
2534
2123
  "examples": [
2535
- "<%= config.bin %> <%= command.id %>",
2536
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2537
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
2124
+ "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974",
2125
+ "<%= config.bin %> <%= command.id %> --timeout 60"
2538
2126
  ],
2539
2127
  "flags": {
2540
2128
  "json": {
@@ -2543,16 +2131,6 @@
2543
2131
  "allowNo": false,
2544
2132
  "type": "boolean"
2545
2133
  },
2546
- "llms": {
2547
- "aliases": [
2548
- "skill"
2549
- ],
2550
- "description": "Show agent-oriented guidance for this command",
2551
- "hidden": true,
2552
- "name": "llms",
2553
- "allowNo": false,
2554
- "type": "boolean"
2555
- },
2556
2134
  "path": {
2557
2135
  "aliases": [
2558
2136
  "blueprint-path"
@@ -2589,6 +2167,7 @@
2589
2167
  },
2590
2168
  "stack": {
2591
2169
  "description": "Stack name or ID to use instead of the locally configured Stack",
2170
+ "hidden": true,
2592
2171
  "name": "stack",
2593
2172
  "hasDynamicHelp": false,
2594
2173
  "multiple": false,
@@ -2603,6 +2182,7 @@
2603
2182
  "exclusive": [
2604
2183
  "organization-id"
2605
2184
  ],
2185
+ "hidden": true,
2606
2186
  "name": "project-id",
2607
2187
  "hasDynamicHelp": false,
2608
2188
  "multiple": false,
@@ -2618,42 +2198,75 @@
2618
2198
  "exclusive": [
2619
2199
  "project-id"
2620
2200
  ],
2201
+ "hidden": true,
2621
2202
  "name": "organization-id",
2622
2203
  "hasDynamicHelp": false,
2623
2204
  "multiple": false,
2624
2205
  "type": "option"
2206
+ },
2207
+ "host": {
2208
+ "char": "h",
2209
+ "description": "The local network interface at which to listen. [default: \"localhost\"]",
2210
+ "name": "host",
2211
+ "required": false,
2212
+ "hasDynamicHelp": false,
2213
+ "multiple": false,
2214
+ "type": "option"
2215
+ },
2216
+ "port": {
2217
+ "char": "p",
2218
+ "description": "TCP port to start emulator on. [default: 8080]",
2219
+ "name": "port",
2220
+ "required": false,
2221
+ "hasDynamicHelp": false,
2222
+ "multiple": false,
2223
+ "type": "option"
2224
+ },
2225
+ "timeout": {
2226
+ "char": "t",
2227
+ "description": "Maximum execution time for all functions, in seconds. Takes precedence over function-specific `timeout`",
2228
+ "name": "timeout",
2229
+ "required": false,
2230
+ "hasDynamicHelp": false,
2231
+ "multiple": false,
2232
+ "type": "option"
2625
2233
  }
2626
2234
  },
2627
2235
  "hasDynamicHelp": false,
2628
2236
  "hiddenAliases": [],
2629
- "id": "blueprints:plan",
2237
+ "id": "functions:dev",
2630
2238
  "pluginAlias": "@sanity/runtime-cli",
2631
2239
  "pluginName": "@sanity/runtime-cli",
2632
2240
  "pluginType": "core",
2633
2241
  "strict": true,
2634
- "summary": "Preview changes that will be applied to the remote Stack",
2242
+ "summary": "Start the Sanity Function emulator",
2635
2243
  "enableJsonFlag": true,
2636
2244
  "needs": [
2637
- "token",
2638
2245
  "blueprint"
2639
2246
  ],
2640
2247
  "isESM": true,
2641
2248
  "relativePath": [
2642
2249
  "dist",
2643
2250
  "commands",
2644
- "blueprints",
2645
- "plan.js"
2251
+ "functions",
2252
+ "dev.js"
2646
2253
  ]
2647
2254
  },
2648
- "blueprints:promote": {
2255
+ "functions:logs": {
2649
2256
  "aliases": [],
2650
- "args": {},
2651
- "description": "Promotes a deployed Stack to organization scope, enabling management of org-level resources. Promotion cannot be reversed.\n\nYour local Blueprint configuration will be updated to reflect the new scope.",
2257
+ "args": {
2258
+ "name": {
2259
+ "description": "The name of the Sanity Function",
2260
+ "name": "name",
2261
+ "required": false
2262
+ }
2263
+ },
2264
+ "description": "Fetches execution logs from a deployed function, useful for debugging production issues or monitoring activity.\n\nUse --watch (-w) to stream logs in real-time. Use --delete to clear all logs for a function (requires confirmation unless --force is specified).",
2652
2265
  "examples": [
2653
- "<%= config.bin %> <%= command.id %>",
2654
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2655
- "<%= config.bin %> <%= command.id %> --project-id <projectId> --stack <name-or-id>",
2656
- "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
2266
+ "<%= config.bin %> <%= command.id %> <name>",
2267
+ "<%= config.bin %> <%= command.id %> <name> --json",
2268
+ "<%= config.bin %> <%= command.id %> <name> --limit 100",
2269
+ "<%= config.bin %> <%= command.id %> <name> --delete"
2657
2270
  ],
2658
2271
  "flags": {
2659
2272
  "json": {
@@ -2662,16 +2275,6 @@
2662
2275
  "allowNo": false,
2663
2276
  "type": "boolean"
2664
2277
  },
2665
- "llms": {
2666
- "aliases": [
2667
- "skill"
2668
- ],
2669
- "description": "Show agent-oriented guidance for this command",
2670
- "hidden": true,
2671
- "name": "llms",
2672
- "allowNo": false,
2673
- "type": "boolean"
2674
- },
2675
2278
  "path": {
2676
2279
  "aliases": [
2677
2280
  "blueprint-path"
@@ -2707,10 +2310,7 @@
2707
2310
  "type": "boolean"
2708
2311
  },
2709
2312
  "stack": {
2710
- "aliases": [
2711
- "id"
2712
- ],
2713
- "description": "Stack name or ID to promote",
2313
+ "description": "Stack name or ID to use instead of the locally configured Stack",
2714
2314
  "name": "stack",
2715
2315
  "hasDynamicHelp": false,
2716
2316
  "multiple": false,
@@ -2725,6 +2325,7 @@
2725
2325
  "exclusive": [
2726
2326
  "organization-id"
2727
2327
  ],
2328
+ "hidden": true,
2728
2329
  "name": "project-id",
2729
2330
  "hasDynamicHelp": false,
2730
2331
  "multiple": false,
@@ -2746,28 +2347,66 @@
2746
2347
  "multiple": false,
2747
2348
  "type": "option"
2748
2349
  },
2350
+ "limit": {
2351
+ "char": "l",
2352
+ "description": "Total number of log entries to retrieve",
2353
+ "name": "limit",
2354
+ "required": false,
2355
+ "default": 50,
2356
+ "hasDynamicHelp": false,
2357
+ "multiple": false,
2358
+ "type": "option"
2359
+ },
2360
+ "utc": {
2361
+ "char": "u",
2362
+ "description": "Show dates in UTC time zone",
2363
+ "name": "utc",
2364
+ "required": false,
2365
+ "allowNo": false,
2366
+ "type": "boolean"
2367
+ },
2368
+ "delete": {
2369
+ "char": "d",
2370
+ "description": "Delete all logs for the function",
2371
+ "exclusive": [
2372
+ "limit",
2373
+ "json"
2374
+ ],
2375
+ "name": "delete",
2376
+ "required": false,
2377
+ "allowNo": false,
2378
+ "type": "boolean"
2379
+ },
2749
2380
  "force": {
2750
- "description": "Skip confirmation prompt",
2381
+ "char": "f",
2382
+ "dependsOn": [
2383
+ "delete"
2384
+ ],
2385
+ "description": "Skip confirmation for deleting logs",
2751
2386
  "name": "force",
2387
+ "required": false,
2752
2388
  "allowNo": false,
2753
2389
  "type": "boolean"
2754
2390
  },
2755
- "new-stack-name": {
2756
- "description": "Set a new name for the Stack while promoting",
2757
- "name": "new-stack-name",
2758
- "hasDynamicHelp": false,
2759
- "multiple": false,
2760
- "type": "option"
2391
+ "watch": {
2392
+ "aliases": [
2393
+ "follow"
2394
+ ],
2395
+ "char": "w",
2396
+ "description": "Watch for new logs (streaming mode)",
2397
+ "name": "watch",
2398
+ "allowNo": false,
2399
+ "type": "boolean"
2761
2400
  }
2762
2401
  },
2763
2402
  "hasDynamicHelp": false,
2764
2403
  "hiddenAliases": [],
2765
- "id": "blueprints:promote",
2404
+ "id": "functions:logs",
2766
2405
  "pluginAlias": "@sanity/runtime-cli",
2767
2406
  "pluginName": "@sanity/runtime-cli",
2768
2407
  "pluginType": "core",
2769
2408
  "strict": true,
2770
- "summary": "Promote a Stack from project scope to organization scope",
2409
+ "summary": "Retrieve or delete logs for a Sanity Function",
2771
2410
  "enableJsonFlag": true,
2772
2411
  "needs": [
2773
2412
  "deployedStack",
@@ -2777,34 +2416,30 @@
2777
2416
  "relativePath": [
2778
2417
  "dist",
2779
2418
  "commands",
2780
- "blueprints",
2781
- "promote.js"
2419
+ "functions",
2420
+ "logs.js"
2782
2421
  ]
2783
2422
  },
2784
- "blueprints:stacks": {
2423
+ "functions:test": {
2785
2424
  "aliases": [],
2786
- "args": {},
2787
- "description": "Shows all Stacks associated with a project or organization. By default, lists Stacks scoped to the local Blueprint.\n\nUse this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to audit what's deployed across your project.\n\nUse --include-projects with --organization-id to also list Stacks from all projects within the organization.",
2425
+ "args": {
2426
+ "name": {
2427
+ "description": "The name of the Sanity Function",
2428
+ "name": "name",
2429
+ "required": false
2430
+ }
2431
+ },
2432
+ "description": "Executes a function locally with the provided payload, simulating how it would run when deployed. Use this to test your function logic before deploying.\n\nProvide test data via --data (inline JSON), --file (JSON file), or --document-id (fetch from Sanity). For update events, use the before/after flag pairs to simulate document changes.",
2788
2433
  "examples": [
2789
- "<%= config.bin %> <%= command.id %>",
2790
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2791
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
2792
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId> --include-projects"
2793
- ],
2794
- "flags": {
2795
- "json": {
2796
- "description": "Format output as json",
2797
- "name": "json",
2798
- "allowNo": false,
2799
- "type": "boolean"
2800
- },
2801
- "llms": {
2802
- "aliases": [
2803
- "skill"
2804
- ],
2805
- "description": "Show agent-oriented guidance for this command",
2806
- "hidden": true,
2807
- "name": "llms",
2434
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }'",
2435
+ "<%= config.bin %> <%= command.id %> <name> --file 'payload.json'",
2436
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }' --timeout 60",
2437
+ "<%= config.bin %> <%= command.id %> <name> --event update --data-before '{ \"title\": \"before\" }' --data-after '{ \"title\": \"after\" }'"
2438
+ ],
2439
+ "flags": {
2440
+ "json": {
2441
+ "description": "Format output as json",
2442
+ "name": "json",
2808
2443
  "allowNo": false,
2809
2444
  "type": "boolean"
2810
2445
  },
@@ -2857,8 +2492,7 @@
2857
2492
  ],
2858
2493
  "description": "Sanity project ID used to scope Blueprint and Stack",
2859
2494
  "exclusive": [
2860
- "organization-id",
2861
- "include-projects"
2495
+ "organization-id"
2862
2496
  ],
2863
2497
  "name": "project-id",
2864
2498
  "hasDynamicHelp": false,
@@ -2880,34 +2514,230 @@
2880
2514
  "multiple": false,
2881
2515
  "type": "option"
2882
2516
  },
2883
- "include-projects": {
2884
- "dependsOn": [
2885
- "organization-id"
2517
+ "data": {
2518
+ "char": "d",
2519
+ "description": "Data to send to the function",
2520
+ "exclusive": [
2521
+ "file",
2522
+ "document-id"
2886
2523
  ],
2887
- "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
2888
- "name": "include-projects",
2524
+ "name": "data",
2525
+ "required": false,
2526
+ "hasDynamicHelp": false,
2527
+ "multiple": false,
2528
+ "type": "option"
2529
+ },
2530
+ "data-before": {
2531
+ "description": "Original document",
2532
+ "exclusive": [
2533
+ "data",
2534
+ "file",
2535
+ "document-id",
2536
+ "file-before",
2537
+ "file-after",
2538
+ "document-id-before",
2539
+ "document-id-after"
2540
+ ],
2541
+ "name": "data-before",
2542
+ "required": false,
2543
+ "hasDynamicHelp": false,
2544
+ "multiple": false,
2545
+ "type": "option"
2546
+ },
2547
+ "data-after": {
2548
+ "description": "Current document",
2549
+ "exclusive": [
2550
+ "data",
2551
+ "file",
2552
+ "document-id",
2553
+ "file-before",
2554
+ "file-after",
2555
+ "document-id-before",
2556
+ "document-id-after"
2557
+ ],
2558
+ "name": "data-after",
2559
+ "required": false,
2560
+ "hasDynamicHelp": false,
2561
+ "multiple": false,
2562
+ "type": "option"
2563
+ },
2564
+ "event": {
2565
+ "char": "e",
2566
+ "description": "Type of event (create, update, delete)",
2567
+ "name": "event",
2568
+ "required": false,
2569
+ "hasDynamicHelp": false,
2570
+ "multiple": false,
2571
+ "options": [
2572
+ "create",
2573
+ "update",
2574
+ "delete"
2575
+ ],
2576
+ "type": "option"
2577
+ },
2578
+ "file": {
2579
+ "char": "f",
2580
+ "description": "Read data from file and send to the function",
2581
+ "exclusive": [
2582
+ "data",
2583
+ "document-id"
2584
+ ],
2585
+ "name": "file",
2586
+ "required": false,
2587
+ "hasDynamicHelp": false,
2588
+ "multiple": false,
2589
+ "type": "option"
2590
+ },
2591
+ "file-before": {
2592
+ "description": "Original document",
2593
+ "exclusive": [
2594
+ "data",
2595
+ "file",
2596
+ "document-id",
2597
+ "data-before",
2598
+ "data-after",
2599
+ "document-id-before",
2600
+ "document-id-after"
2601
+ ],
2602
+ "name": "file-before",
2603
+ "required": false,
2604
+ "hasDynamicHelp": false,
2605
+ "multiple": false,
2606
+ "type": "option"
2607
+ },
2608
+ "file-after": {
2609
+ "description": "Current document",
2610
+ "exclusive": [
2611
+ "data",
2612
+ "file",
2613
+ "document-id",
2614
+ "data-before",
2615
+ "data-after",
2616
+ "document-id-before",
2617
+ "document-id-after"
2618
+ ],
2619
+ "name": "file-after",
2620
+ "required": false,
2621
+ "hasDynamicHelp": false,
2622
+ "multiple": false,
2623
+ "type": "option"
2624
+ },
2625
+ "timeout": {
2626
+ "char": "t",
2627
+ "description": "Execution timeout value in seconds",
2628
+ "name": "timeout",
2629
+ "required": false,
2630
+ "hasDynamicHelp": false,
2631
+ "multiple": false,
2632
+ "type": "option"
2633
+ },
2634
+ "api": {
2635
+ "char": "a",
2636
+ "description": "Sanity API Version to use",
2637
+ "name": "api",
2638
+ "required": false,
2639
+ "hasDynamicHelp": false,
2640
+ "multiple": false,
2641
+ "type": "option"
2642
+ },
2643
+ "dataset": {
2644
+ "description": "The Sanity dataset to use",
2645
+ "name": "dataset",
2646
+ "required": false,
2647
+ "hasDynamicHelp": false,
2648
+ "multiple": false,
2649
+ "type": "option"
2650
+ },
2651
+ "document-id": {
2652
+ "aliases": [
2653
+ "doc",
2654
+ "documentId"
2655
+ ],
2656
+ "description": "Document to fetch and send to function",
2657
+ "exclusive": [
2658
+ "data",
2659
+ "file"
2660
+ ],
2661
+ "name": "document-id",
2662
+ "required": false,
2663
+ "hasDynamicHelp": false,
2664
+ "multiple": false,
2665
+ "type": "option"
2666
+ },
2667
+ "document-id-before": {
2668
+ "description": "Original document",
2669
+ "exclusive": [
2670
+ "data",
2671
+ "file",
2672
+ "document-id",
2673
+ "data-before",
2674
+ "data-after",
2675
+ "file-before",
2676
+ "file-after"
2677
+ ],
2678
+ "name": "document-id-before",
2679
+ "required": false,
2680
+ "hasDynamicHelp": false,
2681
+ "multiple": false,
2682
+ "type": "option"
2683
+ },
2684
+ "document-id-after": {
2685
+ "description": "Current document",
2686
+ "exclusive": [
2687
+ "data",
2688
+ "file",
2689
+ "document-id",
2690
+ "data-before",
2691
+ "data-after",
2692
+ "file-before",
2693
+ "file-after"
2694
+ ],
2695
+ "name": "document-id-after",
2696
+ "required": false,
2697
+ "hasDynamicHelp": false,
2698
+ "multiple": false,
2699
+ "type": "option"
2700
+ },
2701
+ "with-user-token": {
2702
+ "description": "Prime access token from CLI config",
2703
+ "name": "with-user-token",
2889
2704
  "allowNo": false,
2890
2705
  "type": "boolean"
2706
+ },
2707
+ "media-library-id": {
2708
+ "aliases": [
2709
+ "media"
2710
+ ],
2711
+ "description": "Sanity Media Library ID to use",
2712
+ "exclusive": [
2713
+ "project-id",
2714
+ "dataset"
2715
+ ],
2716
+ "name": "media-library-id",
2717
+ "required": false,
2718
+ "hasDynamicHelp": false,
2719
+ "multiple": false,
2720
+ "type": "option"
2891
2721
  }
2892
2722
  },
2893
2723
  "hasDynamicHelp": false,
2894
2724
  "hiddenAliases": [],
2895
- "id": "blueprints:stacks",
2725
+ "id": "functions:test",
2896
2726
  "pluginAlias": "@sanity/runtime-cli",
2897
2727
  "pluginName": "@sanity/runtime-cli",
2898
2728
  "pluginType": "core",
2899
2729
  "strict": true,
2900
- "summary": "List remote Stack deployments for your project or organization",
2730
+ "summary": "Invoke a local Sanity Function",
2901
2731
  "enableJsonFlag": true,
2902
2732
  "needs": [
2903
- "scope"
2733
+ "blueprint"
2904
2734
  ],
2905
2735
  "isESM": true,
2906
2736
  "relativePath": [
2907
2737
  "dist",
2908
2738
  "commands",
2909
- "blueprints",
2910
- "stacks.js"
2739
+ "functions",
2740
+ "test.js"
2911
2741
  ]
2912
2742
  },
2913
2743
  "functions:env:add": {
@@ -2941,16 +2771,6 @@
2941
2771
  "allowNo": false,
2942
2772
  "type": "boolean"
2943
2773
  },
2944
- "llms": {
2945
- "aliases": [
2946
- "skill"
2947
- ],
2948
- "description": "Show agent-oriented guidance for this command",
2949
- "hidden": true,
2950
- "name": "llms",
2951
- "allowNo": false,
2952
- "type": "boolean"
2953
- },
2954
2774
  "path": {
2955
2775
  "aliases": [
2956
2776
  "blueprint-path"
@@ -3067,16 +2887,6 @@
3067
2887
  "allowNo": false,
3068
2888
  "type": "boolean"
3069
2889
  },
3070
- "llms": {
3071
- "aliases": [
3072
- "skill"
3073
- ],
3074
- "description": "Show agent-oriented guidance for this command",
3075
- "hidden": true,
3076
- "name": "llms",
3077
- "allowNo": false,
3078
- "type": "boolean"
3079
- },
3080
2890
  "path": {
3081
2891
  "aliases": [
3082
2892
  "blueprint-path"
@@ -3198,16 +3008,6 @@
3198
3008
  "allowNo": false,
3199
3009
  "type": "boolean"
3200
3010
  },
3201
- "llms": {
3202
- "aliases": [
3203
- "skill"
3204
- ],
3205
- "description": "Show agent-oriented guidance for this command",
3206
- "hidden": true,
3207
- "name": "llms",
3208
- "allowNo": false,
3209
- "type": "boolean"
3210
- },
3211
3011
  "path": {
3212
3012
  "aliases": [
3213
3013
  "blueprint-path"
@@ -3304,5 +3104,5 @@
3304
3104
  ]
3305
3105
  }
3306
3106
  },
3307
- "version": "17.3.0-blueprinit.gaf4f184"
3107
+ "version": "17.3.0-blueprinit.gb1c5e1e"
3308
3108
  }