@sanity/cli 8.37.1 → 8.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +27 -26
  2. package/oclif.manifest.json +447 -447
  3. package/package.json +14 -14
package/README.md CHANGED
@@ -477,7 +477,7 @@ FLAGS
477
477
  --fn-installer=<option> Which package manager to use when installing the @sanity/functions helpers
478
478
  <options: skip|npm|pnpm|yarn>
479
479
  --fn-type=<option>... Document change event(s) that should trigger the function; you can specify multiple
480
- events by specifying this flag multiple times
480
+ events by specifying this flag multiple times.
481
481
  <options: document-publish|document-create|document-delete|document-update|media-library-
482
482
  asset-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-func
483
483
  tion|sync-tag-invalidate|durable-function>
@@ -3783,35 +3783,36 @@ Add a Function to your Blueprint
3783
3783
 
3784
3784
  ```
3785
3785
  USAGE
3786
- $ sanity functions add [--json] [--example <value> | -n <value> | --type
3787
- document-publish|document-create|document-delete|document-update|media-library-asset-create|media-library-asset-dele
3788
- te|media-library-asset-update|pub-sub|scheduled-function|sync-tag-invalidate|durable-function... | --language ts|js
3789
- | --javascript | --helpers | --installer skip|npm|pnpm|yarn | -i]
3790
-
3791
- FLAGS
3792
- -i, --install Shortcut for --installer npm
3793
- -n, --name=<value> Name of the Function to add
3794
- --example=<value> Example to use for the Function
3795
- --[no-]helpers Add helpers to the new Function
3796
- --installer=<option> How to install the @sanity/functions helpers
3797
- <options: skip|npm|pnpm|yarn>
3798
- --javascript Use JavaScript instead of TypeScript
3799
- --json Format output as json
3800
- --language=<option> [default: ts] Language of the new Function
3801
- <options: ts|js>
3802
- --type=<option>... Document change event(s) that should trigger the function; you can specify multiple events
3803
- by specifying this flag multiple times
3804
- <options: document-publish|document-create|document-delete|document-update|media-library-ass
3805
- et-create|media-library-asset-delete|media-library-asset-update|pub-sub|scheduled-function|s
3806
- ync-tag-invalidate|durable-function>
3786
+ $ sanity functions add [--json] [--example <value> | -n <value> | --trigger
3787
+ pub-sub|document-create|document-publish|document-update|document-delete|media-library-asset-create|media-library-as
3788
+ set-update|media-library-asset-delete|sync-tag-invalidate|scheduled-function... | --durable | --language ts|js |
3789
+ --javascript | --helpers | --installer skip|npm|pnpm|yarn | -i]
3790
+
3791
+ FLAGS
3792
+ -i, --install Shortcut for --installer npm
3793
+ -n, --name=<value> Name of the Function to add
3794
+ --durable Creates a durable function. See why you might want to use a durable function at
3795
+ https://www.sanity.io/docs/functions/durable-functions
3796
+ --example=<value> Example to use for the Function
3797
+ --[no-]helpers Add helpers to the new Function
3798
+ --installer=<option> How to install the @sanity/functions helpers
3799
+ <options: skip|npm|pnpm|yarn>
3800
+ --javascript Use JavaScript instead of TypeScript
3801
+ --json Format output as json
3802
+ --language=<option> [default: ts] Language of the new Function
3803
+ <options: ts|js>
3804
+ --trigger=<option>... Event that can trigger a Function
3805
+ <options: pub-sub|document-create|document-publish|document-update|document-delete|media-li
3806
+ brary-asset-create|media-library-asset-update|media-library-asset-delete|sync-tag-invalidat
3807
+ e|scheduled-function>
3807
3808
 
3808
3809
  DESCRIPTION
3809
3810
  Add a Function to your Blueprint
3810
3811
 
3811
3812
  Scaffolds a new Function in the functions/ folder and templates a resource for your Blueprint manifest.
3812
3813
 
3813
- Functions are serverless handlers triggered by document, live content or media-library events (create, update, delete,
3814
- publish).
3814
+ Functions are serverless handlers triggered by document, live content, schedules or media-library events (create,
3815
+ update, delete, publish) or by invoking them directly.
3815
3816
 
3816
3817
  After adding, use 'functions dev' to test locally, then 'blueprints deploy' to publish.
3817
3818
 
@@ -3822,9 +3823,9 @@ EXAMPLES
3822
3823
 
3823
3824
  $ sanity functions add --name my-function
3824
3825
 
3825
- $ sanity functions add --name my-function --type document-create
3826
+ $ sanity functions add --name my-function --trigger document-create
3826
3827
 
3827
- $ sanity functions add --name my-function --type document-create --type document-update --lang js
3828
+ $ sanity functions add --name my-function --trigger document-create --durable --lang js
3828
3829
  ```
3829
3830
 
3830
3831
  ## `sanity functions dev`
@@ -2512,179 +2512,6 @@
2512
2512
  "update.js"
2513
2513
  ]
2514
2514
  },
