@sanity/runtime-cli 17.3.0 → 17.3.2-next.ga266544

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,15 +1,27 @@
1
1
  {
2
2
  "commands": {
3
- "functions:add": {
3
+ "blueprints:add": {
4
4
  "aliases": [],
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.",
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",
7
19
  "examples": [
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"
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"
13
25
  ],
14
26
  "flags": {
15
27
  "json": {
@@ -95,7 +107,7 @@
95
107
  "aliases": [
96
108
  "recipe"
97
109
  ],
98
- "description": "Example to use for the Function",
110
+ "description": "Example to use for the function resource. Discover examples at https://www.sanity.io/exchange/type=recipes/by=sanity",
99
111
  "exclusive": [
100
112
  "name",
101
113
  "fn-type",
@@ -111,18 +123,21 @@
111
123
  },
112
124
  "name": {
113
125
  "char": "n",
114
- "description": "Name of the Function to add",
126
+ "description": "Name of the resource to add",
115
127
  "name": "name",
116
128
  "hasDynamicHelp": false,
117
129
  "multiple": false,
118
130
  "type": "option"
119
131
  },
120
- "type": {
132
+ "fn-type": {
133
+ "aliases": [
134
+ "function-type"
135
+ ],
121
136
  "dependsOn": [
122
137
  "name"
123
138
  ],
124
139
  "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
125
- "name": "type",
140
+ "name": "fn-type",
126
141
  "hasDynamicHelp": false,
127
142
  "multiple": true,
128
143
  "options": [
@@ -140,9 +155,11 @@
140
155
  },
141
156
  "language": {
142
157
  "aliases": [
158
+ "function-language",
159
+ "fn-language",
143
160
  "lang"
144
161
  ],
145
- "description": "Language of the new Function",
162
+ "description": "Language of the new function",
146
163
  "name": "language",
147
164
  "default": "ts",
148
165
  "hasDynamicHelp": false,
@@ -165,15 +182,23 @@
165
182
  "allowNo": false,
166
183
  "type": "boolean"
167
184
  },
168
- "helpers": {
169
- "description": "Add helpers to the new Function",
170
- "name": "helpers",
185
+ "fn-helpers": {
186
+ "aliases": [
187
+ "function-helpers",
188
+ "helpers"
189
+ ],
190
+ "description": "Add helpers to the new function",
191
+ "name": "fn-helpers",
171
192
  "allowNo": true,
172
193
  "type": "boolean"
173
194
  },
174
- "installer": {
175
- "description": "How to install the @sanity/functions helpers",
176
- "name": "installer",
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",
177
202
  "hasDynamicHelp": false,
178
203
  "multiple": false,
179
204
  "options": [
@@ -197,12 +222,13 @@
197
222
  },
198
223
  "hasDynamicHelp": false,
199
224
  "hiddenAliases": [],
200
- "id": "functions:add",
225
+ "id": "blueprints:add",
201
226
  "pluginAlias": "@sanity/runtime-cli",
202
227
  "pluginName": "@sanity/runtime-cli",
203
228
  "pluginType": "core",
229
+ "state": "deprecated",
204
230
  "strict": true,
205
- "summary": "Add a Function to your Blueprint",
231
+ "summary": "[deprecated] Use \"functions add\" instead",
206
232
  "enableJsonFlag": true,
207
233
  "needs": [
208
234
  "blueprint"
@@ -211,19 +237,20 @@
211
237
  "relativePath": [
212
238
  "dist",
213
239
  "commands",
214
- "functions",
240
+ "blueprints",
215
241
  "add.js"
216
242
  ]
217
243
  },
218
- "functions:build": {
244
+ "blueprints:config": {
219
245
  "aliases": [],
220
- "args": {
221
- "name": {
222
- "description": "The name of the Sanity Function",
223
- "name": "name",
224
- "required": false
225
- }
226
- },
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
+ ],
227
254
  "flags": {
228
255
  "json": {
229
256
  "description": "Format output as json",
@@ -266,8 +293,14 @@
266
293
  "type": "boolean"
267
294
  },
268
295
  "stack": {
269
- "description": "Stack name or ID to use instead of the locally configured Stack",
270
- "hidden": true,
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",
271
304
  "name": "stack",
272
305
  "hasDynamicHelp": false,
273
306
  "multiple": false,
@@ -278,11 +311,13 @@
278
311
  "project",
279
312
  "projectId"
280
313
  ],
314
+ "dependsOn": [
315
+ "edit"
316
+ ],
281
317
  "description": "Sanity project ID used to scope Blueprint and Stack",
282
318
  "exclusive": [
283
319
  "organization-id"
284
320
  ],
285
- "hidden": true,
286
321
  "name": "project-id",
287
322
  "hasDynamicHelp": false,
288
323
  "multiple": false,
@@ -294,70 +329,59 @@
294
329
  "organizationId",
295
330
  "org"
296
331
  ],
332
+ "dependsOn": [
333
+ "edit"
334
+ ],
297
335
  "description": "Sanity organization ID used to scope Blueprint and Stack",
298
336
  "exclusive": [
299
337
  "project-id"
300
338
  ],
301
- "hidden": true,
302
339
  "name": "organization-id",
303
340
  "hasDynamicHelp": false,
304
341
  "multiple": false,
305
342
  "type": "option"
306
343
  },
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"
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"
331
350
  }
332
351
  },
333
352
  "hasDynamicHelp": false,
334
- "hidden": true,
335
353
  "hiddenAliases": [],
336
- "id": "functions:build",
354
+ "id": "blueprints:config",
337
355
  "pluginAlias": "@sanity/runtime-cli",
338
356
  "pluginName": "@sanity/runtime-cli",
339
357
  "pluginType": "core",
340
358
  "strict": true,
341
- "summary": "Build Sanity Function(s) to zip archives",
359
+ "summary": "View or edit the local Blueprint configuration",
342
360
  "enableJsonFlag": true,
343
361
  "needs": [
362
+ "token",
344
363
  "blueprint"
345
364
  ],
346
365
  "isESM": true,
347
366
  "relativePath": [
348
367
  "dist",
349
368
  "commands",
350
- "functions",
351
- "build.js"
369
+ "blueprints",
370
+ "config.js"
352
371
  ]
353
372
  },
354
- "functions:dev": {
373
+ "blueprints:deploy": {
355
374
  "aliases": [],
356
375
  "args": {},
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'.",
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).",
358
377
  "examples": [
359
- "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974",
360
- "<%= config.bin %> <%= command.id %> --timeout 60"
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>"
361
385
  ],
362
386
  "flags": {
363
387
  "json": {
@@ -402,7 +426,6 @@
402
426
  },
403
427
  "stack": {
404
428
  "description": "Stack name or ID to use instead of the locally configured Stack",
405
- "hidden": true,
406
429
  "name": "stack",
407
430
  "hasDynamicHelp": false,
408
431
  "multiple": false,
@@ -417,7 +440,6 @@
417
440
  "exclusive": [
418
441
  "organization-id"
419
442
  ],
420
- "hidden": true,
421
443
  "name": "project-id",
422
444
  "hasDynamicHelp": false,
423
445
  "multiple": false,
@@ -433,35 +455,56 @@
433
455
  "exclusive": [
434
456
  "project-id"
435
457
  ],
436
- "hidden": true,
437
458
  "name": "organization-id",
438
459
  "hasDynamicHelp": false,
439
460
  "multiple": false,
440
461
  "type": "option"
441
462
  },
442
- "host": {
443
- "char": "h",
444
- "description": "The local network interface at which to listen. [default: \"localhost\"]",
445
- "name": "host",
446
- "required": false,
463
+ "message": {
464
+ "char": "m",
465
+ "description": "Message describing the deployment (e.g. reason for change)",
466
+ "name": "message",
447
467
  "hasDynamicHelp": false,
448
468
  "multiple": false,
449
469
  "type": "option"
450
470
  },
451
- "port": {
452
- "char": "p",
453
- "description": "TCP port to start emulator on. [default: 8080]",
454
- "name": "port",
455
- "required": false,
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",
456
479
  "hasDynamicHelp": false,
457
480
  "multiple": false,
481
+ "options": [
482
+ "npm",
483
+ "pnpm",
484
+ "yarn"
485
+ ],
458
486
  "type": "option"
459
487
  },
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,
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
+ "configure": {
495
+ "aliases": [
496
+ "config",
497
+ "init"
498
+ ],
499
+ "description": "Configure the local Blueprint interactively before deploying",
500
+ "hidden": true,
501
+ "name": "configure",
502
+ "allowNo": false,
503
+ "type": "boolean"
504
+ },
505
+ "new-stack-name": {
506
+ "description": "Set a new name for the Stack",
507
+ "name": "new-stack-name",
465
508
  "hasDynamicHelp": false,
466
509
  "multiple": false,
467
510
  "type": "option"
@@ -469,39 +512,32 @@
469
512
  },
470
513
  "hasDynamicHelp": false,
471
514
  "hiddenAliases": [],
472
- "id": "functions:dev",
515
+ "id": "blueprints:deploy",
473
516
  "pluginAlias": "@sanity/runtime-cli",
474
517
  "pluginName": "@sanity/runtime-cli",
475
518
  "pluginType": "core",
476
519
  "strict": true,
477
- "summary": "Start the Sanity Function emulator",
520
+ "summary": "Deploy the local Blueprint to the remote Stack",
478
521
  "enableJsonFlag": true,
479
522
  "needs": [
523
+ "deployedStack",
480
524
  "blueprint"
481
525
  ],
482
526
  "isESM": true,
483
527
  "relativePath": [
484
528
  "dist",
485
529
  "commands",
486
- "functions",
487
- "dev.js"
530
+ "blueprints",
531
+ "deploy.js"
488
532
  ]
489
533
  },
490
- "functions:logs": {
534
+ "blueprints:destroy": {
491
535
  "aliases": [],
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).",
536
+ "args": {},
537
+ "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).",
500
538
  "examples": [
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"
539
+ "<%= config.bin %> <%= command.id %>",
540
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
505
541
  ],
506
542
  "flags": {
507
543
  "json": {
@@ -545,7 +581,11 @@
545
581
  "type": "boolean"
546
582
  },
547
583
  "stack": {
548
- "description": "Stack name or ID to use instead of the locally configured Stack",
584
+ "aliases": [
585
+ "stack-id",
586
+ "stackId"
587
+ ],
588
+ "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
549
589
  "name": "stack",
550
590
  "hasDynamicHelp": false,
551
591
  "multiple": false,
@@ -556,11 +596,14 @@
556
596
  "project",
557
597
  "projectId"
558
598
  ],
599
+ "dependsOn": [
600
+ "stack",
601
+ "force"
602
+ ],
559
603
  "description": "Sanity project ID used to scope Blueprint and Stack",
560
604
  "exclusive": [
561
605
  "organization-id"
562
606
  ],
563
- "hidden": true,
564
607
  "name": "project-id",
565
608
  "hasDynamicHelp": false,
566
609
  "multiple": false,
@@ -572,104 +615,62 @@
572
615
  "organizationId",
573
616
  "org"
574
617
  ],
618
+ "dependsOn": [
619
+ "stack",
620
+ "force"
621
+ ],
575
622
  "description": "Sanity organization ID used to scope Blueprint and Stack",
576
623
  "exclusive": [
577
624
  "project-id"
578
625
  ],
579
- "hidden": true,
580
626
  "name": "organization-id",
581
627
  "hasDynamicHelp": false,
582
628
  "multiple": false,
583
629
  "type": "option"
584
630
  },
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
631
  "force": {
616
- "char": "f",
617
- "dependsOn": [
618
- "delete"
632
+ "aliases": [
633
+ "f"
619
634
  ],
620
- "description": "Skip confirmation for deleting logs",
635
+ "description": "Force Stack destruction (skip confirmation)",
621
636
  "name": "force",
622
- "required": false,
623
637
  "allowNo": false,
624
638
  "type": "boolean"
625
639
  },
626
- "watch": {
627
- "aliases": [
628
- "follow"
629
- ],
630
- "char": "w",
631
- "description": "Watch for new logs (streaming mode)",
632
- "name": "watch",
640
+ "no-wait": {
641
+ "description": "Do not wait for Stack destruction to complete",
642
+ "name": "no-wait",
633
643
  "allowNo": false,
634
644
  "type": "boolean"
635
645
  }
636
646
  },
637
647
  "hasDynamicHelp": false,
638
648
  "hiddenAliases": [],
639
- "id": "functions:logs",
649
+ "id": "blueprints:destroy",
640
650
  "pluginAlias": "@sanity/runtime-cli",
641
651
  "pluginName": "@sanity/runtime-cli",
642
652
  "pluginType": "core",
643
653
  "strict": true,
644
- "summary": "Retrieve or delete logs for a Sanity Function",
654
+ "summary": "Destroy a remote Stack deployment and its resources",
645
655
  "enableJsonFlag": true,
646
656
  "needs": [
647
- "deployedStack",
648
- "blueprint"
657
+ "scope"
649
658
  ],
650
659
  "isESM": true,
651
660
  "relativePath": [
652
661
  "dist",
653
662
  "commands",
654
- "functions",
655
- "logs.js"
663
+ "blueprints",
664
+ "destroy.js"
656
665
  ]
657
666
  },
658
- "functions:test": {
667
+ "blueprints:doctor": {
659
668
  "aliases": [],
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.",
669
+ "args": {},
670
+ "description": "Analyzes your local Blueprint and remote Stack configuration for common issues, such as missing authentication, invalid project references, or misconfigured resources.\n\nRun this command when encountering errors with other Blueprint commands. Use --fix to interactively resolve detected issues.\n\nSupports --json for programmatic consumption of diagnostic results.",
668
671
  "examples": [
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\" }'"
672
+ "<%= config.bin %> <%= command.id %>",
673
+ "<%= config.bin %> <%= command.id %> --fix"
673
674
  ],
674
675
  "flags": {
675
676
  "json": {
@@ -685,7 +686,6 @@
685
686
  "char": "p",
686
687
  "description": "Path to a Blueprint file or directory containing one",
687
688
  "env": "SANITY_BLUEPRINT_PATH",
688
- "hidden": true,
689
689
  "name": "path",
690
690
  "hasDynamicHelp": false,
691
691
  "multiple": false,
@@ -698,305 +698,53 @@
698
698
  "allowNo": false,
699
699
  "type": "boolean"
700
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,
932
- "hasDynamicHelp": false,
933
- "multiple": false,
934
- "type": "option"
701
+ "validate-resources": {
702
+ "description": "Validate resources",
703
+ "hidden": true,
704
+ "name": "validate-resources",
705
+ "allowNo": true,
706
+ "type": "boolean"
935
707
  },
936
- "with-user-token": {
937
- "description": "Prime access token from CLI config",
938
- "name": "with-user-token",
708
+ "verbose": {
709
+ "description": "Verbose output",
710
+ "hidden": true,
711
+ "name": "verbose",
939
712
  "allowNo": false,
940
713
  "type": "boolean"
941
714
  },
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"
715
+ "fix": {
716
+ "description": "Interactively fix configuration issues",
717
+ "name": "fix",
718
+ "allowNo": false,
719
+ "type": "boolean"
956
720
  }
957
721
  },
958
722
  "hasDynamicHelp": false,
959
723
  "hiddenAliases": [],
960
- "id": "functions:test",
724
+ "id": "blueprints:doctor",
961
725
  "pluginAlias": "@sanity/runtime-cli",
962
726
  "pluginName": "@sanity/runtime-cli",
963
727
  "pluginType": "core",
964
728
  "strict": true,
965
- "summary": "Invoke a local Sanity Function",
729
+ "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
966
730
  "enableJsonFlag": true,
967
- "needs": [
968
- "blueprint"
969
- ],
970
731
  "isESM": true,
971
732
  "relativePath": [
972
733
  "dist",
973
734
  "commands",
974
- "functions",
975
- "test.js"
735
+ "blueprints",
736
+ "doctor.js"
976
737
  ]
977
738
  },
978
- "blueprints:add": {
739
+ "blueprints:info": {
979
740
  "aliases": [],
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",
741
+ "args": {},
742
+ "description": "Displays the current state and metadata of your remote Stack deployment, including deployed resources, status, and configuration.\n\nUse this command to verify a deployment succeeded, check what resources are live, or confirm which Stack your local Blueprint is connected to.\n\nRun 'blueprints stacks' to see all available Stacks in your project or organization.",
994
743
  "examples": [
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"
744
+ "<%= config.bin %> <%= command.id %>",
745
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
746
+ "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
747
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1000
748
  ],
1001
749
  "flags": {
1002
750
  "json": {
@@ -1040,8 +788,10 @@
1040
788
  "type": "boolean"
1041
789
  },
1042
790
  "stack": {
1043
- "description": "Stack name or ID to use instead of the locally configured Stack",
1044
- "hidden": true,
791
+ "aliases": [
792
+ "id"
793
+ ],
794
+ "description": "Stack name or ID",
1045
795
  "name": "stack",
1046
796
  "hasDynamicHelp": false,
1047
797
  "multiple": false,
@@ -1056,7 +806,6 @@
1056
806
  "exclusive": [
1057
807
  "organization-id"
1058
808
  ],
1059
- "hidden": true,
1060
809
  "name": "project-id",
1061
810
  "hasDynamicHelp": false,
1062
811
  "multiple": false,
@@ -1072,159 +821,233 @@
1072
821
  "exclusive": [
1073
822
  "project-id"
1074
823
  ],
1075
- "hidden": true,
1076
824
  "name": "organization-id",
1077
825
  "hasDynamicHelp": false,
1078
826
  "multiple": false,
1079
827
  "type": "option"
828
+ }
829
+ },
830
+ "hasDynamicHelp": false,
831
+ "hiddenAliases": [],
832
+ "id": "blueprints:info",
833
+ "pluginAlias": "@sanity/runtime-cli",
834
+ "pluginName": "@sanity/runtime-cli",
835
+ "pluginType": "core",
836
+ "strict": true,
837
+ "summary": "Display the status and resources of the remote Stack deployment",
838
+ "enableJsonFlag": true,
839
+ "needs": [
840
+ "deployedStack"
841
+ ],
842
+ "isESM": true,
843
+ "relativePath": [
844
+ "dist",
845
+ "commands",
846
+ "blueprints",
847
+ "info.js"
848
+ ]
849
+ },
850
+ "blueprints:init": {
851
+ "aliases": [],
852
+ "args": {
853
+ "dir": {
854
+ "description": "Directory to create the local Blueprint in (defaults to the current directory)",
855
+ "name": "dir"
856
+ }
857
+ },
858
+ "description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[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.",
859
+ "examples": [
860
+ "<%= config.bin %> <%= command.id %>",
861
+ "<%= config.bin %> <%= command.id %> .",
862
+ "<%= config.bin %> <%= command.id %> [directory]",
863
+ "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
864
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
865
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
866
+ "<%= config.bin %> <%= command.id %> --stack-name <newStackName>",
867
+ "<%= config.bin %> <%= command.id %> --stack-id <existingStackId>",
868
+ "<%= config.bin %> <%= command.id %> new-stack --type <json|js|ts> --org <organizationId> --name <newStackName>",
869
+ "<%= config.bin %> <%= command.id %> old-stack --type <json|js|ts> --project-id <projectId> --stack-id <existingStackId>"
870
+ ],
871
+ "flags": {
872
+ "json": {
873
+ "description": "Format output as json",
874
+ "name": "json",
875
+ "allowNo": false,
876
+ "type": "boolean"
1080
877
  },
1081
- "example": {
878
+ "path": {
1082
879
  "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"
880
+ "blueprint-path"
1093
881
  ],
1094
- "name": "example",
882
+ "char": "p",
883
+ "description": "Path to a Blueprint file or directory containing one",
884
+ "env": "SANITY_BLUEPRINT_PATH",
885
+ "hidden": true,
886
+ "name": "path",
1095
887
  "hasDynamicHelp": false,
1096
888
  "multiple": false,
1097
889
  "type": "option"
1098
890
  },
1099
- "name": {
1100
- "char": "n",
1101
- "description": "Name of the resource to add",
1102
- "name": "name",
891
+ "trace": {
892
+ "description": "Trace output",
893
+ "hidden": true,
894
+ "name": "trace",
895
+ "allowNo": false,
896
+ "type": "boolean"
897
+ },
898
+ "validate-resources": {
899
+ "description": "Validate resources",
900
+ "hidden": true,
901
+ "name": "validate-resources",
902
+ "allowNo": true,
903
+ "type": "boolean"
904
+ },
905
+ "verbose": {
906
+ "description": "Verbose output",
907
+ "hidden": true,
908
+ "name": "verbose",
909
+ "allowNo": false,
910
+ "type": "boolean"
911
+ },
912
+ "dir": {
913
+ "description": "Directory to create the local Blueprint in",
914
+ "name": "dir",
1103
915
  "hasDynamicHelp": false,
1104
916
  "multiple": false,
1105
917
  "type": "option"
1106
918
  },
1107
- "fn-type": {
919
+ "example": {
1108
920
  "aliases": [
1109
- "function-type"
921
+ "recipe"
1110
922
  ],
1111
- "dependsOn": [
1112
- "name"
923
+ "description": "Example to use for the local Blueprint",
924
+ "exclusive": [
925
+ "blueprint-type",
926
+ "stack-id",
927
+ "stack-name"
1113
928
  ],
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",
929
+ "name": "example",
1116
930
  "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
- ],
931
+ "multiple": false,
1129
932
  "type": "option"
1130
933
  },
1131
- "language": {
934
+ "blueprint-type": {
1132
935
  "aliases": [
1133
- "function-language",
1134
- "fn-language",
1135
- "lang"
936
+ "type"
1136
937
  ],
1137
- "description": "Language of the new function",
1138
- "name": "language",
1139
- "default": "ts",
938
+ "description": "Blueprint manifest type to use for the local Blueprint",
939
+ "name": "blueprint-type",
1140
940
  "hasDynamicHelp": false,
1141
941
  "multiple": false,
1142
942
  "options": [
1143
- "ts",
1144
- "js"
943
+ "json",
944
+ "js",
945
+ "ts"
1145
946
  ],
1146
947
  "type": "option"
1147
948
  },
1148
- "javascript": {
949
+ "project-id": {
1149
950
  "aliases": [
1150
- "js"
951
+ "project",
952
+ "projectId"
1151
953
  ],
1152
- "description": "Use JavaScript instead of TypeScript",
954
+ "description": "Sanity project ID used to scope Blueprint and Stack",
1153
955
  "exclusive": [
1154
- "language"
956
+ "organization-id"
1155
957
  ],
1156
- "name": "javascript",
1157
- "allowNo": false,
1158
- "type": "boolean"
958
+ "name": "project-id",
959
+ "hasDynamicHelp": false,
960
+ "multiple": false,
961
+ "type": "option"
1159
962
  },
1160
- "fn-helpers": {
963
+ "organization-id": {
1161
964
  "aliases": [
1162
- "function-helpers",
1163
- "helpers"
965
+ "organization",
966
+ "organizationId",
967
+ "org"
1164
968
  ],
1165
- "description": "Add helpers to the new function",
1166
- "name": "fn-helpers",
1167
- "allowNo": true,
1168
- "type": "boolean"
969
+ "description": "Sanity organization ID used to scope Blueprint and Stack",
970
+ "exclusive": [
971
+ "project-id"
972
+ ],
973
+ "name": "organization-id",
974
+ "hasDynamicHelp": false,
975
+ "multiple": false,
976
+ "type": "option"
1169
977
  },
1170
- "fn-installer": {
978
+ "stack-id": {
1171
979
  "aliases": [
1172
- "function-installer",
1173
- "installer"
980
+ "stackId"
981
+ ],
982
+ "description": "Existing Stack ID used to scope local Blueprint",
983
+ "exclusive": [
984
+ "stack-name"
985
+ ],
986
+ "name": "stack-id",
987
+ "relationships": [
988
+ {
989
+ "type": "some",
990
+ "flags": [
991
+ "project-id",
992
+ "organization-id"
993
+ ]
994
+ }
1174
995
  ],
1175
- "description": "Which package manager to use when installing the @sanity/functions helpers",
1176
- "name": "fn-installer",
1177
996
  "hasDynamicHelp": false,
1178
997
  "multiple": false,
1179
- "options": [
1180
- "skip",
1181
- "npm",
1182
- "pnpm",
1183
- "yarn"
1184
- ],
1185
998
  "type": "option"
1186
999
  },
1187
- "install": {
1188
- "char": "i",
1189
- "description": "Shortcut for --fn-installer npm",
1000
+ "stack-name": {
1001
+ "aliases": [
1002
+ "name"
1003
+ ],
1004
+ "description": "Name to use for a new Stack provisioned during initialization",
1190
1005
  "exclusive": [
1191
- "fn-installer"
1006
+ "stack-id"
1192
1007
  ],
1193
- "name": "install",
1194
- "allowNo": false,
1195
- "type": "boolean"
1008
+ "name": "stack-name",
1009
+ "relationships": [
1010
+ {
1011
+ "type": "some",
1012
+ "flags": [
1013
+ "project-id",
1014
+ "organization-id"
1015
+ ]
1016
+ }
1017
+ ],
1018
+ "hasDynamicHelp": false,
1019
+ "multiple": false,
1020
+ "type": "option"
1196
1021
  }
1197
1022
  },
1198
1023
  "hasDynamicHelp": false,
1199
1024
  "hiddenAliases": [],
1200
- "id": "blueprints:add",
1025
+ "id": "blueprints:init",
1201
1026
  "pluginAlias": "@sanity/runtime-cli",
1202
1027
  "pluginName": "@sanity/runtime-cli",
1203
1028
  "pluginType": "core",
1204
- "state": "deprecated",
1205
1029
  "strict": true,
1206
- "summary": "[deprecated] Use \"functions add\" instead",
1030
+ "summary": "Initialize a Blueprint and create a remote Stack",
1207
1031
  "enableJsonFlag": true,
1208
- "needs": [
1209
- "blueprint"
1210
- ],
1211
1032
  "isESM": true,
1212
1033
  "relativePath": [
1213
1034
  "dist",
1214
1035
  "commands",
1215
1036
  "blueprints",
1216
- "add.js"
1037
+ "init.js"
1217
1038
  ]
1218
1039
  },
1219
- "blueprints:config": {
1040
+ "blueprints:logs": {
1220
1041
  "aliases": [],
1221
1042
  "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.",
1043
+ "description": "Retrieves Stack deployment logs, useful for debugging and monitoring deployment activity.\n\nUse --watch (-w) to tail logs in real-time.\n\nUse --limit, --since, or --before to narrow the result set when not watching.\n\nIf you're not seeing expected logs, verify your Stack is deployed with 'blueprints info'.",
1223
1044
  "examples": [
1224
1045
  "<%= config.bin %> <%= command.id %>",
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>"
1046
+ "<%= config.bin %> <%= command.id %> --watch",
1047
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1048
+ "<%= config.bin %> <%= command.id %> --limit 500",
1049
+ "<%= config.bin %> <%= command.id %> --since 2026-05-01T00:00:00Z",
1050
+ "<%= config.bin %> <%= command.id %> --before 2026-05-01T00:00:00Z"
1228
1051
  ],
1229
1052
  "flags": {
1230
1053
  "json": {
@@ -1268,14 +1091,7 @@
1268
1091
  "type": "boolean"
1269
1092
  },
1270
1093
  "stack": {
1271
- "aliases": [
1272
- "stack-id",
1273
- "stackId"
1274
- ],
1275
- "dependsOn": [
1276
- "edit"
1277
- ],
1278
- "description": "Stack name or ID to set in the configuration. Requires --edit flag",
1094
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1279
1095
  "name": "stack",
1280
1096
  "hasDynamicHelp": false,
1281
1097
  "multiple": false,
@@ -1286,9 +1102,6 @@
1286
1102
  "project",
1287
1103
  "projectId"
1288
1104
  ],
1289
- "dependsOn": [
1290
- "edit"
1291
- ],
1292
1105
  "description": "Sanity project ID used to scope Blueprint and Stack",
1293
1106
  "exclusive": [
1294
1107
  "organization-id"
@@ -1304,9 +1117,6 @@
1304
1117
  "organizationId",
1305
1118
  "org"
1306
1119
  ],
1307
- "dependsOn": [
1308
- "edit"
1309
- ],
1310
1120
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1311
1121
  "exclusive": [
1312
1122
  "project-id"
@@ -1316,47 +1126,80 @@
1316
1126
  "multiple": false,
1317
1127
  "type": "option"
1318
1128
  },
1319
- "edit": {
1320
- "char": "e",
1321
- "description": "Modify the configuration interactively, or directly when combined with ID flags.",
1322
- "name": "edit",
1129
+ "watch": {
1130
+ "aliases": [
1131
+ "follow"
1132
+ ],
1133
+ "char": "w",
1134
+ "description": "Watch for new Stack logs",
1135
+ "name": "watch",
1323
1136
  "allowNo": false,
1324
1137
  "type": "boolean"
1138
+ },
1139
+ "limit": {
1140
+ "char": "l",
1141
+ "description": "Maximum number of log entries to retrieve (1-500)",
1142
+ "exclusive": [
1143
+ "watch"
1144
+ ],
1145
+ "name": "limit",
1146
+ "hasDynamicHelp": false,
1147
+ "multiple": false,
1148
+ "type": "option"
1149
+ },
1150
+ "since": {
1151
+ "description": "Only show logs after this ISO 8601 timestamp",
1152
+ "exclusive": [
1153
+ "watch"
1154
+ ],
1155
+ "name": "since",
1156
+ "hasDynamicHelp": false,
1157
+ "multiple": false,
1158
+ "type": "option"
1159
+ },
1160
+ "before": {
1161
+ "description": "Only show logs before this ISO 8601 timestamp",
1162
+ "exclusive": [
1163
+ "watch"
1164
+ ],
1165
+ "name": "before",
1166
+ "hasDynamicHelp": false,
1167
+ "multiple": false,
1168
+ "type": "option"
1325
1169
  }
1326
1170
  },
1327
1171
  "hasDynamicHelp": false,
1328
1172
  "hiddenAliases": [],
1329
- "id": "blueprints:config",
1173
+ "id": "blueprints:logs",
1330
1174
  "pluginAlias": "@sanity/runtime-cli",
1331
1175
  "pluginName": "@sanity/runtime-cli",
1332
1176
  "pluginType": "core",
1333
1177
  "strict": true,
1334
- "summary": "View or edit the local Blueprint configuration",
1178
+ "summary": "Display logs for the current Blueprint's Stack deployment",
1335
1179
  "enableJsonFlag": true,
1336
1180
  "needs": [
1337
- "token",
1338
- "blueprint"
1181
+ "deployedStack"
1339
1182
  ],
1340
1183
  "isESM": true,
1341
1184
  "relativePath": [
1342
1185
  "dist",
1343
1186
  "commands",
1344
1187
  "blueprints",
1345
- "config.js"
1188
+ "logs.js"
1346
1189
  ]
1347
1190
  },
1348
- "blueprints:deploy": {
1191
+ "blueprints:mint-deploy-token": {
1349
1192
  "aliases": [],
1350
1193
  "args": {},
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).",
1194
+ "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.",
1352
1195
  "examples": [
1353
1196
  "<%= config.bin %> <%= command.id %>",
1354
- "<%= config.bin %> <%= command.id %> --message \"Enable staging dataset\"",
1355
- "<%= config.bin %> <%= command.id %> --no-wait",
1356
- "<%= config.bin %> <%= command.id %> --fn-installer npm",
1357
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1358
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>",
1359
- "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1197
+ "<%= config.bin %> <%= command.id %> --label \"ci-deploy\"",
1198
+ "<%= config.bin %> <%= command.id %> --print",
1199
+ "export SANITY_AUTH_TOKEN=$(<%= config.bin %> <%= command.id %> --print)",
1200
+ "<%= config.bin %> <%= command.id %> --json",
1201
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1202
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId>"
1360
1203
  ],
1361
1204
  "flags": {
1362
1205
  "json": {
@@ -1401,6 +1244,7 @@
1401
1244
  },
1402
1245
  "stack": {
1403
1246
  "description": "Stack name or ID to use instead of the locally configured Stack",
1247
+ "hidden": true,
1404
1248
  "name": "stack",
1405
1249
  "hasDynamicHelp": false,
1406
1250
  "multiple": false,
@@ -1435,73 +1279,52 @@
1435
1279
  "multiple": false,
1436
1280
  "type": "option"
1437
1281
  },
1438
- "message": {
1439
- "char": "m",
1440
- "description": "Message describing the deployment (e.g. reason for change)",
1441
- "name": "message",
1282
+ "label": {
1283
+ "description": "Human-readable label for the robot. Defaults to a generated value.",
1284
+ "name": "label",
1442
1285
  "hasDynamicHelp": false,
1443
1286
  "multiple": false,
1444
1287
  "type": "option"
1445
1288
  },
1446
- "fn-installer": {
1447
- "aliases": [
1448
- "function-installer",
1449
- "installer"
1450
- ],
1451
- "description": "Which package manager to use when installing Function dependencies",
1452
- "hidden": true,
1453
- "name": "fn-installer",
1454
- "hasDynamicHelp": false,
1455
- "multiple": false,
1456
- "options": [
1457
- "npm",
1458
- "pnpm",
1459
- "yarn"
1289
+ "print": {
1290
+ "char": "P",
1291
+ "description": "Print only the raw token to stdout (suitable for shell substitution)",
1292
+ "exclusive": [
1293
+ "json"
1460
1294
  ],
1461
- "type": "option"
1462
- },
1463
- "no-wait": {
1464
- "description": "Do not wait for Stack deployment to complete",
1465
- "name": "no-wait",
1295
+ "name": "print",
1466
1296
  "allowNo": false,
1467
1297
  "type": "boolean"
1468
- },
1469
- "new-stack-name": {
1470
- "description": "Set a new name for the Stack",
1471
- "name": "new-stack-name",
1472
- "hasDynamicHelp": false,
1473
- "multiple": false,
1474
- "type": "option"
1475
1298
  }
1476
1299
  },
1477
1300
  "hasDynamicHelp": false,
1478
1301
  "hiddenAliases": [],
1479
- "id": "blueprints:deploy",
1302
+ "id": "blueprints:mint-deploy-token",
1480
1303
  "pluginAlias": "@sanity/runtime-cli",
1481
1304
  "pluginName": "@sanity/runtime-cli",
1482
1305
  "pluginType": "core",
1483
1306
  "strict": true,
1484
- "summary": "Deploy the local Blueprint to the remote Stack",
1307
+ "summary": "Create a robot API token for deploying Blueprints from CI/CD",
1485
1308
  "enableJsonFlag": true,
1486
1309
  "needs": [
1487
- "deployedStack",
1488
- "blueprint"
1310
+ "scope"
1489
1311
  ],
1490
1312
  "isESM": true,
1491
1313
  "relativePath": [
1492
1314
  "dist",
1493
1315
  "commands",
1494
1316
  "blueprints",
1495
- "deploy.js"
1317
+ "mint-deploy-token.js"
1496
1318
  ]
1497
1319
  },
1498
- "blueprints:destroy": {
1320
+ "blueprints:plan": {
1499
1321
  "aliases": [],
1500
1322
  "args": {},
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).",
1323
+ "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.",
1502
1324
  "examples": [
1503
1325
  "<%= config.bin %> <%= command.id %>",
1504
- "<%= config.bin %> <%= command.id %> --stack <name-or-id> --project-id <projectId> --force --no-wait"
1326
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1327
+ "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1505
1328
  ],
1506
1329
  "flags": {
1507
1330
  "json": {
@@ -1545,11 +1368,7 @@
1545
1368
  "type": "boolean"
1546
1369
  },
1547
1370
  "stack": {
1548
- "aliases": [
1549
- "stack-id",
1550
- "stackId"
1551
- ],
1552
- "description": "Stack name or ID to destroy (defaults to the locally configured Stack)",
1371
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1553
1372
  "name": "stack",
1554
1373
  "hasDynamicHelp": false,
1555
1374
  "multiple": false,
@@ -1560,10 +1379,6 @@
1560
1379
  "project",
1561
1380
  "projectId"
1562
1381
  ],
1563
- "dependsOn": [
1564
- "stack",
1565
- "force"
1566
- ],
1567
1382
  "description": "Sanity project ID used to scope Blueprint and Stack",
1568
1383
  "exclusive": [
1569
1384
  "organization-id"
@@ -1579,10 +1394,6 @@
1579
1394
  "organizationId",
1580
1395
  "org"
1581
1396
  ],
1582
- "dependsOn": [
1583
- "stack",
1584
- "force"
1585
- ],
1586
1397
  "description": "Sanity organization ID used to scope Blueprint and Stack",
1587
1398
  "exclusive": [
1588
1399
  "project-id"
@@ -1591,50 +1402,38 @@
1591
1402
  "hasDynamicHelp": false,
1592
1403
  "multiple": false,
1593
1404
  "type": "option"
1594
- },
1595
- "force": {
1596
- "aliases": [
1597
- "f"
1598
- ],
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",
1607
- "allowNo": false,
1608
- "type": "boolean"
1609
1405
  }
1610
1406
  },
1611
1407
  "hasDynamicHelp": false,
1612
1408
  "hiddenAliases": [],
1613
- "id": "blueprints:destroy",
1409
+ "id": "blueprints:plan",
1614
1410
  "pluginAlias": "@sanity/runtime-cli",
1615
1411
  "pluginName": "@sanity/runtime-cli",
1616
1412
  "pluginType": "core",
1617
1413
  "strict": true,
1618
- "summary": "Destroy a remote Stack deployment and its resources",
1414
+ "summary": "Preview changes that will be applied to the remote Stack",
1619
1415
  "enableJsonFlag": true,
1620
1416
  "needs": [
1621
- "scope"
1417
+ "token",
1418
+ "blueprint"
1622
1419
  ],
1623
1420
  "isESM": true,
1624
1421
  "relativePath": [
1625
1422
  "dist",
1626
1423
  "commands",
1627
1424
  "blueprints",
1628
- "destroy.js"
1425
+ "plan.js"
1629
1426
  ]
1630
1427
  },
1631
- "blueprints:doctor": {
1428
+ "blueprints:promote": {
1632
1429
  "aliases": [],
1633
1430
  "args": {},
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.",
1431
+ "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.",
1635
1432
  "examples": [
1636
1433
  "<%= config.bin %> <%= command.id %>",
1637
- "<%= config.bin %> <%= command.id %> --fix"
1434
+ "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1435
+ "<%= config.bin %> <%= command.id %> --project-id <projectId> --stack <name-or-id>",
1436
+ "<%= config.bin %> <%= command.id %> --new-stack-name <new-name>"
1638
1437
  ],
1639
1438
  "flags": {
1640
1439
  "json": {
@@ -1650,6 +1449,7 @@
1650
1449
  "char": "p",
1651
1450
  "description": "Path to a Blueprint file or directory containing one",
1652
1451
  "env": "SANITY_BLUEPRINT_PATH",
1452
+ "hidden": true,
1653
1453
  "name": "path",
1654
1454
  "hasDynamicHelp": false,
1655
1455
  "multiple": false,
@@ -1676,39 +1476,90 @@
1676
1476
  "allowNo": false,
1677
1477
  "type": "boolean"
1678
1478
  },
1679
- "fix": {
1680
- "description": "Interactively fix configuration issues",
1681
- "name": "fix",
1479
+ "stack": {
1480
+ "aliases": [
1481
+ "id"
1482
+ ],
1483
+ "description": "Stack name or ID to promote",
1484
+ "name": "stack",
1485
+ "hasDynamicHelp": false,
1486
+ "multiple": false,
1487
+ "type": "option"
1488
+ },
1489
+ "project-id": {
1490
+ "aliases": [
1491
+ "project",
1492
+ "projectId"
1493
+ ],
1494
+ "description": "Sanity project ID used to scope Blueprint and Stack",
1495
+ "exclusive": [
1496
+ "organization-id"
1497
+ ],
1498
+ "name": "project-id",
1499
+ "hasDynamicHelp": false,
1500
+ "multiple": false,
1501
+ "type": "option"
1502
+ },
1503
+ "organization-id": {
1504
+ "aliases": [
1505
+ "organization",
1506
+ "organizationId",
1507
+ "org"
1508
+ ],
1509
+ "description": "Sanity organization ID used to scope Blueprint and Stack",
1510
+ "exclusive": [
1511
+ "project-id"
1512
+ ],
1513
+ "hidden": true,
1514
+ "name": "organization-id",
1515
+ "hasDynamicHelp": false,
1516
+ "multiple": false,
1517
+ "type": "option"
1518
+ },
1519
+ "force": {
1520
+ "description": "Skip confirmation prompt",
1521
+ "name": "force",
1682
1522
  "allowNo": false,
1683
1523
  "type": "boolean"
1524
+ },
1525
+ "new-stack-name": {
1526
+ "description": "Set a new name for the Stack while promoting",
1527
+ "name": "new-stack-name",
1528
+ "hasDynamicHelp": false,
1529
+ "multiple": false,
1530
+ "type": "option"
1684
1531
  }
1685
1532
  },
1686
1533
  "hasDynamicHelp": false,
1687
1534
  "hiddenAliases": [],
1688
- "id": "blueprints:doctor",
1535
+ "id": "blueprints:promote",
1689
1536
  "pluginAlias": "@sanity/runtime-cli",
1690
1537
  "pluginName": "@sanity/runtime-cli",
1691
1538
  "pluginType": "core",
1692
1539
  "strict": true,
1693
- "summary": "Diagnose potential issues with local Blueprint and remote Stack configuration",
1540
+ "summary": "Promote a Stack from project scope to organization scope",
1694
1541
  "enableJsonFlag": true,
1542
+ "needs": [
1543
+ "deployedStack",
1544
+ "blueprint"
1545
+ ],
1695
1546
  "isESM": true,
1696
1547
  "relativePath": [
1697
1548
  "dist",
1698
1549
  "commands",
1699
1550
  "blueprints",
1700
- "doctor.js"
1551
+ "promote.js"
1701
1552
  ]
1702
1553
  },
1703
- "blueprints:info": {
1554
+ "blueprints:stacks": {
1704
1555
  "aliases": [],
1705
1556
  "args": {},
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.",
1557
+ "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.",
1707
1558
  "examples": [
1708
1559
  "<%= config.bin %> <%= command.id %>",
1709
- "<%= config.bin %> <%= command.id %> --stack <name-or-id>",
1710
- "<%= config.bin %> <%= command.id %> --project-id <id> --stack <name-or-id>",
1711
- "<%= config.bin %> <%= command.id %> --organization-id <orgId> --stack <name-or-id>"
1560
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
1561
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
1562
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId> --include-projects"
1712
1563
  ],
1713
1564
  "flags": {
1714
1565
  "json": {
@@ -1752,10 +1603,8 @@
1752
1603
  "type": "boolean"
1753
1604
  },
1754
1605
  "stack": {
1755
- "aliases": [
1756
- "id"
1757
- ],
1758
- "description": "Stack name or ID",
1606
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1607
+ "hidden": true,
1759
1608
  "name": "stack",
1760
1609
  "hasDynamicHelp": false,
1761
1610
  "multiple": false,
@@ -1768,7 +1617,8 @@
1768
1617
  ],
1769
1618
  "description": "Sanity project ID used to scope Blueprint and Stack",
1770
1619
  "exclusive": [
1771
- "organization-id"
1620
+ "organization-id",
1621
+ "include-projects"
1772
1622
  ],
1773
1623
  "name": "project-id",
1774
1624
  "hasDynamicHelp": false,
@@ -1789,48 +1639,47 @@
1789
1639
  "hasDynamicHelp": false,
1790
1640
  "multiple": false,
1791
1641
  "type": "option"
1642
+ },
1643
+ "include-projects": {
1644
+ "dependsOn": [
1645
+ "organization-id"
1646
+ ],
1647
+ "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
1648
+ "name": "include-projects",
1649
+ "allowNo": false,
1650
+ "type": "boolean"
1792
1651
  }
1793
1652
  },
1794
1653
  "hasDynamicHelp": false,
1795
1654
  "hiddenAliases": [],
1796
- "id": "blueprints:info",
1655
+ "id": "blueprints:stacks",
1797
1656
  "pluginAlias": "@sanity/runtime-cli",
1798
1657
  "pluginName": "@sanity/runtime-cli",
1799
1658
  "pluginType": "core",
1800
1659
  "strict": true,
1801
- "summary": "Display the status and resources of the remote Stack deployment",
1660
+ "summary": "List remote Stack deployments for your project or organization",
1802
1661
  "enableJsonFlag": true,
1803
1662
  "needs": [
1804
- "deployedStack"
1663
+ "scope"
1805
1664
  ],
1806
1665
  "isESM": true,
1807
1666
  "relativePath": [
1808
1667
  "dist",
1809
1668
  "commands",
1810
1669
  "blueprints",
1811
- "info.js"
1670
+ "stacks.js"
1812
1671
  ]
1813
1672
  },
1814
- "blueprints:init": {
1673
+ "functions:add": {
1815
1674
  "aliases": [],
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.",
1675
+ "args": {},
1676
+ "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.",
1823
1677
  "examples": [
1824
1678
  "<%= config.bin %> <%= command.id %>",
1825
- "<%= config.bin %> <%= command.id %> .",
1826
- "<%= config.bin %> <%= command.id %> [directory]",
1827
- "<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
1828
- "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
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>"
1679
+ "<%= config.bin %> <%= command.id %> --helpers",
1680
+ "<%= config.bin %> <%= command.id %> --name my-function",
1681
+ "<%= config.bin %> <%= command.id %> --name my-function --type document-create",
1682
+ "<%= config.bin %> <%= command.id %> --name my-function --type document-create --type document-update --lang js"
1834
1683
  ],
1835
1684
  "flags": {
1836
1685
  "json": {
@@ -1873,41 +1722,12 @@
1873
1722
  "allowNo": false,
1874
1723
  "type": "boolean"
1875
1724
  },
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",
1725
+ "stack": {
1726
+ "description": "Stack name or ID to use instead of the locally configured Stack",
1727
+ "hidden": true,
1728
+ "name": "stack",
1904
1729
  "hasDynamicHelp": false,
1905
1730
  "multiple": false,
1906
- "options": [
1907
- "json",
1908
- "js",
1909
- "ts"
1910
- ],
1911
1731
  "type": "option"
1912
1732
  },
1913
1733
  "project-id": {
@@ -1919,6 +1739,7 @@
1919
1739
  "exclusive": [
1920
1740
  "organization-id"
1921
1741
  ],
1742
+ "hidden": true,
1922
1743
  "name": "project-id",
1923
1744
  "hasDynamicHelp": false,
1924
1745
  "multiple": false,
@@ -1934,85 +1755,145 @@
1934
1755
  "exclusive": [
1935
1756
  "project-id"
1936
1757
  ],
1758
+ "hidden": true,
1937
1759
  "name": "organization-id",
1938
1760
  "hasDynamicHelp": false,
1939
1761
  "multiple": false,
1940
1762
  "type": "option"
1941
1763
  },
1942
- "stack-id": {
1764
+ "example": {
1943
1765
  "aliases": [
1944
- "stackId"
1766
+ "recipe"
1945
1767
  ],
1946
- "description": "Existing Stack ID used to scope local Blueprint",
1768
+ "description": "Example to use for the Function",
1947
1769
  "exclusive": [
1948
- "stack-name"
1770
+ "name",
1771
+ "fn-type",
1772
+ "language",
1773
+ "javascript",
1774
+ "fn-helpers",
1775
+ "fn-installer"
1949
1776
  ],
1950
- "name": "stack-id",
1951
- "relationships": [
1952
- {
1953
- "type": "some",
1954
- "flags": [
1955
- "project-id",
1956
- "organization-id"
1957
- ]
1958
- }
1777
+ "name": "example",
1778
+ "hasDynamicHelp": false,
1779
+ "multiple": false,
1780
+ "type": "option"
1781
+ },
1782
+ "name": {
1783
+ "char": "n",
1784
+ "description": "Name of the Function to add",
1785
+ "name": "name",
1786
+ "hasDynamicHelp": false,
1787
+ "multiple": false,
1788
+ "type": "option"
1789
+ },
1790
+ "type": {
1791
+ "dependsOn": [
1792
+ "name"
1793
+ ],
1794
+ "description": "Document change event(s) that should trigger the function; you can specify multiple events by specifying this flag multiple times",
1795
+ "name": "type",
1796
+ "hasDynamicHelp": false,
1797
+ "multiple": true,
1798
+ "options": [
1799
+ "document-publish",
1800
+ "document-create",
1801
+ "document-delete",
1802
+ "document-update",
1803
+ "media-library-asset-create",
1804
+ "media-library-asset-delete",
1805
+ "media-library-asset-update",
1806
+ "scheduled-function",
1807
+ "sync-tag-invalidate"
1808
+ ],
1809
+ "type": "option"
1810
+ },
1811
+ "language": {
1812
+ "aliases": [
1813
+ "lang"
1959
1814
  ],
1815
+ "description": "Language of the new Function",
1816
+ "name": "language",
1817
+ "default": "ts",
1960
1818
  "hasDynamicHelp": false,
1961
1819
  "multiple": false,
1820
+ "options": [
1821
+ "ts",
1822
+ "js"
1823
+ ],
1962
1824
  "type": "option"
1963
1825
  },
1964
- "stack-name": {
1826
+ "javascript": {
1965
1827
  "aliases": [
1966
- "name"
1828
+ "js"
1967
1829
  ],
1968
- "description": "Name to use for a new Stack provisioned during initialization",
1830
+ "description": "Use JavaScript instead of TypeScript",
1969
1831
  "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
- }
1832
+ "language"
1981
1833
  ],
1834
+ "name": "javascript",
1835
+ "allowNo": false,
1836
+ "type": "boolean"
1837
+ },
1838
+ "helpers": {
1839
+ "description": "Add helpers to the new Function",
1840
+ "name": "helpers",
1841
+ "allowNo": true,
1842
+ "type": "boolean"
1843
+ },
1844
+ "installer": {
1845
+ "description": "How to install the @sanity/functions helpers",
1846
+ "name": "installer",
1982
1847
  "hasDynamicHelp": false,
1983
1848
  "multiple": false,
1849
+ "options": [
1850
+ "skip",
1851
+ "npm",
1852
+ "pnpm",
1853
+ "yarn"
1854
+ ],
1984
1855
  "type": "option"
1856
+ },
1857
+ "install": {
1858
+ "char": "i",
1859
+ "description": "Shortcut for --fn-installer npm",
1860
+ "exclusive": [
1861
+ "fn-installer"
1862
+ ],
1863
+ "name": "install",
1864
+ "allowNo": false,
1865
+ "type": "boolean"
1985
1866
  }
1986
1867
  },
1987
1868
  "hasDynamicHelp": false,
1988
1869
  "hiddenAliases": [],
1989
- "id": "blueprints:init",
1870
+ "id": "functions:add",
1990
1871
  "pluginAlias": "@sanity/runtime-cli",
1991
1872
  "pluginName": "@sanity/runtime-cli",
1992
1873
  "pluginType": "core",
1993
1874
  "strict": true,
1994
- "summary": "Initialize a Blueprint and create a remote Stack",
1875
+ "summary": "Add a Function to your Blueprint",
1995
1876
  "enableJsonFlag": true,
1877
+ "needs": [
1878
+ "blueprint"
1879
+ ],
1996
1880
  "isESM": true,
1997
1881
  "relativePath": [
1998
1882
  "dist",
1999
1883
  "commands",
2000
- "blueprints",
2001
- "init.js"
1884
+ "functions",
1885
+ "add.js"
2002
1886
  ]
2003
1887
  },
2004
- "blueprints:logs": {
1888
+ "functions:build": {
2005
1889
  "aliases": [],
2006
- "args": {},
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'.",
2008
- "examples": [
2009
- "<%= config.bin %> <%= command.id %>",
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"
2015
- ],
1890
+ "args": {
1891
+ "name": {
1892
+ "description": "The name of the Sanity Function",
1893
+ "name": "name",
1894
+ "required": false
1895
+ }
1896
+ },
2016
1897
  "flags": {
2017
1898
  "json": {
2018
1899
  "description": "Format output as json",
@@ -2056,6 +1937,7 @@
2056
1937
  },
2057
1938
  "stack": {
2058
1939
  "description": "Stack name or ID to use instead of the locally configured Stack",
1940
+ "hidden": true,
2059
1941
  "name": "stack",
2060
1942
  "hasDynamicHelp": false,
2061
1943
  "multiple": false,
@@ -2070,6 +1952,7 @@
2070
1952
  "exclusive": [
2071
1953
  "organization-id"
2072
1954
  ],
1955
+ "hidden": true,
2073
1956
  "name": "project-id",
2074
1957
  "hasDynamicHelp": false,
2075
1958
  "multiple": false,
@@ -2085,85 +1968,66 @@
2085
1968
  "exclusive": [
2086
1969
  "project-id"
2087
1970
  ],
1971
+ "hidden": true,
2088
1972
  "name": "organization-id",
2089
1973
  "hasDynamicHelp": false,
2090
1974
  "multiple": false,
2091
1975
  "type": "option"
2092
1976
  },
2093
- "watch": {
1977
+ "fn-installer": {
2094
1978
  "aliases": [
2095
- "follow"
2096
- ],
2097
- "char": "w",
2098
- "description": "Watch for new Stack logs",
2099
- "name": "watch",
2100
- "allowNo": false,
2101
- "type": "boolean"
2102
- },
2103
- "limit": {
2104
- "char": "l",
2105
- "description": "Maximum number of log entries to retrieve (1-500)",
2106
- "exclusive": [
2107
- "watch"
1979
+ "function-installer",
1980
+ "installer"
2108
1981
  ],
2109
- "name": "limit",
1982
+ "description": "Which package manager to use when building Functions",
1983
+ "hidden": true,
1984
+ "name": "fn-installer",
2110
1985
  "hasDynamicHelp": false,
2111
1986
  "multiple": false,
2112
- "type": "option"
2113
- },
2114
- "since": {
2115
- "description": "Only show logs after this ISO 8601 timestamp",
2116
- "exclusive": [
2117
- "watch"
1987
+ "options": [
1988
+ "npm",
1989
+ "pnpm",
1990
+ "yarn"
2118
1991
  ],
2119
- "name": "since",
2120
- "hasDynamicHelp": false,
2121
- "multiple": false,
2122
1992
  "type": "option"
2123
1993
  },
2124
- "before": {
2125
- "description": "Only show logs before this ISO 8601 timestamp",
2126
- "exclusive": [
2127
- "watch"
2128
- ],
2129
- "name": "before",
1994
+ "out-dir": {
1995
+ "char": "o",
1996
+ "description": "Output directory for zip files",
1997
+ "name": "out-dir",
2130
1998
  "hasDynamicHelp": false,
2131
1999
  "multiple": false,
2132
2000
  "type": "option"
2133
2001
  }
2134
2002
  },
2135
2003
  "hasDynamicHelp": false,
2004
+ "hidden": true,
2136
2005
  "hiddenAliases": [],
2137
- "id": "blueprints:logs",
2006
+ "id": "functions:build",
2138
2007
  "pluginAlias": "@sanity/runtime-cli",
2139
2008
  "pluginName": "@sanity/runtime-cli",
2140
2009
  "pluginType": "core",
2141
2010
  "strict": true,
2142
- "summary": "Display logs for the current Blueprint's Stack deployment",
2011
+ "summary": "Build Sanity Function(s) to zip archives",
2143
2012
  "enableJsonFlag": true,
2144
2013
  "needs": [
2145
- "deployedStack"
2014
+ "blueprint"
2146
2015
  ],
2147
2016
  "isESM": true,
2148
2017
  "relativePath": [
2149
2018
  "dist",
2150
2019
  "commands",
2151
- "blueprints",
2152
- "logs.js"
2020
+ "functions",
2021
+ "build.js"
2153
2022
  ]
2154
2023
  },
2155
- "blueprints:mint-deploy-token": {
2024
+ "functions:dev": {
2156
2025
  "aliases": [],
2157
2026
  "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.",
2027
+ "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'.",
2159
2028
  "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>"
2029
+ "<%= config.bin %> <%= command.id %> --host 127.0.0.1 --port 8974",
2030
+ "<%= config.bin %> <%= command.id %> --timeout 60"
2167
2031
  ],
2168
2032
  "flags": {
2169
2033
  "json": {
@@ -2223,6 +2087,7 @@
2223
2087
  "exclusive": [
2224
2088
  "organization-id"
2225
2089
  ],
2090
+ "hidden": true,
2226
2091
  "name": "project-id",
2227
2092
  "hasDynamicHelp": false,
2228
2093
  "multiple": false,
@@ -2238,57 +2103,70 @@
2238
2103
  "exclusive": [
2239
2104
  "project-id"
2240
2105
  ],
2106
+ "hidden": true,
2241
2107
  "name": "organization-id",
2242
2108
  "hasDynamicHelp": false,
2243
2109
  "multiple": false,
2244
2110
  "type": "option"
2245
2111
  },
2246
- "label": {
2247
- "description": "Human-readable label for the robot. Defaults to a generated value.",
2248
- "name": "label",
2112
+ "host": {
2113
+ "char": "h",
2114
+ "description": "The local network interface at which to listen. [default: \"localhost\"]",
2115
+ "name": "host",
2116
+ "required": false,
2249
2117
  "hasDynamicHelp": false,
2250
2118
  "multiple": false,
2251
2119
  "type": "option"
2252
2120
  },
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"
2121
+ "port": {
2122
+ "char": "p",
2123
+ "description": "TCP port to start emulator on. [default: 8080]",
2124
+ "name": "port",
2125
+ "required": false,
2126
+ "hasDynamicHelp": false,
2127
+ "multiple": false,
2128
+ "type": "option"
2129
+ },
2130
+ "timeout": {
2131
+ "char": "t",
2132
+ "description": "Maximum execution time for all functions, in seconds. Takes precedence over function-specific `timeout`",
2133
+ "name": "timeout",
2134
+ "required": false,
2135
+ "hasDynamicHelp": false,
2136
+ "multiple": false,
2137
+ "type": "option"
2262
2138
  }
2263
2139
  },
2264
2140
  "hasDynamicHelp": false,
2265
2141
  "hiddenAliases": [],
2266
- "id": "blueprints:mint-deploy-token",
2142
+ "id": "functions:dev",
2267
2143
  "pluginAlias": "@sanity/runtime-cli",
2268
2144
  "pluginName": "@sanity/runtime-cli",
2269
2145
  "pluginType": "core",
2270
2146
  "strict": true,
2271
- "summary": "Create a robot API token for deploying Blueprints from CI/CD",
2147
+ "summary": "Start the Sanity Function emulator",
2272
2148
  "enableJsonFlag": true,
2273
2149
  "needs": [
2274
- "scope"
2150
+ "blueprint"
2275
2151
  ],
2276
2152
  "isESM": true,
2277
2153
  "relativePath": [
2278
2154
  "dist",
2279
2155
  "commands",
2280
- "blueprints",
2281
- "mint-deploy-token.js"
2156
+ "functions",
2157
+ "dev.js"
2282
2158
  ]
2283
2159
  },
2284
- "blueprints:plan": {
2160
+ "functions:list": {
2285
2161
  "aliases": [],
2286
2162
  "args": {},
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.",
2163
+ "description": "Lists functions deployed directly in the selected project or organization scope. The local Blueprint config supplies the scope by default.\n\nUse --project-id or --organization-id to select a scope without a local Blueprint. Organization results include organization-scoped functions only.",
2288
2164
  "examples": [
2289
2165
  "<%= 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>"
2166
+ "<%= config.bin %> <%= command.id %> --verbose",
2167
+ "<%= config.bin %> <%= command.id %> --project-id <projectId>",
2168
+ "<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
2169
+ "<%= config.bin %> <%= command.id %> --project-id <projectId> --json"
2292
2170
  ],
2293
2171
  "flags": {
2294
2172
  "json": {
@@ -2325,14 +2203,15 @@
2325
2203
  "type": "boolean"
2326
2204
  },
2327
2205
  "verbose": {
2328
- "description": "Verbose output",
2329
- "hidden": true,
2206
+ "char": "v",
2207
+ "description": "Show function configuration details",
2330
2208
  "name": "verbose",
2331
2209
  "allowNo": false,
2332
2210
  "type": "boolean"
2333
2211
  },
2334
2212
  "stack": {
2335
2213
  "description": "Stack name or ID to use instead of the locally configured Stack",
2214
+ "hidden": true,
2336
2215
  "name": "stack",
2337
2216
  "hasDynamicHelp": false,
2338
2217
  "multiple": false,
@@ -2369,35 +2248,41 @@
2369
2248
  }
2370
2249
  },
2371
2250
  "hasDynamicHelp": false,
2251
+ "hidden": true,
2372
2252
  "hiddenAliases": [],
2373
- "id": "blueprints:plan",
2253
+ "id": "functions:list",
2374
2254
  "pluginAlias": "@sanity/runtime-cli",
2375
2255
  "pluginName": "@sanity/runtime-cli",
2376
2256
  "pluginType": "core",
2377
2257
  "strict": true,
2378
- "summary": "Preview changes that will be applied to the remote Stack",
2258
+ "summary": "List deployed Sanity Functions",
2379
2259
  "enableJsonFlag": true,
2380
2260
  "needs": [
2381
- "token",
2382
- "blueprint"
2261
+ "scope"
2383
2262
  ],
2384
2263
  "isESM": true,
2385
2264
  "relativePath": [
2386
2265
  "dist",
2387
2266
  "commands",
2388
- "blueprints",
2389
- "plan.js"
2267
+ "functions",
2268
+ "list.js"
2390
2269
  ]
2391
2270
  },
2392
- "blueprints:promote": {
2271
+ "functions:logs": {
2393
2272
  "aliases": [],
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.",
2273
+ "args": {
2274
+ "name": {
2275
+ "description": "The name of the Sanity Function",
2276
+ "name": "name",
2277
+ "required": false
2278
+ }
2279
+ },
2280
+ "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).",
2396
2281
  "examples": [
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>"
2282
+ "<%= config.bin %> <%= command.id %> <name>",
2283
+ "<%= config.bin %> <%= command.id %> <name> --json",
2284
+ "<%= config.bin %> <%= command.id %> <name> --limit 100",
2285
+ "<%= config.bin %> <%= command.id %> <name> --delete"
2401
2286
  ],
2402
2287
  "flags": {
2403
2288
  "json": {
@@ -2441,10 +2326,7 @@
2441
2326
  "type": "boolean"
2442
2327
  },
2443
2328
  "stack": {
2444
- "aliases": [
2445
- "id"
2446
- ],
2447
- "description": "Stack name or ID to promote",
2329
+ "description": "Stack name or ID to use instead of the locally configured Stack",
2448
2330
  "name": "stack",
2449
2331
  "hasDynamicHelp": false,
2450
2332
  "multiple": false,
@@ -2459,6 +2341,7 @@
2459
2341
  "exclusive": [
2460
2342
  "organization-id"
2461
2343
  ],
2344
+ "hidden": true,
2462
2345
  "name": "project-id",
2463
2346
  "hasDynamicHelp": false,
2464
2347
  "multiple": false,
@@ -2480,28 +2363,66 @@
2480
2363
  "multiple": false,
2481
2364
  "type": "option"
2482
2365
  },
2366
+ "limit": {
2367
+ "char": "l",
2368
+ "description": "Total number of log entries to retrieve",
2369
+ "name": "limit",
2370
+ "required": false,
2371
+ "default": 50,
2372
+ "hasDynamicHelp": false,
2373
+ "multiple": false,
2374
+ "type": "option"
2375
+ },
2376
+ "utc": {
2377
+ "char": "u",
2378
+ "description": "Show dates in UTC time zone",
2379
+ "name": "utc",
2380
+ "required": false,
2381
+ "allowNo": false,
2382
+ "type": "boolean"
2383
+ },
2384
+ "delete": {
2385
+ "char": "d",
2386
+ "description": "Delete all logs for the function",
2387
+ "exclusive": [
2388
+ "limit",
2389
+ "json"
2390
+ ],
2391
+ "name": "delete",
2392
+ "required": false,
2393
+ "allowNo": false,
2394
+ "type": "boolean"
2395
+ },
2483
2396
  "force": {
2484
- "description": "Skip confirmation prompt",
2397
+ "char": "f",
2398
+ "dependsOn": [
2399
+ "delete"
2400
+ ],
2401
+ "description": "Skip confirmation for deleting logs",
2485
2402
  "name": "force",
2403
+ "required": false,
2404
+ "allowNo": false,
2405
+ "type": "boolean"
2406
+ },
2407
+ "watch": {
2408
+ "aliases": [
2409
+ "follow"
2410
+ ],
2411
+ "char": "w",
2412
+ "description": "Watch for new logs (streaming mode)",
2413
+ "name": "watch",
2486
2414
  "allowNo": false,
2487
2415
  "type": "boolean"
2488
- },
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"
2495
2416
  }
2496
2417
  },
2497
2418
  "hasDynamicHelp": false,
2498
2419
  "hiddenAliases": [],
2499
- "id": "blueprints:promote",
2420
+ "id": "functions:logs",
2500
2421
  "pluginAlias": "@sanity/runtime-cli",
2501
2422
  "pluginName": "@sanity/runtime-cli",
2502
2423
  "pluginType": "core",
2503
2424
  "strict": true,
2504
- "summary": "Promote a Stack from project scope to organization scope",
2425
+ "summary": "Retrieve or delete logs for a Sanity Function",
2505
2426
  "enableJsonFlag": true,
2506
2427
  "needs": [
2507
2428
  "deployedStack",
@@ -2511,19 +2432,25 @@
2511
2432
  "relativePath": [
2512
2433
  "dist",
2513
2434
  "commands",
2514
- "blueprints",
2515
- "promote.js"
2435
+ "functions",
2436
+ "logs.js"
2516
2437
  ]
2517
2438
  },
2518
- "blueprints:stacks": {
2439
+ "functions:test": {
2519
2440
  "aliases": [],
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.",
2441
+ "args": {
2442
+ "name": {
2443
+ "description": "The name of the Sanity Function",
2444
+ "name": "name",
2445
+ "required": false
2446
+ }
2447
+ },
2448
+ "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.",
2522
2449
  "examples": [
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"
2450
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }'",
2451
+ "<%= config.bin %> <%= command.id %> <name> --file 'payload.json'",
2452
+ "<%= config.bin %> <%= command.id %> <name> --data '{ \"id\": 1 }' --timeout 60",
2453
+ "<%= config.bin %> <%= command.id %> <name> --event update --data-before '{ \"title\": \"before\" }' --data-after '{ \"title\": \"after\" }'"
2527
2454
  ],
2528
2455
  "flags": {
2529
2456
  "json": {
@@ -2581,8 +2508,7 @@
2581
2508
  ],
2582
2509
  "description": "Sanity project ID used to scope Blueprint and Stack",
2583
2510
  "exclusive": [
2584
- "organization-id",
2585
- "include-projects"
2511
+ "organization-id"
2586
2512
  ],
2587
2513
  "name": "project-id",
2588
2514
  "hasDynamicHelp": false,
@@ -2604,34 +2530,230 @@
2604
2530
  "multiple": false,
2605
2531
  "type": "option"
2606
2532
  },
2607
- "include-projects": {
2608
- "dependsOn": [
2609
- "organization-id"
2533
+ "data": {
2534
+ "char": "d",
2535
+ "description": "Data to send to the function",
2536
+ "exclusive": [
2537
+ "file",
2538
+ "document-id"
2610
2539
  ],
2611
- "description": "Include Stacks from all projects within the organization. Requires --organization-id.",
2612
- "name": "include-projects",
2540
+ "name": "data",
2541
+ "required": false,
2542
+ "hasDynamicHelp": false,
2543
+ "multiple": false,
2544
+ "type": "option"
2545
+ },
2546
+ "data-before": {
2547
+ "description": "Original document",
2548
+ "exclusive": [
2549
+ "data",
2550
+ "file",
2551
+ "document-id",
2552
+ "file-before",
2553
+ "file-after",
2554
+ "document-id-before",
2555
+ "document-id-after"
2556
+ ],
2557
+ "name": "data-before",
2558
+ "required": false,
2559
+ "hasDynamicHelp": false,
2560
+ "multiple": false,
2561
+ "type": "option"
2562
+ },
2563
+ "data-after": {
2564
+ "description": "Current document",
2565
+ "exclusive": [
2566
+ "data",
2567
+ "file",
2568
+ "document-id",
2569
+ "file-before",
2570
+ "file-after",
2571
+ "document-id-before",
2572
+ "document-id-after"
2573
+ ],
2574
+ "name": "data-after",
2575
+ "required": false,
2576
+ "hasDynamicHelp": false,
2577
+ "multiple": false,
2578
+ "type": "option"
2579
+ },
2580
+ "event": {
2581
+ "char": "e",
2582
+ "description": "Type of event (create, update, delete)",
2583
+ "name": "event",
2584
+ "required": false,
2585
+ "hasDynamicHelp": false,
2586
+ "multiple": false,
2587
+ "options": [
2588
+ "create",
2589
+ "update",
2590
+ "delete"
2591
+ ],
2592
+ "type": "option"
2593
+ },
2594
+ "file": {
2595
+ "char": "f",
2596
+ "description": "Read data from file and send to the function",
2597
+ "exclusive": [
2598
+ "data",
2599
+ "document-id"
2600
+ ],
2601
+ "name": "file",
2602
+ "required": false,
2603
+ "hasDynamicHelp": false,
2604
+ "multiple": false,
2605
+ "type": "option"
2606
+ },
2607
+ "file-before": {
2608
+ "description": "Original document",
2609
+ "exclusive": [
2610
+ "data",
2611
+ "file",
2612
+ "document-id",
2613
+ "data-before",
2614
+ "data-after",
2615
+ "document-id-before",
2616
+ "document-id-after"
2617
+ ],
2618
+ "name": "file-before",
2619
+ "required": false,
2620
+ "hasDynamicHelp": false,
2621
+ "multiple": false,
2622
+ "type": "option"
2623
+ },
2624
+ "file-after": {
2625
+ "description": "Current document",
2626
+ "exclusive": [
2627
+ "data",
2628
+ "file",
2629
+ "document-id",
2630
+ "data-before",
2631
+ "data-after",
2632
+ "document-id-before",
2633
+ "document-id-after"
2634
+ ],
2635
+ "name": "file-after",
2636
+ "required": false,
2637
+ "hasDynamicHelp": false,
2638
+ "multiple": false,
2639
+ "type": "option"
2640
+ },
2641
+ "timeout": {
2642
+ "char": "t",
2643
+ "description": "Execution timeout value in seconds",
2644
+ "name": "timeout",
2645
+ "required": false,
2646
+ "hasDynamicHelp": false,
2647
+ "multiple": false,
2648
+ "type": "option"
2649
+ },
2650
+ "api": {
2651
+ "char": "a",
2652
+ "description": "Sanity API Version to use",
2653
+ "name": "api",
2654
+ "required": false,
2655
+ "hasDynamicHelp": false,
2656
+ "multiple": false,
2657
+ "type": "option"
2658
+ },
2659
+ "dataset": {
2660
+ "description": "The Sanity dataset to use",
2661
+ "name": "dataset",
2662
+ "required": false,
2663
+ "hasDynamicHelp": false,
2664
+ "multiple": false,
2665
+ "type": "option"
2666
+ },
2667
+ "document-id": {
2668
+ "aliases": [
2669
+ "doc",
2670
+ "documentId"
2671
+ ],
2672
+ "description": "Document to fetch and send to function",
2673
+ "exclusive": [
2674
+ "data",
2675
+ "file"
2676
+ ],
2677
+ "name": "document-id",
2678
+ "required": false,
2679
+ "hasDynamicHelp": false,
2680
+ "multiple": false,
2681
+ "type": "option"
2682
+ },
2683
+ "document-id-before": {
2684
+ "description": "Original document",
2685
+ "exclusive": [
2686
+ "data",
2687
+ "file",
2688
+ "document-id",
2689
+ "data-before",
2690
+ "data-after",
2691
+ "file-before",
2692
+ "file-after"
2693
+ ],
2694
+ "name": "document-id-before",
2695
+ "required": false,
2696
+ "hasDynamicHelp": false,
2697
+ "multiple": false,
2698
+ "type": "option"
2699
+ },
2700
+ "document-id-after": {
2701
+ "description": "Current document",
2702
+ "exclusive": [
2703
+ "data",
2704
+ "file",
2705
+ "document-id",
2706
+ "data-before",
2707
+ "data-after",
2708
+ "file-before",
2709
+ "file-after"
2710
+ ],
2711
+ "name": "document-id-after",
2712
+ "required": false,
2713
+ "hasDynamicHelp": false,
2714
+ "multiple": false,
2715
+ "type": "option"
2716
+ },
2717
+ "with-user-token": {
2718
+ "description": "Prime access token from CLI config",
2719
+ "name": "with-user-token",
2613
2720
  "allowNo": false,
2614
2721
  "type": "boolean"
2722
+ },
2723
+ "media-library-id": {
2724
+ "aliases": [
2725
+ "media"
2726
+ ],
2727
+ "description": "Sanity Media Library ID to use",
2728
+ "exclusive": [
2729
+ "project-id",
2730
+ "dataset"
2731
+ ],
2732
+ "name": "media-library-id",
2733
+ "required": false,
2734
+ "hasDynamicHelp": false,
2735
+ "multiple": false,
2736
+ "type": "option"
2615
2737
  }
2616
2738
  },
2617
2739
  "hasDynamicHelp": false,
2618
2740
  "hiddenAliases": [],
2619
- "id": "blueprints:stacks",
2741
+ "id": "functions:test",
2620
2742
  "pluginAlias": "@sanity/runtime-cli",
2621
2743
  "pluginName": "@sanity/runtime-cli",
2622
2744
  "pluginType": "core",
2623
2745
  "strict": true,
2624
- "summary": "List remote Stack deployments for your project or organization",
2746
+ "summary": "Invoke a local Sanity Function",
2625
2747
  "enableJsonFlag": true,
2626
2748
  "needs": [
2627
- "scope"
2749
+ "blueprint"
2628
2750
  ],
2629
2751
  "isESM": true,
2630
2752
  "relativePath": [
2631
2753
  "dist",
2632
2754
  "commands",
2633
- "blueprints",
2634
- "stacks.js"
2755
+ "functions",
2756
+ "test.js"
2635
2757
  ]
2636
2758
  },
2637
2759
  "functions:env:add": {
@@ -2998,5 +3120,5 @@
2998
3120
  ]
2999
3121
  }
3000
3122
  },
3001
- "version": "17.3.0"
3123
+ "version": "17.3.2-next.ga266544"
3002
3124
  }