@sanity/runtime-cli 17.2.0-next.ga4b9ae7 → 17.3.0

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,7 +95,7 @@
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
101
  "fn-type",
@@ -123,21 +111,18 @@
123
111
  },
124
112
  "name": {
125
113
  "char": "n",
126
- "description": "Name of the resource to add",
114
+ "description": "Name of the Function to add",
127
115
  "name": "name",
128
116
  "hasDynamicHelp": false,
129
117
  "multiple": false,
130
118
  "type": "option"
131
119
  },
132
- "fn-type": {
133
- "aliases": [
134
- "function-type"
135
- ],
120
+ "type": {
136
121
  "dependsOn": [
137
122
  "name"
138
123
  ],
139
124
  "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",
125
+ "name": "type",
141
126
  "hasDynamicHelp": false,
142
127
  "multiple": true,
143
128
  "options": [
@@ -155,11 +140,9 @@
155
140
  },
156
141
  "language": {
157
142
  "aliases": [
158
- "function-language",
159
- "fn-language",
160
143
  "lang"
161
144
  ],
162
- "description": "Language of the new function",
145
+ "description": "Language of the new Function",
163
146
  "name": "language",
164
147
  "default": "ts",
165
148
  "hasDynamicHelp": false,
@@ -182,23 +165,15 @@
182
165
  "allowNo": false,
183
166
  "type": "boolean"
184
167
  },
185
- "fn-helpers": {
186
- "aliases": [
187
- "function-helpers",
188
- "helpers"
189
- ],
190
- "description": "Add helpers to the new function",
191
- "name": "fn-helpers",
168
+ "helpers": {
169
+ "description": "Add helpers to the new Function",
170
+ "name": "helpers",
192
171
  "allowNo": true,
193
172
  "type": "boolean"
194
173
  },
195
- "fn-installer": {
196
- "aliases": [
197
- "function-installer",
198
- "installer"
199
- ],
200
- "description": "Which package manager to use when installing the @sanity/functions helpers",
201
- "name": "fn-installer",
174
+ "installer": {
175
+ "description": "How to install the @sanity/functions helpers",
176
+ "name": "installer",
202
177
  "hasDynamicHelp": false,
203
178
  "multiple": false,
204
179
  "options": [
@@ -222,13 +197,12 @@
222
197
  },
223
198
  "hasDynamicHelp": false,
224
199
  "hiddenAliases": [],
225
- "id": "blueprints:add",
200
+ "id": "functions:add",
226
201
  "pluginAlias": "@sanity/runtime-cli",
227
202
  "pluginName": "@sanity/runtime-cli",
228
203
  "pluginType": "core",
229
- "state": "deprecated",
230
204
  "strict": true,
231
- "summary": "[deprecated] Use \"functions add\" instead",
205
+ "summary": "Add a Function to your Blueprint",
232
206
  "enableJsonFlag": true,
233
207
  "needs": [
234
208
  "blueprint"
@@ -237,20 +211,19 @@
237
211
  "relativePath": [
238
212
  "dist",
239
213
  "commands",
240
- "blueprints",
214
+ "functions",
241
215
  "add.js"
242
216
  ]
243
217
  },
244
- "blueprints:config": {
218
+ "functions:build": {
245
219
  "aliases": [],
246
- "args": {},
247
- "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.",
248
- "examples": [
249
- "<%= config.bin %> <%= command.id %>",
250
- "<%= config.bin %> <%= command.id %> --edit",
251
- "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
252
- "<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack <name-or-id>"
253
- ],
220
+ "args": {
221
+ "name": {
222
+ "description": "The name of the Sanity Function",
223
+ "name": "name",
224
+ "required": false
225
+ }
226
+ },
254
227
  "flags": {
255
228
  "json": {
256
229
  "description": "Format output as json",
@@ -293,14 +266,8 @@
293
266
  "type": "boolean"
294
267
  },
295
268
  "stack": {
296
- "aliases": [
297
- "stack-id",
298
- "stackId"
299
- ],
300
- "dependsOn": [
301
- "edit"
302
- ],
303
- "description": "Stack name or ID to set in the configuration. Requires --edit flag",
269
+ "description": "Stack name or ID to use instead of the locally configured Stack",
270
+ "hidden": true,
304
271
  "name": "stack",
305
272
  "hasDynamicHelp": false,
306
273
  "multiple": false,
@@ -311,13 +278,11 @@
311
278
  "project",
312
279
  "projectId"
313
280
  ],
314
- "dependsOn": [
315
- "edit"
316
- ],
317
281
  "description": "Sanity project ID used to scope Blueprint and Stack",
318
282
  "exclusive": [
319
283
  "organization-id"
320
284
  ],
285
+ "hidden": true,
321
286
  "name": "project-id",
322
287
  "hasDynamicHelp": false,
323
288
  "multiple": false,
@@ -329,59 +294,70 @@
329
294
  "organizationId",
330
295
  "org"
331
296
  ],
332
- "dependsOn": [
333
- "edit"
334
- ],
335
297
  "description": "Sanity organization ID used to scope Blueprint and Stack",
336
298
  "exclusive": [
337
299
  "project-id"
338
300
  ],
301
+ "hidden": true,
339
302
  "name": "organization-id",
340
303
  "hasDynamicHelp": false,
341
304
  "multiple": false,
342
305
  "type": "option"
343
306
  },
344
- "edit": {
345
- "char": "e",
346
- "description": "Modify the configuration interactively, or directly when combined with ID flags.",
347
- "name": "edit",
348
- "allowNo": false,
349
- "type": "boolean"
307
+ "fn-installer": {
308
+ "aliases": [
309
+ "function-installer",
310
+ "installer"
311
+ ],
312
+ "description": "Which package manager to use when building Functions",
313
+ "hidden": true,
314
+ "name": "fn-installer",
315
+ "hasDynamicHelp": false,
316
+ "multiple": false,
317
+ "options": [
318
+ "npm",
319
+ "pnpm",
320
+ "yarn"
321
+ ],
322
+ "type": "option"
323
+ },
324
+ "out-dir": {
325
+ "char": "o",
326
+ "description": "Output directory for zip files",
327
+ "name": "out-dir",
328
+ "hasDynamicHelp": false,
329
+ "multiple": false,
330
+ "type": "option"
350
331
  }
351
332
  },
352
333
  "hasDynamicHelp": false,
334
+ "hidden": true,
353
335
  "hiddenAliases": [],
354
- "id": "blueprints:config",
336
+ "id": "functions:build",
355
337
  "pluginAlias": "@sanity/runtime-cli",
356
338
  "pluginName": "@sanity/runtime-cli",
357
339
  "pluginType": "core",
358
340
  "strict": true,
359
- "summary": "View or edit the local Blueprint configuration",
341
+ "summary": "Build Sanity Function(s) to zip archives",
360
342
  "enableJsonFlag": true,
361
343
  "needs": [
362
- "token",
363
344
  "blueprint"
364
345
  ],
365
346
  "isESM": true,
366
347
  "relativePath": [
367
348
  "dist",
368
349
  "commands",
369
- "blueprints",
370
- "config.js"
350
+ "functions",
351
+ "build.js"
371
352
  ]
372
353
  },
373
- "blueprints:deploy": {
354
+ "functions:dev": {
374
355
  "aliases": [],
375
356
  "args": {},
376
- "description": "Applies your local Blueprint to the remote Stack, creating, updating, or removing resources as needed. This is the primary command for applying infrastructure changes.\n\nBefore deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack status or 'blueprints logs' to monitor activity.\n\nUse --no-wait to queue the deployment and return immediately without waiting for completion.\n\nUse --fn-installer to force which package manager to use when deploying functions.\n\nSet SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
357
+ "description": "Runs a local, web-based development server to test your functions before deploying.\n\nOpen the emulator in your browser to interactively test your functions with the payload editor.\n\nOptionally, set the host and port with the --host and --port flags. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
377
358
  "examples": [
378
- "<%= config.bin %> <%= command.id %>",
379
- "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
380
- "<%= config.bin %> <%= command.id %> --no-wait",
381
- "<%= config.bin %> <%= command.id %> --fn-installer npm",
382
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
383
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>",
384
- "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
359
+ "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974",
360
+ "<%= config.bin %> <%= command.id %> --timeout 60"
385
361
  ],
386
362
  "flags": {
387
363
  "json": {
@@ -426,6 +402,7 @@
426
402
  },
427
403
  "stack": {
428
404
  "description": "Stack name or ID to use instead of the locally configured Stack",
405
+ "hidden": true,
429
406
  "name": "stack",
430
407
  "hasDynamicHelp": false,
431
408
  "multiple": false,
@@ -440,6 +417,7 @@
440
417
  "exclusive": [
441
418
  "organization-id"
442
419
  ],
420
+ "hidden": true,
443
421
  "name": "project-id",
444
422
  "hasDynamicHelp": false,
445
423
  "multiple": false,
@@ -455,45 +433,35 @@
455
433
  "exclusive": [
456
434
  "project-id"
457
435
  ],
436
+ "hidden": true,
458
437
  "name": "organization-id",
459
438
  "hasDynamicHelp": false,
460
439
  "multiple": false,
461
440
  "type": "option"
462
441
  },
463
- "message": {
464
- "char": "m",
465
- "description": "Message describing the deployment (e.g. reason for change)",
466
- "name": "message",
442
+ "host": {
443
+ "char": "h",
444
+ "description": "The local network interface at which to listen. [default: \"localhost\"]",
445
+ "name": "host",
446
+ "required": false,
467
447
  "hasDynamicHelp": false,
468
448
  "multiple": false,
469
449
  "type": "option"
470
450
  },
471
- "fn-installer": {
472
- "aliases": [
473
- "function-installer",
474
- "installer"
475
- ],
476
- "description": "Which package manager to use when installing Function dependencies",
477
- "hidden": true,
478
- "name": "fn-installer",
451
+ "port": {
452
+ "char": "p",
453
+ "description": "TCP port to start emulator on. [default: 8080]",
454
+ "name": "port",
455
+ "required": false,
479
456
  "hasDynamicHelp": false,
480
457
  "multiple": false,
481
- "options": [
482
- "npm",
483
- "pnpm",
484
- "yarn"
485
- ],
486
458
  "type": "option"
487
459
  },
488
- "no-wait": {
489
- "description": "Do not wait for Stack deployment to complete",
490
- "name": "no-wait",
491
- "allowNo": false,
492
- "type": "boolean"
493
- },
494
- "new-stack-name": {
495
- "description": "Set a new name for the Stack",
496
- "name": "new-stack-name",
460
+ "timeout": {
461
+ "char": "t",
462
+ "description": "Maximum execution time for all functions, in seconds. Takes precedence over function-specific `timeout`",
463
+ "name": "timeout",
464
+ "required": false,
497
465
  "hasDynamicHelp": false,
498
466
  "multiple": false,
499
467
  "type": "option"
@@ -501,32 +469,39 @@
501
469
  },
502
470
  "hasDynamicHelp": false,
503
471
  "hiddenAliases": [],
504
- "id": "blueprints:deploy",
472
+ "id": "functions:dev",
505
473
  "pluginAlias": "@sanity/runtime-cli",
506
474
  "pluginName": "@sanity/runtime-cli",
507
475
  "pluginType": "core",
508
476
  "strict": true,
509
- "summary": "Deploy the local Blueprint to the remote Stack",
477
+ "summary": "Start the Sanity Function emulator",
510
478
  "enableJsonFlag": true,
511
479
  "needs": [
512
- "deployedStack",
513
480
  "blueprint"
514
481
  ],
515
482
  "isESM": true,
516
483
  "relativePath": [
517
484
  "dist",
518
485
  "commands",
519
- "blueprints",
520
- "deploy.js"
486
+ "functions",
487
+ "dev.js"
521
488
  ]
522
489
  },
523
- "blueprints:destroy": {
490
+ "functions:logs": {
524
491
  "aliases": [],
525
- "args": {},
526
- "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).",
492
+ "args": {
493
+ "name": {
494
+ "description": "The name of the Sanity Function",
495
+ "name": "name",
496
+ "required": false
497
+ }
498
+ },
499
+ "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).",
527
500
  "examples": [
528
- "<%= config.bin %> <%= command.id %>",
529
- "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
501
+ "<%= config.bin %> <%= command.id %> <name>",
502
+ "<%= config.bin %> <%= command.id %> <name> --json",
503
+ "<%= config.bin %> <%= command.id %> <name> --limit 100",
504
+ "<%= config.bin %> <%= command.id %> <name> --delete"
530
505
  ],
531
506
  "flags": {
532
507
  "json": {
@@ -570,11 +545,7 @@
570
545
  "type": "boolean"
571
546
  },
572
547
  "stack": {
573
- "aliases": [
574
- "stack-id",
575
- "stackId"
576
- ],
577
- "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
548
+ "description": "Stack name or ID to use instead of the locally configured Stack",
578
549
  "name": "stack",
579
550
  "hasDynamicHelp": false,
580
551
  "multiple": false,
@@ -585,14 +556,11 @@
585
556
  "project",
586
557
  "projectId"
587
558
  ],
588
- "dependsOn": [
589
- "stack",
590
- "force"
591
- ],
592
559
  "description": "Sanity project ID used to scope Blueprint and Stack",
593
560
  "exclusive": [
594
561
  "organization-id"
595
562
  ],
563
+ "hidden": true,
596
564
  "name": "project-id",
597
565
  "hasDynamicHelp": false,
598
566
  "multiple": false,
@@ -604,62 +572,104 @@
604
572
  "organizationId",
605
573
  "org"
606
574
  ],
607
- "dependsOn": [
608
- "stack",
609
- "force"
610
- ],
611
575
  "description": "Sanity organization ID used to scope Blueprint and Stack",
612
576
  "exclusive": [
613
577
  "project-id"
614
578
  ],
579
+ "hidden": true,
615
580
  "name": "organization-id",
616
581
  "hasDynamicHelp": false,
617
582
  "multiple": false,
618
583
  "type": "option"
619
584
  },
620
- "force": {
621
- "aliases": [
622
- "f"
623
- ],
624
- "description": "Force Stack destruction (skip confirmation)",
625
- "name": "force",
626
- "allowNo": false,
627
- "type": "boolean"
628
- },
629
- "no-wait": {
630
- "description": "Do not wait for Stack destruction to complete",
631
- "name": "no-wait",
585
+ "limit": {
586
+ "char": "l",
587
+ "description": "Total number of log entries to retrieve",
588
+ "name": "limit",
589
+ "required": false,
590
+ "default": 50,
591
+ "hasDynamicHelp": false,
592
+ "multiple": false,
593
+ "type": "option"
594
+ },
595
+ "utc": {
596
+ "char": "u",
597
+ "description": "Show dates in UTC time zone",
598
+ "name": "utc",
599
+ "required": false,
600
+ "allowNo": false,
601
+ "type": "boolean"
602
+ },
603
+ "delete": {
604
+ "char": "d",
605
+ "description": "Delete all logs for the function",
606
+ "exclusive": [
607
+ "limit",
608
+ "json"
609
+ ],
610
+ "name": "delete",
611
+ "required": false,
612
+ "allowNo": false,
613
+ "type": "boolean"
614
+ },
615
+ "force": {
616
+ "char": "f",
617
+ "dependsOn": [
618
+ "delete"
619
+ ],
620
+ "description": "Skip confirmation for deleting logs",
621
+ "name": "force",
622
+ "required": false,
623
+ "allowNo": false,
624
+ "type": "boolean"
625
+ },
626
+ "watch": {
627
+ "aliases": [
628
+ "follow"
629
+ ],
630
+ "char": "w",
631
+ "description": "Watch for new logs (streaming mode)",
632
+ "name": "watch",
632
633
  "allowNo": false,
633
634
  "type": "boolean"
634
635
  }
635
636
  },
636
637
  "hasDynamicHelp": false,
637
638
  "hiddenAliases": [],
638
- "id": "blueprints:destroy",
639
+ "id": "functions:logs",
639
640
  "pluginAlias": "@sanity/runtime-cli",
640
641
  "pluginName": "@sanity/runtime-cli",
641
642
  "pluginType": "core",
642
643
  "strict": true,
643
- "summary": "Destroy a remote Stack deployment and its resources",
644
+ "summary": "Retrieve or delete logs for a Sanity Function",
644
645
  "enableJsonFlag": true,
645
646
  "needs": [
646
- "scope"
647
+ "deployedStack",
648
+ "blueprint"
647
649
  ],
648
650
  "isESM": true,
649
651
  "relativePath": [
650
652
  "dist",
651
653
  "commands",
652
- "blueprints",
653
- "destroy.js"
654
+ "functions",
655
+ "logs.js"
654
656
  ]
655
657
  },
656
- "blueprints:doctor": {
658
+ "functions:test": {
657
659
  "aliases": [],
658
- "args": {},
659
- "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.",
660
+ "args": {
661
+ "name": {
662
+ "description": "The name of the Sanity Function",
663
+ "name": "name",
664
+ "required": false
665
+ }
666
+ },
667
+ "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.",
660
668
  "examples": [
661
- "<%= config.bin %> <%= command.id %>",
662
- "<%= config.bin %> <%= command.id %> --fix"
669
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }'",
670
+ "<%= config.bin %> <%= command.id %> <name> --file 'payload.json'",
671
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }' --timeout 60",
672
+ "<%= config.bin %> <%= command.id %> <name> --event update --data-before '{ \"title\": \"before\" }' --data-after '{ \"title\": \"after\" }'"
663
673
  ],
664
674
  "flags": {
665
675
  "json": {
@@ -672,68 +682,321 @@
672
682
  "aliases": [
673
683
  "blueprint-path"
674
684
  ],
675
- "char": "p",
676
- "description": "Path to a Blueprint file or directory containing one",
677
- "env": "SANITY_BLUEPRINT_PATH",
678
- "name": "path",
685
+ "char": "p",
686
+ "description": "Path to a Blueprint file or directory containing one",
687
+ "env": "SANITY_BLUEPRINT_PATH",
688
+ "hidden": true,
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
+ "stack": {
716
+ "description": "Stack name or ID to use instead of the locally configured Stack",
717
+ "hidden": true,
718
+ "name": "stack",
719
+ "hasDynamicHelp": false,
720
+ "multiple": false,
721
+ "type": "option"
722
+ },
723
+ "project-id": {
724
+ "aliases": [
725
+ "project",
726
+ "projectId"
727
+ ],
728
+ "description": "Sanity project ID used to scope Blueprint and Stack",
729
+ "exclusive": [
730
+ "organization-id"
731
+ ],
732
+ "name": "project-id",
733
+ "hasDynamicHelp": false,
734
+ "multiple": false,
735
+ "type": "option"
736
+ },
737
+ "organization-id": {
738
+ "aliases": [
739
+ "organization",
740
+ "organizationId",
741
+ "org"
742
+ ],
743
+ "description": "Sanity organization ID used to scope Blueprint and Stack",
744
+ "exclusive": [
745
+ "project-id"
746
+ ],
747
+ "name": "organization-id",
748
+ "hasDynamicHelp": false,
749
+ "multiple": false,
750
+ "type": "option"
751
+ },
752
+ "data": {
753
+ "char": "d",
754
+ "description": "Data to send to the function",
755
+ "exclusive": [
756
+ "file",
757
+ "document-id"
758
+ ],
759
+ "name": "data",
760
+ "required": false,
761
+ "hasDynamicHelp": false,
762
+ "multiple": false,
763
+ "type": "option"
764
+ },
765
+ "data-before": {
766
+ "description": "Original document",
767
+ "exclusive": [
768
+ "data",
769
+ "file",
770
+ "document-id",
771
+ "file-before",
772
+ "file-after",
773
+ "document-id-before",
774
+ "document-id-after"
775
+ ],
776
+ "name": "data-before",
777
+ "required": false,
778
+ "hasDynamicHelp": false,
779
+ "multiple": false,
780
+ "type": "option"
781
+ },
782
+ "data-after": {
783
+ "description": "Current document",
784
+ "exclusive": [
785
+ "data",
786
+ "file",
787
+ "document-id",
788
+ "file-before",
789
+ "file-after",
790
+ "document-id-before",
791
+ "document-id-after"
792
+ ],
793
+ "name": "data-after",
794
+ "required": false,
795
+ "hasDynamicHelp": false,
796
+ "multiple": false,
797
+ "type": "option"
798
+ },
799
+ "event": {
800
+ "char": "e",
801
+ "description": "Type of event (create, update, delete)",
802
+ "name": "event",
803
+ "required": false,
804
+ "hasDynamicHelp": false,
805
+ "multiple": false,
806
+ "options": [
807
+ "create",
808
+ "update",
809
+ "delete"
810
+ ],
811
+ "type": "option"
812
+ },
813
+ "file": {
814
+ "char": "f",
815
+ "description": "Read data from file and send to the function",
816
+ "exclusive": [
817
+ "data",
818
+ "document-id"
819
+ ],
820
+ "name": "file",
821
+ "required": false,
822
+ "hasDynamicHelp": false,
823
+ "multiple": false,
824
+ "type": "option"
825
+ },
826
+ "file-before": {
827
+ "description": "Original document",
828
+ "exclusive": [
829
+ "data",
830
+ "file",
831
+ "document-id",
832
+ "data-before",
833
+ "data-after",
834
+ "document-id-before",
835
+ "document-id-after"
836
+ ],
837
+ "name": "file-before",
838
+ "required": false,
839
+ "hasDynamicHelp": false,
840
+ "multiple": false,
841
+ "type": "option"
842
+ },
843
+ "file-after": {
844
+ "description": "Current document",
845
+ "exclusive": [
846
+ "data",
847
+ "file",
848
+ "document-id",
849
+ "data-before",
850
+ "data-after",
851
+ "document-id-before",
852
+ "document-id-after"
853
+ ],
854
+ "name": "file-after",
855
+ "required": false,
856
+ "hasDynamicHelp": false,
857
+ "multiple": false,
858
+ "type": "option"
859
+ },
860
+ "timeout": {
861
+ "char": "t",
862
+ "description": "Execution timeout value in seconds",
863
+ "name": "timeout",
864
+ "required": false,
865
+ "hasDynamicHelp": false,
866
+ "multiple": false,
867
+ "type": "option"
868
+ },
869
+ "api": {
870
+ "char": "a",
871
+ "description": "Sanity API Version to use",
872
+ "name": "api",
873
+ "required": false,
874
+ "hasDynamicHelp": false,
875
+ "multiple": false,
876
+ "type": "option"
877
+ },
878
+ "dataset": {
879
+ "description": "The Sanity dataset to use",
880
+ "name": "dataset",
881
+ "required": false,
882
+ "hasDynamicHelp": false,
883
+ "multiple": false,
884
+ "type": "option"
885
+ },
886
+ "document-id": {
887
+ "aliases": [
888
+ "doc",
889
+ "documentId"
890
+ ],
891
+ "description": "Document to fetch and send to function",
892
+ "exclusive": [
893
+ "data",
894
+ "file"
895
+ ],
896
+ "name": "document-id",
897
+ "required": false,
898
+ "hasDynamicHelp": false,
899
+ "multiple": false,
900
+ "type": "option"
901
+ },
902
+ "document-id-before": {
903
+ "description": "Original document",
904
+ "exclusive": [
905
+ "data",
906
+ "file",
907
+ "document-id",
908
+ "data-before",
909
+ "data-after",
910
+ "file-before",
911
+ "file-after"
912
+ ],
913
+ "name": "document-id-before",
914
+ "required": false,
915
+ "hasDynamicHelp": false,
916
+ "multiple": false,
917
+ "type": "option"
918
+ },
919
+ "document-id-after": {
920
+ "description": "Current document",
921
+ "exclusive": [
922
+ "data",
923
+ "file",
924
+ "document-id",
925
+ "data-before",
926
+ "data-after",
927
+ "file-before",
928
+ "file-after"
929
+ ],
930
+ "name": "document-id-after",
931
+ "required": false,
679
932
  "hasDynamicHelp": false,
680
933
  "multiple": false,
681
934
  "type": "option"
682
935
  },
683
- "trace": {
684
- "description": "Trace output",
685
- "hidden": true,
686
- "name": "trace",
687
- "allowNo": false,
688
- "type": "boolean"
689
- },
690
- "validate-resources": {
691
- "description": "Validate resources",
692
- "hidden": true,
693
- "name": "validate-resources",
694
- "allowNo": true,
695
- "type": "boolean"
696
- },
697
- "verbose": {
698
- "description": "Verbose output",
699
- "hidden": true,
700
- "name": "verbose",
936
+ "with-user-token": {
937
+ "description": "Prime access token from CLI config",
938
+ "name": "with-user-token",
701
939
  "allowNo": false,
702
940
  "type": "boolean"
703
941
  },
704
- "fix": {
705
- "description": "Interactively fix configuration issues",
706
- "name": "fix",
707
- "allowNo": false,
708
- "type": "boolean"
942
+ "media-library-id": {
943
+ "aliases": [
944
+ "media"
945
+ ],
946
+ "description": "Sanity Media Library ID to use",
947
+ "exclusive": [
948
+ "project-id",
949
+ "dataset"
950
+ ],
951
+ "name": "media-library-id",
952
+ "required": false,
953
+ "hasDynamicHelp": false,
954
+ "multiple": false,
955
+ "type": "option"
709
956
  }
710
957
  },
711
958
  "hasDynamicHelp": false,
712
959
  "hiddenAliases": [],
713
- "id": "blueprints:doctor",
960
+ "id": "functions:test",
714
961
  "pluginAlias": "@sanity/runtime-cli",
715
962
  "pluginName": "@sanity/runtime-cli",
716
963
  "pluginType": "core",
717
964
  "strict": true,
718
- "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
965
+ "summary": "Invoke a local Sanity Function",
719
966
  "enableJsonFlag": true,
967
+ "needs": [
968
+ "blueprint"
969
+ ],
720
970
  "isESM": true,
721
971
  "relativePath": [
722
972
  "dist",
723
973
  "commands",
724
- "blueprints",
725
- "doctor.js"
974
+ "functions",
975
+ "test.js"
726
976
  ]
727
977
  },
728
- "blueprints:info": {
978
+ "blueprints:add": {
729
979
  "aliases": [],
730
- "args": {},
731
- "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.",
980
+ "args": {
981
+ "type": {
982
+ "description": "Type of resource to add (only \"function\" is supported)",
983
+ "name": "type",
984
+ "options": [
985
+ "function"
986
+ ],
987
+ "required": true
988
+ }
989
+ },
990
+ "deprecationOptions": {
991
+ "to": "functions add"
992
+ },
993
+ "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",
732
994
  "examples": [
733
- "<%= config.bin %> <%= command.id %>",
734
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
735
- "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
736
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
995
+ "<%= config.bin %> <%= command.id %> function",
996
+ "<%= config.bin %> <%= command.id %> function --helpers",
997
+ "<%= config.bin %> <%= command.id %> function --name my-function",
998
+ "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create",
999
+ "<%= config.bin %> <%= command.id %> function --name my-function --fn-type document-create --fn-type document-update --lang js"
737
1000
  ],
738
1001
  "flags": {
739
1002
  "json": {
@@ -777,10 +1040,8 @@
777
1040
  "type": "boolean"
778
1041
  },
779
1042
  "stack": {
780
- "aliases": [
781
- "id"
782
- ],
783
- "description": "Stack name or ID",
1043
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1044
+ "hidden": true,
784
1045
  "name": "stack",
785
1046
  "hasDynamicHelp": false,
786
1047
  "multiple": false,
@@ -795,6 +1056,7 @@
795
1056
  "exclusive": [
796
1057
  "organization-id"
797
1058
  ],
1059
+ "hidden": true,
798
1060
  "name": "project-id",
799
1061
  "hasDynamicHelp": false,
800
1062
  "multiple": false,
@@ -810,52 +1072,159 @@
810
1072
  "exclusive": [
811
1073
  "project-id"
812
1074
  ],
1075
+ "hidden": true,
813
1076
  "name": "organization-id",
814
1077
  "hasDynamicHelp": false,
815
1078
  "multiple": false,
816
1079
  "type": "option"
1080
+ },
1081
+ "example": {
1082
+ "aliases": [
1083
+ "recipe"
1084
+ ],
1085
+ "description": "Example to use for the function resource. Discover examples at https://www.sanity.io/exchange/type=recipes/by=sanity",
1086
+ "exclusive": [
1087
+ "name",
1088
+ "fn-type",
1089
+ "language",
1090
+ "javascript",
1091
+ "fn-helpers",
1092
+ "fn-installer"
1093
+ ],
1094
+ "name": "example",
1095
+ "hasDynamicHelp": false,
1096
+ "multiple": false,
1097
+ "type": "option"
1098
+ },
1099
+ "name": {
1100
+ "char": "n",
1101
+ "description": "Name of the resource to add",
1102
+ "name": "name",
1103
+ "hasDynamicHelp": false,
1104
+ "multiple": false,
1105
+ "type": "option"
1106
+ },
1107
+ "fn-type": {
1108
+ "aliases": [
1109
+ "function-type"
1110
+ ],
1111
+ "dependsOn": [
1112
+ "name"
1113
+ ],
1114
+ "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
1115
+ "name": "fn-type",
1116
+ "hasDynamicHelp": false,
1117
+ "multiple": true,
1118
+ "options": [
1119
+ "document-publish",
1120
+ "document-create",
1121
+ "document-delete",
1122
+ "document-update",
1123
+ "media-library-asset-create",
1124
+ "media-library-asset-delete",
1125
+ "media-library-asset-update",
1126
+ "scheduled-function",
1127
+ "sync-tag-invalidate"
1128
+ ],
1129
+ "type": "option"
1130
+ },
1131
+ "language": {
1132
+ "aliases": [
1133
+ "function-language",
1134
+ "fn-language",
1135
+ "lang"
1136
+ ],
1137
+ "description": "Language of the new function",
1138
+ "name": "language",
1139
+ "default": "ts",
1140
+ "hasDynamicHelp": false,
1141
+ "multiple": false,
1142
+ "options": [
1143
+ "ts",
1144
+ "js"
1145
+ ],
1146
+ "type": "option"
1147
+ },
1148
+ "javascript": {
1149
+ "aliases": [
1150
+ "js"
1151
+ ],
1152
+ "description": "Use JavaScript instead of TypeScript",
1153
+ "exclusive": [
1154
+ "language"
1155
+ ],
1156
+ "name": "javascript",
1157
+ "allowNo": false,
1158
+ "type": "boolean"
1159
+ },
1160
+ "fn-helpers": {
1161
+ "aliases": [
1162
+ "function-helpers",
1163
+ "helpers"
1164
+ ],
1165
+ "description": "Add helpers to the new function",
1166
+ "name": "fn-helpers",
1167
+ "allowNo": true,
1168
+ "type": "boolean"
1169
+ },
1170
+ "fn-installer": {
1171
+ "aliases": [
1172
+ "function-installer",
1173
+ "installer"
1174
+ ],
1175
+ "description": "Which package manager to use when installing the @sanity/functions helpers",
1176
+ "name": "fn-installer",
1177
+ "hasDynamicHelp": false,
1178
+ "multiple": false,
1179
+ "options": [
1180
+ "skip",
1181
+ "npm",
1182
+ "pnpm",
1183
+ "yarn"
1184
+ ],
1185
+ "type": "option"
1186
+ },
1187
+ "install": {
1188
+ "char": "i",
1189
+ "description": "Shortcut for --fn-installer npm",
1190
+ "exclusive": [
1191
+ "fn-installer"
1192
+ ],
1193
+ "name": "install",
1194
+ "allowNo": false,
1195
+ "type": "boolean"
817
1196
  }
818
1197
  },
819
1198
  "hasDynamicHelp": false,
820
1199
  "hiddenAliases": [],
821
- "id": "blueprints:info",
1200
+ "id": "blueprints:add",
822
1201
  "pluginAlias": "@sanity/runtime-cli",
823
1202
  "pluginName": "@sanity/runtime-cli",
824
1203
  "pluginType": "core",
1204
+ "state": "deprecated",
825
1205
  "strict": true,
826
- "summary": "Display the status and resources of the remote Stack deployment",
1206
+ "summary": "[deprecated] Use \"functions add\" instead",
827
1207
  "enableJsonFlag": true,
828
1208
  "needs": [
829
- "deployedStack"
1209
+ "blueprint"
830
1210
  ],
831
1211
  "isESM": true,
832
1212
  "relativePath": [
833
1213
  "dist",
834
1214
  "commands",
835
1215
  "blueprints",
836
- "info.js"
1216
+ "add.js"
837
1217
  ]
838
1218
  },
839
- "blueprints:init": {
1219
+ "blueprints:config": {
840
1220
  "aliases": [],
841
- "args": {
842
- "dir": {
843
- "description": "Directory to create the local Blueprint in (defaults to the current directory)",
844
- "name": "dir"
845
- }
846
- },
847
- "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
1221
+ "args": {},
1222
+ "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.",
848
1223
  "examples": [
849
1224
  "<%= config.bin %> <%= command.id %>",
850
- "<%= config.bin %> <%= command.id %> .",
851
- "<%= config.bin %> <%= command.id %> [directory]",
852
- "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
853
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
854
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
855
- "<%= config.bin %> <%= command.id %> --stack-name <newStackName>",
856
- "<%= config.bin %> <%= command.id %> --stack-id <existingStackId>",
857
- "<%= config.bin %> <%= command.id %> new-stack --type <json|js|ts> --org <organizationId> --name <newStackName>",
858
- "<%= config.bin %> <%= command.id %> old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>"
1225
+ "<%= config.bin %> <%= command.id %> --edit",
1226
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId>",
1227
+ "<%= config.bin %> <%= command.id %> --edit --project-id <projectId> --stack <name-or-id>"
859
1228
  ],
860
1229
  "flags": {
861
1230
  "json": {
@@ -894,45 +1263,22 @@
894
1263
  "verbose": {
895
1264
  "description": "Verbose output",
896
1265
  "hidden": true,
897
- "name": "verbose",
898
- "allowNo": false,
899
- "type": "boolean"
900
- },
901
- "dir": {
902
- "description": "Directory to create the local Blueprint in",
903
- "name": "dir",
904
- "hasDynamicHelp": false,
905
- "multiple": false,
906
- "type": "option"
1266
+ "name": "verbose",
1267
+ "allowNo": false,
1268
+ "type": "boolean"
907
1269
  },
908
- "example": {
1270
+ "stack": {
909
1271
  "aliases": [
910
- "recipe"
911
- ],
912
- "description": "Example to use for the local Blueprint",
913
- "exclusive": [
914
- "blueprint-type",
915
1272
  "stack-id",
916
- "stack-name"
1273
+ "stackId"
917
1274
  ],
918
- "name": "example",
919
- "hasDynamicHelp": false,
920
- "multiple": false,
921
- "type": "option"
922
- },
923
- "blueprint-type": {
924
- "aliases": [
925
- "type"
1275
+ "dependsOn": [
1276
+ "edit"
926
1277
  ],
927
- "description": "Blueprint manifest type to use for the local Blueprint",
928
- "name": "blueprint-type",
1278
+ "description": "Stack name or ID to set in the configuration. Requires --edit flag",
1279
+ "name": "stack",
929
1280
  "hasDynamicHelp": false,
930
1281
  "multiple": false,
931
- "options": [
932
- "json",
933
- "js",
934
- "ts"
935
- ],
936
1282
  "type": "option"
937
1283
  },
938
1284
  "project-id": {
@@ -940,6 +1286,9 @@
940
1286
  "project",
941
1287
  "projectId"
942
1288
  ],
1289
+ "dependsOn": [
1290
+ "edit"
1291
+ ],
943
1292
  "description": "Sanity project ID used to scope Blueprint and Stack",
944
1293
  "exclusive": [
945
1294
  "organization-id"
@@ -955,6 +1304,9 @@
955
1304
  "organizationId",
956
1305
  "org"
957
1306
  ],
1307
+ "dependsOn": [
1308
+ "edit"
1309
+ ],
958
1310
  "description": "Sanity organization ID used to scope Blueprint and Stack",
959
1311
  "exclusive": [
960
1312
  "project-id"
@@ -964,79 +1316,47 @@
964
1316
  "multiple": false,
965
1317
  "type": "option"
966
1318
  },
967
- "stack-id": {
968
- "aliases": [
969
- "stackId"
970
- ],
971
- "description": "Existing Stack ID used to scope local Blueprint",
972
- "exclusive": [
973
- "stack-name"
974
- ],
975
- "name": "stack-id",
976
- "relationships": [
977
- {
978
- "type": "some",
979
- "flags": [
980
- "project-id",
981
- "organization-id"
982
- ]
983
- }
984
- ],
985
- "hasDynamicHelp": false,
986
- "multiple": false,
987
- "type": "option"
988
- },
989
- "stack-name": {
990
- "aliases": [
991
- "name"
992
- ],
993
- "description": "Name to use for a new Stack provisioned during initialization",
994
- "exclusive": [
995
- "stack-id"
996
- ],
997
- "name": "stack-name",
998
- "relationships": [
999
- {
1000
- "type": "some",
1001
- "flags": [
1002
- "project-id",
1003
- "organization-id"
1004
- ]
1005
- }
1006
- ],
1007
- "hasDynamicHelp": false,
1008
- "multiple": false,
1009
- "type": "option"
1319
+ "edit": {
1320
+ "char": "e",
1321
+ "description": "Modify the configuration interactively, or directly when combined with ID flags.",
1322
+ "name": "edit",
1323
+ "allowNo": false,
1324
+ "type": "boolean"
1010
1325
  }
1011
1326
  },
1012
1327
  "hasDynamicHelp": false,
1013
1328
  "hiddenAliases": [],
1014
- "id": "blueprints:init",
1329
+ "id": "blueprints:config",
1015
1330
  "pluginAlias": "@sanity/runtime-cli",
1016
1331
  "pluginName": "@sanity/runtime-cli",
1017
1332
  "pluginType": "core",
1018
1333
  "strict": true,
1019
- "summary": "Initialize a Blueprint and create a remote Stack",
1334
+ "summary": "View or edit the local Blueprint configuration",
1020
1335
  "enableJsonFlag": true,
1336
+ "needs": [
1337
+ "token",
1338
+ "blueprint"
1339
+ ],
1021
1340
  "isESM": true,
1022
1341
  "relativePath": [
1023
1342
  "dist",
1024
1343
  "commands",
1025
1344
  "blueprints",
1026
- "init.js"
1345
+ "config.js"
1027
1346
  ]
1028
1347
  },
1029
- "blueprints:logs": {
1348
+ "blueprints:deploy": {
1030
1349
  "aliases": [],
1031
1350
  "args": {},
1032
- "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'.",
1351
+ "description": "Applies your local Blueprint to the remote Stack, creating, updating, or removing resources as needed. This is the primary command for applying infrastructure changes.\n\nBefore deploying, run 'blueprints plan' to preview changes. After deployment, use 'blueprints info' to verify Stack status or 'blueprints logs' to monitor activity.\n\nUse --no-wait to queue the deployment and return immediately without waiting for completion.\n\nUse --fn-installer to force which package manager to use when deploying functions.\n\nSet SANITY_ASSET_TIMEOUT (seconds) to override the 60-second timeout for processing resource assets.\n\nExit codes: 0 deployed, 2 deployment failed, 75 deployment accepted but completion could not be confirmed (rerun 'blueprints info' to check).",
1033
1352
  "examples": [
1034
1353
  "<%= config.bin %> <%= command.id %>",
1035
- "<%= config.bin %> <%= command.id %> --watch",
1354
+ "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
1355
+ "<%= config.bin %> <%= command.id %> --no-wait",
1356
+ "<%= config.bin %> <%= command.id %> --fn-installer npm",
1036
1357
  "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1037
- "<%= config.bin %> <%= command.id %> --limit 500",
1038
- "<%= config.bin %> <%= command.id %> --since 2026-05-01T00:00:00Z",
1039
- "<%= config.bin %> <%= command.id %> --before 2026-05-01T00:00:00Z"
1358
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>",
1359
+ "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1040
1360
  ],
1041
1361
  "flags": {
1042
1362
  "json": {
@@ -1115,43 +1435,40 @@
1115
1435
  "multiple": false,
1116
1436
  "type": "option"
1117
1437
  },
1118
- "watch": {
1119
- "aliases": [
1120
- "follow"
1121
- ],
1122
- "char": "w",
1123
- "description": "Watch for new Stack logs",
1124
- "name": "watch",
1125
- "allowNo": false,
1126
- "type": "boolean"
1127
- },
1128
- "limit": {
1129
- "char": "l",
1130
- "description": "Maximum number of log entries to retrieve (1-500)",
1131
- "exclusive": [
1132
- "watch"
1133
- ],
1134
- "name": "limit",
1438
+ "message": {
1439
+ "char": "m",
1440
+ "description": "Message describing the deployment (e.g. reason for change)",
1441
+ "name": "message",
1135
1442
  "hasDynamicHelp": false,
1136
1443
  "multiple": false,
1137
1444
  "type": "option"
1138
1445
  },
1139
- "since": {
1140
- "description": "Only show logs after this ISO 8601 timestamp",
1141
- "exclusive": [
1142
- "watch"
1446
+ "fn-installer": {
1447
+ "aliases": [
1448
+ "function-installer",
1449
+ "installer"
1143
1450
  ],
1144
- "name": "since",
1451
+ "description": "Which package manager to use when installing Function dependencies",
1452
+ "hidden": true,
1453
+ "name": "fn-installer",
1145
1454
  "hasDynamicHelp": false,
1146
1455
  "multiple": false,
1456
+ "options": [
1457
+ "npm",
1458
+ "pnpm",
1459
+ "yarn"
1460
+ ],
1147
1461
  "type": "option"
1148
1462
  },
1149
- "before": {
1150
- "description": "Only show logs before this ISO 8601 timestamp",
1151
- "exclusive": [
1152
- "watch"
1153
- ],
1154
- "name": "before",
1463
+ "no-wait": {
1464
+ "description": "Do not wait for Stack deployment to complete",
1465
+ "name": "no-wait",
1466
+ "allowNo": false,
1467
+ "type": "boolean"
1468
+ },
1469
+ "new-stack-name": {
1470
+ "description": "Set a new name for the Stack",
1471
+ "name": "new-stack-name",
1155
1472
  "hasDynamicHelp": false,
1156
1473
  "multiple": false,
1157
1474
  "type": "option"
@@ -1159,36 +1476,32 @@
1159
1476
  },
1160
1477
  "hasDynamicHelp": false,
1161
1478
  "hiddenAliases": [],
1162
- "id": "blueprints:logs",
1479
+ "id": "blueprints:deploy",
1163
1480
  "pluginAlias": "@sanity/runtime-cli",
1164
1481
  "pluginName": "@sanity/runtime-cli",
1165
1482
  "pluginType": "core",
1166
1483
  "strict": true,
1167
- "summary": "Display logs for the current Blueprint's Stack deployment",
1484
+ "summary": "Deploy the local Blueprint to the remote Stack",
1168
1485
  "enableJsonFlag": true,
1169
1486
  "needs": [
1170
- "deployedStack"
1487
+ "deployedStack",
1488
+ "blueprint"
1171
1489
  ],
1172
1490
  "isESM": true,
1173
1491
  "relativePath": [
1174
1492
  "dist",
1175
1493
  "commands",
1176
1494
  "blueprints",
1177
- "logs.js"
1495
+ "deploy.js"
1178
1496
  ]
1179
1497
  },
1180
- "blueprints:mint-deploy-token": {
1498
+ "blueprints:destroy": {
1181
1499
  "aliases": [],
1182
1500
  "args": {},
1183
- "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.",
1501
+ "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).",
1184
1502
  "examples": [
1185
1503
  "<%= config.bin %> <%= command.id %>",
1186
- "<%= config.bin %> <%= command.id %> --label \"ci-deploy\"",
1187
- "<%= config.bin %> <%= command.id %> --print",
1188
- "export SANITY_AUTH_TOKEN=$(<%= config.bin %> <%= command.id %> --print)",
1189
- "<%= config.bin %> <%= command.id %> --json",
1190
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1191
- "<%= config.bin %> <%= command.id %> --organization-id <orgId>"
1504
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
1192
1505
  ],
1193
1506
  "flags": {
1194
1507
  "json": {
@@ -1232,8 +1545,11 @@
1232
1545
  "type": "boolean"
1233
1546
  },
1234
1547
  "stack": {
1235
- "description": "Stack name or ID to use instead of the locally configured Stack",
1236
- "hidden": true,
1548
+ "aliases": [
1549
+ "stack-id",
1550
+ "stackId"
1551
+ ],
1552
+ "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
1237
1553
  "name": "stack",
1238
1554
  "hasDynamicHelp": false,
1239
1555
  "multiple": false,
@@ -1244,6 +1560,10 @@
1244
1560
  "project",
1245
1561
  "projectId"
1246
1562
  ],
1563
+ "dependsOn": [
1564
+ "stack",
1565
+ "force"
1566
+ ],
1247
1567
  "description": "Sanity project ID used to scope Blueprint and Stack",
1248
1568
  "exclusive": [
1249
1569
  "organization-id"
@@ -1259,6 +1579,10 @@
1259
1579
  "organizationId",
1260
1580
  "org"
1261
1581
  ],
1582
+ "dependsOn": [
1583
+ "stack",
1584
+ "force"
1585
+ ],
1262
1586
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1263
1587
  "exclusive": [
1264
1588
  "project-id"
@@ -1268,32 +1592,30 @@
1268
1592
  "multiple": false,
1269
1593
  "type": "option"
1270
1594
  },
1271
- "label": {
1272
- "description": "Human-readable label for the robot. Defaults to a generated value.",
1273
- "name": "label",
1274
- "hasDynamicHelp": false,
1275
- "multiple": false,
1276
- "type": "option"
1277
- },
1278
- "print": {
1279
- "char": "P",
1280
- "description": "Print only the raw token to stdout (suitable for shell substitution)",
1281
- "exclusive": [
1282
- "json"
1595
+ "force": {
1596
+ "aliases": [
1597
+ "f"
1283
1598
  ],
1284
- "name": "print",
1599
+ "description": "Force Stack destruction (skip confirmation)",
1600
+ "name": "force",
1601
+ "allowNo": false,
1602
+ "type": "boolean"
1603
+ },
1604
+ "no-wait": {
1605
+ "description": "Do not wait for Stack destruction to complete",
1606
+ "name": "no-wait",
1285
1607
  "allowNo": false,
1286
1608
  "type": "boolean"
1287
1609
  }
1288
1610
  },
1289
1611
  "hasDynamicHelp": false,
1290
1612
  "hiddenAliases": [],
1291
- "id": "blueprints:mint-deploy-token",
1613
+ "id": "blueprints:destroy",
1292
1614
  "pluginAlias": "@sanity/runtime-cli",
1293
1615
  "pluginName": "@sanity/runtime-cli",
1294
1616
  "pluginType": "core",
1295
1617
  "strict": true,
1296
- "summary": "Create a robot API token for deploying Blueprints from CI/CD",
1618
+ "summary": "Destroy a remote Stack deployment and its resources",
1297
1619
  "enableJsonFlag": true,
1298
1620
  "needs": [
1299
1621
  "scope"
@@ -1303,17 +1625,16 @@
1303
1625
  "dist",
1304
1626
  "commands",
1305
1627
  "blueprints",
1306
- "mint-deploy-token.js"
1628
+ "destroy.js"
1307
1629
  ]
1308
1630
  },
1309
- "blueprints:plan": {
1631
+ "blueprints:doctor": {
1310
1632
  "aliases": [],
1311
1633
  "args": {},
1312
- "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.",
1634
+ "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.",
1313
1635
  "examples": [
1314
1636
  "<%= config.bin %> <%= command.id %>",
1315
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1316
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1637
+ "<%= config.bin %> <%= command.id %> --fix"
1317
1638
  ],
1318
1639
  "flags": {
1319
1640
  "json": {
@@ -1329,7 +1650,6 @@
1329
1650
  "char": "p",
1330
1651
  "description": "Path to a Blueprint file or directory containing one",
1331
1652
  "env": "SANITY_BLUEPRINT_PATH",
1332
- "hidden": true,
1333
1653
  "name": "path",
1334
1654
  "hasDynamicHelp": false,
1335
1655
  "multiple": false,
@@ -1356,73 +1676,39 @@
1356
1676
  "allowNo": false,
1357
1677
  "type": "boolean"
1358
1678
  },
1359
- "stack": {
1360
- "description": "Stack name or ID to use instead of the locally configured Stack",
1361
- "name": "stack",
1362
- "hasDynamicHelp": false,
1363
- "multiple": false,
1364
- "type": "option"
1365
- },
1366
- "project-id": {
1367
- "aliases": [
1368
- "project",
1369
- "projectId"
1370
- ],
1371
- "description": "Sanity project ID used to scope Blueprint and Stack",
1372
- "exclusive": [
1373
- "organization-id"
1374
- ],
1375
- "name": "project-id",
1376
- "hasDynamicHelp": false,
1377
- "multiple": false,
1378
- "type": "option"
1379
- },
1380
- "organization-id": {
1381
- "aliases": [
1382
- "organization",
1383
- "organizationId",
1384
- "org"
1385
- ],
1386
- "description": "Sanity organization ID used to scope Blueprint and Stack",
1387
- "exclusive": [
1388
- "project-id"
1389
- ],
1390
- "name": "organization-id",
1391
- "hasDynamicHelp": false,
1392
- "multiple": false,
1393
- "type": "option"
1679
+ "fix": {
1680
+ "description": "Interactively fix configuration issues",
1681
+ "name": "fix",
1682
+ "allowNo": false,
1683
+ "type": "boolean"
1394
1684
  }
1395
1685
  },
1396
1686
  "hasDynamicHelp": false,
1397
1687
  "hiddenAliases": [],
1398
- "id": "blueprints:plan",
1688
+ "id": "blueprints:doctor",
1399
1689
  "pluginAlias": "@sanity/runtime-cli",
1400
1690
  "pluginName": "@sanity/runtime-cli",
1401
1691
  "pluginType": "core",
1402
1692
  "strict": true,
1403
- "summary": "Preview changes that will be applied to the remote Stack",
1693
+ "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
1404
1694
  "enableJsonFlag": true,
1405
- "needs": [
1406
- "token",
1407
- "blueprint"
1408
- ],
1409
1695
  "isESM": true,
1410
1696
  "relativePath": [
1411
1697
  "dist",
1412
1698
  "commands",
1413
1699
  "blueprints",
1414
- "plan.js"
1700
+ "doctor.js"
1415
1701
  ]
1416
1702
  },
1417
- "blueprints:promote": {
1703
+ "blueprints:info": {
1418
1704
  "aliases": [],
1419
1705
  "args": {},
1420
- "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.",
1706
+ "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.",
1421
1707
  "examples": [
1422
1708
  "<%= config.bin %> <%= command.id %>",
1423
1709
  "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1424
- "<%= config.bin %> <%= command.id %> --project-id <projectId> --stack <name-or-id>",
1425
- "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1710
+ "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
1711
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1426
1712
  ],
1427
1713
  "flags": {
1428
1714
  "json": {
@@ -1469,7 +1755,7 @@
1469
1755
  "aliases": [
1470
1756
  "id"
1471
1757
  ],
1472
- "description": "Stack name or ID to promote",
1758
+ "description": "Stack name or ID",
1473
1759
  "name": "stack",
1474
1760
  "hasDynamicHelp": false,
1475
1761
  "multiple": false,
@@ -1499,56 +1785,52 @@
1499
1785
  "exclusive": [
1500
1786
  "project-id"
1501
1787
  ],
1502
- "hidden": true,
1503
1788
  "name": "organization-id",
1504
1789
  "hasDynamicHelp": false,
1505
1790
  "multiple": false,
1506
1791
  "type": "option"
1507
- },
1508
- "force": {
1509
- "description": "Skip confirmation prompt",
1510
- "name": "force",
1511
- "allowNo": false,
1512
- "type": "boolean"
1513
- },
1514
- "new-stack-name": {
1515
- "description": "Set a new name for the Stack while promoting",
1516
- "name": "new-stack-name",
1517
- "hasDynamicHelp": false,
1518
- "multiple": false,
1519
- "type": "option"
1520
1792
  }
1521
1793
  },
1522
1794
  "hasDynamicHelp": false,
1523
1795
  "hiddenAliases": [],
1524
- "id": "blueprints:promote",
1796
+ "id": "blueprints:info",
1525
1797
  "pluginAlias": "@sanity/runtime-cli",
1526
1798
  "pluginName": "@sanity/runtime-cli",
1527
1799
  "pluginType": "core",
1528
1800
  "strict": true,
1529
- "summary": "Promote a Stack from project scope to organization scope",
1801
+ "summary": "Display the status and resources of the remote Stack deployment",
1530
1802
  "enableJsonFlag": true,
1531
1803
  "needs": [
1532
- "deployedStack",
1533
- "blueprint"
1804
+ "deployedStack"
1534
1805
  ],
1535
1806
  "isESM": true,
1536
1807
  "relativePath": [
1537
1808
  "dist",
1538
1809
  "commands",
1539
1810
  "blueprints",
1540
- "promote.js"
1811
+ "info.js"
1541
1812
  ]
1542
1813
  },
1543
- "blueprints:stacks": {
1814
+ "blueprints:init": {
1544
1815
  "aliases": [],
1545
- "args": {},
1546
- "description": "Shows all Stacks associated with a project or organization. By default, lists Stacks scoped to the local Blueprint.\n\nUse this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to audit what's deployed across your project.\n\nUse --include-projects with --organization-id to also list Stacks from all projects within the organization.",
1816
+ "args": {
1817
+ "dir": {
1818
+ "description": "Directory to create the local Blueprint in (defaults to the current directory)",
1819
+ "name": "dir"
1820
+ }
1821
+ },
1822
+ "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
1547
1823
  "examples": [
1548
1824
  "<%= config.bin %> <%= command.id %>",
1549
- "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1825
+ "<%= config.bin %> <%= command.id %> .",
1826
+ "<%= config.bin %> <%= command.id %> [directory]",
1827
+ "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
1550
1828
  "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
1551
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId> --include-projects"
1829
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1830
+ "<%= config.bin %> <%= command.id %> --stack-name <newStackName>",
1831
+ "<%= config.bin %> <%= command.id %> --stack-id <existingStackId>",
1832
+ "<%= config.bin %> <%= command.id %> new-stack --type <json|js|ts> --org <organizationId> --name <newStackName>",
1833
+ "<%= config.bin %> <%= command.id %> old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>"
1552
1834
  ],
1553
1835
  "flags": {
1554
1836
  "json": {
@@ -1591,12 +1873,41 @@
1591
1873
  "allowNo": false,
1592
1874
  "type": "boolean"
1593
1875
  },
1594
- "stack": {
1595
- "description": "Stack name or ID to use instead of the locally configured Stack",
1596
- "hidden": true,
1597
- "name": "stack",
1876
+ "dir": {
1877
+ "description": "Directory to create the local Blueprint in",
1878
+ "name": "dir",
1879
+ "hasDynamicHelp": false,
1880
+ "multiple": false,
1881
+ "type": "option"
1882
+ },
1883
+ "example": {
1884
+ "aliases": [
1885
+ "recipe"
1886
+ ],
1887
+ "description": "Example to use for the local Blueprint",
1888
+ "exclusive": [
1889
+ "blueprint-type",
1890
+ "stack-id",
1891
+ "stack-name"
1892
+ ],
1893
+ "name": "example",
1894
+ "hasDynamicHelp": false,
1895
+ "multiple": false,
1896
+ "type": "option"
1897
+ },
1898
+ "blueprint-type": {
1899
+ "aliases": [
1900
+ "type"
1901
+ ],
1902
+ "description": "Blueprint manifest type to use for the local Blueprint",
1903
+ "name": "blueprint-type",
1598
1904
  "hasDynamicHelp": false,
1599
1905
  "multiple": false,
1906
+ "options": [
1907
+ "json",
1908
+ "js",
1909
+ "ts"
1910
+ ],
1600
1911
  "type": "option"
1601
1912
  },
1602
1913
  "project-id": {
@@ -1606,8 +1917,7 @@
1606
1917
  ],
1607
1918
  "description": "Sanity project ID used to scope Blueprint and Stack",
1608
1919
  "exclusive": [
1609
- "organization-id",
1610
- "include-projects"
1920
+ "organization-id"
1611
1921
  ],
1612
1922
  "name": "project-id",
1613
1923
  "hasDynamicHelp": false,
@@ -1629,46 +1939,79 @@
1629
1939
  "multiple": false,
1630
1940
  "type": "option"
1631
1941
  },
1632
- "include-projects": {
1633
- "dependsOn": [
1634
- "organization-id"
1942
+ "stack-id": {
1943
+ "aliases": [
1944
+ "stackId"
1635
1945
  ],
1636
- "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
1637
- "name": "include-projects",
1638
- "allowNo": false,
1639
- "type": "boolean"
1946
+ "description": "Existing Stack ID used to scope local Blueprint",
1947
+ "exclusive": [
1948
+ "stack-name"
1949
+ ],
1950
+ "name": "stack-id",
1951
+ "relationships": [
1952
+ {
1953
+ "type": "some",
1954
+ "flags": [
1955
+ "project-id",
1956
+ "organization-id"
1957
+ ]
1958
+ }
1959
+ ],
1960
+ "hasDynamicHelp": false,
1961
+ "multiple": false,
1962
+ "type": "option"
1963
+ },
1964
+ "stack-name": {
1965
+ "aliases": [
1966
+ "name"
1967
+ ],
1968
+ "description": "Name to use for a new Stack provisioned during initialization",
1969
+ "exclusive": [
1970
+ "stack-id"
1971
+ ],
1972
+ "name": "stack-name",
1973
+ "relationships": [
1974
+ {
1975
+ "type": "some",
1976
+ "flags": [
1977
+ "project-id",
1978
+ "organization-id"
1979
+ ]
1980
+ }
1981
+ ],
1982
+ "hasDynamicHelp": false,
1983
+ "multiple": false,
1984
+ "type": "option"
1640
1985
  }
1641
1986
  },
1642
1987
  "hasDynamicHelp": false,
1643
1988
  "hiddenAliases": [],
1644
- "id": "blueprints:stacks",
1989
+ "id": "blueprints:init",
1645
1990
  "pluginAlias": "@sanity/runtime-cli",
1646
1991
  "pluginName": "@sanity/runtime-cli",
1647
1992
  "pluginType": "core",
1648
1993
  "strict": true,
1649
- "summary": "List remote Stack deployments for your project or organization",
1994
+ "summary": "Initialize a Blueprint and create a remote Stack",
1650
1995
  "enableJsonFlag": true,
1651
- "needs": [
1652
- "scope"
1653
- ],
1654
1996
  "isESM": true,
1655
1997
  "relativePath": [
1656
1998
  "dist",
1657
1999
  "commands",
1658
2000
  "blueprints",
1659
- "stacks.js"
2001
+ "init.js"
1660
2002
  ]
1661
2003
  },
1662
- "functions:add": {
2004
+ "blueprints:logs": {
1663
2005
  "aliases": [],
1664
2006
  "args": {},
1665
- "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.",
2007
+ "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'.",
1666
2008
  "examples": [
1667
2009
  "<%= config.bin %> <%= command.id %>",
1668
- "<%= config.bin %> <%= command.id %> --helpers",
1669
- "<%= config.bin %> <%= command.id %> --name my-function",
1670
- "<%= config.bin %> <%= command.id %> --name my-function --type document-create",
1671
- "<%= config.bin %> <%= command.id %> --name my-function --type document-create --type document-update --lang js"
2010
+ "<%= config.bin %> <%= command.id %> --watch",
2011
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2012
+ "<%= config.bin %> <%= command.id %> --limit 500",
2013
+ "<%= config.bin %> <%= command.id %> --since 2026-05-01T00:00:00Z",
2014
+ "<%= config.bin %> <%= command.id %> --before 2026-05-01T00:00:00Z"
1672
2015
  ],
1673
2016
  "flags": {
1674
2017
  "json": {
@@ -1713,7 +2056,6 @@
1713
2056
  },
1714
2057
  "stack": {
1715
2058
  "description": "Stack name or ID to use instead of the locally configured Stack",
1716
- "hidden": true,
1717
2059
  "name": "stack",
1718
2060
  "hasDynamicHelp": false,
1719
2061
  "multiple": false,
@@ -1728,7 +2070,6 @@
1728
2070
  "exclusive": [
1729
2071
  "organization-id"
1730
2072
  ],
1731
- "hidden": true,
1732
2073
  "name": "project-id",
1733
2074
  "hasDynamicHelp": false,
1734
2075
  "multiple": false,
@@ -1744,145 +2085,86 @@
1744
2085
  "exclusive": [
1745
2086
  "project-id"
1746
2087
  ],
1747
- "hidden": true,
1748
- "name": "organization-id",
1749
- "hasDynamicHelp": false,
1750
- "multiple": false,
1751
- "type": "option"
1752
- },
1753
- "example": {
1754
- "aliases": [
1755
- "recipe"
1756
- ],
1757
- "description": "Example to use for the Function",
1758
- "exclusive": [
1759
- "name",
1760
- "fn-type",
1761
- "language",
1762
- "javascript",
1763
- "fn-helpers",
1764
- "fn-installer"
1765
- ],
1766
- "name": "example",
1767
- "hasDynamicHelp": false,
1768
- "multiple": false,
1769
- "type": "option"
1770
- },
1771
- "name": {
1772
- "char": "n",
1773
- "description": "Name of the Function to add",
1774
- "name": "name",
1775
- "hasDynamicHelp": false,
1776
- "multiple": false,
1777
- "type": "option"
1778
- },
1779
- "type": {
1780
- "dependsOn": [
1781
- "name"
1782
- ],
1783
- "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
1784
- "name": "type",
1785
- "hasDynamicHelp": false,
1786
- "multiple": true,
1787
- "options": [
1788
- "document-publish",
1789
- "document-create",
1790
- "document-delete",
1791
- "document-update",
1792
- "media-library-asset-create",
1793
- "media-library-asset-delete",
1794
- "media-library-asset-update",
1795
- "scheduled-function",
1796
- "sync-tag-invalidate"
1797
- ],
1798
- "type": "option"
1799
- },
1800
- "language": {
1801
- "aliases": [
1802
- "lang"
1803
- ],
1804
- "description": "Language of the new Function",
1805
- "name": "language",
1806
- "default": "ts",
2088
+ "name": "organization-id",
1807
2089
  "hasDynamicHelp": false,
1808
2090
  "multiple": false,
1809
- "options": [
1810
- "ts",
1811
- "js"
1812
- ],
1813
2091
  "type": "option"
1814
2092
  },
1815
- "javascript": {
2093
+ "watch": {
1816
2094
  "aliases": [
1817
- "js"
1818
- ],
1819
- "description": "Use JavaScript instead of TypeScript",
1820
- "exclusive": [
1821
- "language"
2095
+ "follow"
1822
2096
  ],
1823
- "name": "javascript",
2097
+ "char": "w",
2098
+ "description": "Watch for new Stack logs",
2099
+ "name": "watch",
1824
2100
  "allowNo": false,
1825
2101
  "type": "boolean"
1826
2102
  },
1827
- "helpers": {
1828
- "description": "Add helpers to the new Function",
1829
- "name": "helpers",
1830
- "allowNo": true,
1831
- "type": "boolean"
1832
- },
1833
- "installer": {
1834
- "description": "How to install the @sanity/functions helpers",
1835
- "name": "installer",
2103
+ "limit": {
2104
+ "char": "l",
2105
+ "description": "Maximum number of log entries to retrieve (1-500)",
2106
+ "exclusive": [
2107
+ "watch"
2108
+ ],
2109
+ "name": "limit",
1836
2110
  "hasDynamicHelp": false,
1837
2111
  "multiple": false,
1838
- "options": [
1839
- "skip",
1840
- "npm",
1841
- "pnpm",
1842
- "yarn"
2112
+ "type": "option"
2113
+ },
2114
+ "since": {
2115
+ "description": "Only show logs after this ISO 8601 timestamp",
2116
+ "exclusive": [
2117
+ "watch"
1843
2118
  ],
2119
+ "name": "since",
2120
+ "hasDynamicHelp": false,
2121
+ "multiple": false,
1844
2122
  "type": "option"
1845
2123
  },
1846
- "install": {
1847
- "char": "i",
1848
- "description": "Shortcut for --fn-installer npm",
2124
+ "before": {
2125
+ "description": "Only show logs before this ISO 8601 timestamp",
1849
2126
  "exclusive": [
1850
- "fn-installer"
2127
+ "watch"
1851
2128
  ],
1852
- "name": "install",
1853
- "allowNo": false,
1854
- "type": "boolean"
2129
+ "name": "before",
2130
+ "hasDynamicHelp": false,
2131
+ "multiple": false,
2132
+ "type": "option"
1855
2133
  }
1856
2134
  },
1857
2135
  "hasDynamicHelp": false,
1858
2136
  "hiddenAliases": [],
1859
- "id": "functions:add",
2137
+ "id": "blueprints:logs",
1860
2138
  "pluginAlias": "@sanity/runtime-cli",
1861
2139
  "pluginName": "@sanity/runtime-cli",
1862
2140
  "pluginType": "core",
1863
2141
  "strict": true,
1864
- "summary": "Add a Function to your Blueprint",
2142
+ "summary": "Display logs for the current Blueprint's Stack deployment",
1865
2143
  "enableJsonFlag": true,
1866
2144
  "needs": [
1867
- "blueprint"
2145
+ "deployedStack"
1868
2146
  ],
1869
2147
  "isESM": true,
1870
2148
  "relativePath": [
1871
2149
  "dist",
1872
2150
  "commands",
1873
- "functions",
1874
- "add.js"
2151
+ "blueprints",
2152
+ "logs.js"
1875
2153
  ]
1876
2154
  },
1877
- "functions:build": {
2155
+ "blueprints:mint-deploy-token": {
1878
2156
  "aliases": [],
1879
- "args": {
1880
- "name": {
1881
- "description": "The name of the Sanity Function",
1882
- "name": "name",
1883
- "required": false
1884
- }
1885
- },
2157
+ "args": {},
2158
+ "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.",
2159
+ "examples": [
2160
+ "<%= config.bin %> <%= command.id %>",
2161
+ "<%= config.bin %> <%= command.id %> --label \"ci-deploy\"",
2162
+ "<%= config.bin %> <%= command.id %> --print",
2163
+ "export SANITY_AUTH_TOKEN=$(<%= config.bin %> <%= command.id %> --print)",
2164
+ "<%= config.bin %> <%= command.id %> --json",
2165
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2166
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId>"
2167
+ ],
1886
2168
  "flags": {
1887
2169
  "json": {
1888
2170
  "description": "Format output as json",
@@ -1941,7 +2223,6 @@
1941
2223
  "exclusive": [
1942
2224
  "organization-id"
1943
2225
  ],
1944
- "hidden": true,
1945
2226
  "name": "project-id",
1946
2227
  "hasDynamicHelp": false,
1947
2228
  "multiple": false,
@@ -1957,66 +2238,57 @@
1957
2238
  "exclusive": [
1958
2239
  "project-id"
1959
2240
  ],
1960
- "hidden": true,
1961
2241
  "name": "organization-id",
1962
2242
  "hasDynamicHelp": false,
1963
2243
  "multiple": false,
1964
2244
  "type": "option"
1965
2245
  },
1966
- "fn-installer": {
1967
- "aliases": [
1968
- "function-installer",
1969
- "installer"
1970
- ],
1971
- "description": "Which package manager to use when building Functions",
1972
- "hidden": true,
1973
- "name": "fn-installer",
2246
+ "label": {
2247
+ "description": "Human-readable label for the robot. Defaults to a generated value.",
2248
+ "name": "label",
1974
2249
  "hasDynamicHelp": false,
1975
2250
  "multiple": false,
1976
- "options": [
1977
- "npm",
1978
- "pnpm",
1979
- "yarn"
1980
- ],
1981
2251
  "type": "option"
1982
2252
  },
1983
- "out-dir": {
1984
- "char": "o",
1985
- "description": "Output directory for zip files",
1986
- "name": "out-dir",
1987
- "hasDynamicHelp": false,
1988
- "multiple": false,
1989
- "type": "option"
2253
+ "print": {
2254
+ "char": "P",
2255
+ "description": "Print only the raw token to stdout (suitable for shell substitution)",
2256
+ "exclusive": [
2257
+ "json"
2258
+ ],
2259
+ "name": "print",
2260
+ "allowNo": false,
2261
+ "type": "boolean"
1990
2262
  }
1991
2263
  },
1992
2264
  "hasDynamicHelp": false,
1993
- "hidden": true,
1994
2265
  "hiddenAliases": [],
1995
- "id": "functions:build",
2266
+ "id": "blueprints:mint-deploy-token",
1996
2267
  "pluginAlias": "@sanity/runtime-cli",
1997
2268
  "pluginName": "@sanity/runtime-cli",
1998
2269
  "pluginType": "core",
1999
2270
  "strict": true,
2000
- "summary": "Build Sanity Function(s) to zip archives",
2271
+ "summary": "Create a robot API token for deploying Blueprints from CI/CD",
2001
2272
  "enableJsonFlag": true,
2002
2273
  "needs": [
2003
- "blueprint"
2274
+ "scope"
2004
2275
  ],
2005
2276
  "isESM": true,
2006
2277
  "relativePath": [
2007
2278
  "dist",
2008
2279
  "commands",
2009
- "functions",
2010
- "build.js"
2280
+ "blueprints",
2281
+ "mint-deploy-token.js"
2011
2282
  ]
2012
2283
  },
2013
- "functions:dev": {
2284
+ "blueprints:plan": {
2014
2285
  "aliases": [],
2015
2286
  "args": {},
2016
- "description": "Runs a local, web-based development server to test your functions before deploying.\n\nOpen the emulator in your browser to interactively test your functions with the payload editor.\n\nOptionally, set the host and port with the --host and --port flags. Function timeout can be configured with the --timeout flag.\n\nTo invoke a function with the CLI, use 'functions test'.",
2287
+ "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.",
2017
2288
  "examples": [
2018
- "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974",
2019
- "<%= config.bin %> <%= command.id %> --timeout 60"
2289
+ "<%= config.bin %> <%= command.id %>",
2290
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2291
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
2020
2292
  ],
2021
2293
  "flags": {
2022
2294
  "json": {
@@ -2061,7 +2333,6 @@
2061
2333
  },
2062
2334
  "stack": {
2063
2335
  "description": "Stack name or ID to use instead of the locally configured Stack",
2064
- "hidden": true,
2065
2336
  "name": "stack",
2066
2337
  "hasDynamicHelp": false,
2067
2338
  "multiple": false,
@@ -2076,7 +2347,6 @@
2076
2347
  "exclusive": [
2077
2348
  "organization-id"
2078
2349
  ],
2079
- "hidden": true,
2080
2350
  "name": "project-id",
2081
2351
  "hasDynamicHelp": false,
2082
2352
  "multiple": false,
@@ -2092,75 +2362,42 @@
2092
2362
  "exclusive": [
2093
2363
  "project-id"
2094
2364
  ],
2095
- "hidden": true,
2096
2365
  "name": "organization-id",
2097
2366
  "hasDynamicHelp": false,
2098
2367
  "multiple": false,
2099
2368
  "type": "option"
2100
- },
2101
- "host": {
2102
- "char": "h",
2103
- "description": "The local network interface at which to listen. [default: \"localhost\"]",
2104
- "name": "host",
2105
- "required": false,
2106
- "hasDynamicHelp": false,
2107
- "multiple": false,
2108
- "type": "option"
2109
- },
2110
- "port": {
2111
- "char": "p",
2112
- "description": "TCP port to start emulator on. [default: 8080]",
2113
- "name": "port",
2114
- "required": false,
2115
- "hasDynamicHelp": false,
2116
- "multiple": false,
2117
- "type": "option"
2118
- },
2119
- "timeout": {
2120
- "char": "t",
2121
- "description": "Maximum execution time for all functions, in seconds. Takes precedence over function-specific `timeout`",
2122
- "name": "timeout",
2123
- "required": false,
2124
- "hasDynamicHelp": false,
2125
- "multiple": false,
2126
- "type": "option"
2127
2369
  }
2128
2370
  },
2129
2371
  "hasDynamicHelp": false,
2130
2372
  "hiddenAliases": [],
2131
- "id": "functions:dev",
2373
+ "id": "blueprints:plan",
2132
2374
  "pluginAlias": "@sanity/runtime-cli",
2133
2375
  "pluginName": "@sanity/runtime-cli",
2134
2376
  "pluginType": "core",
2135
2377
  "strict": true,
2136
- "summary": "Start the Sanity Function emulator",
2378
+ "summary": "Preview changes that will be applied to the remote Stack",
2137
2379
  "enableJsonFlag": true,
2138
2380
  "needs": [
2381
+ "token",
2139
2382
  "blueprint"
2140
2383
  ],
2141
2384
  "isESM": true,
2142
2385
  "relativePath": [
2143
2386
  "dist",
2144
2387
  "commands",
2145
- "functions",
2146
- "dev.js"
2388
+ "blueprints",
2389
+ "plan.js"
2147
2390
  ]
2148
2391
  },
2149
- "functions:logs": {
2392
+ "blueprints:promote": {
2150
2393
  "aliases": [],
2151
- "args": {
2152
- "name": {
2153
- "description": "The name of the Sanity Function",
2154
- "name": "name",
2155
- "required": false
2156
- }
2157
- },
2158
- "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).",
2394
+ "args": {},
2395
+ "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.",
2159
2396
  "examples": [
2160
- "<%= config.bin %> <%= command.id %> <name>",
2161
- "<%= config.bin %> <%= command.id %> <name> --json",
2162
- "<%= config.bin %> <%= command.id %> <name> --limit 100",
2163
- "<%= config.bin %> <%= command.id %> <name> --delete"
2397
+ "<%= config.bin %> <%= command.id %>",
2398
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
2399
+ "<%= config.bin %> <%= command.id %> --project-id <projectId> --stack <name-or-id>",
2400
+ "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
2164
2401
  ],
2165
2402
  "flags": {
2166
2403
  "json": {
@@ -2204,7 +2441,10 @@
2204
2441
  "type": "boolean"
2205
2442
  },
2206
2443
  "stack": {
2207
- "description": "Stack name or ID to use instead of the locally configured Stack",
2444
+ "aliases": [
2445
+ "id"
2446
+ ],
2447
+ "description": "Stack name or ID to promote",
2208
2448
  "name": "stack",
2209
2449
  "hasDynamicHelp": false,
2210
2450
  "multiple": false,
@@ -2219,7 +2459,6 @@
2219
2459
  "exclusive": [
2220
2460
  "organization-id"
2221
2461
  ],
2222
- "hidden": true,
2223
2462
  "name": "project-id",
2224
2463
  "hasDynamicHelp": false,
2225
2464
  "multiple": false,
@@ -2241,66 +2480,28 @@
2241
2480
  "multiple": false,
2242
2481
  "type": "option"
2243
2482
  },
2244
- "limit": {
2245
- "char": "l",
2246
- "description": "Total number of log entries to retrieve",
2247
- "name": "limit",
2248
- "required": false,
2249
- "default": 50,
2250
- "hasDynamicHelp": false,
2251
- "multiple": false,
2252
- "type": "option"
2253
- },
2254
- "utc": {
2255
- "char": "u",
2256
- "description": "Show dates in UTC time zone",
2257
- "name": "utc",
2258
- "required": false,
2259
- "allowNo": false,
2260
- "type": "boolean"
2261
- },
2262
- "delete": {
2263
- "char": "d",
2264
- "description": "Delete all logs for the function",
2265
- "exclusive": [
2266
- "limit",
2267
- "json"
2268
- ],
2269
- "name": "delete",
2270
- "required": false,
2271
- "allowNo": false,
2272
- "type": "boolean"
2273
- },
2274
2483
  "force": {
2275
- "char": "f",
2276
- "dependsOn": [
2277
- "delete"
2278
- ],
2279
- "description": "Skip confirmation for deleting logs",
2484
+ "description": "Skip confirmation prompt",
2280
2485
  "name": "force",
2281
- "required": false,
2282
2486
  "allowNo": false,
2283
2487
  "type": "boolean"
2284
2488
  },
2285
- "watch": {
2286
- "aliases": [
2287
- "follow"
2288
- ],
2289
- "char": "w",
2290
- "description": "Watch for new logs (streaming mode)",
2291
- "name": "watch",
2292
- "allowNo": false,
2293
- "type": "boolean"
2489
+ "new-stack-name": {
2490
+ "description": "Set a new name for the Stack while promoting",
2491
+ "name": "new-stack-name",
2492
+ "hasDynamicHelp": false,
2493
+ "multiple": false,
2494
+ "type": "option"
2294
2495
  }
2295
2496
  },
2296
2497
  "hasDynamicHelp": false,
2297
2498
  "hiddenAliases": [],
2298
- "id": "functions:logs",
2499
+ "id": "blueprints:promote",
2299
2500
  "pluginAlias": "@sanity/runtime-cli",
2300
2501
  "pluginName": "@sanity/runtime-cli",
2301
2502
  "pluginType": "core",
2302
2503
  "strict": true,
2303
- "summary": "Retrieve or delete logs for a Sanity Function",
2504
+ "summary": "Promote a Stack from project scope to organization scope",
2304
2505
  "enableJsonFlag": true,
2305
2506
  "needs": [
2306
2507
  "deployedStack",
@@ -2310,25 +2511,19 @@
2310
2511
  "relativePath": [
2311
2512
  "dist",
2312
2513
  "commands",
2313
- "functions",
2314
- "logs.js"
2514
+ "blueprints",
2515
+ "promote.js"
2315
2516
  ]
2316
2517
  },
2317
- "functions:test": {
2518
+ "blueprints:stacks": {
2318
2519
  "aliases": [],
2319
- "args": {
2320
- "name": {
2321
- "description": "The name of the Sanity Function",
2322
- "name": "name",
2323
- "required": false
2324
- }
2325
- },
2326
- "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.",
2520
+ "args": {},
2521
+ "description": "Shows all Stacks associated with a project or organization. By default, lists Stacks scoped to the local Blueprint.\n\nUse this to discover existing Stacks you can scope a local Blueprint to (using 'blueprints config --edit'), or to audit what's deployed across your project.\n\nUse --include-projects with --organization-id to also list Stacks from all projects within the organization.",
2327
2522
  "examples": [
2328
- "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }'",
2329
- "<%= config.bin %> <%= command.id %> <name> --file 'payload.json'",
2330
- "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }' --timeout 60",
2331
- "<%= config.bin %> <%= command.id %> <name> --event update --data-before '{ \"title\": \"before\" }' --data-after '{ \"title\": \"after\" }'"
2523
+ "<%= config.bin %> <%= command.id %>",
2524
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2525
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
2526
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId> --include-projects"
2332
2527
  ],
2333
2528
  "flags": {
2334
2529
  "json": {
@@ -2386,7 +2581,8 @@
2386
2581
  ],
2387
2582
  "description": "Sanity project ID used to scope Blueprint and Stack",
2388
2583
  "exclusive": [
2389
- "organization-id"
2584
+ "organization-id",
2585
+ "include-projects"
2390
2586
  ],
2391
2587
  "name": "project-id",
2392
2588
  "hasDynamicHelp": false,
@@ -2408,230 +2604,34 @@
2408
2604
  "multiple": false,
2409
2605
  "type": "option"
2410
2606
  },
2411
- "data": {
2412
- "char": "d",
2413
- "description": "Data to send to the function",
2414
- "exclusive": [
2415
- "file",
2416
- "document-id"
2417
- ],
2418
- "name": "data",
2419
- "required": false,
2420
- "hasDynamicHelp": false,
2421
- "multiple": false,
2422
- "type": "option"
2423
- },
2424
- "data-before": {
2425
- "description": "Original document",
2426
- "exclusive": [
2427
- "data",
2428
- "file",
2429
- "document-id",
2430
- "file-before",
2431
- "file-after",
2432
- "document-id-before",
2433
- "document-id-after"
2434
- ],
2435
- "name": "data-before",
2436
- "required": false,
2437
- "hasDynamicHelp": false,
2438
- "multiple": false,
2439
- "type": "option"
2440
- },
2441
- "data-after": {
2442
- "description": "Current document",
2443
- "exclusive": [
2444
- "data",
2445
- "file",
2446
- "document-id",
2447
- "file-before",
2448
- "file-after",
2449
- "document-id-before",
2450
- "document-id-after"
2451
- ],
2452
- "name": "data-after",
2453
- "required": false,
2454
- "hasDynamicHelp": false,
2455
- "multiple": false,
2456
- "type": "option"
2457
- },
2458
- "event": {
2459
- "char": "e",
2460
- "description": "Type of event (create, update, delete)",
2461
- "name": "event",
2462
- "required": false,
2463
- "hasDynamicHelp": false,
2464
- "multiple": false,
2465
- "options": [
2466
- "create",
2467
- "update",
2468
- "delete"
2469
- ],
2470
- "type": "option"
2471
- },
2472
- "file": {
2473
- "char": "f",
2474
- "description": "Read data from file and send to the function",
2475
- "exclusive": [
2476
- "data",
2477
- "document-id"
2478
- ],
2479
- "name": "file",
2480
- "required": false,
2481
- "hasDynamicHelp": false,
2482
- "multiple": false,
2483
- "type": "option"
2484
- },
2485
- "file-before": {
2486
- "description": "Original document",
2487
- "exclusive": [
2488
- "data",
2489
- "file",
2490
- "document-id",
2491
- "data-before",
2492
- "data-after",
2493
- "document-id-before",
2494
- "document-id-after"
2495
- ],
2496
- "name": "file-before",
2497
- "required": false,
2498
- "hasDynamicHelp": false,
2499
- "multiple": false,
2500
- "type": "option"
2501
- },
2502
- "file-after": {
2503
- "description": "Current document",
2504
- "exclusive": [
2505
- "data",
2506
- "file",
2507
- "document-id",
2508
- "data-before",
2509
- "data-after",
2510
- "document-id-before",
2511
- "document-id-after"
2512
- ],
2513
- "name": "file-after",
2514
- "required": false,
2515
- "hasDynamicHelp": false,
2516
- "multiple": false,
2517
- "type": "option"
2518
- },
2519
- "timeout": {
2520
- "char": "t",
2521
- "description": "Execution timeout value in seconds",
2522
- "name": "timeout",
2523
- "required": false,
2524
- "hasDynamicHelp": false,
2525
- "multiple": false,
2526
- "type": "option"
2527
- },
2528
- "api": {
2529
- "char": "a",
2530
- "description": "Sanity API Version to use",
2531
- "name": "api",
2532
- "required": false,
2533
- "hasDynamicHelp": false,
2534
- "multiple": false,
2535
- "type": "option"
2536
- },
2537
- "dataset": {
2538
- "description": "The Sanity dataset to use",
2539
- "name": "dataset",
2540
- "required": false,
2541
- "hasDynamicHelp": false,
2542
- "multiple": false,
2543
- "type": "option"
2544
- },
2545
- "document-id": {
2546
- "aliases": [
2547
- "doc",
2548
- "documentId"
2549
- ],
2550
- "description": "Document to fetch and send to function",
2551
- "exclusive": [
2552
- "data",
2553
- "file"
2554
- ],
2555
- "name": "document-id",
2556
- "required": false,
2557
- "hasDynamicHelp": false,
2558
- "multiple": false,
2559
- "type": "option"
2560
- },
2561
- "document-id-before": {
2562
- "description": "Original document",
2563
- "exclusive": [
2564
- "data",
2565
- "file",
2566
- "document-id",
2567
- "data-before",
2568
- "data-after",
2569
- "file-before",
2570
- "file-after"
2571
- ],
2572
- "name": "document-id-before",
2573
- "required": false,
2574
- "hasDynamicHelp": false,
2575
- "multiple": false,
2576
- "type": "option"
2577
- },
2578
- "document-id-after": {
2579
- "description": "Current document",
2580
- "exclusive": [
2581
- "data",
2582
- "file",
2583
- "document-id",
2584
- "data-before",
2585
- "data-after",
2586
- "file-before",
2587
- "file-after"
2607
+ "include-projects": {
2608
+ "dependsOn": [
2609
+ "organization-id"
2588
2610
  ],
2589
- "name": "document-id-after",
2590
- "required": false,
2591
- "hasDynamicHelp": false,
2592
- "multiple": false,
2593
- "type": "option"
2594
- },
2595
- "with-user-token": {
2596
- "description": "Prime access token from CLI config",
2597
- "name": "with-user-token",
2611
+ "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
2612
+ "name": "include-projects",
2598
2613
  "allowNo": false,
2599
2614
  "type": "boolean"
2600
- },
2601
- "media-library-id": {
2602
- "aliases": [
2603
- "media"
2604
- ],
2605
- "description": "Sanity Media Library ID to use",
2606
- "exclusive": [
2607
- "project-id",
2608
- "dataset"
2609
- ],
2610
- "name": "media-library-id",
2611
- "required": false,
2612
- "hasDynamicHelp": false,
2613
- "multiple": false,
2614
- "type": "option"
2615
2615
  }
2616
2616
  },
2617
2617
  "hasDynamicHelp": false,
2618
2618
  "hiddenAliases": [],
2619
- "id": "functions:test",
2619
+ "id": "blueprints:stacks",
2620
2620
  "pluginAlias": "@sanity/runtime-cli",
2621
2621
  "pluginName": "@sanity/runtime-cli",
2622
2622
  "pluginType": "core",
2623
2623
  "strict": true,
2624
- "summary": "Invoke a local Sanity Function",
2624
+ "summary": "List remote Stack deployments for your project or organization",
2625
2625
  "enableJsonFlag": true,
2626
2626
  "needs": [
2627
- "blueprint"
2627
+ "scope"
2628
2628
  ],
2629
2629
  "isESM": true,
2630
2630
  "relativePath": [
2631
2631
  "dist",
2632
2632
  "commands",
2633
- "functions",
2634
- "test.js"
2633
+ "blueprints",
2634
+ "stacks.js"
2635
2635
  ]
2636
2636
  },
2637
2637
  "functions:env:add": {
@@ -2655,7 +2655,8 @@
2655
2655
  },
2656
2656
  "description": "Sets an environment variable in a deployed Sanity Function. If the variable already exists, its value is updated.\n\nEnvironment variables are useful for API keys, configuration values, and other secrets that shouldn't be hardcoded. Changes take effect on the next function invocation.",
2657
2657
  "examples": [
2658
- "<%= config.bin %> <%= command.id %> MyFunction API_URL https://api.example.com/"
2658
+ "<%= config.bin %> <%= command.id %> MyFunction API_URL https://api.example.com/",
2659
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> MyFunction API_URL https://api.example.com/"
2659
2660
  ],
2660
2661
  "flags": {
2661
2662
  "json": {
@@ -2700,7 +2701,6 @@
2700
2701
  },
2701
2702
  "stack": {
2702
2703
  "description": "Stack name or ID to use instead of the locally configured Stack",
2703
- "hidden": true,
2704
2704
  "name": "stack",
2705
2705
  "hasDynamicHelp": false,
2706
2706
  "multiple": false,
@@ -2771,7 +2771,8 @@
2771
2771
  },
2772
2772
  "description": "Displays all environment variables (keys only) configured in a deployed Sanity Function.\n\nUse 'functions env add' to set variables or 'functions env remove' to delete them.",
2773
2773
  "examples": [
2774
- "<%= config.bin %> <%= command.id %> MyFunction"
2774
+ "<%= config.bin %> <%= command.id %> MyFunction",
2775
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> MyFunction"
2775
2776
  ],
2776
2777
  "flags": {
2777
2778
  "json": {
@@ -2816,7 +2817,6 @@
2816
2817
  },
2817
2818
  "stack": {
2818
2819
  "description": "Stack name or ID to use instead of the locally configured Stack",
2819
- "hidden": true,
2820
2820
  "name": "stack",
2821
2821
  "hasDynamicHelp": false,
2822
2822
  "multiple": false,
@@ -2892,7 +2892,8 @@
2892
2892
  },
2893
2893
  "description": "Deletes an environment variable from a deployed Sanity Function. The change takes effect on the next function invocation.\n\nUse 'functions env list' to see current variables before removing.",
2894
2894
  "examples": [
2895
- "<%= config.bin %> <%= command.id %> MyFunction API_URL"
2895
+ "<%= config.bin %> <%= command.id %> MyFunction API_URL",
2896
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> MyFunction API_URL"
2896
2897
  ],
2897
2898
  "flags": {
2898
2899
  "json": {
@@ -2937,7 +2938,6 @@
2937
2938
  },
2938
2939
  "stack": {
2939
2940
  "description": "Stack name or ID to use instead of the locally configured Stack",
2940
- "hidden": true,
2941
2941
  "name": "stack",
2942
2942
  "hasDynamicHelp": false,
2943
2943
  "multiple": false,
@@ -2998,5 +2998,5 @@
2998
2998
  ]
2999
2999
  }
3000
3000
  },
3001
- "version": "17.2.0-next.ga4b9ae7"
3001
+ "version": "17.3.0"
3002
3002
  }