2515
- "cors:add": {
2516
- "aliases": [],
2517
- "args": {
2518
- "origin": {
2519
- "description": "Origin to allow (e.g., https://example.com)",
2520
- "name": "origin",
2521
- "required": true
2522
- }
2523
- },
2524
- "description": "Add a CORS origin to the project",
2525
- "examples": [
2526
- {
2527
- "command": "<%= config.bin %> <%= command.id %>",
2528
- "description": "Interactively add a CORS origin"
2529
- },
2530
- {
2531
- "command": "<%= config.bin %> <%= command.id %> http://localhost:3000 --no-credentials",
2532
- "description": "Add a localhost origin without credentials"
2533
- },
2534
- {
2535
- "command": "<%= config.bin %> <%= command.id %> https://myapp.com --credentials",
2536
- "description": "Add a production origin with credentials allowed"
2537
- },
2538
- {
2539
- "command": "<%= config.bin %> <%= command.id %> https://myapp.com --project abc123",
2540
- "description": "Add a CORS origin for a specific project"
2541
- }
2542
- ],
2543
- "flags": {
2544
- "project": {
2545
- "aliases": [
2546
- "project-id"
2547
- ],
2548
- "char": "p",
2549
- "deprecateAliases": true,
2550
- "description": "Project ID to add CORS origin to (overrides CLI configuration)",
2551
- "helpGroup": "OVERRIDE",
2552
- "name": "project",
2553
- "hasDynamicHelp": false,
2554
- "helpValue": "<id>",
2555
- "multiple": false,
2556
- "type": "option"
2557
- },
2558
- "credentials": {
2559
- "description": "Allow credentials (token/cookie) to be sent from this origin",
2560
- "name": "credentials",
2561
- "required": false,
2562
- "allowNo": true,
2563
- "type": "boolean"
2564
- },
2565
- "yes": {
2566
- "char": "y",
2567
- "description": "Confirm risky wildcard origins without prompting",
2568
- "name": "yes",
2569
- "allowNo": false,
2570
- "type": "boolean"
2571
- }
2572
- },
2573
- "hasDynamicHelp": false,
2574
- "hiddenAliases": [],
2575
- "id": "cors:add",
2576
- "pluginAlias": "@sanity/cli",
2577
- "pluginName": "@sanity/cli",
2578
- "pluginType": "core",
2579
- "strict": true,
2580
- "isESM": true,
2581
- "relativePath": [
2582
- "dist",
2583
- "commands",
2584
- "cors",
2585
- "add.js"
2586
- ]
2587
- },
2588
- "cors:delete": {
2589
- "aliases": [],
2590
- "args": {
2591
- "origin": {
2592
- "description": "Origin to delete (will prompt if not provided)",
2593
- "name": "origin",
2594
- "required": false
2595
- }
2596
- },
2597
- "description": "Delete a CORS origin from the project",
2598
- "examples": [
2599
- {
2600
- "command": "<%= config.bin %> <%= command.id %>",
2601
- "description": "Interactively select and delete a CORS origin"
2602
- },
2603
- {
2604
- "command": "<%= config.bin %> <%= command.id %> https://example.com",
2605
- "description": "Delete a specific CORS origin"
2606
- },
2607
- {
2608
- "command": "<%= config.bin %> <%= command.id %> --project abc123",
2609
- "description": "Delete a CORS origin from a specific project"
2610
- }
2611
- ],
2612
- "flags": {
2613
- "project": {
2614
- "aliases": [
2615
- "project-id"
2616
- ],
2617
- "char": "p",
2618
- "deprecateAliases": true,
2619
- "description": "Project ID to delete CORS origin from (overrides CLI configuration)",
2620
- "helpGroup": "OVERRIDE",
2621
- "name": "project",
2622
- "hasDynamicHelp": false,
2623
- "helpValue": "<id>",
2624
- "multiple": false,
2625
- "type": "option"
2626
- }
2627
- },
2628
- "hasDynamicHelp": false,
2629
- "hiddenAliases": [],
2630
- "id": "cors:delete",
2631
- "pluginAlias": "@sanity/cli",
2632
- "pluginName": "@sanity/cli",
2633
- "pluginType": "core",
2634
- "strict": true,
2635
- "isESM": true,
2636
- "relativePath": [
2637
- "dist",
2638
- "commands",
2639
- "cors",
2640
- "delete.js"
2641
- ]
2642
- },
2643
- "cors:list": {
2644
- "aliases": [],
2645
- "args": {},
2646
- "description": "List CORS origins for the project",
2647
- "examples": [
2648
- {
2649
- "command": "<%= config.bin %> <%= command.id %>",
2650
- "description": "List CORS origins for the project"
2651
- },
2652
- {
2653
- "command": "<%= config.bin %> <%= command.id %> --project abc123",
2654
- "description": "List CORS origins for a specific project"
2655
- }
2656
- ],
2657
- "flags": {
2658
- "project": {
2659
- "aliases": [
2660
- "project-id"
2661
- ],
2662
- "char": "p",
2663
- "deprecateAliases": true,
2664
- "description": "Project ID to list CORS origins for (overrides CLI configuration)",
2665
- "helpGroup": "OVERRIDE",
2666
- "name": "project",
2667
- "hasDynamicHelp": false,
2668
- "helpValue": "<id>",
2669
- "multiple": false,
2670
- "type": "option"
2671
- }
2672
- },
2673
- "hasDynamicHelp": false,
2674
- "hiddenAliases": [],
2675
- "id": "cors:list",
2676
- "pluginAlias": "@sanity/cli",
2677
- "pluginName": "@sanity/cli",
2678
- "pluginType": "core",
2679
- "strict": true,
2680
- "isESM": true,
2681
- "relativePath": [
2682
- "dist",
2683
- "commands",
2684
- "cors",
2685
- "list.js"
2686
- ]
2687
- },
2688
2515
  "datasets:copy": {
2689
2516
  "aliases": [],
2690
2517
  "args": {
@@ -3361,69 +3188,67 @@
3361
3188
  "list.js"
3362
3189
  ]
3363
3190
  },
