@sanity/runtime-cli 17.21.0-next.g768eed0 → 17.21.0-next.g90838ec

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.
@@ -1,27 +1,15 @@
1
1
  {
2
2
  "commands": {
3
- "blueprints:add": {
3
+ "functions:add": {
4
4
  "aliases": [],
5
- "args": {
6
- "type": {
7
- "description": "Type of resource to add (only \"function\" is supported)",
8
- "name": "type",
9
- "options": [
10
- "function"
11
- ],
12
- "required": true
13
- }
14
- },
15
- "deprecationOptions": {
16
- "to": "functions add"
17
- },
18
- "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",
5
+ "args": {},
6
+ "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.",
19
7
  "examples": [
20
- "<%= config.bin %> <%= command.id %> function",
21
- "<%= config.bin %> <%= command.id %> function --helpers",
22
- "<%= config.bin %> <%= command.id %> function --name my-function",
23
- "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create",
24
- "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create --fn-type document-update --lang js"
8
+ "<%= config.bin %> <%= command.id %>",
9
+ "<%= config.bin %> <%= command.id %> --helpers",
10
+ "<%= config.bin %> <%= command.id %> --name my-function",
11
+ "<%= config.bin %> <%= command.id %> --name my-function --type document-create",
12
+ "<%= config.bin %> <%= command.id %> --name my-function --type document-create --type document-update --lang js"
25
13
  ],
26
14
  "flags": {
27
15
  "json": {
@@ -107,14 +95,15 @@
107
95
  "aliases": [
108
96
  "recipe"
109
97
  ],
110
- "description": "Example to use for the function resource. Discover examples at https://www.sanity.io/exchange/type=recipes/by=sanity",
98
+ "description": "Example to use for the Function",
111
99
  "exclusive": [
112
100
  "name",
113
- "fn-type",
101
+ "type",
114
102
  "language",
115
103
  "javascript",
116
- "fn-helpers",
117
- "fn-installer"
104
+ "helpers",
105
+ "installer",
106
+ "install"
118
107
  ],
119
108
  "name": "example",
120
109
  "hasDynamicHelp": false,
@@ -123,21 +112,18 @@
123
112
  },
124
113
  "name": {
125
114
  "char": "n",
126
- "description": "Name of the resource to add",
115
+ "description": "Name of the Function to add",
127
116
  "name": "name",
128
117
  "hasDynamicHelp": false,
129
118
  "multiple": false,
130
119
  "type": "option"
131
120
  },
132
- "fn-type": {
133
- "aliases": [
134
- "function-type"
135
- ],
121
+ "type": {
136
122
  "dependsOn": [
137
123
  "name"
138
124
  ],
139
125
  "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
140
- "name": "fn-type",
126
+ "name": "type",
141
127
  "hasDynamicHelp": false,
142
128
  "multiple": true,
143
129
  "options": [
@@ -157,11 +143,9 @@
157
143
  },
158
144
  "language": {
159
145
  "aliases": [
160
- "function-language",
161
- "fn-language",
162
146
  "lang"
163
147
  ],
164
- "description": "Language of the new function",
148
+ "description": "Language of the new Function",
165
149
  "name": "language",
166
150
  "default": "ts",
167
151
  "hasDynamicHelp": false,
@@ -184,23 +168,15 @@
184
168
  "allowNo": false,
185
169
  "type": "boolean"
186
170
  },
187
- "fn-helpers": {
188
- "aliases": [
189
- "function-helpers",
190
- "helpers"
191
- ],
192
- "description": "Add helpers to the new function",
193
- "name": "fn-helpers",
171
+ "helpers": {
172
+ "description": "Add helpers to the new Function",
173
+ "name": "helpers",
194
174
  "allowNo": true,
195
175
  "type": "boolean"
196
176
  },
197
- "fn-installer": {
198
- "aliases": [
199
- "function-installer",
200
- "installer"
201
- ],
202
- "description": "Which package manager to use when installing the @sanity/functions helpers",
203
- "name": "fn-installer",
177
+ "installer": {
178
+ "description": "How to install the @sanity/functions helpers",
179
+ "name": "installer",
204
180
  "hasDynamicHelp": false,
205
181
  "multiple": false,
206
182
  "options": [
@@ -213,9 +189,9 @@
213
189
  },
214
190
  "install": {
215
191
  "char": "i",
216
- "description": "Shortcut for --fn-installer npm",
192
+ "description": "Shortcut for --installer npm",
217
193
  "exclusive": [
218
- "fn-installer"
194
+ "installer"
219
195
  ],
220
196
  "name": "install",
221
197
  "allowNo": false,
@@ -224,13 +200,12 @@
224
200
  },
225
201
  "hasDynamicHelp": false,
226
202
  "hiddenAliases": [],
227
- "id": "blueprints:add",
203
+ "id": "functions:add",
228
204
  "pluginAlias": "@sanity/runtime-cli",
229
205
  "pluginName": "@sanity/runtime-cli",
230
206
  "pluginType": "core",
231
- "state": "deprecated",
232
207
  "strict": true,
233
- "summary": "[deprecated] Use \"functions add\" instead",
208
+ "summary": "Add a Function to your Blueprint",
234
209
  "enableJsonFlag": true,
235
210
  "needs": [
236
211
  "blueprint"
@@ -239,20 +214,19 @@
239
214
  "relativePath": [
240
215
  "dist",
241
216
  "commands",
242
- "blueprints",
217
+ "functions",
243
218
  "add.js"
244
219
  ]
245
220
  },
246
- "blueprints:config": {
221
+ "functions:build": {
247
222
  "aliases": [],
248
- "args": {},
249
- "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.",
250
- "examples": [
251
- "<%= config.bin %> <%= command.id %>",
252
- "<%= config.bin %> <%= command.id %> --edit",
253
- "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
254
- "<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack <name-or-id>"
255
- ],
223
+ "args": {
224
+ "name": {
225
+ "description": "The name of the Sanity Function",
226
+ "name": "name",
227
+ "required": false
228
+ }
229
+ },
256
230
  "flags": {
257
231
  "json": {
258
232
  "description": "Format output as json",
@@ -295,14 +269,8 @@
295
269
  "type": "boolean"
296
270
  },
297
271
  "stack": {
298
- "aliases": [
299
- "stack-id",
300
- "stackId"
301
- ],
302
- "dependsOn": [
303
- "edit"
304
- ],
305
- "description": "Stack name or ID to set in the configuration. Requires --edit flag",
272
+ "description": "Stack name or ID to use instead of the locally configured Stack",
273
+ "hidden": true,
306
274
  "name": "stack",
307
275
  "hasDynamicHelp": false,
308
276
  "multiple": false,
@@ -313,13 +281,11 @@
313
281
  "project",
314
282
  "projectId"
315
283
  ],
316
- "dependsOn": [
317
- "edit"
318
- ],
319
284
  "description": "Sanity project ID used to scope Blueprint and Stack",
320
285
  "exclusive": [
321
286
  "organization-id"
322
287
  ],
288
+ "hidden": true,
323
289
  "name": "project-id",
324
290
  "hasDynamicHelp": false,
325
291
  "multiple": false,
@@ -331,59 +297,70 @@
331
297
  "organizationId",
332
298
  "org"
333
299
  ],
334
- "dependsOn": [
335
- "edit"
336
- ],
337
300
  "description": "Sanity organization ID used to scope Blueprint and Stack",
338
301
  "exclusive": [
339
302
  "project-id"
340
303
  ],
304
+ "hidden": true,
341
305
  "name": "organization-id",
342
306
  "hasDynamicHelp": false,
343
307
  "multiple": false,
344
308
  "type": "option"
345
309
  },
346
- "edit": {
347
- "char": "e",
348
- "description": "Modify the configuration interactively, or directly when combined with ID flags.",
349
- "name": "edit",
350
- "allowNo": false,
351
- "type": "boolean"
310
+ "fn-installer": {
311
+ "aliases": [
312
+ "function-installer",
313
+ "installer"
314
+ ],
315
+ "description": "Which package manager to use when building Functions",
316
+ "hidden": true,
317
+ "name": "fn-installer",
318
+ "hasDynamicHelp": false,
319
+ "multiple": false,
320
+ "options": [
321
+ "npm",
322
+ "pnpm",
323
+ "yarn"
324
+ ],
325
+ "type": "option"
326
+ },
327
+ "out-dir": {
328
+ "char": "o",
329
+ "description": "Output directory for zip files",
330
+ "name": "out-dir",
331
+ "hasDynamicHelp": false,
332
+ "multiple": false,
333
+ "type": "option"
352
334
  }
353
335
  },
354
336
  "hasDynamicHelp": false,
337
+ "hidden": true,
355
338
  "hiddenAliases": [],
356
- "id": "blueprints:config",
339
+ "id": "functions:build",
357
340
  "pluginAlias": "@sanity/runtime-cli",
358
341
  "pluginName": "@sanity/runtime-cli",
359
342
  "pluginType": "core",
360
343
  "strict": true,
361
- "summary": "View or edit the local Blueprint configuration",
344
+ "summary": "Build Sanity Function(s) to zip archives",
362
345
  "enableJsonFlag": true,
363
346
  "needs": [
364
- "token",
365
347
  "blueprint"
366
348
  ],
367
349
  "isESM": true,
368
350
  "relativePath": [
369
351
  "dist",
370
352
  "commands",
371
- "blueprints",
372
- "config.js"
353
+ "functions",
354
+ "build.js"
373
355
  ]
374
356
  },
375
- "blueprints:deploy": {
357
+ "functions:dev": {
376
358
  "aliases": [],
377
359
  "args": {},
378
- "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 180-second timeout for processing resource assets.\n\nSet SANITY_ASSET_CONCURRENCY to override how many resource assets are processed at once (default 4).\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
360
+ "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. The live-reload WebSocket server shares this host and port. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
379
361
  "examples": [
380
- "<%= config.bin %> <%= command.id %>",
381
- "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
382
- "<%= config.bin %> <%= command.id %> --no-wait",
383
- "<%= config.bin %> <%= command.id %> --fn-installer npm",
384
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
385
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>",
386
- "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
362
+ "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 3333",
363
+ "<%= config.bin %> <%= command.id %> --timeout 60"
387
364
  ],
388
365
  "flags": {
389
366
  "json": {
@@ -428,6 +405,7 @@
428
405
  },
429
406
  "stack": {
430
407
  "description": "Stack name or ID to use instead of the locally configured Stack",
408
+ "hidden": true,
431
409
  "name": "stack",
432
410
  "hasDynamicHelp": false,
433
411
  "multiple": false,
@@ -442,6 +420,7 @@
442
420
  "exclusive": [
443
421
  "organization-id"
444
422
  ],
423
+ "hidden": true,
445
424
  "name": "project-id",
446
425
  "hasDynamicHelp": false,
447
426
  "multiple": false,
@@ -457,56 +436,35 @@
457
436
  "exclusive": [
458
437
  "project-id"
459
438
  ],
439
+ "hidden": true,
460
440
  "name": "organization-id",
461
441
  "hasDynamicHelp": false,
462
442
  "multiple": false,
463
443
  "type": "option"
464
444
  },
465
- "message": {
466
- "char": "m",
467
- "description": "Message describing the deployment (e.g. reason for change)",
468
- "name": "message",
445
+ "host": {
446
+ "char": "h",
447
+ "description": "The local network interface at which to listen. [default: \"localhost\"]",
448
+ "name": "host",
449
+ "required": false,
469
450
  "hasDynamicHelp": false,
470
451
  "multiple": false,
471
452
  "type": "option"
472
453
  },
473
- "fn-installer": {
474
- "aliases": [
475
- "function-installer",
476
- "installer"
477
- ],
478
- "description": "Which package manager to use when installing Function dependencies",
479
- "hidden": true,
480
- "name": "fn-installer",
454
+ "port": {
455
+ "char": "p",
456
+ "description": "TCP port to start emulator on. [default: 8080]",
457
+ "name": "port",
458
+ "required": false,
481
459
  "hasDynamicHelp": false,
482
460
  "multiple": false,
483
- "options": [
484
- "npm",
485
- "pnpm",
486
- "yarn"
487
- ],
488
461
  "type": "option"
489
462
  },
490
- "no-wait": {
491
- "description": "Do not wait for Stack deployment to complete",
492
- "name": "no-wait",
493
- "allowNo": false,
494
- "type": "boolean"
495
- },
496
- "configure": {
497
- "aliases": [
498
- "config",
499
- "init"
500
- ],
501
- "description": "Configure the local Blueprint interactively before deploying",
502
- "hidden": true,
503
- "name": "configure",
504
- "allowNo": false,
505
- "type": "boolean"
506
- },
507
- "new-stack-name": {
508
- "description": "Set a new name for the Stack",
509
- "name": "new-stack-name",
463
+ "timeout": {
464
+ "char": "t",
465
+ "description": "Maximum execution time for all functions, in seconds. Takes precedence over function-specific `timeout`",
466
+ "name": "timeout",
467
+ "required": false,
510
468
  "hasDynamicHelp": false,
511
469
  "multiple": false,
512
470
  "type": "option"
@@ -514,32 +472,34 @@
514
472
  },
515
473
  "hasDynamicHelp": false,
516
474
  "hiddenAliases": [],
517
- "id": "blueprints:deploy",
475
+ "id": "functions:dev",
518
476
  "pluginAlias": "@sanity/runtime-cli",
519
477
  "pluginName": "@sanity/runtime-cli",
520
478
  "pluginType": "core",
521
479
  "strict": true,
522
- "summary": "Deploy the local Blueprint to the remote Stack",
480
+ "summary": "Start the Sanity Function emulator",
523
481
  "enableJsonFlag": true,
524
482
  "needs": [
525
- "deployedStack",
526
483
  "blueprint"
527
484
  ],
528
485
  "isESM": true,
529
486
  "relativePath": [
530
487
  "dist",
531
488
  "commands",
532
- "blueprints",
533
- "deploy.js"
489
+ "functions",
490
+ "dev.js"
534
491
  ]
535
492
  },
536
- "blueprints:destroy": {
493
+ "functions:list": {
537
494
  "aliases": [],
538
495
  "args": {},
539
- "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).",
496
+ "description": "Lists functions deployed directly in the selected project or organization scope. The local Blueprint config supplies the scope by default.\n\nUse --project-id or --organization-id to select a scope without a local Blueprint. Organization results include organization-scoped functions only.",
540
497
  "examples": [
541
498
  "<%= config.bin %> <%= command.id %>",
542
- "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
499
+ "<%= config.bin %> <%= command.id %> --verbose",
500
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
501
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
502
+ "<%= config.bin %> <%= command.id %> --project-id <projectId> --json"
543
503
  ],
544
504
  "flags": {
545
505
  "json": {
@@ -576,18 +536,15 @@
576
536
  "type": "boolean"
577
537
  },
578
538
  "verbose": {
579
- "description": "Verbose output",
580
- "hidden": true,
539
+ "char": "v",
540
+ "description": "Show function configuration details",
581
541
  "name": "verbose",
582
542
  "allowNo": false,
583
543
  "type": "boolean"
584
544
  },
585
545
  "stack": {
586
- "aliases": [
587
- "stack-id",
588
- "stackId"
589
- ],
590
- "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
546
+ "description": "Stack name or ID to use instead of the locally configured Stack",
547
+ "hidden": true,
591
548
  "name": "stack",
592
549
  "hasDynamicHelp": false,
593
550
  "multiple": false,
@@ -598,10 +555,6 @@
598
555
  "project",
599
556
  "projectId"
600
557
  ],
601
- "dependsOn": [
602
- "stack",
603
- "force"
604
- ],
605
558
  "description": "Sanity project ID used to scope Blueprint and Stack",
606
559
  "exclusive": [
607
560
  "organization-id"
@@ -617,10 +570,6 @@
617
570
  "organizationId",
618
571
  "org"
619
572
  ],
620
- "dependsOn": [
621
- "stack",
622
- "force"
623
- ],
624
573
  "description": "Sanity organization ID used to scope Blueprint and Stack",
625
574
  "exclusive": [
626
575
  "project-id"
@@ -629,29 +578,17 @@
629
578
  "hasDynamicHelp": false,
630
579
  "multiple": false,
631
580
  "type": "option"
632
- },
633
- "force": {
634
- "char": "f",
635
- "description": "Force Stack destruction (skip confirmation)",
636
- "name": "force",
637
- "allowNo": false,
638
- "type": "boolean"
639
- },
640
- "no-wait": {
641
- "description": "Do not wait for Stack destruction to complete",
642
- "name": "no-wait",
643
- "allowNo": false,
644
- "type": "boolean"
645
581
  }
646
582
  },
647
583
  "hasDynamicHelp": false,
584
+ "hidden": true,
648
585
  "hiddenAliases": [],
649
- "id": "blueprints:destroy",
586
+ "id": "functions:list",
650
587
  "pluginAlias": "@sanity/runtime-cli",
651
588
  "pluginName": "@sanity/runtime-cli",
652
589
  "pluginType": "core",
653
590
  "strict": true,
654
- "summary": "Destroy a remote Stack deployment and its resources",
591
+ "summary": "List deployed Sanity Functions",
655
592
  "enableJsonFlag": true,
656
593
  "needs": [
657
594
  "scope"
@@ -660,91 +597,25 @@
660
597
  "relativePath": [
661
598
  "dist",
662
599
  "commands",
663
- "blueprints",
664
- "destroy.js"
600
+ "functions",
601
+ "list.js"
665
602
  ]
666
603
  },
667
- "blueprints:doctor": {
604
+ "functions:logs": {
668
605
  "aliases": [],
669
- "args": {},
670
- "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.",
671
- "examples": [
672
- "<%= config.bin %> <%= command.id %>",
673
- "<%= config.bin %> <%= command.id %> --fix"
674
- ],
675
- "flags": {
676
- "json": {
677
- "description": "Format output as json",
678
- "name": "json",
679
- "allowNo": false,
680
- "type": "boolean"
681
- },
682
- "path": {
683
- "aliases": [
684
- "blueprint-path"
685
- ],
686
- "char": "p",
687
- "description": "Path to a Blueprint file or directory containing one",
688
- "env": "SANITY_BLUEPRINT_PATH",
689
- "name": "path",
690
- "hasDynamicHelp": false,
691
- "multiple": false,
692
- "type": "option"
693
- },
694
- "trace": {
695
- "description": "Trace output",
696
- "hidden": true,
697
- "name": "trace",
698
- "allowNo": false,
699
- "type": "boolean"
700
- },
701
- "validate-resources": {
702
- "description": "Validate resources",
703
- "hidden": true,
704
- "name": "validate-resources",
705
- "allowNo": true,
706
- "type": "boolean"
707
- },
708
- "verbose": {
709
- "description": "Verbose output",
710
- "hidden": true,
711
- "name": "verbose",
712
- "allowNo": false,
713
- "type": "boolean"
714
- },
715
- "fix": {
716
- "description": "Interactively fix configuration issues",
717
- "name": "fix",
718
- "allowNo": false,
719
- "type": "boolean"
606
+ "args": {
607
+ "name": {
608
+ "description": "The name of the Sanity Function",
609
+ "name": "name",
610
+ "required": false
720
611
  }
721
612
  },
722
- "hasDynamicHelp": false,
723
- "hiddenAliases": [],
724
- "id": "blueprints:doctor",
725
- "pluginAlias": "@sanity/runtime-cli",
726
- "pluginName": "@sanity/runtime-cli",
727
- "pluginType": "core",
728
- "strict": true,
729
- "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
730
- "enableJsonFlag": true,
731
- "isESM": true,
732
- "relativePath": [
733
- "dist",
734
- "commands",
735
- "blueprints",
736
- "doctor.js"
737
- ]
738
- },
739
- "blueprints:info": {
740
- "aliases": [],
741
- "args": {},
742
- "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.",
613
+ "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).",
743
614
  "examples": [
744
- "<%= config.bin %> <%= command.id %>",
745
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
746
- "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
747
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
615
+ "<%= config.bin %> <%= command.id %> <name>",
616
+ "<%= config.bin %> <%= command.id %> <name> --json",
617
+ "<%= config.bin %> <%= command.id %> <name> --limit 100",
618
+ "<%= config.bin %> <%= command.id %> <name> --delete"
748
619
  ],
749
620
  "flags": {
750
621
  "json": {
@@ -781,17 +652,14 @@
781
652
  "type": "boolean"
782
653
  },
783
654
  "verbose": {
784
- "char": "v",
785
- "description": "Show resource and external IDs",
655
+ "description": "Verbose output",
656
+ "hidden": true,
786
657
  "name": "verbose",
787
658
  "allowNo": false,
788
659
  "type": "boolean"
789
660
  },
790
661
  "stack": {
791
- "aliases": [
792
- "id"
793
- ],
794
- "description": "Stack name or ID",
662
+ "description": "Stack name or ID to use instead of the locally configured Stack",
795
663
  "name": "stack",
796
664
  "hasDynamicHelp": false,
797
665
  "multiple": false,
@@ -806,6 +674,7 @@
806
674
  "exclusive": [
807
675
  "organization-id"
808
676
  ],
677
+ "hidden": true,
809
678
  "name": "project-id",
810
679
  "hasDynamicHelp": false,
811
680
  "multiple": false,
@@ -821,52 +690,103 @@
821
690
  "exclusive": [
822
691
  "project-id"
823
692
  ],
693
+ "hidden": true,
824
694
  "name": "organization-id",
825
695
  "hasDynamicHelp": false,
826
696
  "multiple": false,
827
697
  "type": "option"
698
+ },
699
+ "limit": {
700
+ "char": "l",
701
+ "description": "Total number of log entries to retrieve",
702
+ "name": "limit",
703
+ "required": false,
704
+ "default": 50,
705
+ "hasDynamicHelp": false,
706
+ "multiple": false,
707
+ "type": "option"
708
+ },
709
+ "utc": {
710
+ "char": "u",
711
+ "description": "Show dates in UTC time zone",
712
+ "name": "utc",
713
+ "required": false,
714
+ "allowNo": false,
715
+ "type": "boolean"
716
+ },
717
+ "delete": {
718
+ "char": "d",
719
+ "description": "Delete all logs for the function",
720
+ "exclusive": [
721
+ "limit",
722
+ "json"
723
+ ],
724
+ "name": "delete",
725
+ "required": false,
726
+ "allowNo": false,
727
+ "type": "boolean"
728
+ },
729
+ "force": {
730
+ "char": "f",
731
+ "dependsOn": [
732
+ "delete"
733
+ ],
734
+ "description": "Skip confirmation for deleting logs",
735
+ "name": "force",
736
+ "required": false,
737
+ "allowNo": false,
738
+ "type": "boolean"
739
+ },
740
+ "watch": {
741
+ "aliases": [
742
+ "follow"
743
+ ],
744
+ "char": "w",
745
+ "description": "Watch for new logs (streaming mode)",
746
+ "exclusive": [
747
+ "json"
748
+ ],
749
+ "name": "watch",
750
+ "allowNo": false,
751
+ "type": "boolean"
828
752
  }
829
753
  },
830
754
  "hasDynamicHelp": false,
831
755
  "hiddenAliases": [],
832
- "id": "blueprints:info",
756
+ "id": "functions:logs",
833
757
  "pluginAlias": "@sanity/runtime-cli",
834
758
  "pluginName": "@sanity/runtime-cli",
835
759
  "pluginType": "core",
836
760
  "strict": true,
837
- "summary": "Display the status and resources of the remote Stack deployment",
761
+ "summary": "Retrieve or delete logs for a Sanity Function",
838
762
  "enableJsonFlag": true,
839
763
  "needs": [
840
- "deployedStack"
764
+ "deployedStack",
765
+ "blueprint"
841
766
  ],
842
767
  "isESM": true,
843
768
  "relativePath": [
844
769
  "dist",
845
770
  "commands",
846
- "blueprints",
847
- "info.js"
771
+ "functions",
772
+ "logs.js"
848
773
  ]
849
774
  },
850
- "blueprints:init": {
775
+ "functions:test": {
851
776
  "aliases": [],
852
777
  "args": {
853
- "dir": {
854
- "description": "Directory to create the local Blueprint in (defaults to the current directory)",
855
- "name": "dir"
778
+ "name": {
779
+ "description": "The name of the Sanity Function",
780
+ "name": "name",
781
+ "required": false
856
782
  }
857
783
  },
858
- "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\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. A .gitignore covering node_modules, .env, and Function build output is created or updated; the .sanity/ config itself is not ignored.\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.",
784
+ "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.",
859
785
  "examples": [
860
- "<%= config.bin %> <%= command.id %>",
861
- "<%= config.bin %> <%= command.id %> .",
862
- "<%= config.bin %> <%= command.id %> [directory]",
863
- "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
864
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
865
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
866
- "<%= config.bin %> <%= command.id %> --stack-name <newStackName>",
867
- "<%= config.bin %> <%= command.id %> --stack-id <existingStackId>",
868
- "<%= config.bin %> <%= command.id %> new-stack --type <json|js|ts> --org <organizationId> --name <newStackName>",
869
- "<%= config.bin %> <%= command.id %> old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>"
786
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }'",
787
+ "<%= config.bin %> <%= command.id %> <name> --file 'payload.json'",
788
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }' --timeout 60",
789
+ "<%= config.bin %> <%= command.id %> <name> --event update --data-before '{ \"title\": \"before\" }' --data-after '{ \"title\": \"after\" }'"
870
790
  ],
871
791
  "flags": {
872
792
  "json": {
@@ -909,41 +829,12 @@
909
829
  "allowNo": false,
910
830
  "type": "boolean"
911
831
  },
912
- "dir": {
913
- "description": "Directory to create the local Blueprint in",
914
- "name": "dir",
915
- "hasDynamicHelp": false,
916
- "multiple": false,
917
- "type": "option"
918
- },
919
- "example": {
920
- "aliases": [
921
- "recipe"
922
- ],
923
- "description": "Example to use for the local Blueprint",
924
- "exclusive": [
925
- "blueprint-type",
926
- "stack-id",
927
- "stack-name"
928
- ],
929
- "name": "example",
930
- "hasDynamicHelp": false,
931
- "multiple": false,
932
- "type": "option"
933
- },
934
- "blueprint-type": {
935
- "aliases": [
936
- "type"
937
- ],
938
- "description": "Blueprint manifest type to use for the local Blueprint",
939
- "name": "blueprint-type",
832
+ "stack": {
833
+ "description": "Stack name or ID to use instead of the locally configured Stack",
834
+ "hidden": true,
835
+ "name": "stack",
940
836
  "hasDynamicHelp": false,
941
837
  "multiple": false,
942
- "options": [
943
- "json",
944
- "js",
945
- "ts"
946
- ],
947
838
  "type": "option"
948
839
  },
949
840
  "project-id": {
@@ -975,79 +866,491 @@
975
866
  "multiple": false,
976
867
  "type": "option"
977
868
  },
978
- "stack-id": {
979
- "aliases": [
980
- "stackId"
869
+ "data": {
870
+ "char": "d",
871
+ "description": "Data to send to the function",
872
+ "exclusive": [
873
+ "file",
874
+ "document-id"
981
875
  ],
982
- "description": "Existing Stack ID used to scope local Blueprint",
876
+ "name": "data",
877
+ "required": false,
878
+ "hasDynamicHelp": false,
879
+ "multiple": false,
880
+ "type": "option"
881
+ },
882
+ "data-before": {
883
+ "description": "Original document",
983
884
  "exclusive": [
984
- "stack-name"
885
+ "data",
886
+ "file",
887
+ "document-id",
888
+ "file-before",
889
+ "file-after",
890
+ "document-id-before",
891
+ "document-id-after"
985
892
  ],
986
- "name": "stack-id",
987
- "relationships": [
988
- {
989
- "type": "some",
990
- "flags": [
991
- "project-id",
992
- "organization-id"
993
- ]
994
- }
893
+ "name": "data-before",
894
+ "required": false,
895
+ "hasDynamicHelp": false,
896
+ "multiple": false,
897
+ "type": "option"
898
+ },
899
+ "data-after": {
900
+ "description": "Current document",
901
+ "exclusive": [
902
+ "data",
903
+ "file",
904
+ "document-id",
905
+ "file-before",
906
+ "file-after",
907
+ "document-id-before",
908
+ "document-id-after"
995
909
  ],
910
+ "name": "data-after",
911
+ "required": false,
996
912
  "hasDynamicHelp": false,
997
913
  "multiple": false,
998
914
  "type": "option"
999
915
  },
1000
- "stack-name": {
916
+ "event": {
917
+ "char": "e",
918
+ "description": "Type of event (create, update, delete)",
919
+ "name": "event",
920
+ "required": false,
921
+ "hasDynamicHelp": false,
922
+ "multiple": false,
923
+ "options": [
924
+ "create",
925
+ "update",
926
+ "delete"
927
+ ],
928
+ "type": "option"
929
+ },
930
+ "file": {
931
+ "char": "f",
932
+ "description": "Read data from file and send to the function",
933
+ "exclusive": [
934
+ "data",
935
+ "document-id"
936
+ ],
937
+ "name": "file",
938
+ "required": false,
939
+ "hasDynamicHelp": false,
940
+ "multiple": false,
941
+ "type": "option"
942
+ },
943
+ "file-before": {
944
+ "description": "Original document",
945
+ "exclusive": [
946
+ "data",
947
+ "file",
948
+ "document-id",
949
+ "data-before",
950
+ "data-after",
951
+ "document-id-before",
952
+ "document-id-after"
953
+ ],
954
+ "name": "file-before",
955
+ "required": false,
956
+ "hasDynamicHelp": false,
957
+ "multiple": false,
958
+ "type": "option"
959
+ },
960
+ "file-after": {
961
+ "description": "Current document",
962
+ "exclusive": [
963
+ "data",
964
+ "file",
965
+ "document-id",
966
+ "data-before",
967
+ "data-after",
968
+ "document-id-before",
969
+ "document-id-after"
970
+ ],
971
+ "name": "file-after",
972
+ "required": false,
973
+ "hasDynamicHelp": false,
974
+ "multiple": false,
975
+ "type": "option"
976
+ },
977
+ "timeout": {
978
+ "char": "t",
979
+ "description": "Execution timeout value in seconds",
980
+ "name": "timeout",
981
+ "required": false,
982
+ "hasDynamicHelp": false,
983
+ "multiple": false,
984
+ "type": "option"
985
+ },
986
+ "api": {
987
+ "char": "a",
988
+ "description": "Sanity API Version to use",
989
+ "name": "api",
990
+ "required": false,
991
+ "hasDynamicHelp": false,
992
+ "multiple": false,
993
+ "type": "option"
994
+ },
995
+ "dataset": {
996
+ "description": "The Sanity dataset to use",
997
+ "name": "dataset",
998
+ "required": false,
999
+ "hasDynamicHelp": false,
1000
+ "multiple": false,
1001
+ "type": "option"
1002
+ },
1003
+ "document-id": {
1004
+ "aliases": [
1005
+ "doc",
1006
+ "documentId"
1007
+ ],
1008
+ "description": "Document to fetch and send to function",
1009
+ "exclusive": [
1010
+ "data",
1011
+ "file"
1012
+ ],
1013
+ "name": "document-id",
1014
+ "required": false,
1015
+ "hasDynamicHelp": false,
1016
+ "multiple": false,
1017
+ "type": "option"
1018
+ },
1019
+ "document-id-before": {
1020
+ "description": "Original document",
1021
+ "exclusive": [
1022
+ "data",
1023
+ "file",
1024
+ "document-id",
1025
+ "data-before",
1026
+ "data-after",
1027
+ "file-before",
1028
+ "file-after"
1029
+ ],
1030
+ "name": "document-id-before",
1031
+ "required": false,
1032
+ "hasDynamicHelp": false,
1033
+ "multiple": false,
1034
+ "type": "option"
1035
+ },
1036
+ "document-id-after": {
1037
+ "description": "Current document",
1038
+ "exclusive": [
1039
+ "data",
1040
+ "file",
1041
+ "document-id",
1042
+ "data-before",
1043
+ "data-after",
1044
+ "file-before",
1045
+ "file-after"
1046
+ ],
1047
+ "name": "document-id-after",
1048
+ "required": false,
1049
+ "hasDynamicHelp": false,
1050
+ "multiple": false,
1051
+ "type": "option"
1052
+ },
1053
+ "with-user-token": {
1054
+ "description": "Prime access token from CLI config",
1055
+ "name": "with-user-token",
1056
+ "allowNo": false,
1057
+ "type": "boolean"
1058
+ },
1059
+ "media-library-id": {
1060
+ "aliases": [
1061
+ "media"
1062
+ ],
1063
+ "description": "Sanity Media Library ID to use",
1064
+ "exclusive": [
1065
+ "project-id",
1066
+ "dataset"
1067
+ ],
1068
+ "name": "media-library-id",
1069
+ "required": false,
1070
+ "hasDynamicHelp": false,
1071
+ "multiple": false,
1072
+ "type": "option"
1073
+ },
1074
+ "no-wait": {
1075
+ "description": "Skip durable wait delays instead of sleeping",
1076
+ "name": "no-wait",
1077
+ "required": false,
1078
+ "allowNo": false,
1079
+ "type": "boolean"
1080
+ }
1081
+ },
1082
+ "hasDynamicHelp": false,
1083
+ "hiddenAliases": [],
1084
+ "id": "functions:test",
1085
+ "pluginAlias": "@sanity/runtime-cli",
1086
+ "pluginName": "@sanity/runtime-cli",
1087
+ "pluginType": "core",
1088
+ "strict": true,
1089
+ "summary": "Invoke a local Sanity Function",
1090
+ "enableJsonFlag": true,
1091
+ "needs": [
1092
+ "blueprint"
1093
+ ],
1094
+ "isESM": true,
1095
+ "relativePath": [
1096
+ "dist",
1097
+ "commands",
1098
+ "functions",
1099
+ "test.js"
1100
+ ]
1101
+ },
1102
+ "blueprints:add": {
1103
+ "aliases": [],
1104
+ "args": {
1105
+ "type": {
1106
+ "description": "Type of resource to add (only \"function\" is supported)",
1107
+ "name": "type",
1108
+ "options": [
1109
+ "function"
1110
+ ],
1111
+ "required": true
1112
+ }
1113
+ },
1114
+ "deprecationOptions": {
1115
+ "to": "functions add"
1116
+ },
1117
+ "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",
1118
+ "examples": [
1119
+ "<%= config.bin %> <%= command.id %> function",
1120
+ "<%= config.bin %> <%= command.id %> function --helpers",
1121
+ "<%= config.bin %> <%= command.id %> function --name my-function",
1122
+ "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create",
1123
+ "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create --fn-type document-update --lang js"
1124
+ ],
1125
+ "flags": {
1126
+ "json": {
1127
+ "description": "Format output as json",
1128
+ "name": "json",
1129
+ "allowNo": false,
1130
+ "type": "boolean"
1131
+ },
1132
+ "path": {
1133
+ "aliases": [
1134
+ "blueprint-path"
1135
+ ],
1136
+ "char": "p",
1137
+ "description": "Path to a Blueprint file or directory containing one",
1138
+ "env": "SANITY_BLUEPRINT_PATH",
1139
+ "hidden": true,
1140
+ "name": "path",
1141
+ "hasDynamicHelp": false,
1142
+ "multiple": false,
1143
+ "type": "option"
1144
+ },
1145
+ "trace": {
1146
+ "description": "Trace output",
1147
+ "hidden": true,
1148
+ "name": "trace",
1149
+ "allowNo": false,
1150
+ "type": "boolean"
1151
+ },
1152
+ "validate-resources": {
1153
+ "description": "Validate resources",
1154
+ "hidden": true,
1155
+ "name": "validate-resources",
1156
+ "allowNo": true,
1157
+ "type": "boolean"
1158
+ },
1159
+ "verbose": {
1160
+ "description": "Verbose output",
1161
+ "hidden": true,
1162
+ "name": "verbose",
1163
+ "allowNo": false,
1164
+ "type": "boolean"
1165
+ },
1166
+ "stack": {
1167
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1168
+ "hidden": true,
1169
+ "name": "stack",
1170
+ "hasDynamicHelp": false,
1171
+ "multiple": false,
1172
+ "type": "option"
1173
+ },
1174
+ "project-id": {
1175
+ "aliases": [
1176
+ "project",
1177
+ "projectId"
1178
+ ],
1179
+ "description": "Sanity project ID used to scope Blueprint and Stack",
1180
+ "exclusive": [
1181
+ "organization-id"
1182
+ ],
1183
+ "hidden": true,
1184
+ "name": "project-id",
1185
+ "hasDynamicHelp": false,
1186
+ "multiple": false,
1187
+ "type": "option"
1188
+ },
1189
+ "organization-id": {
1190
+ "aliases": [
1191
+ "organization",
1192
+ "organizationId",
1193
+ "org"
1194
+ ],
1195
+ "description": "Sanity organization ID used to scope Blueprint and Stack",
1196
+ "exclusive": [
1197
+ "project-id"
1198
+ ],
1199
+ "hidden": true,
1200
+ "name": "organization-id",
1201
+ "hasDynamicHelp": false,
1202
+ "multiple": false,
1203
+ "type": "option"
1204
+ },
1205
+ "example": {
1206
+ "aliases": [
1207
+ "recipe"
1208
+ ],
1209
+ "description": "Example to use for the function resource. Discover examples at https://www.sanity.io/exchange/type=recipes/by=sanity",
1210
+ "exclusive": [
1211
+ "name",
1212
+ "fn-type",
1213
+ "language",
1214
+ "javascript",
1215
+ "fn-helpers",
1216
+ "fn-installer"
1217
+ ],
1218
+ "name": "example",
1219
+ "hasDynamicHelp": false,
1220
+ "multiple": false,
1221
+ "type": "option"
1222
+ },
1223
+ "name": {
1224
+ "char": "n",
1225
+ "description": "Name of the resource to add",
1226
+ "name": "name",
1227
+ "hasDynamicHelp": false,
1228
+ "multiple": false,
1229
+ "type": "option"
1230
+ },
1231
+ "fn-type": {
1001
1232
  "aliases": [
1233
+ "function-type"
1234
+ ],
1235
+ "dependsOn": [
1002
1236
  "name"
1003
1237
  ],
1004
- "description": "Name to use for a new Stack provisioned during initialization",
1238
+ "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
1239
+ "name": "fn-type",
1240
+ "hasDynamicHelp": false,
1241
+ "multiple": true,
1242
+ "options": [
1243
+ "document-publish",
1244
+ "document-create",
1245
+ "document-delete",
1246
+ "document-update",
1247
+ "media-library-asset-create",
1248
+ "media-library-asset-delete",
1249
+ "media-library-asset-update",
1250
+ "pub-sub",
1251
+ "scheduled-function",
1252
+ "sync-tag-invalidate",
1253
+ "durable-function"
1254
+ ],
1255
+ "type": "option"
1256
+ },
1257
+ "language": {
1258
+ "aliases": [
1259
+ "function-language",
1260
+ "fn-language",
1261
+ "lang"
1262
+ ],
1263
+ "description": "Language of the new function",
1264
+ "name": "language",
1265
+ "default": "ts",
1266
+ "hasDynamicHelp": false,
1267
+ "multiple": false,
1268
+ "options": [
1269
+ "ts",
1270
+ "js"
1271
+ ],
1272
+ "type": "option"
1273
+ },
1274
+ "javascript": {
1275
+ "aliases": [
1276
+ "js"
1277
+ ],
1278
+ "description": "Use JavaScript instead of TypeScript",
1005
1279
  "exclusive": [
1006
- "stack-id"
1280
+ "language"
1007
1281
  ],
1008
- "name": "stack-name",
1009
- "relationships": [
1010
- {
1011
- "type": "some",
1012
- "flags": [
1013
- "project-id",
1014
- "organization-id"
1015
- ]
1016
- }
1282
+ "name": "javascript",
1283
+ "allowNo": false,
1284
+ "type": "boolean"
1285
+ },
1286
+ "fn-helpers": {
1287
+ "aliases": [
1288
+ "function-helpers",
1289
+ "helpers"
1290
+ ],
1291
+ "description": "Add helpers to the new function",
1292
+ "name": "fn-helpers",
1293
+ "allowNo": true,
1294
+ "type": "boolean"
1295
+ },
1296
+ "fn-installer": {
1297
+ "aliases": [
1298
+ "function-installer",
1299
+ "installer"
1017
1300
  ],
1301
+ "description": "Which package manager to use when installing the @sanity/functions helpers",
1302
+ "name": "fn-installer",
1018
1303
  "hasDynamicHelp": false,
1019
1304
  "multiple": false,
1305
+ "options": [
1306
+ "skip",
1307
+ "npm",
1308
+ "pnpm",
1309
+ "yarn"
1310
+ ],
1020
1311
  "type": "option"
1312
+ },
1313
+ "install": {
1314
+ "char": "i",
1315
+ "description": "Shortcut for --fn-installer npm",
1316
+ "exclusive": [
1317
+ "fn-installer"
1318
+ ],
1319
+ "name": "install",
1320
+ "allowNo": false,
1321
+ "type": "boolean"
1021
1322
  }
1022
1323
  },
1023
1324
  "hasDynamicHelp": false,
1024
1325
  "hiddenAliases": [],
1025
- "id": "blueprints:init",
1326
+ "id": "blueprints:add",
1026
1327
  "pluginAlias": "@sanity/runtime-cli",
1027
1328
  "pluginName": "@sanity/runtime-cli",
1028
1329
  "pluginType": "core",
1330
+ "state": "deprecated",
1029
1331
  "strict": true,
1030
- "summary": "Initialize a Blueprint and create a remote Stack",
1332
+ "summary": "[deprecated] Use \"functions add\" instead",
1031
1333
  "enableJsonFlag": true,
1334
+ "needs": [
1335
+ "blueprint"
1336
+ ],
1032
1337
  "isESM": true,
1033
1338
  "relativePath": [
1034
1339
  "dist",
1035
1340
  "commands",
1036
1341
  "blueprints",
1037
- "init.js"
1342
+ "add.js"
1038
1343
  ]
1039
1344
  },
1040
- "blueprints:logs": {
1345
+ "blueprints:config": {
1041
1346
  "aliases": [],
1042
1347
  "args": {},
1043
- "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'.",
1348
+ "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.",
1044
1349
  "examples": [
1045
1350
  "<%= config.bin %> <%= command.id %>",
1046
- "<%= config.bin %> <%= command.id %> --watch",
1047
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1048
- "<%= config.bin %> <%= command.id %> --limit 500",
1049
- "<%= config.bin %> <%= command.id %> --since 2026-05-01T00:00:00Z",
1050
- "<%= config.bin %> <%= command.id %> --before 2026-05-01T00:00:00Z"
1351
+ "<%= config.bin %> <%= command.id %> --edit",
1352
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
1353
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack <name-or-id>"
1051
1354
  ],
1052
1355
  "flags": {
1053
1356
  "json": {
@@ -1091,7 +1394,14 @@
1091
1394
  "type": "boolean"
1092
1395
  },
1093
1396
  "stack": {
1094
- "description": "Stack name or ID to use instead of the locally configured Stack",
1397
+ "aliases": [
1398
+ "stack-id",
1399
+ "stackId"
1400
+ ],
1401
+ "dependsOn": [
1402
+ "edit"
1403
+ ],
1404
+ "description": "Stack name or ID to set in the configuration. Requires --edit flag",
1095
1405
  "name": "stack",
1096
1406
  "hasDynamicHelp": false,
1097
1407
  "multiple": false,
@@ -1102,6 +1412,9 @@
1102
1412
  "project",
1103
1413
  "projectId"
1104
1414
  ],
1415
+ "dependsOn": [
1416
+ "edit"
1417
+ ],
1105
1418
  "description": "Sanity project ID used to scope Blueprint and Stack",
1106
1419
  "exclusive": [
1107
1420
  "organization-id"
@@ -1117,6 +1430,9 @@
1117
1430
  "organizationId",
1118
1431
  "org"
1119
1432
  ],
1433
+ "dependsOn": [
1434
+ "edit"
1435
+ ],
1120
1436
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1121
1437
  "exclusive": [
1122
1438
  "project-id"
@@ -1126,83 +1442,47 @@
1126
1442
  "multiple": false,
1127
1443
  "type": "option"
1128
1444
  },
1129
- "watch": {
1130
- "aliases": [
1131
- "follow"
1132
- ],
1133
- "char": "w",
1134
- "description": "Watch for new Stack logs",
1135
- "exclusive": [
1136
- "json"
1137
- ],
1138
- "name": "watch",
1445
+ "edit": {
1446
+ "char": "e",
1447
+ "description": "Modify the configuration interactively, or directly when combined with ID flags.",
1448
+ "name": "edit",
1139
1449
  "allowNo": false,
1140
1450
  "type": "boolean"
1141
- },
1142
- "limit": {
1143
- "char": "l",
1144
- "description": "Maximum number of log entries to retrieve (1-500)",
1145
- "exclusive": [
1146
- "watch"
1147
- ],
1148
- "name": "limit",
1149
- "hasDynamicHelp": false,
1150
- "multiple": false,
1151
- "type": "option"
1152
- },
1153
- "since": {
1154
- "description": "Only show logs after this ISO 8601 timestamp",
1155
- "exclusive": [
1156
- "watch"
1157
- ],
1158
- "name": "since",
1159
- "hasDynamicHelp": false,
1160
- "multiple": false,
1161
- "type": "option"
1162
- },
1163
- "before": {
1164
- "description": "Only show logs before this ISO 8601 timestamp",
1165
- "exclusive": [
1166
- "watch"
1167
- ],
1168
- "name": "before",
1169
- "hasDynamicHelp": false,
1170
- "multiple": false,
1171
- "type": "option"
1172
1451
  }
1173
1452
  },
1174
1453
  "hasDynamicHelp": false,
1175
1454
  "hiddenAliases": [],
1176
- "id": "blueprints:logs",
1455
+ "id": "blueprints:config",
1177
1456
  "pluginAlias": "@sanity/runtime-cli",
1178
1457
  "pluginName": "@sanity/runtime-cli",
1179
1458
  "pluginType": "core",
1180
1459
  "strict": true,
1181
- "summary": "Display logs for the current Blueprint's Stack deployment",
1460
+ "summary": "View or edit the local Blueprint configuration",
1182
1461
  "enableJsonFlag": true,
1183
1462
  "needs": [
1184
- "deployedStack"
1463
+ "token",
1464
+ "blueprint"
1185
1465
  ],
1186
1466
  "isESM": true,
1187
1467
  "relativePath": [
1188
1468
  "dist",
1189
1469
  "commands",
1190
1470
  "blueprints",
1191
- "logs.js"
1471
+ "config.js"
1192
1472
  ]
1193
1473
  },
1194
- "blueprints:mint-deploy-token": {
1474
+ "blueprints:deploy": {
1195
1475
  "aliases": [],
1196
1476
  "args": {},
1197
- "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.",
1477
+ "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 180-second timeout for processing resource assets.\n\nSet SANITY_ASSET_CONCURRENCY to override how many resource assets are processed at once (default 4).\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
1198
1478
  "examples": [
1199
1479
  "<%= config.bin %> <%= command.id %>",
1200
- "<%= config.bin %> <%= command.id %> --label \"ci-deploy\"",
1201
- "<%= config.bin %> <%= command.id %> --print",
1202
- "export SANITY_AUTH_TOKEN=$(<%= config.bin %> <%= command.id %> --print)",
1203
- "<%= config.bin %> <%= command.id %> --json",
1204
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1205
- "<%= config.bin %> <%= command.id %> --organization-id <orgId>"
1480
+ "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
1481
+ "<%= config.bin %> <%= command.id %> --no-wait",
1482
+ "<%= config.bin %> <%= command.id %> --fn-installer npm",
1483
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1484
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>",
1485
+ "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1206
1486
  ],
1207
1487
  "flags": {
1208
1488
  "json": {
@@ -1247,7 +1527,6 @@
1247
1527
  },
1248
1528
  "stack": {
1249
1529
  "description": "Stack name or ID to use instead of the locally configured Stack",
1250
- "hidden": true,
1251
1530
  "name": "stack",
1252
1531
  "hasDynamicHelp": false,
1253
1532
  "multiple": false,
@@ -1282,52 +1561,84 @@
1282
1561
  "multiple": false,
1283
1562
  "type": "option"
1284
1563
  },
1285
- "label": {
1286
- "description": "Human-readable label for the robot. Defaults to a generated value.",
1287
- "name": "label",
1564
+ "message": {
1565
+ "char": "m",
1566
+ "description": "Message describing the deployment (e.g. reason for change)",
1567
+ "name": "message",
1288
1568
  "hasDynamicHelp": false,
1289
1569
  "multiple": false,
1290
1570
  "type": "option"
1291
1571
  },
1292
- "print": {
1293
- "char": "P",
1294
- "description": "Print only the raw token to stdout (suitable for shell substitution)",
1295
- "exclusive": [
1296
- "json"
1572
+ "fn-installer": {
1573
+ "aliases": [
1574
+ "function-installer",
1575
+ "installer"
1297
1576
  ],
1298
- "name": "print",
1577
+ "description": "Which package manager to use when installing Function dependencies",
1578
+ "hidden": true,
1579
+ "name": "fn-installer",
1580
+ "hasDynamicHelp": false,
1581
+ "multiple": false,
1582
+ "options": [
1583
+ "npm",
1584
+ "pnpm",
1585
+ "yarn"
1586
+ ],
1587
+ "type": "option"
1588
+ },
1589
+ "no-wait": {
1590
+ "description": "Do not wait for Stack deployment to complete",
1591
+ "name": "no-wait",
1592
+ "allowNo": false,
1593
+ "type": "boolean"
1594
+ },
1595
+ "configure": {
1596
+ "aliases": [
1597
+ "config",
1598
+ "init"
1599
+ ],
1600
+ "description": "Configure the local Blueprint interactively before deploying",
1601
+ "hidden": true,
1602
+ "name": "configure",
1299
1603
  "allowNo": false,
1300
1604
  "type": "boolean"
1605
+ },
1606
+ "new-stack-name": {
1607
+ "description": "Set a new name for the Stack",
1608
+ "name": "new-stack-name",
1609
+ "hasDynamicHelp": false,
1610
+ "multiple": false,
1611
+ "type": "option"
1301
1612
  }
1302
1613
  },
1303
1614
  "hasDynamicHelp": false,
1304
1615
  "hiddenAliases": [],
1305
- "id": "blueprints:mint-deploy-token",
1616
+ "id": "blueprints:deploy",
1306
1617
  "pluginAlias": "@sanity/runtime-cli",
1307
1618
  "pluginName": "@sanity/runtime-cli",
1308
1619
  "pluginType": "core",
1309
1620
  "strict": true,
1310
- "summary": "Create a robot API token for deploying Blueprints from CI/CD",
1621
+ "summary": "Deploy the local Blueprint to the remote Stack",
1311
1622
  "enableJsonFlag": true,
1312
1623
  "needs": [
1313
- "scope"
1624
+ "deployedStack",
1625
+ "blueprint"
1314
1626
  ],
1315
1627
  "isESM": true,
1316
1628
  "relativePath": [
1317
1629
  "dist",
1318
1630
  "commands",
1319
1631
  "blueprints",
1320
- "mint-deploy-token.js"
1632
+ "deploy.js"
1321
1633
  ]
1322
1634
  },
1323
- "blueprints:plan": {
1635
+ "blueprints:destroy": {
1324
1636
  "aliases": [],
1325
1637
  "args": {},
1326
- "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.",
1638
+ "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).",
1327
1639
  "examples": [
1328
1640
  "<%= config.bin %> <%= command.id %>",
1329
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1330
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1641
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
1331
1642
  ],
1332
1643
  "flags": {
1333
1644
  "json": {
@@ -1371,7 +1682,11 @@
1371
1682
  "type": "boolean"
1372
1683
  },
1373
1684
  "stack": {
1374
- "description": "Stack name or ID to use instead of the locally configured Stack",
1685
+ "aliases": [
1686
+ "stack-id",
1687
+ "stackId"
1688
+ ],
1689
+ "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
1375
1690
  "name": "stack",
1376
1691
  "hasDynamicHelp": false,
1377
1692
  "multiple": false,
@@ -1382,6 +1697,10 @@
1382
1697
  "project",
1383
1698
  "projectId"
1384
1699
  ],
1700
+ "dependsOn": [
1701
+ "stack",
1702
+ "force"
1703
+ ],
1385
1704
  "description": "Sanity project ID used to scope Blueprint and Stack",
1386
1705
  "exclusive": [
1387
1706
  "organization-id"
@@ -1397,6 +1716,10 @@
1397
1716
  "organizationId",
1398
1717
  "org"
1399
1718
  ],
1719
+ "dependsOn": [
1720
+ "stack",
1721
+ "force"
1722
+ ],
1400
1723
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1401
1724
  "exclusive": [
1402
1725
  "project-id"
@@ -1405,38 +1728,48 @@
1405
1728
  "hasDynamicHelp": false,
1406
1729
  "multiple": false,
1407
1730
  "type": "option"
1731
+ },
1732
+ "force": {
1733
+ "char": "f",
1734
+ "description": "Force Stack destruction (skip confirmation)",
1735
+ "name": "force",
1736
+ "allowNo": false,
1737
+ "type": "boolean"
1738
+ },
1739
+ "no-wait": {
1740
+ "description": "Do not wait for Stack destruction to complete",
1741
+ "name": "no-wait",
1742
+ "allowNo": false,
1743
+ "type": "boolean"
1408
1744
  }
1409
1745
  },
1410
1746
  "hasDynamicHelp": false,
1411
1747
  "hiddenAliases": [],
1412
- "id": "blueprints:plan",
1748
+ "id": "blueprints:destroy",
1413
1749
  "pluginAlias": "@sanity/runtime-cli",
1414
1750
  "pluginName": "@sanity/runtime-cli",
1415
1751
  "pluginType": "core",
1416
1752
  "strict": true,
1417
- "summary": "Preview changes that will be applied to the remote Stack",
1753
+ "summary": "Destroy a remote Stack deployment and its resources",
1418
1754
  "enableJsonFlag": true,
1419
1755
  "needs": [
1420
- "token",
1421
- "blueprint"
1756
+ "scope"
1422
1757
  ],
1423
1758
  "isESM": true,
1424
1759
  "relativePath": [
1425
1760
  "dist",
1426
1761
  "commands",
1427
1762
  "blueprints",
1428
- "plan.js"
1763
+ "destroy.js"
1429
1764
  ]
1430
1765
  },
1431
- "blueprints:promote": {
1766
+ "blueprints:doctor": {
1432
1767
  "aliases": [],
1433
1768
  "args": {},
1434
- "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.",
1769
+ "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.",
1435
1770
  "examples": [
1436
1771
  "<%= config.bin %> <%= command.id %>",
1437
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1438
- "<%= config.bin %> <%= command.id %> --project-id <projectId> --stack <name-or-id>",
1439
- "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1772
+ "<%= config.bin %> <%= command.id %> --fix"
1440
1773
  ],
1441
1774
  "flags": {
1442
1775
  "json": {
@@ -1452,7 +1785,6 @@
1452
1785
  "char": "p",
1453
1786
  "description": "Path to a Blueprint file or directory containing one",
1454
1787
  "env": "SANITY_BLUEPRINT_PATH",
1455
- "hidden": true,
1456
1788
  "name": "path",
1457
1789
  "hasDynamicHelp": false,
1458
1790
  "multiple": false,
@@ -1479,91 +1811,39 @@
1479
1811
  "allowNo": false,
1480
1812
  "type": "boolean"
1481
1813
  },
1482
- "stack": {
1483
- "aliases": [
1484
- "id"
1485
- ],
1486
- "description": "Stack name or ID to promote",
1487
- "name": "stack",
1488
- "hasDynamicHelp": false,
1489
- "multiple": false,
1490
- "type": "option"
1491
- },
1492
- "project-id": {
1493
- "aliases": [
1494
- "project",
1495
- "projectId"
1496
- ],
1497
- "description": "Sanity project ID used to scope Blueprint and Stack",
1498
- "exclusive": [
1499
- "organization-id"
1500
- ],
1501
- "name": "project-id",
1502
- "hasDynamicHelp": false,
1503
- "multiple": false,
1504
- "type": "option"
1505
- },
1506
- "organization-id": {
1507
- "aliases": [
1508
- "organization",
1509
- "organizationId",
1510
- "org"
1511
- ],
1512
- "description": "Sanity organization ID used to scope Blueprint and Stack",
1513
- "exclusive": [
1514
- "project-id"
1515
- ],
1516
- "hidden": true,
1517
- "name": "organization-id",
1518
- "hasDynamicHelp": false,
1519
- "multiple": false,
1520
- "type": "option"
1521
- },
1522
- "force": {
1523
- "description": "Skip confirmation prompt",
1524
- "name": "force",
1814
+ "fix": {
1815
+ "description": "Interactively fix configuration issues",
1816
+ "name": "fix",
1525
1817
  "allowNo": false,
1526
1818
  "type": "boolean"
1527
- },
1528
- "new-stack-name": {
1529
- "description": "Set a new name for the Stack while promoting",
1530
- "name": "new-stack-name",
1531
- "hasDynamicHelp": false,
1532
- "multiple": false,
1533
- "type": "option"
1534
1819
  }
1535
1820
  },
1536
1821
  "hasDynamicHelp": false,
1537
1822
  "hiddenAliases": [],
1538
- "id": "blueprints:promote",
1823
+ "id": "blueprints:doctor",
1539
1824
  "pluginAlias": "@sanity/runtime-cli",
1540
1825
  "pluginName": "@sanity/runtime-cli",
1541
1826
  "pluginType": "core",
1542
1827
  "strict": true,
1543
- "summary": "Promote a Stack from project scope to organization scope",
1828
+ "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
1544
1829
  "enableJsonFlag": true,
1545
- "needs": [
1546
- "deployedStack",
1547
- "blueprint"
1548
- ],
1549
1830
  "isESM": true,
1550
1831
  "relativePath": [
1551
1832
  "dist",
1552
1833
  "commands",
1553
1834
  "blueprints",
1554
- "promote.js"
1835
+ "doctor.js"
1555
1836
  ]
1556
1837
  },
1557
- "blueprints:stacks": {
1838
+ "blueprints:info": {
1558
1839
  "aliases": [],
1559
1840
  "args": {},
1560
- "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\nWithout a scope, prompts for an organization or project. Use --all to list Stacks across every organization and project you can access, or --include-projects with --organization-id for one organization and its projects.",
1841
+ "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.",
1561
1842
  "examples": [
1562
1843
  "<%= config.bin %> <%= command.id %>",
1563
- "<%= config.bin %> <%= command.id %> --all",
1564
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1565
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
1566
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId> --include-projects"
1844
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1845
+ "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
1846
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1567
1847
  ],
1568
1848
  "flags": {
1569
1849
  "json": {
@@ -1600,15 +1880,17 @@
1600
1880
  "type": "boolean"
1601
1881
  },
1602
1882
  "verbose": {
1603
- "description": "Verbose output",
1604
- "hidden": true,
1883
+ "char": "v",
1884
+ "description": "Show resource and external IDs",
1605
1885
  "name": "verbose",
1606
1886
  "allowNo": false,
1607
1887
  "type": "boolean"
1608
1888
  },
1609
1889
  "stack": {
1610
- "description": "Stack name or ID to use instead of the locally configured Stack",
1611
- "hidden": true,
1890
+ "aliases": [
1891
+ "id"
1892
+ ],
1893
+ "description": "Stack name or ID",
1612
1894
  "name": "stack",
1613
1895
  "hasDynamicHelp": false,
1614
1896
  "multiple": false,
@@ -1621,9 +1903,7 @@
1621
1903
  ],
1622
1904
  "description": "Sanity project ID used to scope Blueprint and Stack",
1623
1905
  "exclusive": [
1624
- "organization-id",
1625
- "include-projects",
1626
- "all"
1906
+ "organization-id"
1627
1907
  ],
1628
1908
  "name": "project-id",
1629
1909
  "hasDynamicHelp": false,
@@ -1638,65 +1918,54 @@
1638
1918
  ],
1639
1919
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1640
1920
  "exclusive": [
1641
- "project-id",
1642
- "all"
1921
+ "project-id"
1643
1922
  ],
1644
1923
  "name": "organization-id",
1645
1924
  "hasDynamicHelp": false,
1646
1925
  "multiple": false,
1647
1926
  "type": "option"
1648
- },
1649
- "include-projects": {
1650
- "dependsOn": [
1651
- "organization-id"
1652
- ],
1653
- "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
1654
- "name": "include-projects",
1655
- "allowNo": false,
1656
- "type": "boolean"
1657
- },
1658
- "all": {
1659
- "description": "List Stacks from every organization and project you have access to",
1660
- "exclusive": [
1661
- "project-id",
1662
- "organization-id",
1663
- "include-projects"
1664
- ],
1665
- "name": "all",
1666
- "allowNo": false,
1667
- "type": "boolean"
1668
1927
  }
1669
1928
  },
1670
1929
  "hasDynamicHelp": false,
1671
1930
  "hiddenAliases": [],
1672
- "id": "blueprints:stacks",
1931
+ "id": "blueprints:info",
1673
1932
  "pluginAlias": "@sanity/runtime-cli",
1674
1933
  "pluginName": "@sanity/runtime-cli",
1675
1934
  "pluginType": "core",
1676
1935
  "strict": true,
1677
- "summary": "List remote Stack deployments for your project or organization",
1936
+ "summary": "Display the status and resources of the remote Stack deployment",
1678
1937
  "enableJsonFlag": true,
1679
1938
  "needs": [
1680
- "token"
1939
+ "deployedStack"
1681
1940
  ],
1682
1941
  "isESM": true,
1683
1942
  "relativePath": [
1684
1943
  "dist",
1685
1944
  "commands",
1686
1945
  "blueprints",
1687
- "stacks.js"
1946
+ "info.js"
1688
1947
  ]
1689
1948
  },
1690
- "functions:add": {
1949
+ "blueprints:init": {
1691
1950
  "aliases": [],
1692
- "args": {},
1693
- "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.",
1951
+ "args": {
1952
+ "dir": {
1953
+ "description": "Directory to create the local Blueprint in (defaults to the current directory)",
1954
+ "name": "dir"
1955
+ }
1956
+ },
1957
+ "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\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. A .gitignore covering node_modules, .env, and Function build output is created or updated; the .sanity/ config itself is not ignored.\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.",
1694
1958
  "examples": [
1695
1959
  "<%= config.bin %> <%= command.id %>",
1696
- "<%= config.bin %> <%= command.id %> --helpers",
1697
- "<%= config.bin %> <%= command.id %> --name my-function",
1698
- "<%= config.bin %> <%= command.id %> --name my-function --type document-create",
1699
- "<%= config.bin %> <%= command.id %> --name my-function --type document-create --type document-update --lang js"
1960
+ "<%= config.bin %> <%= command.id %> .",
1961
+ "<%= config.bin %> <%= command.id %> [directory]",
1962
+ "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
1963
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
1964
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1965
+ "<%= config.bin %> <%= command.id %> --stack-name <newStackName>",
1966
+ "<%= config.bin %> <%= command.id %> --stack-id <existingStackId>",
1967
+ "<%= config.bin %> <%= command.id %> new-stack --type <json|js|ts> --org <organizationId> --name <newStackName>",
1968
+ "<%= config.bin %> <%= command.id %> old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>"
1700
1969
  ],
1701
1970
  "flags": {
1702
1971
  "json": {
@@ -1739,12 +2008,41 @@
1739
2008
  "allowNo": false,
1740
2009
  "type": "boolean"
1741
2010
  },
1742
- "stack": {
1743
- "description": "Stack name or ID to use instead of the locally configured Stack",
1744
- "hidden": true,
1745
- "name": "stack",
2011
+ "dir": {
2012
+ "description": "Directory to create the local Blueprint in",
2013
+ "name": "dir",
2014
+ "hasDynamicHelp": false,
2015
+ "multiple": false,
2016
+ "type": "option"
2017
+ },
2018
+ "example": {
2019
+ "aliases": [
2020
+ "recipe"
2021
+ ],
2022
+ "description": "Example to use for the local Blueprint",
2023
+ "exclusive": [
2024
+ "blueprint-type",
2025
+ "stack-id",
2026
+ "stack-name"
2027
+ ],
2028
+ "name": "example",
2029
+ "hasDynamicHelp": false,
2030
+ "multiple": false,
2031
+ "type": "option"
2032
+ },
2033
+ "blueprint-type": {
2034
+ "aliases": [
2035
+ "type"
2036
+ ],
2037
+ "description": "Blueprint manifest type to use for the local Blueprint",
2038
+ "name": "blueprint-type",
1746
2039
  "hasDynamicHelp": false,
1747
2040
  "multiple": false,
2041
+ "options": [
2042
+ "json",
2043
+ "js",
2044
+ "ts"
2045
+ ],
1748
2046
  "type": "option"
1749
2047
  },
1750
2048
  "project-id": {
@@ -1756,7 +2054,6 @@
1756
2054
  "exclusive": [
1757
2055
  "organization-id"
1758
2056
  ],
1759
- "hidden": true,
1760
2057
  "name": "project-id",
1761
2058
  "hasDynamicHelp": false,
1762
2059
  "multiple": false,
@@ -1772,148 +2069,85 @@
1772
2069
  "exclusive": [
1773
2070
  "project-id"
1774
2071
  ],
1775
- "hidden": true,
1776
2072
  "name": "organization-id",
1777
2073
  "hasDynamicHelp": false,
1778
2074
  "multiple": false,
1779
2075
  "type": "option"
1780
2076
  },
1781
- "example": {
2077
+ "stack-id": {
1782
2078
  "aliases": [
1783
- "recipe"
2079
+ "stackId"
1784
2080
  ],
1785
- "description": "Example to use for the Function",
2081
+ "description": "Existing Stack ID used to scope local Blueprint",
1786
2082
  "exclusive": [
1787
- "name",
1788
- "type",
1789
- "language",
1790
- "javascript",
1791
- "helpers",
1792
- "installer",
1793
- "install"
1794
- ],
1795
- "name": "example",
1796
- "hasDynamicHelp": false,
1797
- "multiple": false,
1798
- "type": "option"
1799
- },
1800
- "name": {
1801
- "char": "n",
1802
- "description": "Name of the Function to add",
1803
- "name": "name",
1804
- "hasDynamicHelp": false,
1805
- "multiple": false,
1806
- "type": "option"
1807
- },
1808
- "type": {
1809
- "dependsOn": [
1810
- "name"
1811
- ],
1812
- "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
1813
- "name": "type",
1814
- "hasDynamicHelp": false,
1815
- "multiple": true,
1816
- "options": [
1817
- "document-publish",
1818
- "document-create",
1819
- "document-delete",
1820
- "document-update",
1821
- "media-library-asset-create",
1822
- "media-library-asset-delete",
1823
- "media-library-asset-update",
1824
- "pub-sub",
1825
- "scheduled-function",
1826
- "sync-tag-invalidate",
1827
- "durable-function"
2083
+ "stack-name"
1828
2084
  ],
1829
- "type": "option"
1830
- },
1831
- "language": {
1832
- "aliases": [
1833
- "lang"
2085
+ "name": "stack-id",
2086
+ "relationships": [
2087
+ {
2088
+ "type": "some",
2089
+ "flags": [
2090
+ "project-id",
2091
+ "organization-id"
2092
+ ]
2093
+ }
1834
2094
  ],
1835
- "description": "Language of the new Function",
1836
- "name": "language",
1837
- "default": "ts",
1838
2095
  "hasDynamicHelp": false,
1839
2096
  "multiple": false,
1840
- "options": [
1841
- "ts",
1842
- "js"
1843
- ],
1844
2097
  "type": "option"
1845
2098
  },
1846
- "javascript": {
2099
+ "stack-name": {
1847
2100
  "aliases": [
1848
- "js"
2101
+ "name"
1849
2102
  ],
1850
- "description": "Use JavaScript instead of TypeScript",
2103
+ "description": "Name to use for a new Stack provisioned during initialization",
1851
2104
  "exclusive": [
1852
- "language"
2105
+ "stack-id"
2106
+ ],
2107
+ "name": "stack-name",
2108
+ "relationships": [
2109
+ {
2110
+ "type": "some",
2111
+ "flags": [
2112
+ "project-id",
2113
+ "organization-id"
2114
+ ]
2115
+ }
1853
2116
  ],
1854
- "name": "javascript",
1855
- "allowNo": false,
1856
- "type": "boolean"
1857
- },
1858
- "helpers": {
1859
- "description": "Add helpers to the new Function",
1860
- "name": "helpers",
1861
- "allowNo": true,
1862
- "type": "boolean"
1863
- },
1864
- "installer": {
1865
- "description": "How to install the @sanity/functions helpers",
1866
- "name": "installer",
1867
2117
  "hasDynamicHelp": false,
1868
2118
  "multiple": false,
1869
- "options": [
1870
- "skip",
1871
- "npm",
1872
- "pnpm",
1873
- "yarn"
1874
- ],
1875
2119
  "type": "option"
1876
- },
1877
- "install": {
1878
- "char": "i",
1879
- "description": "Shortcut for --installer npm",
1880
- "exclusive": [
1881
- "installer"
1882
- ],
1883
- "name": "install",
1884
- "allowNo": false,
1885
- "type": "boolean"
1886
2120
  }
1887
2121
  },
1888
2122
  "hasDynamicHelp": false,
1889
2123
  "hiddenAliases": [],
1890
- "id": "functions:add",
2124
+ "id": "blueprints:init",
1891
2125
  "pluginAlias": "@sanity/runtime-cli",
1892
2126
  "pluginName": "@sanity/runtime-cli",
1893
2127
  "pluginType": "core",
1894
2128
  "strict": true,
1895
- "summary": "Add a Function to your Blueprint",
2129
+ "summary": "Initialize a Blueprint and create a remote Stack",
1896
2130
  "enableJsonFlag": true,
1897
- "needs": [
1898
- "blueprint"
1899
- ],
1900
2131
  "isESM": true,
1901
2132
  "relativePath": [
1902
2133
  "dist",
1903
2134
  "commands",
1904
- "functions",
1905
- "add.js"
2135
+ "blueprints",
2136
+ "init.js"
1906
2137
  ]
1907
2138
  },
1908
- "functions:build": {
2139
+ "blueprints:logs": {
1909
2140
  "aliases": [],
1910
- "args": {
1911
- "name": {
1912
- "description": "The name of the Sanity Function",
1913
- "name": "name",
1914
- "required": false
1915
- }
1916
- },
2141
+ "args": {},
2142
+ "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'.",
2143
+ "examples": [
2144
+ "<%= config.bin %> <%= command.id %>",
2145
+ "<%= config.bin %> <%= command.id %> --watch",
2146
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2147
+ "<%= config.bin %> <%= command.id %> --limit 500",
2148
+ "<%= config.bin %> <%= command.id %> --since 2026-05-01T00:00:00Z",
2149
+ "<%= config.bin %> <%= command.id %> --before 2026-05-01T00:00:00Z"
2150
+ ],
1917
2151
  "flags": {
1918
2152
  "json": {
1919
2153
  "description": "Format output as json",
@@ -1957,7 +2191,6 @@
1957
2191
  },
1958
2192
  "stack": {
1959
2193
  "description": "Stack name or ID to use instead of the locally configured Stack",
1960
- "hidden": true,
1961
2194
  "name": "stack",
1962
2195
  "hasDynamicHelp": false,
1963
2196
  "multiple": false,
@@ -1972,7 +2205,6 @@
1972
2205
  "exclusive": [
1973
2206
  "organization-id"
1974
2207
  ],
1975
- "hidden": true,
1976
2208
  "name": "project-id",
1977
2209
  "hasDynamicHelp": false,
1978
2210
  "multiple": false,
@@ -1988,66 +2220,88 @@
1988
2220
  "exclusive": [
1989
2221
  "project-id"
1990
2222
  ],
1991
- "hidden": true,
1992
2223
  "name": "organization-id",
1993
2224
  "hasDynamicHelp": false,
1994
2225
  "multiple": false,
1995
2226
  "type": "option"
1996
2227
  },
1997
- "fn-installer": {
2228
+ "watch": {
1998
2229
  "aliases": [
1999
- "function-installer",
2000
- "installer"
2230
+ "follow"
2001
2231
  ],
2002
- "description": "Which package manager to use when building Functions",
2003
- "hidden": true,
2004
- "name": "fn-installer",
2232
+ "char": "w",
2233
+ "description": "Watch for new Stack logs",
2234
+ "exclusive": [
2235
+ "json"
2236
+ ],
2237
+ "name": "watch",
2238
+ "allowNo": false,
2239
+ "type": "boolean"
2240
+ },
2241
+ "limit": {
2242
+ "char": "l",
2243
+ "description": "Maximum number of log entries to retrieve (1-500)",
2244
+ "exclusive": [
2245
+ "watch"
2246
+ ],
2247
+ "name": "limit",
2005
2248
  "hasDynamicHelp": false,
2006
2249
  "multiple": false,
2007
- "options": [
2008
- "npm",
2009
- "pnpm",
2010
- "yarn"
2250
+ "type": "option"
2251
+ },
2252
+ "since": {
2253
+ "description": "Only show logs after this ISO 8601 timestamp",
2254
+ "exclusive": [
2255
+ "watch"
2011
2256
  ],
2257
+ "name": "since",
2258
+ "hasDynamicHelp": false,
2259
+ "multiple": false,
2012
2260
  "type": "option"
2013
2261
  },
2014
- "out-dir": {
2015
- "char": "o",
2016
- "description": "Output directory for zip files",
2017
- "name": "out-dir",
2262
+ "before": {
2263
+ "description": "Only show logs before this ISO 8601 timestamp",
2264
+ "exclusive": [
2265
+ "watch"
2266
+ ],
2267
+ "name": "before",
2018
2268
  "hasDynamicHelp": false,
2019
2269
  "multiple": false,
2020
2270
  "type": "option"
2021
2271
  }
2022
2272
  },
2023
2273
  "hasDynamicHelp": false,
2024
- "hidden": true,
2025
2274
  "hiddenAliases": [],
2026
- "id": "functions:build",
2275
+ "id": "blueprints:logs",
2027
2276
  "pluginAlias": "@sanity/runtime-cli",
2028
2277
  "pluginName": "@sanity/runtime-cli",
2029
2278
  "pluginType": "core",
2030
2279
  "strict": true,
2031
- "summary": "Build Sanity Function(s) to zip archives",
2280
+ "summary": "Display logs for the current Blueprint's Stack deployment",
2032
2281
  "enableJsonFlag": true,
2033
2282
  "needs": [
2034
- "blueprint"
2283
+ "deployedStack"
2035
2284
  ],
2036
2285
  "isESM": true,
2037
2286
  "relativePath": [
2038
2287
  "dist",
2039
2288
  "commands",
2040
- "functions",
2041
- "build.js"
2289
+ "blueprints",
2290
+ "logs.js"
2042
2291
  ]
2043
2292
  },
2044
- "functions:dev": {
2293
+ "blueprints:mint-deploy-token": {
2045
2294
  "aliases": [],
2046
2295
  "args": {},
2047
- "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. The live-reload WebSocket server shares this host and port. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
2296
+ "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.",
2048
2297
  "examples": [
2049
- "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 3333",
2050
- "<%= config.bin %> <%= command.id %> --timeout 60"
2298
+ "<%= config.bin %> <%= command.id %>",
2299
+ "<%= config.bin %> <%= command.id %> --label \"ci-deploy\"",
2300
+ "<%= config.bin %> <%= command.id %> --print",
2301
+ "export SANITY_AUTH_TOKEN=$(<%= config.bin %> <%= command.id %> --print)",
2302
+ "<%= config.bin %> <%= command.id %> --json",
2303
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2304
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId>"
2051
2305
  ],
2052
2306
  "flags": {
2053
2307
  "json": {
@@ -2107,7 +2361,6 @@
2107
2361
  "exclusive": [
2108
2362
  "organization-id"
2109
2363
  ],
2110
- "hidden": true,
2111
2364
  "name": "project-id",
2112
2365
  "hasDynamicHelp": false,
2113
2366
  "multiple": false,
@@ -2123,70 +2376,57 @@
2123
2376
  "exclusive": [
2124
2377
  "project-id"
2125
2378
  ],
2126
- "hidden": true,
2127
2379
  "name": "organization-id",
2128
2380
  "hasDynamicHelp": false,
2129
2381
  "multiple": false,
2130
2382
  "type": "option"
2131
2383
  },
2132
- "host": {
2133
- "char": "h",
2134
- "description": "The local network interface at which to listen. [default: \"localhost\"]",
2135
- "name": "host",
2136
- "required": false,
2137
- "hasDynamicHelp": false,
2138
- "multiple": false,
2139
- "type": "option"
2140
- },
2141
- "port": {
2142
- "char": "p",
2143
- "description": "TCP port to start emulator on. [default: 8080]",
2144
- "name": "port",
2145
- "required": false,
2384
+ "label": {
2385
+ "description": "Human-readable label for the robot. Defaults to a generated value.",
2386
+ "name": "label",
2146
2387
  "hasDynamicHelp": false,
2147
2388
  "multiple": false,
2148
2389
  "type": "option"
2149
2390
  },
2150
- "timeout": {
2151
- "char": "t",
2152
- "description": "Maximum execution time for all functions, in seconds. Takes precedence over function-specific `timeout`",
2153
- "name": "timeout",
2154
- "required": false,
2155
- "hasDynamicHelp": false,
2156
- "multiple": false,
2157
- "type": "option"
2391
+ "print": {
2392
+ "char": "P",
2393
+ "description": "Print only the raw token to stdout (suitable for shell substitution)",
2394
+ "exclusive": [
2395
+ "json"
2396
+ ],
2397
+ "name": "print",
2398
+ "allowNo": false,
2399
+ "type": "boolean"
2158
2400
  }
2159
2401
  },
2160
2402
  "hasDynamicHelp": false,
2161
2403
  "hiddenAliases": [],
2162
- "id": "functions:dev",
2404
+ "id": "blueprints:mint-deploy-token",
2163
2405
  "pluginAlias": "@sanity/runtime-cli",
2164
2406
  "pluginName": "@sanity/runtime-cli",
2165
2407
  "pluginType": "core",
2166
2408
  "strict": true,
2167
- "summary": "Start the Sanity Function emulator",
2409
+ "summary": "Create a robot API token for deploying Blueprints from CI/CD",
2168
2410
  "enableJsonFlag": true,
2169
2411
  "needs": [
2170
- "blueprint"
2412
+ "scope"
2171
2413
  ],
2172
2414
  "isESM": true,
2173
2415
  "relativePath": [
2174
2416
  "dist",
2175
2417
  "commands",
2176
- "functions",
2177
- "dev.js"
2418
+ "blueprints",
2419
+ "mint-deploy-token.js"
2178
2420
  ]
2179
2421
  },
2180
- "functions:list": {
2422
+ "blueprints:plan": {
2181
2423
  "aliases": [],
2182
2424
  "args": {},
2183
- "description": "Lists functions deployed directly in the selected project or organization scope. The local Blueprint config supplies the scope by default.\n\nUse --project-id or --organization-id to select a scope without a local Blueprint. Organization results include organization-scoped functions only.",
2425
+ "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.",
2184
2426
  "examples": [
2185
2427
  "<%= config.bin %> <%= command.id %>",
2186
- "<%= config.bin %> <%= command.id %> --verbose",
2187
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2188
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
2189
- "<%= config.bin %> <%= command.id %> --project-id <projectId> --json"
2428
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2429
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
2190
2430
  ],
2191
2431
  "flags": {
2192
2432
  "json": {
@@ -2223,15 +2463,14 @@
2223
2463
  "type": "boolean"
2224
2464
  },
2225
2465
  "verbose": {
2226
- "char": "v",
2227
- "description": "Show function configuration details",
2466
+ "description": "Verbose output",
2467
+ "hidden": true,
2228
2468
  "name": "verbose",
2229
2469
  "allowNo": false,
2230
2470
  "type": "boolean"
2231
2471
  },
2232
2472
  "stack": {
2233
2473
  "description": "Stack name or ID to use instead of the locally configured Stack",
2234
- "hidden": true,
2235
2474
  "name": "stack",
2236
2475
  "hasDynamicHelp": false,
2237
2476
  "multiple": false,
@@ -2268,41 +2507,35 @@
2268
2507
  }
2269
2508
  },
2270
2509
  "hasDynamicHelp": false,
2271
- "hidden": true,
2272
2510
  "hiddenAliases": [],
2273
- "id": "functions:list",
2511
+ "id": "blueprints:plan",
2274
2512
  "pluginAlias": "@sanity/runtime-cli",
2275
2513
  "pluginName": "@sanity/runtime-cli",
2276
2514
  "pluginType": "core",
2277
2515
  "strict": true,
2278
- "summary": "List deployed Sanity Functions",
2516
+ "summary": "Preview changes that will be applied to the remote Stack",
2279
2517
  "enableJsonFlag": true,
2280
2518
  "needs": [
2281
- "scope"
2519
+ "token",
2520
+ "blueprint"
2282
2521
  ],
2283
2522
  "isESM": true,
2284
2523
  "relativePath": [
2285
2524
  "dist",
2286
2525
  "commands",
2287
- "functions",
2288
- "list.js"
2526
+ "blueprints",
2527
+ "plan.js"
2289
2528
  ]
2290
2529
  },
2291
- "functions:logs": {
2530
+ "blueprints:promote": {
2292
2531
  "aliases": [],
2293
- "args": {
2294
- "name": {
2295
- "description": "The name of the Sanity Function",
2296
- "name": "name",
2297
- "required": false
2298
- }
2299
- },
2300
- "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).",
2532
+ "args": {},
2533
+ "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.",
2301
2534
  "examples": [
2302
- "<%= config.bin %> <%= command.id %> <name>",
2303
- "<%= config.bin %> <%= command.id %> <name> --json",
2304
- "<%= config.bin %> <%= command.id %> <name> --limit 100",
2305
- "<%= config.bin %> <%= command.id %> <name> --delete"
2535
+ "<%= config.bin %> <%= command.id %>",
2536
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2537
+ "<%= config.bin %> <%= command.id %> --project-id <projectId> --stack <name-or-id>",
2538
+ "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
2306
2539
  ],
2307
2540
  "flags": {
2308
2541
  "json": {
@@ -2346,7 +2579,10 @@
2346
2579
  "type": "boolean"
2347
2580
  },
2348
2581
  "stack": {
2349
- "description": "Stack name or ID to use instead of the locally configured Stack",
2582
+ "aliases": [
2583
+ "id"
2584
+ ],
2585
+ "description": "Stack name or ID to promote",
2350
2586
  "name": "stack",
2351
2587
  "hasDynamicHelp": false,
2352
2588
  "multiple": false,
@@ -2361,7 +2597,6 @@
2361
2597
  "exclusive": [
2362
2598
  "organization-id"
2363
2599
  ],
2364
- "hidden": true,
2365
2600
  "name": "project-id",
2366
2601
  "hasDynamicHelp": false,
2367
2602
  "multiple": false,
@@ -2383,69 +2618,28 @@
2383
2618
  "multiple": false,
2384
2619
  "type": "option"
2385
2620
  },
2386
- "limit": {
2387
- "char": "l",
2388
- "description": "Total number of log entries to retrieve",
2389
- "name": "limit",
2390
- "required": false,
2391
- "default": 50,
2392
- "hasDynamicHelp": false,
2393
- "multiple": false,
2394
- "type": "option"
2395
- },
2396
- "utc": {
2397
- "char": "u",
2398
- "description": "Show dates in UTC time zone",
2399
- "name": "utc",
2400
- "required": false,
2401
- "allowNo": false,
2402
- "type": "boolean"
2403
- },
2404
- "delete": {
2405
- "char": "d",
2406
- "description": "Delete all logs for the function",
2407
- "exclusive": [
2408
- "limit",
2409
- "json"
2410
- ],
2411
- "name": "delete",
2412
- "required": false,
2413
- "allowNo": false,
2414
- "type": "boolean"
2415
- },
2416
2621
  "force": {
2417
- "char": "f",
2418
- "dependsOn": [
2419
- "delete"
2420
- ],
2421
- "description": "Skip confirmation for deleting logs",
2622
+ "description": "Skip confirmation prompt",
2422
2623
  "name": "force",
2423
- "required": false,
2424
2624
  "allowNo": false,
2425
2625
  "type": "boolean"
2426
2626
  },
2427
- "watch": {
2428
- "aliases": [
2429
- "follow"
2430
- ],
2431
- "char": "w",
2432
- "description": "Watch for new logs (streaming mode)",
2433
- "exclusive": [
2434
- "json"
2435
- ],
2436
- "name": "watch",
2437
- "allowNo": false,
2438
- "type": "boolean"
2627
+ "new-stack-name": {
2628
+ "description": "Set a new name for the Stack while promoting",
2629
+ "name": "new-stack-name",
2630
+ "hasDynamicHelp": false,
2631
+ "multiple": false,
2632
+ "type": "option"
2439
2633
  }
2440
2634
  },
2441
2635
  "hasDynamicHelp": false,
2442
2636
  "hiddenAliases": [],
2443
- "id": "functions:logs",
2637
+ "id": "blueprints:promote",
2444
2638
  "pluginAlias": "@sanity/runtime-cli",
2445
2639
  "pluginName": "@sanity/runtime-cli",
2446
2640
  "pluginType": "core",
2447
2641
  "strict": true,
2448
- "summary": "Retrieve or delete logs for a Sanity Function",
2642
+ "summary": "Promote a Stack from project scope to organization scope",
2449
2643
  "enableJsonFlag": true,
2450
2644
  "needs": [
2451
2645
  "deployedStack",
@@ -2455,25 +2649,20 @@
2455
2649
  "relativePath": [
2456
2650
  "dist",
2457
2651
  "commands",
2458
- "functions",
2459
- "logs.js"
2652
+ "blueprints",
2653
+ "promote.js"
2460
2654
  ]
2461
2655
  },
2462
- "functions:test": {
2656
+ "blueprints:stacks": {
2463
2657
  "aliases": [],
2464
- "args": {
2465
- "name": {
2466
- "description": "The name of the Sanity Function",
2467
- "name": "name",
2468
- "required": false
2469
- }
2470
- },
2471
- "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.",
2658
+ "args": {},
2659
+ "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\nWithout a scope, prompts for an organization or project. Use --all to list Stacks across every organization and project you can access, or --include-projects with --organization-id for one organization and its projects.",
2472
2660
  "examples": [
2473
- "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }'",
2474
- "<%= config.bin %> <%= command.id %> <name> --file 'payload.json'",
2475
- "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }' --timeout 60",
2476
- "<%= config.bin %> <%= command.id %> <name> --event update --data-before '{ \"title\": \"before\" }' --data-after '{ \"title\": \"after\" }'"
2661
+ "<%= config.bin %> <%= command.id %>",
2662
+ "<%= config.bin %> <%= command.id %> --all",
2663
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2664
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
2665
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId> --include-projects"
2477
2666
  ],
2478
2667
  "flags": {
2479
2668
  "json": {
@@ -2531,7 +2720,9 @@
2531
2720
  ],
2532
2721
  "description": "Sanity project ID used to scope Blueprint and Stack",
2533
2722
  "exclusive": [
2534
- "organization-id"
2723
+ "organization-id",
2724
+ "include-projects",
2725
+ "all"
2535
2726
  ],
2536
2727
  "name": "project-id",
2537
2728
  "hasDynamicHelp": false,
@@ -2546,244 +2737,53 @@
2546
2737
  ],
2547
2738
  "description": "Sanity organization ID used to scope Blueprint and Stack",
2548
2739
  "exclusive": [
2549
- "project-id"
2740
+ "project-id",
2741
+ "all"
2550
2742
  ],
2551
2743
  "name": "organization-id",
2552
2744
  "hasDynamicHelp": false,
2553
2745
  "multiple": false,
2554
2746
  "type": "option"
2555
2747
  },
2556
- "data": {
2557
- "char": "d",
2558
- "description": "Data to send to the function",
2559
- "exclusive": [
2560
- "file",
2561
- "document-id"
2562
- ],
2563
- "name": "data",
2564
- "required": false,
2565
- "hasDynamicHelp": false,
2566
- "multiple": false,
2567
- "type": "option"
2568
- },
2569
- "data-before": {
2570
- "description": "Original document",
2571
- "exclusive": [
2572
- "data",
2573
- "file",
2574
- "document-id",
2575
- "file-before",
2576
- "file-after",
2577
- "document-id-before",
2578
- "document-id-after"
2579
- ],
2580
- "name": "data-before",
2581
- "required": false,
2582
- "hasDynamicHelp": false,
2583
- "multiple": false,
2584
- "type": "option"
2585
- },
2586
- "data-after": {
2587
- "description": "Current document",
2588
- "exclusive": [
2589
- "data",
2590
- "file",
2591
- "document-id",
2592
- "file-before",
2593
- "file-after",
2594
- "document-id-before",
2595
- "document-id-after"
2596
- ],
2597
- "name": "data-after",
2598
- "required": false,
2599
- "hasDynamicHelp": false,
2600
- "multiple": false,
2601
- "type": "option"
2602
- },
2603
- "event": {
2604
- "char": "e",
2605
- "description": "Type of event (create, update, delete)",
2606
- "name": "event",
2607
- "required": false,
2608
- "hasDynamicHelp": false,
2609
- "multiple": false,
2610
- "options": [
2611
- "create",
2612
- "update",
2613
- "delete"
2614
- ],
2615
- "type": "option"
2616
- },
2617
- "file": {
2618
- "char": "f",
2619
- "description": "Read data from file and send to the function",
2620
- "exclusive": [
2621
- "data",
2622
- "document-id"
2623
- ],
2624
- "name": "file",
2625
- "required": false,
2626
- "hasDynamicHelp": false,
2627
- "multiple": false,
2628
- "type": "option"
2629
- },
2630
- "file-before": {
2631
- "description": "Original document",
2632
- "exclusive": [
2633
- "data",
2634
- "file",
2635
- "document-id",
2636
- "data-before",
2637
- "data-after",
2638
- "document-id-before",
2639
- "document-id-after"
2640
- ],
2641
- "name": "file-before",
2642
- "required": false,
2643
- "hasDynamicHelp": false,
2644
- "multiple": false,
2645
- "type": "option"
2646
- },
2647
- "file-after": {
2648
- "description": "Current document",
2649
- "exclusive": [
2650
- "data",
2651
- "file",
2652
- "document-id",
2653
- "data-before",
2654
- "data-after",
2655
- "document-id-before",
2656
- "document-id-after"
2657
- ],
2658
- "name": "file-after",
2659
- "required": false,
2660
- "hasDynamicHelp": false,
2661
- "multiple": false,
2662
- "type": "option"
2663
- },
2664
- "timeout": {
2665
- "char": "t",
2666
- "description": "Execution timeout value in seconds",
2667
- "name": "timeout",
2668
- "required": false,
2669
- "hasDynamicHelp": false,
2670
- "multiple": false,
2671
- "type": "option"
2672
- },
2673
- "api": {
2674
- "char": "a",
2675
- "description": "Sanity API Version to use",
2676
- "name": "api",
2677
- "required": false,
2678
- "hasDynamicHelp": false,
2679
- "multiple": false,
2680
- "type": "option"
2681
- },
2682
- "dataset": {
2683
- "description": "The Sanity dataset to use",
2684
- "name": "dataset",
2685
- "required": false,
2686
- "hasDynamicHelp": false,
2687
- "multiple": false,
2688
- "type": "option"
2689
- },
2690
- "document-id": {
2691
- "aliases": [
2692
- "doc",
2693
- "documentId"
2694
- ],
2695
- "description": "Document to fetch and send to function",
2696
- "exclusive": [
2697
- "data",
2698
- "file"
2699
- ],
2700
- "name": "document-id",
2701
- "required": false,
2702
- "hasDynamicHelp": false,
2703
- "multiple": false,
2704
- "type": "option"
2705
- },
2706
- "document-id-before": {
2707
- "description": "Original document",
2708
- "exclusive": [
2709
- "data",
2710
- "file",
2711
- "document-id",
2712
- "data-before",
2713
- "data-after",
2714
- "file-before",
2715
- "file-after"
2716
- ],
2717
- "name": "document-id-before",
2718
- "required": false,
2719
- "hasDynamicHelp": false,
2720
- "multiple": false,
2721
- "type": "option"
2722
- },
2723
- "document-id-after": {
2724
- "description": "Current document",
2725
- "exclusive": [
2726
- "data",
2727
- "file",
2728
- "document-id",
2729
- "data-before",
2730
- "data-after",
2731
- "file-before",
2732
- "file-after"
2748
+ "include-projects": {
2749
+ "dependsOn": [
2750
+ "organization-id"
2733
2751
  ],
2734
- "name": "document-id-after",
2735
- "required": false,
2736
- "hasDynamicHelp": false,
2737
- "multiple": false,
2738
- "type": "option"
2739
- },
2740
- "with-user-token": {
2741
- "description": "Prime access token from CLI config",
2742
- "name": "with-user-token",
2752
+ "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
2753
+ "name": "include-projects",
2743
2754
  "allowNo": false,
2744
2755
  "type": "boolean"
2745
2756
  },
2746
- "media-library-id": {
2747
- "aliases": [
2748
- "media"
2749
- ],
2750
- "description": "Sanity Media Library ID to use",
2757
+ "all": {
2758
+ "description": "List Stacks from every organization and project you have access to",
2751
2759
  "exclusive": [
2752
2760
  "project-id",
2753
- "dataset"
2761
+ "organization-id",
2762
+ "include-projects"
2754
2763
  ],
2755
- "name": "media-library-id",
2756
- "required": false,
2757
- "hasDynamicHelp": false,
2758
- "multiple": false,
2759
- "type": "option"
2760
- },
2761
- "no-wait": {
2762
- "description": "Skip durable wait delays instead of sleeping",
2763
- "name": "no-wait",
2764
- "required": false,
2764
+ "name": "all",
2765
2765
  "allowNo": false,
2766
2766
  "type": "boolean"
2767
2767
  }
2768
2768
  },
2769
2769
  "hasDynamicHelp": false,
2770
2770
  "hiddenAliases": [],
2771
- "id": "functions:test",
2771
+ "id": "blueprints:stacks",
2772
2772
  "pluginAlias": "@sanity/runtime-cli",
2773
2773
  "pluginName": "@sanity/runtime-cli",
2774
2774
  "pluginType": "core",
2775
2775
  "strict": true,
2776
- "summary": "Invoke a local Sanity Function",
2776
+ "summary": "List remote Stack deployments for your project or organization",
2777
2777
  "enableJsonFlag": true,
2778
2778
  "needs": [
2779
- "blueprint"
2779
+ "token"
2780
2780
  ],
2781
2781
  "isESM": true,
2782
2782
  "relativePath": [
2783
2783
  "dist",
2784
2784
  "commands",
2785
- "functions",
2786
- "test.js"
2785
+ "blueprints",
2786
+ "stacks.js"
2787
2787
  ]
2788
2788
  },
2789
2789
  "functions:env:add": {
@@ -3150,5 +3150,5 @@
3150
3150
  ]
3151
3151
  }
3152
3152
  },
3153
- "version": "17.21.0-next.g768eed0"
3153
+ "version": "17.21.0-next.g90838ec"
3154
3154
  }