3364
- "docs:browse": {
3365
- "aliases": [],
3366
- "args": {},
3367
- "description": "Open Sanity docs in your browser",
3368
- "flags": {},
3369
- "hasDynamicHelp": false,
3370
- "hiddenAliases": [],
3371
- "id": "docs:browse",
3372
- "pluginAlias": "@sanity/cli",
3373
- "pluginName": "@sanity/cli",
3374
- "pluginType": "core",
3375
- "strict": true,
3376
- "enableJsonFlag": false,
3377
- "isESM": true,
3378
- "relativePath": [
3379
- "dist",
3380
- "commands",
3381
- "docs",
3382
- "browse.js"
3383
- ]
3384
- },
3385
- "docs:read": {
3191
+ "cors:add": {
3386
3192
  "aliases": [],
3387
3193
  "args": {
3388
- "path": {
3389
- "description": "Path or URL to article, found in search results and docs content as links",
3390
- "name": "path",
3194
+ "origin": {
3195
+ "description": "Origin to allow (e.g., https://example.com)",
3196
+ "name": "origin",
3391
3197
  "required": true
3392
3198
  }
3393
3199
  },
3394
- "description": "Read an article in terminal",
3200
+ "description": "Add a CORS origin to the project",
3395
3201
  "examples": [
3396
3202
  {
3397
- "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation",
3398
- "description": "Read as markdown in terminal"
3203
+ "command": "<%= config.bin %> <%= command.id %>",
3204
+ "description": "Interactively add a CORS origin"
3399
3205
  },
3400
3206
  {
3401
- "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
3402
- "description": "Read using full URL"
3207
+ "command": "<%= config.bin %> <%= command.id %> http://localhost:3000 --no-credentials",
3208
+ "description": "Add a localhost origin without credentials"
3403
3209
  },
3404
3210
  {
3405
- "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation --web",
3406
- "description": "Open in web browser"
3211
+ "command": "<%= config.bin %> <%= command.id %> https://myapp.com --credentials",
3212
+ "description": "Add a production origin with credentials allowed"
3407
3213
  },
3408
3214
  {
3409
- "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation -w",
3410
- "description": "Open using full URL in web browser"
3215
+ "command": "<%= config.bin %> <%= command.id %> https://myapp.com --project abc123",
3216
+ "description": "Add a CORS origin for a specific project"
3411
3217
  }
3412
3218
  ],
3413
3219
  "flags": {
3414
- "web": {
3220
+ "project": {
3415
3221
  "aliases": [
3416
- "w"
3222
+ "project-id"
3417
3223
  ],
3418
- "description": "Open in a web browser",
3419
- "name": "web",
3224
+ "char": "p",
3225
+ "deprecateAliases": true,
3226
+ "description": "Project ID to add CORS origin to (overrides CLI configuration)",
3227
+ "helpGroup": "OVERRIDE",
3228
+ "name": "project",
3229
+ "hasDynamicHelp": false,
3230
+ "helpValue": "<id>",
3231
+ "multiple": false,
3232
+ "type": "option"
3233
+ },
3234
+ "credentials": {
3235
+ "description": "Allow credentials (token/cookie) to be sent from this origin",
3236
+ "name": "credentials",
3237
+ "required": false,
3238
+ "allowNo": true,
3239
+ "type": "boolean"
3240
+ },
3241
+ "yes": {
3242
+ "char": "y",
3243
+ "description": "Confirm risky wildcard origins without prompting",
3244
+ "name": "yes",
3420
3245
  "allowNo": false,
3421
3246
  "type": "boolean"
3422
3247
  }
3423
3248
  },
3424
3249
  "hasDynamicHelp": false,
3425
3250
  "hiddenAliases": [],
3426
- "id": "docs:read",
3251
+ "id": "cors:add",
3427
3252
  "pluginAlias": "@sanity/cli",
3428
3253
  "pluginName": "@sanity/cli",
3429
3254
  "pluginType": "core",
@@ -3432,14 +3257,189 @@
3432
3257
  "relativePath": [
3433
3258
  "dist",
3434
3259
  "commands",
3435
- "docs",
3436
- "read.js"
3260
+ "cors",
3261
+ "add.js"
3437
3262
  ]
3438
3263
  },
3439
- "docs:search": {
3264
+ "cors:delete": {
3440
3265
  "aliases": [],
3441
3266
  "args": {
3442
- "query": {
3267
+ "origin": {
3268
+ "description": "Origin to delete (will prompt if not provided)",
3269
+ "name": "origin",
3270
+ "required": false
3271
+ }
3272
+ },
3273
+ "description": "Delete a CORS origin from the project",
3274
+ "examples": [
3275
+ {
3276
+ "command": "<%= config.bin %> <%= command.id %>",
3277
+ "description": "Interactively select and delete a CORS origin"
3278
+ },
3279
+ {
3280
+ "command": "<%= config.bin %> <%= command.id %> https://example.com",
3281
+ "description": "Delete a specific CORS origin"
3282
+ },
3283
+ {
3284
+ "command": "<%= config.bin %> <%= command.id %> --project abc123",
3285
+ "description": "Delete a CORS origin from a specific project"
3286
+ }
3287
+ ],
3288
+ "flags": {
3289
+ "project": {
3290
+ "aliases": [
3291
+ "project-id"
3292
+ ],
3293
+ "char": "p",
3294
+ "deprecateAliases": true,
3295
+ "description": "Project ID to delete CORS origin from (overrides CLI configuration)",
3296
+ "helpGroup": "OVERRIDE",
3297
+ "name": "project",
3298
+ "hasDynamicHelp": false,
3299
+ "helpValue": "<id>",
3300
+ "multiple": false,
3301
+ "type": "option"
3302
+ }
3303
+ },
3304
+ "hasDynamicHelp": false,
3305
+ "hiddenAliases": [],
3306
+ "id": "cors:delete",
3307
+ "pluginAlias": "@sanity/cli",
3308
+ "pluginName": "@sanity/cli",
3309
+ "pluginType": "core",
3310
+ "strict": true,
3311
+ "isESM": true,
3312
+ "relativePath": [
3313
+ "dist",
3314
+ "commands",
3315
+ "cors",
3316
+ "delete.js"
3317
+ ]
3318
+ },
3319
+ "cors:list": {
3320
+ "aliases": [],
3321
+ "args": {},
3322
+ "description": "List CORS origins for the project",
3323
+ "examples": [
3324
+ {
3325
+ "command": "<%= config.bin %> <%= command.id %>",
3326
+ "description": "List CORS origins for the project"
3327
+ },
3328
+ {
3329
+ "command": "<%= config.bin %> <%= command.id %> --project abc123",
3330
+ "description": "List CORS origins for a specific project"
3331
+ }
3332
+ ],
3333
+ "flags": {
3334
+ "project": {
3335
+ "aliases": [
3336
+ "project-id"
3337
+ ],
3338
+ "char": "p",
3339
+ "deprecateAliases": true,
3340
+ "description": "Project ID to list CORS origins for (overrides CLI configuration)",
3341
+ "helpGroup": "OVERRIDE",
3342
+ "name": "project",
3343
+ "hasDynamicHelp": false,
3344
+ "helpValue": "<id>",
3345
+ "multiple": false,
3346
+ "type": "option"
3347
+ }
3348
+ },
3349
+ "hasDynamicHelp": false,
3350
+ "hiddenAliases": [],
3351
+ "id": "cors:list",
3352
+ "pluginAlias": "@sanity/cli",
3353
+ "pluginName": "@sanity/cli",
3354
+ "pluginType": "core",
3355
+ "strict": true,
3356
+ "isESM": true,
3357
+ "relativePath": [
3358
+ "dist",
3359
+ "commands",
3360
+ "cors",
3361
+ "list.js"
3362
+ ]
3363
+ },
3364
+ "docs:browse": {
3365
+ "aliases": [],
3366
+ "args": {},
3367
+ "description": "Open Sanity docs in your browser",
3368
+ "flags": {},
3369
+ "hasDynamicHelp": false,
3370
+ "hiddenAliases": [],
3371
+ "id": "docs:browse",
3372
+ "pluginAlias": "@sanity/cli",
3373
+ "pluginName": "@sanity/cli",
3374
+ "pluginType": "core",
3375
+ "strict": true,
3376
+ "enableJsonFlag": false,
3377
+ "isESM": true,
3378
+ "relativePath": [
3379
+ "dist",
3380
+ "commands",
3381
+ "docs",
3382
+ "browse.js"
3383
+ ]
3384
+ },
3385
+ "docs:read": {
3386
+ "aliases": [],
3387
+ "args": {
3388
+ "path": {
3389
+ "description": "Path or URL to article, found in search results and docs content as links",
3390
+ "name": "path",
3391
+ "required": true
3392
+ }
3393
+ },
3394
+ "description": "Read an article in terminal",
3395
+ "examples": [
3396
+ {
3397
+ "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation",
3398
+ "description": "Read as markdown in terminal"
3399
+ },
3400
+ {
3401
+ "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
3402
+ "description": "Read using full URL"
3403
+ },
3404
+ {
3405
+ "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation --web",
3406
+ "description": "Open in web browser"
3407
+ },
3408
+ {
3409
+ "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation -w",
3410
+ "description": "Open using full URL in web browser"
3411
+ }
3412
+ ],
3413
+ "flags": {
3414
+ "web": {
3415
+ "aliases": [
3416
+ "w"
3417
+ ],
3418
+ "description": "Open in a web browser",
3419
+ "name": "web",
3420
+ "allowNo": false,
3421
+ "type": "boolean"
3422
+ }
3423
+ },
3424
+ "hasDynamicHelp": false,
3425
+ "hiddenAliases": [],
3426
+ "id": "docs:read",
3427
+ "pluginAlias": "@sanity/cli",
3428
+ "pluginName": "@sanity/cli",
3429
+ "pluginType": "core",
3430
+ "strict": true,
3431
+ "isESM": true,
3432
+ "relativePath": [
3433
+ "dist",
3434
+ "commands",
3435
+ "docs",
3436
+ "read.js"
3437
+ ]
3438
+ },
3439
+ "docs:search": {
3440
+ "aliases": [],
3441
+ "args": {
3442
+ "query": {
3443
3443
  "description": "Search query for documentation",
3444
3444
  "name": "query",
3445
3445
  "required": true
@@ -4498,69 +4498,58 @@
4498
4498
  "logs.js"
4499
4499
  ]
4500
4500
  },
4501
- "manifest:extract": {
4501
+ "mcp:configure": {
4502
4502
  "aliases": [],
4503
4503
  "args": {},
4504
- "description": "Extract studio configuration as JSON manifest files.\n\nNote: This command is experimental and subject to change. It is currently intended for use with Create only.",
4504
+ "description": "Configure Sanity MCP server for AI editors (Antigravity, Claude Code, Cline, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI, MCPorter, OpenCode, Pi, VS Code, VS Code Insiders, Zed)",
4505
4505
  "examples": [
4506
4506
  {
4507
4507
  "command": "<%= config.bin %> <%= command.id %>",
4508
- "description": "Extracts manifests"
4509
- },
4510
- {
4511
- "command": "<%= config.bin %> <%= command.id %> --path /public/static",
4512
- "description": "Extracts manifests into /public/static"
4508
+ "description": "Configure Sanity MCP server for detected AI editors"
4513
4509
  }
4514
4510
  ],
4515
- "flags": {
4516
- "path": {
4517
- "description": "Optional path to specify destination directory of the manifest files",
4518
- "name": "path",
4519
- "default": "dist/static",
4520
- "hasDynamicHelp": false,
4521
- "multiple": false,
4522
- "type": "option"
4523
- }
4524
- },
4511
+ "flags": {},
4525
4512
  "hasDynamicHelp": false,
4526
4513
  "hiddenAliases": [],
4527
- "id": "manifest:extract",
4514
+ "id": "mcp:configure",
4528
4515
  "pluginAlias": "@sanity/cli",
4529
4516
  "pluginName": "@sanity/cli",
4530
4517
  "pluginType": "core",
4531
4518
  "strict": true,
4532
- "telemetry": {
4533
- "redactedFlags": [
4534
- {
4535
- "canonical": "--path",
4536
- "flags": [
4537
- "--path"
4538
- ]
4539
- }
4540
- ]
4541
- },
4542
4519
  "isESM": true,
4543
4520
  "relativePath": [
4544
4521
  "dist",
4545
4522
  "commands",
4546
- "manifest",
4547
- "extract.js"
4523
+ "mcp",
4524
+ "configure.js"
4548
4525
  ]
4549
4526
  },
4550
- "mcp:configure": {
4527
+ "migrations:create": {
4551
4528
  "aliases": [],
4552
- "args": {},
4553
- "description": "Configure Sanity MCP server for AI editors (Antigravity, Claude Code, Cline, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI, MCPorter, OpenCode, Pi, VS Code, VS Code Insiders, Zed)",
4529
+ "args": {
4530
+ "title": {
4531
+ "description": "Title of migration",
4532
+ "name": "title",
4533
+ "required": false
4534
+ }
4535
+ },
4536
+ "description": "Create a new migration within your project",
4554
4537
  "examples": [
4555
4538
  {
4556
4539
  "command": "<%= config.bin %> <%= command.id %>",
4557
- "description": "Configure Sanity MCP server for detected AI editors"
4540
+ "description": "Create a new migration, prompting for title and options"
4541
+ },
4542
+ {
4543
+ "command": "<%= config.bin %> <%= command.id %> \"Rename field from location to address\"",
4544
+ "description": "Create a new migration with the provided title, prompting for options"
4558
4545
  }
4559
4546
  ],
4560
4547
  "flags": {},
4561
4548
  "hasDynamicHelp": false,
4562
- "hiddenAliases": [],
4563
- "id": "mcp:configure",
4549
+ "hiddenAliases": [
4550
+ "migration:create"
4551
+ ],
4552
+ "id": "migrations:create",
4564
4553
  "pluginAlias": "@sanity/cli",
4565
4554
  "pluginName": "@sanity/cli",
4566
4555
  "pluginType": "core",
@@ -4569,29 +4558,171 @@
4569
4558
  "relativePath": [
4570
4559
  "dist",
4571
4560
  "commands",
4572
- "mcp",
4573
- "configure.js"
4561
+ "migrations",
4562
+ "create.js"
4574
4563
  ]
4575
4564
  },
4576
- "media:create-aspect": {
4565
+ "migrations:list": {
4577
4566
  "aliases": [],
4578
4567
  "args": {},
4579
- "description": "Create a new aspect definition file",
4568
+ "description": "List available migrations",
4580
4569
  "examples": [
4581
4570
  {
4582
4571
  "command": "<%= config.bin %> <%= command.id %>",
4583
- "description": "Create a new aspect definition file"
4572
+ "description": "List all available migrations in the project"
4584
4573
  }
4585
4574
  ],
4586
- "flags": {
4587
- "name": {
4588
- "description": "Aspect name. Defaults to the title in camel case",
4589
- "name": "name",
4590
- "hasDynamicHelp": false,
4591
- "multiple": false,
4592
- "type": "option"
4593
- },
4594
- "title": {
4575
+ "flags": {},
4576
+ "hasDynamicHelp": false,
4577
+ "hiddenAliases": [
4578
+ "migration:list"
4579
+ ],
4580
+ "id": "migrations:list",
4581
+ "pluginAlias": "@sanity/cli",
4582
+ "pluginName": "@sanity/cli",
4583
+ "pluginType": "core",
4584
+ "strict": true,
4585
+ "isESM": true,
4586
+ "relativePath": [
4587
+ "dist",
4588
+ "commands",
4589
+ "migrations",
4590
+ "list.js"
4591
+ ]
4592
+ },
4593
+ "migrations:run": {
4594
+ "aliases": [],
4595
+ "args": {
4596
+ "id": {
4597
+ "description": "ID",
4598
+ "name": "id",
4599
+ "required": false
4600
+ }
4601
+ },
4602
+ "description": "Run a migration against a dataset",
4603
+ "examples": [
4604
+ {
4605
+ "command": "<%= config.bin %> <%= command.id %> <id>",
4606
+ "description": "dry run the migration"
4607
+ },
4608
+ {
4609
+ "command": "<%= config.bin %> <%= command.id %> <id> --no-dry-run --project xyz --dataset staging",
4610
+ "description": "execute the migration against a dataset"
4611
+ },
4612
+ {
4613
+ "command": "<%= config.bin %> <%= command.id %> <id> --from-export=production.tar.gz --no-dry-run --project xyz --dataset staging",
4614
+ "description": "execute the migration using a dataset export as the source"
4615
+ }
4616
+ ],
4617
+ "flags": {
4618
+ "api-version": {
4619
+ "description": "API version to use when migrating. Defaults to v2024-01-29.",
4620
+ "name": "api-version",
4621
+ "hasDynamicHelp": false,
4622
+ "multiple": false,
4623
+ "type": "option"
4624
+ },
4625
+ "concurrency": {
4626
+ "description": "How many mutation requests to run in parallel. Must be between 1 and 10. Default: 6.",
4627
+ "name": "concurrency",
4628
+ "default": 6,
4629
+ "hasDynamicHelp": false,
4630
+ "multiple": false,
4631
+ "type": "option"
4632
+ },
4633
+ "confirm": {
4634
+ "description": "Prompt for confirmation before running the migration (default: true). Use --no-confirm to skip.",
4635
+ "name": "confirm",
4636
+ "allowNo": true,
4637
+ "type": "boolean"
4638
+ },
4639
+ "dataset": {
4640
+ "description": "Dataset to migrate. Defaults to the dataset configured in your Sanity CLI config.",
4641
+ "name": "dataset",
4642
+ "hasDynamicHelp": false,
4643
+ "multiple": false,
4644
+ "type": "option"
4645
+ },
4646
+ "dry-run": {
4647
+ "description": "By default the migration runs in dry mode. Use --no-dry-run to migrate dataset.",
4648
+ "name": "dry-run",
4649
+ "allowNo": true,
4650
+ "type": "boolean"
4651
+ },
4652
+ "from-export": {
4653
+ "description": "Use a local dataset export as source for migration instead of calling the Sanity API. Note: this is only supported for dry runs.",
4654
+ "name": "from-export",
4655
+ "hasDynamicHelp": false,
4656
+ "multiple": false,
4657
+ "type": "option"
4658
+ },
4659
+ "progress": {
4660
+ "description": "Display progress during migration (default: true). Use --no-progress to hide output.",
4661
+ "name": "progress",
4662
+ "allowNo": true,
4663
+ "type": "boolean"
4664
+ },
4665
+ "project": {
4666
+ "aliases": [
4667
+ "project-id"
4668
+ ],
4669
+ "char": "p",
4670
+ "deprecateAliases": true,
4671
+ "description": "Project ID of the dataset to migrate (overrides CLI configuration)",
4672
+ "helpGroup": "OVERRIDE",
4673
+ "name": "project",
4674
+ "hasDynamicHelp": false,
4675
+ "helpValue": "<id>",
4676
+ "multiple": false,
4677
+ "type": "option"
4678
+ }
4679
+ },
4680
+ "hasDynamicHelp": false,
4681
+ "hiddenAliases": [
4682
+ "migration:run"
4683
+ ],
4684
+ "id": "migrations:run",
4685
+ "pluginAlias": "@sanity/cli",
4686
+ "pluginName": "@sanity/cli",
4687
+ "pluginType": "core",
4688
+ "strict": true,
4689
+ "telemetry": {
4690
+ "redactedFlags": [
4691
+ {
4692
+ "canonical": "--from-export",
4693
+ "flags": [
4694
+ "--from-export"
4695
+ ]
4696
+ }
4697
+ ]
4698
+ },
4699
+ "isESM": true,
4700
+ "relativePath": [
4701
+ "dist",
4702
+ "commands",
4703
+ "migrations",
4704
+ "run.js"
4705
+ ]
4706
+ },
4707
+ "media:create-aspect": {
4708
+ "aliases": [],
4709
+ "args": {},
4710
+ "description": "Create a new aspect definition file",
4711
+ "examples": [
4712
+ {
4713
+ "command": "<%= config.bin %> <%= command.id %>",
4714
+ "description": "Create a new aspect definition file"
4715
+ }
4716
+ ],
4717
+ "flags": {
4718
+ "name": {
4719
+ "description": "Aspect name. Defaults to the title in camel case",
4720
+ "name": "name",
4721
+ "hasDynamicHelp": false,
4722
+ "multiple": false,
4723
+ "type": "option"
4724
+ },
4725
+ "title": {
4595
4726
  "description": "Aspect title",
4596
4727
  "name": "title",
4597
4728
  "hasDynamicHelp": false,
@@ -5066,186 +5197,6 @@
5066
5197
  "pull-aspects.js"
5067
5198
  ]
5068
5199
  },
5069
- "migrations:create": {
5070
- "aliases": [],
5071
- "args": {
5072
- "title": {
5073
- "description": "Title of migration",
5074
- "name": "title",
5075
- "required": false
5076
- }
5077
- },
5078
- "description": "Create a new migration within your project",
5079
- "examples": [
5080
- {
5081
- "command": "<%= config.bin %> <%= command.id %>",
5082
- "description": "Create a new migration, prompting for title and options"
5083
- },
5084
- {
5085
- "command": "<%= config.bin %> <%= command.id %> \"Rename field from location to address\"",
5086
- "description": "Create a new migration with the provided title, prompting for options"
5087
- }
5088
- ],
5089
- "flags": {},
5090
- "hasDynamicHelp": false,
5091
- "hiddenAliases": [
5092
- "migration:create"
5093
- ],
5094
- "id": "migrations:create",
5095
- "pluginAlias": "@sanity/cli",
5096
- "pluginName": "@sanity/cli",
5097
- "pluginType": "core",
5098
- "strict": true,
5099
- "isESM": true,
5100
- "relativePath": [
5101
- "dist",
5102
- "commands",
5103
- "migrations",
5104
- "create.js"
5105
- ]
5106
- },
5107
- "migrations:list": {
5108
- "aliases": [],
5109
- "args": {},
5110
- "description": "List available migrations",
5111
- "examples": [
5112
- {
5113
- "command": "<%= config.bin %> <%= command.id %>",
5114
- "description": "List all available migrations in the project"
5115
- }
5116
- ],
5117
- "flags": {},
5118
- "hasDynamicHelp": false,
5119
- "hiddenAliases": [
5120
- "migration:list"
5121
- ],
5122
- "id": "migrations:list",
5123
- "pluginAlias": "@sanity/cli",
5124
- "pluginName": "@sanity/cli",
5125
- "pluginType": "core",
5126
- "strict": true,
5127
- "isESM": true,
5128
- "relativePath": [
5129
- "dist",
5130
- "commands",
5131
- "migrations",
5132
- "list.js"
5133
- ]
5134
- },
5135
- "migrations:run": {
5136
- "aliases": [],
5137
- "args": {
5138
- "id": {
5139
- "description": "ID",
5140
- "name": "id",
5141
- "required": false
5142
- }
5143
- },
5144
- "description": "Run a migration against a dataset",
5145
- "examples": [
5146
- {
5147
- "command": "<%= config.bin %> <%= command.id %> <id>",
5148
- "description": "dry run the migration"
5149
- },
5150
- {
5151
- "command": "<%= config.bin %> <%= command.id %> <id> --no-dry-run --project xyz --dataset staging",
5152
- "description": "execute the migration against a dataset"
5153
- },
5154
- {
5155
- "command": "<%= config.bin %> <%= command.id %> <id> --from-export=production.tar.gz --no-dry-run --project xyz --dataset staging",
5156
- "description": "execute the migration using a dataset export as the source"
5157
- }
5158
- ],
5159
- "flags": {
5160
- "api-version": {
5161
- "description": "API version to use when migrating. Defaults to v2024-01-29.",
5162
- "name": "api-version",
5163
- "hasDynamicHelp": false,
5164
- "multiple": false,
5165
- "type": "option"
5166
- },
5167
- "concurrency": {
5168
- "description": "How many mutation requests to run in parallel. Must be between 1 and 10. Default: 6.",
5169
- "name": "concurrency",
5170
- "default": 6,
5171
- "hasDynamicHelp": false,
5172
- "multiple": false,
5173
- "type": "option"
5174
- },
5175
- "confirm": {
5176
- "description": "Prompt for confirmation before running the migration (default: true). Use --no-confirm to skip.",
5177
- "name": "confirm",
5178
- "allowNo": true,
5179
- "type": "boolean"
5180
- },
5181
- "dataset": {
5182
- "description": "Dataset to migrate. Defaults to the dataset configured in your Sanity CLI config.",
5183
- "name": "dataset",
5184
- "hasDynamicHelp": false,
5185
- "multiple": false,
5186
- "type": "option"
5187
- },
5188
- "dry-run": {
5189
- "description": "By default the migration runs in dry mode. Use --no-dry-run to migrate dataset.",
5190
- "name": "dry-run",
5191
- "allowNo": true,
5192
- "type": "boolean"
5193
- },
5194
- "from-export": {
5195
- "description": "Use a local dataset export as source for migration instead of calling the Sanity API. Note: this is only supported for dry runs.",
5196
- "name": "from-export",
5197
- "hasDynamicHelp": false,
5198
- "multiple": false,
5199
- "type": "option"
5200
- },
5201
- "progress": {
5202
- "description": "Display progress during migration (default: true). Use --no-progress to hide output.",
5203
- "name": "progress",
5204
- "allowNo": true,
5205
- "type": "boolean"
5206
- },
5207
- "project": {
5208
- "aliases": [
5209
- "project-id"
5210
- ],
5211
- "char": "p",
5212
- "deprecateAliases": true,
5213
- "description": "Project ID of the dataset to migrate (overrides CLI configuration)",
5214
- "helpGroup": "OVERRIDE",
5215
- "name": "project",
5216
- "hasDynamicHelp": false,
5217
- "helpValue": "<id>",
5218
- "multiple": false,
5219
- "type": "option"
5220
- }
5221
- },
5222
- "hasDynamicHelp": false,
5223
- "hiddenAliases": [
5224
- "migration:run"
5225
- ],
5226
- "id": "migrations:run",
5227
- "pluginAlias": "@sanity/cli",
5228
- "pluginName": "@sanity/cli",
5229
- "pluginType": "core",
5230
- "strict": true,
5231
- "telemetry": {
5232
- "redactedFlags": [
5233
- {
5234
- "canonical": "--from-export",
5235
- "flags": [
5236
- "--from-export"
5237
- ]
5238
- }
5239
- ]
5240
- },
5241
- "isESM": true,
5242
- "relativePath": [
5243
- "dist",
5244
- "commands",
5245
- "migrations",
5246
- "run.js"
5247
- ]
5248
- },
5249
5200
  "openapi:get": {
5250
5201
  "aliases": [],
5251
5202
  "args": {
@@ -5360,6 +5311,55 @@
5360
5311
  "list.js"
5361
5312
  ]
5362
5313
  },
5314
+ "manifest:extract": {
5315
+ "aliases": [],
5316
+ "args": {},
5317
+ "description": "Extract studio configuration as JSON manifest files.\n\nNote: This command is experimental and subject to change. It is currently intended for use with Create only.",
5318
+ "examples": [
5319
+ {
5320
+ "command": "<%= config.bin %> <%= command.id %>",
5321
+ "description": "Extracts manifests"
5322
+ },
5323
+ {
5324
+ "command": "<%= config.bin %> <%= command.id %> --path /public/static",
5325
+ "description": "Extracts manifests into /public/static"
5326
+ }
5327
+ ],
5328
+ "flags": {
5329
+ "path": {
5330
+ "description": "Optional path to specify destination directory of the manifest files",
5331
+ "name": "path",
5332
+ "default": "dist/static",
5333
+ "hasDynamicHelp": false,
5334
+ "multiple": false,
5335
+ "type": "option"
5336
+ }
5337
+ },
5338
+ "hasDynamicHelp": false,
5339
+ "hiddenAliases": [],
5340
+ "id": "manifest:extract",
5341
+ "pluginAlias": "@sanity/cli",
5342
+ "pluginName": "@sanity/cli",
5343
+ "pluginType": "core",
5344
+ "strict": true,
5345
+ "telemetry": {
5346
+ "redactedFlags": [
5347
+ {
5348
+ "canonical": "--path",
5349
+ "flags": [
5350
+ "--path"
5351
+ ]
5352
+ }
5353
+ ]
5354
+ },
5355
+ "isESM": true,
5356
+ "relativePath": [
5357
+ "dist",
5358
+ "commands",
5359
+ "manifest",
5360
+ "extract.js"
5361
+ ]
5362
+ },
5363
5363
  "organizations:create": {
5364
5364
  "aliases": [],
5365
5365
  "args": {},
@@ -10462,5 +10462,5 @@
10462
10462
  ]
10463
10463
  }
10464
10464
  },
10465
- "version": "8.37.1"
10465
+ "version": "8.38.0"
10466
10466
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli",
3
- "version": "8.37.1",
3
+ "version": "8.38.0",
4
4
  "description": "Sanity CLI tool for managing Sanity projects and organizations",
5
5
  "keywords": [
6
6
  "cli",
@@ -63,7 +63,7 @@
63
63
  "@oclif/plugin-help": "^6.3.0",
64
64
  "@oclif/plugin-not-found": "^3.3.0",
65
65
  "@sanity/blueprints": "^0.35.0",
66
- "@sanity/cli-build": "^7.6.0",
66
+ "@sanity/cli-build": "^7.7.0",
67
67
  "@sanity/cli-core": "^3.18.0",
68
68
  "@sanity/cli-setup": "^0.1.2",
69
69
  "@sanity/client": "^8.17.0",
@@ -71,18 +71,18 @@
71
71
  "@sanity/descriptors": "^1.3.0",
72
72
  "@sanity/export": "^7.1.1",
73
73
  "@sanity/generate-help-url": "^4.0.0",
74
- "@sanity/id-utils": "^1.1.0",
74
+ "@sanity/id-utils": "^2.0.0",
75
75
  "@sanity/import": "^7.1.1",
76
76
  "@sanity/migrate": "^8.0.5",
77
- "@sanity/runtime-cli": "^17.23.0",
78
- "@sanity/schema": "^6.25.0",
77
+ "@sanity/runtime-cli": "^17.25.0",
78
+ "@sanity/schema": "^6.26.0",
79
79
  "@sanity/schema-descriptor-utils": "^1.4.0",
80
80
  "@sanity/telemetry": "^1.1.0",
81
81
  "@sanity/template-validator": "^3.1.1",
82
- "@sanity/types": "^6.25.0",
83
- "@sanity/util": "^6.25.0",
84
- "@sanity/validation": "^6.25.0",
85
- "@sanity/workbench-cli": "^2.22.0",
82
+ "@sanity/types": "^6.26.0",
83
+ "@sanity/util": "^6.26.0",
84
+ "@sanity/validation": "^6.26.0",
85
+ "@sanity/workbench-cli": "^2.22.1",
86
86
  "@sanity/worker-channels": "^2.0.0",
87
87
  "@sanity/workflows": ">=0.39.0 <1.0.0",
88
88
  "@sanity/workflows-cli": ">=0.39.0 <1.0.0",
@@ -93,7 +93,7 @@
93
93
  "execa": "^10.0.1",
94
94
  "form-data": "^4.0.6",
95
95
  "get-latest-version": "^6.0.1",
96
- "groq-js": "^2.0.3",
96
+ "groq-js": "^2.0.4",
97
97
  "gunzip-maybe": "^1.4.2",
98
98
  "import-meta-resolve": "^4.2.0",
99
99
  "is-installed-globally": "^1.0.1",
@@ -111,7 +111,7 @@
111
111
  "promise-props-recursive": "^2.0.2",
112
112
  "rxjs": "^7.8.2",
113
113
  "semver": "^7.8.6",
114
- "skills": "^1.9.0",
114
+ "skills": "^1.9.1",
115
115
  "smol-toml": "^1.9.1",
116
116
  "string-argv": "^0.3.2",
117
117
  "string-width": "^7.2.0",
@@ -119,7 +119,7 @@
119
119
  "tar-stream": "^3.3.0",
120
120
  "tinyglobby": "^0.2.17",
121
121
  "valibot": "^1.5.0",
122
- "vite": "^8.4.0",
122
+ "vite": "^8.4.1",
123
123
  "which": "^6.0.1",
124
124
  "wrap-ansi": "^9.0.2",
125
125
  "yaml": "^2.9.1",
@@ -138,7 +138,7 @@
138
138
  "@types/jscodeshift": "^17.3.0",
139
139
  "@types/jsdom": "^28.0.3",
140
140
  "@types/lodash-es": "^4.17.12",
141
- "@types/node": "^22.20.5",
141
+ "@types/node": "^22.20.7",
142
142
  "@types/picomatch": "^4.0.3",
143
143
  "@types/semver": "^7.8.0",
144
144
  "@types/tar-stream": "^3.1.4",
@@ -154,7 +154,7 @@
154
154
  "oxlint": "^1.94.0",
155
155
  "publint": "^0.3.25",
156
156
  "rimraf": "^6.0.1",
157
- "sanity": "^6.25.0",
157
+ "sanity": "^6.26.0",
158
158
  "tsx": "^4.23.15",
159
159
  "typescript": "^6.0.3",
160
160
  "vitest": "^5.1.1"