@sanity/cli 8.22.1 → 8.24.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 (98) hide show
  1. package/README.md +313 -0
  2. package/dist/actions/codemods/dashboard.js +136 -8
  3. package/dist/actions/codemods/dashboard.js.map +1 -1
  4. package/dist/actions/codemods/types.js.map +1 -1
  5. package/dist/actions/context/watchJob.js +9 -3
  6. package/dist/actions/context/watchJob.js.map +1 -1
  7. package/dist/actions/deploy/blueprintManaged.js +59 -0
  8. package/dist/actions/deploy/blueprintManaged.js.map +1 -0
  9. package/dist/actions/deploy/deployApp.js +117 -1
  10. package/dist/actions/deploy/deployApp.js.map +1 -1
  11. package/dist/actions/deploy/deployRunner.js.map +1 -1
  12. package/dist/actions/deploy/deployStudio.js +6 -31
  13. package/dist/actions/deploy/deployStudio.js.map +1 -1
  14. package/dist/actions/exec/runScript.worker.js +6 -2
  15. package/dist/actions/exec/runScript.worker.js.map +1 -1
  16. package/dist/actions/init/bootstrapLocalTemplate.js +35 -11
  17. package/dist/actions/init/bootstrapLocalTemplate.js.map +1 -1
  18. package/dist/actions/init/createMediaLibraryCliConfig.js +12 -0
  19. package/dist/actions/init/createMediaLibraryCliConfig.js.map +1 -0
  20. package/dist/actions/init/determineMediaLibraryTemplate.js +14 -0
  21. package/dist/actions/init/determineMediaLibraryTemplate.js.map +1 -0
  22. package/dist/actions/init/initAction.js +35 -6
  23. package/dist/actions/init/initAction.js.map +1 -1
  24. package/dist/actions/init/initApp.js +81 -6
  25. package/dist/actions/init/initApp.js.map +1 -1
  26. package/dist/actions/init/offerAspectPull.js +81 -0
  27. package/dist/actions/init/offerAspectPull.js.map +1 -0
  28. package/dist/actions/init/project/getOrCreateDataset.js +8 -5
  29. package/dist/actions/init/project/getOrCreateDataset.js.map +1 -1
  30. package/dist/actions/init/project/getOrCreateProject.js +7 -5
  31. package/dist/actions/init/project/getOrCreateProject.js.map +1 -1
  32. package/dist/actions/init/project/getProjectDetails.js +25 -2
  33. package/dist/actions/init/project/getProjectDetails.js.map +1 -1
  34. package/dist/actions/init/project/promptUserForOrganization.js +6 -4
  35. package/dist/actions/init/project/promptUserForOrganization.js.map +1 -1
  36. package/dist/actions/init/templates/index.js +3 -0
  37. package/dist/actions/init/templates/index.js.map +1 -1
  38. package/dist/actions/init/templates/mediaLibraryConfig.js +51 -0
  39. package/dist/actions/init/templates/mediaLibraryConfig.js.map +1 -0
  40. package/dist/actions/media/aspectName.js +8 -0
  41. package/dist/actions/media/aspectName.js.map +1 -0
  42. package/dist/actions/media/aspectSync/contract.js +163 -0
  43. package/dist/actions/media/aspectSync/contract.js.map +1 -0
  44. package/dist/actions/media/aspectSync/syncAspects.js +115 -0
  45. package/dist/actions/media/aspectSync/syncAspects.js.map +1 -0
  46. package/dist/actions/media/cliConfigFields.js +192 -0
  47. package/dist/actions/media/cliConfigFields.js.map +1 -0
  48. package/dist/actions/media/pullAspects.js +225 -0
  49. package/dist/actions/media/pullAspects.js.map +1 -0
  50. package/dist/actions/media/resolveMediaLibraryId.js +83 -0
  51. package/dist/actions/media/resolveMediaLibraryId.js.map +1 -0
  52. package/dist/commands/codemod.js +1 -0
  53. package/dist/commands/codemod.js.map +1 -1
  54. package/dist/commands/context/build.js +2 -2
  55. package/dist/commands/context/build.js.map +1 -1
  56. package/dist/commands/context/entries/get.js +83 -0
  57. package/dist/commands/context/entries/get.js.map +1 -0
  58. package/dist/commands/context/entries/list.js +82 -0
  59. package/dist/commands/context/entries/list.js.map +1 -0
  60. package/dist/commands/context/entries/rebuild.js +95 -0
  61. package/dist/commands/context/entries/rebuild.js.map +1 -0
  62. package/dist/commands/context/issues/apply.js +86 -0
  63. package/dist/commands/context/issues/apply.js.map +1 -0
  64. package/dist/commands/context/issues/dismiss.js +52 -0
  65. package/dist/commands/context/issues/dismiss.js.map +1 -0
  66. package/dist/commands/context/issues/get.js +105 -0
  67. package/dist/commands/context/issues/get.js.map +1 -0
  68. package/dist/commands/context/issues/list.js +128 -0
  69. package/dist/commands/context/issues/list.js.map +1 -0
  70. package/dist/commands/context/issues/reopen.js +53 -0
  71. package/dist/commands/context/issues/reopen.js.map +1 -0
  72. package/dist/commands/context/issues/resolve.js +137 -0
  73. package/dist/commands/context/issues/resolve.js.map +1 -0
  74. package/dist/commands/context/jobs/get.js +2 -2
  75. package/dist/commands/context/jobs/get.js.map +1 -1
  76. package/dist/commands/context/query.js +92 -0
  77. package/dist/commands/context/query.js.map +1 -0
  78. package/dist/commands/deploy.js +13 -0
  79. package/dist/commands/deploy.js.map +1 -1
  80. package/dist/commands/media/prune-aspect-data.js +170 -0
  81. package/dist/commands/media/prune-aspect-data.js.map +1 -0
  82. package/dist/commands/media/pull-aspects.js +309 -0
  83. package/dist/commands/media/pull-aspects.js.map +1 -0
  84. package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js +17 -0
  85. package/dist/exports/invokeSanityCli/commandPolicies/mcpPolicy.js.map +1 -1
  86. package/dist/services/context.js +96 -3
  87. package/dist/services/context.js.map +1 -1
  88. package/dist/services/mediaLibraries.js +175 -8
  89. package/dist/services/mediaLibraries.js.map +1 -1
  90. package/dist/util/searchChoices.js +52 -0
  91. package/dist/util/searchChoices.js.map +1 -0
  92. package/oclif.manifest.json +2134 -1445
  93. package/package.json +9 -8
  94. package/templates/media-library-config/README.md +52 -0
  95. package/templates/media-library-config/eslint.config.txt +52 -0
  96. package/templates/media-library-config/src/fields/caption.tsx +29 -0
  97. package/templates/media-library-config/src/fields/notes.tsx +54 -0
  98. package/templates/shopify/.gitignore +0 -26
@@ -423,6 +423,14 @@
423
423
  "allowNo": false,
424
424
  "type": "boolean"
425
425
  },
426
+ "media-library-id": {
427
+ "description": "For a Media Library config deploy: the media library to sync the aspect definitions to. Defaults to the single active library of the configured organization; required when the organization has several",
428
+ "hidden": true,
429
+ "name": "media-library-id",
430
+ "hasDynamicHelp": false,
431
+ "multiple": false,
432
+ "type": "option"
433
+ },
426
434
  "minify": {
427
435
  "description": "Minify built JavaScript (use --no-minify to skip for faster builds)",
428
436
  "name": "minify",
@@ -2600,6 +2608,130 @@
2600
2608
  "list.js"
2601
2609
  ]
2602
2610
  },
2611
+ "docs:browse": {
2612
+ "aliases": [],
2613
+ "args": {},
2614
+ "description": "Open Sanity docs in your browser",
2615
+ "flags": {},
2616
+ "hasDynamicHelp": false,
2617
+ "hiddenAliases": [],
2618
+ "id": "docs:browse",
2619
+ "pluginAlias": "@sanity/cli",
2620
+ "pluginName": "@sanity/cli",
2621
+ "pluginType": "core",
2622
+ "strict": true,
2623
+ "enableJsonFlag": false,
2624
+ "isESM": true,
2625
+ "relativePath": [
2626
+ "dist",
2627
+ "commands",
2628
+ "docs",
2629
+ "browse.js"
2630
+ ]
2631
+ },
2632
+ "docs:read": {
2633
+ "aliases": [],
2634
+ "args": {
2635
+ "path": {
2636
+ "description": "Path or URL to article, found in search results and docs content as links",
2637
+ "name": "path",
2638
+ "required": true
2639
+ }
2640
+ },
2641
+ "description": "Read an article in terminal",
2642
+ "examples": [
2643
+ {
2644
+ "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation",
2645
+ "description": "Read as markdown in terminal"
2646
+ },
2647
+ {
2648
+ "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
2649
+ "description": "Read using full URL"
2650
+ },
2651
+ {
2652
+ "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation --web",
2653
+ "description": "Open in web browser"
2654
+ },
2655
+ {
2656
+ "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation -w",
2657
+ "description": "Open using full URL in web browser"
2658
+ }
2659
+ ],
2660
+ "flags": {
2661
+ "web": {
2662
+ "aliases": [
2663
+ "w"
2664
+ ],
2665
+ "description": "Open in a web browser",
2666
+ "name": "web",
2667
+ "allowNo": false,
2668
+ "type": "boolean"
2669
+ }
2670
+ },
2671
+ "hasDynamicHelp": false,
2672
+ "hiddenAliases": [],
2673
+ "id": "docs:read",
2674
+ "pluginAlias": "@sanity/cli",
2675
+ "pluginName": "@sanity/cli",
2676
+ "pluginType": "core",
2677
+ "strict": true,
2678
+ "isESM": true,
2679
+ "relativePath": [
2680
+ "dist",
2681
+ "commands",
2682
+ "docs",
2683
+ "read.js"
2684
+ ]
2685
+ },
2686
+ "docs:search": {
2687
+ "aliases": [],
2688
+ "args": {
2689
+ "query": {
2690
+ "description": "Search query for documentation",
2691
+ "name": "query",
2692
+ "required": true
2693
+ }
2694
+ },
2695
+ "description": "Search Sanity docs",
2696
+ "examples": [
2697
+ {
2698
+ "command": "<%= config.bin %> <%= command.id %> schema",
2699
+ "description": "Search for documentation about schemas"
2700
+ },
2701
+ {
2702
+ "command": "<%= config.bin %> <%= command.id %> \"groq functions\"",
2703
+ "description": "Search with phrase"
2704
+ },
2705
+ {
2706
+ "command": "<%= config.bin %> <%= command.id %> \"deployment\" --limit=5",
2707
+ "description": "Limit search results"
2708
+ }
2709
+ ],
2710
+ "flags": {
2711
+ "limit": {
2712
+ "description": "Maximum number of results to return",
2713
+ "name": "limit",
2714
+ "default": 10,
2715
+ "hasDynamicHelp": false,
2716
+ "multiple": false,
2717
+ "type": "option"
2718
+ }
2719
+ },
2720
+ "hasDynamicHelp": false,
2721
+ "hiddenAliases": [],
2722
+ "id": "docs:search",
2723
+ "pluginAlias": "@sanity/cli",
2724
+ "pluginName": "@sanity/cli",
2725
+ "pluginType": "core",
2726
+ "strict": true,
2727
+ "isESM": true,
2728
+ "relativePath": [
2729
+ "dist",
2730
+ "commands",
2731
+ "docs",
2732
+ "search.js"
2733
+ ]
2734
+ },
2603
2735
  "context:build": {
2604
2736
  "aliases": [],
2605
2737
  "args": {
@@ -2867,6 +2999,78 @@
2867
2999
  "list.js"
2868
3000
  ]
2869
3001
  },
3002
+ "context:query": {
3003
+ "aliases": [],
3004
+ "args": {
3005
+ "query": {
3006
+ "description": "GROQ query to run against the organization's Context documents",
3007
+ "name": "query",
3008
+ "required": true
3009
+ }
3010
+ },
3011
+ "description": "Query an organization's Context documents with GROQ",
3012
+ "examples": [
3013
+ {
3014
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"sanity.context.issue\" && status == \"open\"]{_id, knowledgeBaseId}'",
3015
+ "description": "List open issues across all knowledge bases"
3016
+ },
3017
+ {
3018
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"sanity.context.entry\" && knowledgeBaseId == $kb].path' --params '{\"kb\": \"kb-abc123\"}' --json",
3019
+ "description": "List the entry paths of one knowledge base as plain JSON"
3020
+ }
3021
+ ],
3022
+ "flags": {
3023
+ "json": {
3024
+ "description": "Format output as json.",
3025
+ "helpGroup": "GLOBAL",
3026
+ "name": "json",
3027
+ "allowNo": false,
3028
+ "type": "boolean"
3029
+ },
3030
+ "organization": {
3031
+ "description": "Organization to query (overrides CLI configuration)",
3032
+ "helpGroup": "OVERRIDE",
3033
+ "name": "organization",
3034
+ "hasDynamicHelp": false,
3035
+ "helpValue": "<id>",
3036
+ "multiple": false,
3037
+ "type": "option"
3038
+ },
3039
+ "params": {
3040
+ "description": "Query parameters as a JSON object",
3041
+ "name": "params",
3042
+ "hasDynamicHelp": false,
3043
+ "helpValue": "<json>",
3044
+ "multiple": false,
3045
+ "type": "option"
3046
+ }
3047
+ },
3048
+ "hasDynamicHelp": false,
3049
+ "hiddenAliases": [],
3050
+ "id": "context:query",
3051
+ "pluginAlias": "@sanity/cli",
3052
+ "pluginName": "@sanity/cli",
3053
+ "pluginType": "core",
3054
+ "strict": true,
3055
+ "enableJsonFlag": true,
3056
+ "telemetry": {
3057
+ "redactedFlags": [
3058
+ {
3059
+ "canonical": "--params",
3060
+ "flags": [
3061
+ "--params"
3062
+ ]
3063
+ }
3064
+ ]
3065
+ },
3066
+ "isESM": true,
3067
+ "relativePath": [
3068
+ "dist",
3069
+ "commands",
3070
+ "context",
3071
+ "query.js"
3072
+ ]
3073
+ },
2870
3074
  "context:refresh": {
2871
3075
  "aliases": [],
2872
3076
  "args": {
@@ -2991,222 +3195,96 @@
2991
3195
  "update.js"
2992
3196
  ]
2993
3197
  },
2994
- "docs:browse": {
2995
- "aliases": [],
2996
- "args": {},
2997
- "description": "Open Sanity docs in your browser",
2998
- "flags": {},
2999
- "hasDynamicHelp": false,
3000
- "hiddenAliases": [],
3001
- "id": "docs:browse",
3002
- "pluginAlias": "@sanity/cli",
3003
- "pluginName": "@sanity/cli",
3004
- "pluginType": "core",
3005
- "strict": true,
3006
- "enableJsonFlag": false,
3007
- "isESM": true,
3008
- "relativePath": [
3009
- "dist",
3010
- "commands",
3011
- "docs",
3012
- "browse.js"
3013
- ]
3014
- },
3015
- "docs:read": {
3198
+ "documents:create": {
3016
3199
  "aliases": [],
3017
3200
  "args": {
3018
- "path": {
3019
- "description": "Path or URL to article, found in search results and docs content as links",
3020
- "name": "path",
3021
- "required": true
3201
+ "file": {
3202
+ "description": "JSON file to create document(s) from",
3203
+ "name": "file",
3204
+ "required": false
3022
3205
  }
3023
3206
  },
3024
- "description": "Read an article in terminal",
3207
+ "description": "Create one or more documents",
3025
3208
  "examples": [
3026
3209
  {
3027
- "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation",
3028
- "description": "Read as markdown in terminal"
3210
+ "command": "<%= config.bin %> <%= command.id %> myDocument.json",
3211
+ "description": "Create the document specified in \"myDocument.json\""
3029
3212
  },
3030
3213
  {
3031
- "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
3032
- "description": "Read using full URL"
3214
+ "command": "<%= config.bin %> <%= command.id %>",
3215
+ "description": "Open configured $EDITOR and create the specified document(s)"
3033
3216
  },
3034
3217
  {
3035
- "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation --web",
3036
- "description": "Open in web browser"
3218
+ "command": "<%= config.bin %> <%= command.id %> --id myDocId --replace",
3219
+ "description": "Fetch document with the ID \"myDocId\" and open configured $EDITOR with the current document content (if any). Replace document with the edited version when the editor closes"
3037
3220
  },
3038
3221
  {
3039
- "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation -w",
3040
- "description": "Open using full URL in web browser"
3222
+ "command": "<%= config.bin %> <%= command.id %> --id myDocId --watch --replace --json5",
3223
+ "description": "Open configured $EDITOR and replace the document with the given content on each save. Use JSON5 file extension and parser for simplified syntax."
3224
+ },
3225
+ {
3226
+ "command": "<%= config.bin %> <%= command.id %> myDocument.json --project-id abc123",
3227
+ "description": "Create documents in a specific project"
3041
3228
  }
3042
3229
  ],
3043
3230
  "flags": {
3044
- "web": {
3045
- "aliases": [
3046
- "w"
3047
- ],
3048
- "description": "Open in a web browser",
3049
- "name": "web",
3050
- "allowNo": false,
3051
- "type": "boolean"
3052
- }
3053
- },
3054
- "hasDynamicHelp": false,
3055
- "hiddenAliases": [],
3056
- "id": "docs:read",
3057
- "pluginAlias": "@sanity/cli",
3058
- "pluginName": "@sanity/cli",
3059
- "pluginType": "core",
3060
- "strict": true,
3061
- "isESM": true,
3062
- "relativePath": [
3063
- "dist",
3064
- "commands",
3065
- "docs",
3066
- "read.js"
3067
- ]
3068
- },
3069
- "docs:search": {
3070
- "aliases": [],
3071
- "args": {
3072
- "query": {
3073
- "description": "Search query for documentation",
3074
- "name": "query",
3075
- "required": true
3076
- }
3077
- },
3078
- "description": "Search Sanity docs",
3079
- "examples": [
3080
- {
3081
- "command": "<%= config.bin %> <%= command.id %> schema",
3082
- "description": "Search for documentation about schemas"
3083
- },
3084
- {
3085
- "command": "<%= config.bin %> <%= command.id %> \"groq functions\"",
3086
- "description": "Search with phrase"
3087
- },
3088
- {
3089
- "command": "<%= config.bin %> <%= command.id %> \"deployment\" --limit=5",
3090
- "description": "Limit search results"
3091
- }
3092
- ],
3093
- "flags": {
3094
- "limit": {
3095
- "description": "Maximum number of results to return",
3096
- "name": "limit",
3097
- "default": 10,
3231
+ "project-id": {
3232
+ "char": "p",
3233
+ "description": "Project ID to create document(s) in (overrides CLI configuration)",
3234
+ "helpGroup": "OVERRIDE",
3235
+ "name": "project-id",
3098
3236
  "hasDynamicHelp": false,
3237
+ "helpValue": "<id>",
3099
3238
  "multiple": false,
3100
3239
  "type": "option"
3101
- }
3102
- },
3103
- "hasDynamicHelp": false,
3104
- "hiddenAliases": [],
3105
- "id": "docs:search",
3106
- "pluginAlias": "@sanity/cli",
3107
- "pluginName": "@sanity/cli",
3108
- "pluginType": "core",
3109
- "strict": true,
3110
- "isESM": true,
3111
- "relativePath": [
3112
- "dist",
3113
- "commands",
3114
- "docs",
3115
- "search.js"
3116
- ]
3117
- },
3118
- "graphql:deploy": {
3119
- "aliases": [],
3120
- "args": {},
3121
- "description": "Deploy a GraphQL API from the current Sanity schema",
3122
- "examples": [
3123
- {
3124
- "command": "<%= config.bin %> <%= command.id %>",
3125
- "description": "Deploy all defined GraphQL APIs"
3126
- },
3127
- {
3128
- "command": "<%= config.bin %> <%= command.id %> --dry-run",
3129
- "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy"
3130
- },
3131
- {
3132
- "command": "<%= config.bin %> <%= command.id %> --api staging --api ios",
3133
- "description": "Deploy only the GraphQL APIs with the IDs \"staging\" and \"ios\""
3134
- },
3135
- {
3136
- "command": "<%= config.bin %> <%= command.id %> --playground",
3137
- "description": "Deploy all defined GraphQL APIs, overriding any playground setting"
3138
- }
3139
- ],
3140
- "flags": {
3141
- "api": {
3142
- "description": "Only deploy API with this ID (can be specified multiple times)",
3143
- "name": "api",
3144
- "hasDynamicHelp": false,
3145
- "multiple": true,
3146
- "type": "option"
3147
3240
  },
3148
3241
  "dataset": {
3149
3242
  "char": "d",
3150
- "description": "Deploy API for the given dataset",
3243
+ "description": "Dataset to create document(s) in (overrides CLI configuration)",
3244
+ "helpGroup": "OVERRIDE",
3151
3245
  "name": "dataset",
3152
3246
  "hasDynamicHelp": false,
3153
3247
  "helpValue": "<name>",
3154
3248
  "multiple": false,
3155
3249
  "type": "option"
3156
3250
  },
3157
- "dry-run": {
3158
- "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy",
3159
- "name": "dry-run",
3160
- "allowNo": false,
3161
- "type": "boolean"
3162
- },
3163
- "force": {
3164
- "description": "Deploy API without confirming breaking changes",
3165
- "name": "force",
3166
- "allowNo": false,
3167
- "type": "boolean"
3168
- },
3169
- "generation": {
3170
- "description": "API generation to deploy (defaults to \"gen3\")",
3171
- "name": "generation",
3251
+ "id": {
3252
+ "description": "Specify a document ID to use. Will fetch remote document ID and populate editor.",
3253
+ "name": "id",
3172
3254
  "hasDynamicHelp": false,
3173
3255
  "multiple": false,
3174
- "options": [
3175
- "gen1",
3176
- "gen2",
3177
- "gen3"
3178
- ],
3179
3256
  "type": "option"
3180
3257
  },
3181
- "non-null-document-fields": {
3182
- "description": "Use non-null document fields (_id, _type etc)",
3183
- "name": "non-null-document-fields",
3258
+ "json5": {
3259
+ "description": "Use JSON5 file type to allow a \"simplified\" version of JSON",
3260
+ "name": "json5",
3184
3261
  "allowNo": false,
3185
3262
  "type": "boolean"
3186
3263
  },
3187
- "playground": {
3188
- "description": "Enable GraphQL playground for easier debugging",
3189
- "name": "playground",
3190
- "allowNo": true,
3264
+ "missing": {
3265
+ "description": "On duplicate document IDs, don't modify the target document(s)",
3266
+ "name": "missing",
3267
+ "allowNo": false,
3191
3268
  "type": "boolean"
3192
3269
  },
3193
- "tag": {
3194
- "description": "Deploy API(s) to given tag (defaults to \"default\")",
3195
- "name": "tag",
3196
- "hasDynamicHelp": false,
3197
- "multiple": false,
3198
- "type": "option"
3270
+ "replace": {
3271
+ "description": "On duplicate document IDs, replace existing document with specified document(s)",
3272
+ "name": "replace",
3273
+ "allowNo": false,
3274
+ "type": "boolean"
3199
3275
  },
3200
- "with-union-cache": {
3201
- "description": "Cache union types (faster for schemas with many self-references)",
3202
- "name": "with-union-cache",
3276
+ "watch": {
3277
+ "description": "Write the documents whenever the target file or buffer changes",
3278
+ "name": "watch",
3203
3279
  "allowNo": false,
3204
3280
  "type": "boolean"
3205
3281
  }
3206
3282
  },
3207
3283
  "hasDynamicHelp": false,
3208
- "hiddenAliases": [],
3209
- "id": "graphql:deploy",
3284
+ "hiddenAliases": [
3285
+ "document:create"
3286
+ ],
3287
+ "id": "documents:create",
3210
3288
  "pluginAlias": "@sanity/cli",
3211
3289
  "pluginName": "@sanity/cli",
3212
3290
  "pluginType": "core",
@@ -3215,85 +3293,118 @@
3215
3293
  "relativePath": [
3216
3294
  "dist",
3217
3295
  "commands",
3218
- "graphql",
3219
- "deploy.js"
3296
+ "documents",
3297
+ "create.js"
3220
3298
  ]
3221
3299
  },
3222
- "graphql:list": {
3300
+ "documents:delete": {
3223
3301
  "aliases": [],
3224
- "args": {},
3225
- "description": "List deployed GraphQL endpoints for the project",
3302
+ "args": {
3303
+ "id": {
3304
+ "description": "Document ID to delete",
3305
+ "name": "id",
3306
+ "required": true
3307
+ },
3308
+ "ids": {
3309
+ "description": "Additional document IDs to delete",
3310
+ "name": "ids",
3311
+ "required": false
3312
+ }
3313
+ },
3314
+ "description": "Delete one or more documents from the project's configured dataset",
3226
3315
  "examples": [
3227
3316
  {
3228
- "command": "<%= config.bin %> <%= command.id %>",
3229
- "description": "List GraphQL endpoints for the project"
3317
+ "command": "<%= config.bin %> <%= command.id %> myDocId",
3318
+ "description": "Delete the document with the ID \"myDocId\""
3230
3319
  },
3231
3320
  {
3232
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
3233
- "description": "List GraphQL endpoints for a specific project"
3321
+ "command": "<%= config.bin %> <%= command.id %> 'myDocId'",
3322
+ "description": "ID wrapped in double or single quote works equally well"
3323
+ },
3324
+ {
3325
+ "command": "<%= config.bin %> <%= command.id %> --dataset=blog someDocId",
3326
+ "description": "Delete document with ID \"someDocId\" from dataset \"blog\""
3327
+ },
3328
+ {
3329
+ "command": "<%= config.bin %> <%= command.id %> doc1 doc2",
3330
+ "description": "Delete the document with ID \"doc1\" and \"doc2\""
3331
+ },
3332
+ {
3333
+ "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3334
+ "description": "Delete a document from a specific project"
3234
3335
  }
3235
3336
  ],
3236
3337
  "flags": {
3237
3338
  "project-id": {
3238
3339
  "char": "p",
3239
- "description": "Project ID to list GraphQL endpoints for (overrides CLI configuration)",
3340
+ "description": "Project ID to delete from (overrides CLI configuration)",
3240
3341
  "helpGroup": "OVERRIDE",
3241
3342
  "name": "project-id",
3242
3343
  "hasDynamicHelp": false,
3243
3344
  "helpValue": "<id>",
3244
3345
  "multiple": false,
3245
3346
  "type": "option"
3347
+ },
3348
+ "dataset": {
3349
+ "char": "d",
3350
+ "description": "Dataset to delete from (overrides CLI configuration)",
3351
+ "helpGroup": "OVERRIDE",
3352
+ "name": "dataset",
3353
+ "hasDynamicHelp": false,
3354
+ "helpValue": "<name>",
3355
+ "multiple": false,
3356
+ "type": "option"
3246
3357
  }
3247
3358
  },
3248
3359
  "hasDynamicHelp": false,
3249
- "hiddenAliases": [],
3250
- "id": "graphql:list",
3360
+ "hiddenAliases": [
3361
+ "document:delete"
3362
+ ],
3363
+ "id": "documents:delete",
3251
3364
  "pluginAlias": "@sanity/cli",
3252
3365
  "pluginName": "@sanity/cli",
3253
3366
  "pluginType": "core",
3254
- "strict": true,
3367
+ "strict": false,
3255
3368
  "isESM": true,
3256
3369
  "relativePath": [
3257
3370
  "dist",
3258
3371
  "commands",
3259
- "graphql",
3260
- "list.js"
3372
+ "documents",
3373
+ "delete.js"
3261
3374
  ]
3262
3375
  },
3263
- "graphql:undeploy": {
3376
+ "documents:get": {
3264
3377
  "aliases": [],
3265
- "args": {},
3266
- "description": "Remove a deployed GraphQL API",
3378
+ "args": {
3379
+ "documentId": {
3380
+ "description": "Document ID to retrieve",
3381
+ "name": "documentId",
3382
+ "required": true
3383
+ }
3384
+ },
3385
+ "description": "Get and print a document by ID",
3267
3386
  "examples": [
3268
3387
  {
3269
- "command": "<%= config.bin %> <%= command.id %>",
3270
- "description": "Undeploy GraphQL API for current project and dataset"
3271
- },
3272
- {
3273
- "command": "<%= config.bin %> <%= command.id %> --api ios",
3274
- "description": "Undeploy API with ID \"ios\""
3275
- },
3276
- {
3277
- "command": "<%= config.bin %> <%= command.id %> --dataset staging",
3278
- "description": "Undeploy GraphQL API for staging dataset"
3388
+ "command": "<%= config.bin %> <%= command.id %> myDocId",
3389
+ "description": "Get the document with ID \"myDocId\""
3279
3390
  },
3280
3391
  {
3281
- "command": "<%= config.bin %> <%= command.id %> --dataset staging --tag next",
3282
- "description": "Undeploy GraphQL API for staging dataset with \"next\" tag"
3392
+ "command": "<%= config.bin %> <%= command.id %> myDocId --pretty",
3393
+ "description": "Get document with colorized JSON output"
3283
3394
  },
3284
3395
  {
3285
- "command": "<%= config.bin %> <%= command.id %> --force",
3286
- "description": "Undeploy GraphQL API without confirmation prompt"
3396
+ "command": "<%= config.bin %> <%= command.id %> myDocId --dataset production",
3397
+ "description": "Get document from a specific dataset"
3287
3398
  },
3288
3399
  {
3289
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3290
- "description": "Undeploy GraphQL API for a specific project and dataset"
3400
+ "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3401
+ "description": "Get a document from a specific project"
3291
3402
  }
3292
3403
  ],
3293
3404
  "flags": {
3294
3405
  "project-id": {
3295
3406
  "char": "p",
3296
- "description": "Project ID to undeploy GraphQL API from (overrides CLI configuration)",
3407
+ "description": "Project ID to get document from (overrides CLI configuration)",
3297
3408
  "helpGroup": "OVERRIDE",
3298
3409
  "name": "project-id",
3299
3410
  "hasDynamicHelp": false,
@@ -3301,21 +3412,9 @@
3301
3412
  "multiple": false,
3302
3413
  "type": "option"
3303
3414
  },
3304
- "api": {
3305
- "description": "Undeploy API with this ID",
3306
- "exclusive": [
3307
- "project-id",
3308
- "project"
3309
- ],
3310
- "name": "api",
3311
- "required": false,
3312
- "hasDynamicHelp": false,
3313
- "multiple": false,
3314
- "type": "option"
3315
- },
3316
3415
  "dataset": {
3317
3416
  "char": "d",
3318
- "description": "Dataset to undeploy GraphQL API from (overrides CLI configuration)",
3417
+ "description": "Dataset to get document from (overrides CLI configuration)",
3319
3418
  "helpGroup": "OVERRIDE",
3320
3419
  "name": "dataset",
3321
3420
  "hasDynamicHelp": false,
@@ -3323,37 +3422,18 @@
3323
3422
  "multiple": false,
3324
3423
  "type": "option"
3325
3424
  },
3326
- "force": {
3327
- "description": "Skip confirmation prompt",
3328
- "name": "force",
3425
+ "pretty": {
3426
+ "description": "Colorize JSON output",
3427
+ "name": "pretty",
3329
3428
  "allowNo": false,
3330
3429
  "type": "boolean"
3331
- },
3332
- "project": {
3333
- "deprecated": {
3334
- "to": "project-id"
3335
- },
3336
- "description": "Project ID to delete GraphQL API for",
3337
- "hidden": true,
3338
- "name": "project",
3339
- "required": false,
3340
- "hasDynamicHelp": false,
3341
- "multiple": false,
3342
- "type": "option"
3343
- },
3344
- "tag": {
3345
- "description": "Tag to undeploy GraphQL API from",
3346
- "name": "tag",
3347
- "required": false,
3348
- "default": "default",
3349
- "hasDynamicHelp": false,
3350
- "multiple": false,
3351
- "type": "option"
3352
3430
  }
3353
3431
  },
3354
3432
  "hasDynamicHelp": false,
3355
- "hiddenAliases": [],
3356
- "id": "graphql:undeploy",
3433
+ "hiddenAliases": [
3434
+ "document:get"
3435
+ ],
3436
+ "id": "documents:get",
3357
3437
  "pluginAlias": "@sanity/cli",
3358
3438
  "pluginName": "@sanity/cli",
3359
3439
  "pluginType": "core",
@@ -3362,46 +3442,42 @@
3362
3442
  "relativePath": [
3363
3443
  "dist",
3364
3444
  "commands",
3365
- "graphql",
3366
- "undeploy.js"
3445
+ "documents",
3446
+ "get.js"
3367
3447
  ]
3368
3448
  },
3369
- "documents:create": {
3449
+ "documents:query": {
3370
3450
  "aliases": [],
3371
3451
  "args": {
3372
- "file": {
3373
- "description": "JSON file to create document(s) from",
3374
- "name": "file",
3375
- "required": false
3452
+ "query": {
3453
+ "description": "GROQ query to run against the dataset",
3454
+ "name": "query",
3455
+ "required": true
3376
3456
  }
3377
3457
  },
3378
- "description": "Create one or more documents",
3458
+ "description": "Query for documents",
3379
3459
  "examples": [
3380
3460
  {
3381
- "command": "<%= config.bin %> <%= command.id %> myDocument.json",
3382
- "description": "Create the document specified in \"myDocument.json\""
3383
- },
3384
- {
3385
- "command": "<%= config.bin %> <%= command.id %>",
3386
- "description": "Open configured $EDITOR and create the specified document(s)"
3461
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"][0..4]'",
3462
+ "description": "Fetch 5 documents of type \"movie\""
3387
3463
  },
3388
3464
  {
3389
- "command": "<%= config.bin %> <%= command.id %> --id myDocId --replace",
3390
- "description": "Fetch document with the ID \"myDocId\" and open configured $EDITOR with the current document content (if any). Replace document with the edited version when the editor closes"
3465
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"]|order(releaseDate asc)[0]{title}' --dataset staging",
3466
+ "description": "Fetch title of the oldest movie in the dataset named \"staging\""
3391
3467
  },
3392
3468
  {
3393
- "command": "<%= config.bin %> <%= command.id %> --id myDocId --watch --replace --json5",
3394
- "description": "Open configured $EDITOR and replace the document with the given content on each save. Use JSON5 file extension and parser for simplified syntax."
3469
+ "command": "<%= config.bin %> <%= command.id %> '*[_id == \"header\"] { \"headerText\": pt::text(body) }' --api-version v2021-06-07",
3470
+ "description": "Use API version v2021-06-07 and do a query"
3395
3471
  },
3396
3472
  {
3397
- "command": "<%= config.bin %> <%= command.id %> myDocument.json --project-id abc123",
3398
- "description": "Create documents in a specific project"
3473
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"post\"]' --project-id abc123 --dataset production",
3474
+ "description": "Query documents in a specific project and dataset"
3399
3475
  }
3400
3476
  ],
3401
3477
  "flags": {
3402
3478
  "project-id": {
3403
3479
  "char": "p",
3404
- "description": "Project ID to create document(s) in (overrides CLI configuration)",
3480
+ "description": "Project ID to query (overrides CLI configuration)",
3405
3481
  "helpGroup": "OVERRIDE",
3406
3482
  "name": "project-id",
3407
3483
  "hasDynamicHelp": false,
@@ -3411,7 +3487,7 @@
3411
3487
  },
3412
3488
  "dataset": {
3413
3489
  "char": "d",
3414
- "description": "Dataset to create document(s) in (overrides CLI configuration)",
3490
+ "description": "Dataset to query (overrides CLI configuration)",
3415
3491
  "helpGroup": "OVERRIDE",
3416
3492
  "name": "dataset",
3417
3493
  "hasDynamicHelp": false,
@@ -3419,43 +3495,42 @@
3419
3495
  "multiple": false,
3420
3496
  "type": "option"
3421
3497
  },
3422
- "id": {
3423
- "description": "Specify a document ID to use. Will fetch remote document ID and populate editor.",
3424
- "name": "id",
3425
- "hasDynamicHelp": false,
3426
- "multiple": false,
3427
- "type": "option"
3428
- },
3429
- "json5": {
3430
- "description": "Use JSON5 file type to allow a \"simplified\" version of JSON",
3431
- "name": "json5",
3498
+ "anonymous": {
3499
+ "description": "Send the query without any authorization token",
3500
+ "name": "anonymous",
3432
3501
  "allowNo": false,
3433
3502
  "type": "boolean"
3434
3503
  },
3435
- "missing": {
3436
- "description": "On duplicate document IDs, don't modify the target document(s)",
3437
- "name": "missing",
3438
- "allowNo": false,
3439
- "type": "boolean"
3504
+ "api-version": {
3505
+ "description": "API version to use (defaults to 2025-08-15)",
3506
+ "name": "api-version",
3507
+ "hasDynamicHelp": false,
3508
+ "multiple": false,
3509
+ "type": "option"
3440
3510
  },
3441
- "replace": {
3442
- "description": "On duplicate document IDs, replace existing document with specified document(s)",
3443
- "name": "replace",
3511
+ "pretty": {
3512
+ "description": "Colorize JSON output",
3513
+ "name": "pretty",
3444
3514
  "allowNo": false,
3445
3515
  "type": "boolean"
3446
3516
  },
3447
- "watch": {
3448
- "description": "Write the documents whenever the target file or buffer changes",
3449
- "name": "watch",
3450
- "allowNo": false,
3451
- "type": "boolean"
3517
+ "project": {
3518
+ "deprecated": {
3519
+ "to": "project-id"
3520
+ },
3521
+ "description": "Project ID to query",
3522
+ "hidden": true,
3523
+ "name": "project",
3524
+ "hasDynamicHelp": false,
3525
+ "multiple": false,
3526
+ "type": "option"
3452
3527
  }
3453
3528
  },
3454
3529
  "hasDynamicHelp": false,
3455
3530
  "hiddenAliases": [
3456
- "document:create"
3531
+ "document:query"
3457
3532
  ],
3458
- "id": "documents:create",
3533
+ "id": "documents:query",
3459
3534
  "pluginAlias": "@sanity/cli",
3460
3535
  "pluginName": "@sanity/cli",
3461
3536
  "pluginType": "core",
@@ -3465,51 +3540,39 @@
3465
3540
  "dist",
3466
3541
  "commands",
3467
3542
  "documents",
3468
- "create.js"
3543
+ "query.js"
3469
3544
  ]
3470
3545
  },
3471
- "documents:delete": {
3546
+ "documents:validate": {
3472
3547
  "aliases": [],
3473
- "args": {
3474
- "id": {
3475
- "description": "Document ID to delete",
3476
- "name": "id",
3477
- "required": true
3478
- },
3479
- "ids": {
3480
- "description": "Additional document IDs to delete",
3481
- "name": "ids",
3482
- "required": false
3483
- }
3484
- },
3485
- "description": "Delete one or more documents from the project's configured dataset",
3548
+ "args": {},
3549
+ "description": "Validate documents in a dataset against the studio schema",
3486
3550
  "examples": [
3487
3551
  {
3488
- "command": "<%= config.bin %> <%= command.id %> myDocId",
3489
- "description": "Delete the document with the ID \"myDocId\""
3552
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
3553
+ "description": "Validates all documents in a Sanity project with more than one workspace"
3490
3554
  },
3491
3555
  {
3492
- "command": "<%= config.bin %> <%= command.id %> 'myDocId'",
3493
- "description": "ID wrapped in double or single quote works equally well"
3556
+ "command": "<%= config.bin %> <%= command.id %> --workspace default --dataset staging",
3557
+ "description": "Override the dataset specified in the workspace"
3494
3558
  },
3495
3559
  {
3496
- "command": "<%= config.bin %> <%= command.id %> --dataset=blog someDocId",
3497
- "description": "Delete document with ID \"someDocId\" from dataset \"blog\""
3560
+ "command": "<%= config.bin %> <%= command.id %> --yes > report.txt",
3561
+ "description": "Save the results of the report into a file"
3498
3562
  },
3499
3563
  {
3500
- "command": "<%= config.bin %> <%= command.id %> doc1 doc2",
3501
- "description": "Delete the document with ID \"doc1\" and \"doc2\""
3564
+ "command": "<%= config.bin %> <%= command.id %> --level info",
3565
+ "description": "Report out info level validation markers too"
3502
3566
  },
3503
3567
  {
3504
- "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3505
- "description": "Delete a document from a specific project"
3568
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3569
+ "description": "Validate documents in a specific project and dataset"
3506
3570
  }
3507
3571
  ],
3508
3572
  "flags": {
3509
3573
  "project-id": {
3510
3574
  "char": "p",
3511
- "description": "Project ID to delete from (overrides CLI configuration)",
3512
- "helpGroup": "OVERRIDE",
3575
+ "description": "Override the project ID used. By default, this is derived from the given workspace",
3513
3576
  "name": "project-id",
3514
3577
  "hasDynamicHelp": false,
3515
3578
  "helpValue": "<id>",
@@ -3518,93 +3581,185 @@
3518
3581
  },
3519
3582
  "dataset": {
3520
3583
  "char": "d",
3521
- "description": "Dataset to delete from (overrides CLI configuration)",
3522
- "helpGroup": "OVERRIDE",
3584
+ "description": "Override the dataset used. By default, this is derived from the given workspace",
3523
3585
  "name": "dataset",
3524
3586
  "hasDynamicHelp": false,
3525
3587
  "helpValue": "<name>",
3526
3588
  "multiple": false,
3527
3589
  "type": "option"
3590
+ },
3591
+ "file": {
3592
+ "description": "Path to an NDJSON file or tar archive containing an NDJSON file (optionally gzip-compressed)",
3593
+ "name": "file",
3594
+ "hasDynamicHelp": false,
3595
+ "multiple": false,
3596
+ "type": "option"
3597
+ },
3598
+ "format": {
3599
+ "description": "The output format used to print the found validation markers and report progress",
3600
+ "name": "format",
3601
+ "hasDynamicHelp": false,
3602
+ "multiple": false,
3603
+ "options": [
3604
+ "json",
3605
+ "ndjson",
3606
+ "pretty"
3607
+ ],
3608
+ "type": "option"
3609
+ },
3610
+ "level": {
3611
+ "description": "The minimum level reported. Defaults to warning",
3612
+ "name": "level",
3613
+ "default": "warning",
3614
+ "hasDynamicHelp": false,
3615
+ "multiple": false,
3616
+ "options": [
3617
+ "error",
3618
+ "warning",
3619
+ "info"
3620
+ ],
3621
+ "type": "option"
3622
+ },
3623
+ "max-custom-validation-concurrency": {
3624
+ "description": "Specify how many custom validators can run concurrently",
3625
+ "name": "max-custom-validation-concurrency",
3626
+ "default": 5,
3627
+ "hasDynamicHelp": false,
3628
+ "multiple": false,
3629
+ "type": "option"
3630
+ },
3631
+ "max-fetch-concurrency": {
3632
+ "description": "Specify how many `client.fetch` requests are allowed to run concurrently",
3633
+ "name": "max-fetch-concurrency",
3634
+ "default": 25,
3635
+ "hasDynamicHelp": false,
3636
+ "multiple": false,
3637
+ "type": "option"
3638
+ },
3639
+ "workspace": {
3640
+ "description": "The name of the workspace to use when downloading and validating all documents",
3641
+ "name": "workspace",
3642
+ "hasDynamicHelp": false,
3643
+ "multiple": false,
3644
+ "type": "option"
3645
+ },
3646
+ "yes": {
3647
+ "char": "y",
3648
+ "description": "Skips the first confirmation prompt",
3649
+ "name": "yes",
3650
+ "allowNo": false,
3651
+ "type": "boolean"
3528
3652
  }
3529
3653
  },
3530
3654
  "hasDynamicHelp": false,
3531
3655
  "hiddenAliases": [
3532
- "document:delete"
3656
+ "document:validate"
3533
3657
  ],
3534
- "id": "documents:delete",
3658
+ "id": "documents:validate",
3535
3659
  "pluginAlias": "@sanity/cli",
3536
3660
  "pluginName": "@sanity/cli",
3537
3661
  "pluginType": "core",
3538
- "strict": false,
3662
+ "strict": true,
3539
3663
  "isESM": true,
3540
3664
  "relativePath": [
3541
3665
  "dist",
3542
3666
  "commands",
3543
3667
  "documents",
3544
- "delete.js"
3668
+ "validate.js"
3545
3669
  ]
3546
3670
  },
3547
- "documents:get": {
3671
+ "graphql:deploy": {
3548
3672
  "aliases": [],
3549
- "args": {
3550
- "documentId": {
3551
- "description": "Document ID to retrieve",
3552
- "name": "documentId",
3553
- "required": true
3554
- }
3555
- },
3556
- "description": "Get and print a document by ID",
3673
+ "args": {},
3674
+ "description": "Deploy a GraphQL API from the current Sanity schema",
3557
3675
  "examples": [
3558
3676
  {
3559
- "command": "<%= config.bin %> <%= command.id %> myDocId",
3560
- "description": "Get the document with ID \"myDocId\""
3677
+ "command": "<%= config.bin %> <%= command.id %>",
3678
+ "description": "Deploy all defined GraphQL APIs"
3561
3679
  },
3562
3680
  {
3563
- "command": "<%= config.bin %> <%= command.id %> myDocId --pretty",
3564
- "description": "Get document with colorized JSON output"
3681
+ "command": "<%= config.bin %> <%= command.id %> --dry-run",
3682
+ "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy"
3565
3683
  },
3566
3684
  {
3567
- "command": "<%= config.bin %> <%= command.id %> myDocId --dataset production",
3568
- "description": "Get document from a specific dataset"
3685
+ "command": "<%= config.bin %> <%= command.id %> --api staging --api ios",
3686
+ "description": "Deploy only the GraphQL APIs with the IDs \"staging\" and \"ios\""
3569
3687
  },
3570
3688
  {
3571
- "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3572
- "description": "Get a document from a specific project"
3689
+ "command": "<%= config.bin %> <%= command.id %> --playground",
3690
+ "description": "Deploy all defined GraphQL APIs, overriding any playground setting"
3573
3691
  }
3574
3692
  ],
3575
3693
  "flags": {
3576
- "project-id": {
3577
- "char": "p",
3578
- "description": "Project ID to get document from (overrides CLI configuration)",
3579
- "helpGroup": "OVERRIDE",
3580
- "name": "project-id",
3694
+ "api": {
3695
+ "description": "Only deploy API with this ID (can be specified multiple times)",
3696
+ "name": "api",
3697
+ "hasDynamicHelp": false,
3698
+ "multiple": true,
3699
+ "type": "option"
3700
+ },
3701
+ "dataset": {
3702
+ "char": "d",
3703
+ "description": "Deploy API for the given dataset",
3704
+ "name": "dataset",
3705
+ "hasDynamicHelp": false,
3706
+ "helpValue": "<name>",
3707
+ "multiple": false,
3708
+ "type": "option"
3709
+ },
3710
+ "dry-run": {
3711
+ "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy",
3712
+ "name": "dry-run",
3713
+ "allowNo": false,
3714
+ "type": "boolean"
3715
+ },
3716
+ "force": {
3717
+ "description": "Deploy API without confirming breaking changes",
3718
+ "name": "force",
3719
+ "allowNo": false,
3720
+ "type": "boolean"
3721
+ },
3722
+ "generation": {
3723
+ "description": "API generation to deploy (defaults to \"gen3\")",
3724
+ "name": "generation",
3581
3725
  "hasDynamicHelp": false,
3582
- "helpValue": "<id>",
3583
3726
  "multiple": false,
3727
+ "options": [
3728
+ "gen1",
3729
+ "gen2",
3730
+ "gen3"
3731
+ ],
3584
3732
  "type": "option"
3585
3733
  },
3586
- "dataset": {
3587
- "char": "d",
3588
- "description": "Dataset to get document from (overrides CLI configuration)",
3589
- "helpGroup": "OVERRIDE",
3590
- "name": "dataset",
3734
+ "non-null-document-fields": {
3735
+ "description": "Use non-null document fields (_id, _type etc)",
3736
+ "name": "non-null-document-fields",
3737
+ "allowNo": false,
3738
+ "type": "boolean"
3739
+ },
3740
+ "playground": {
3741
+ "description": "Enable GraphQL playground for easier debugging",
3742
+ "name": "playground",
3743
+ "allowNo": true,
3744
+ "type": "boolean"
3745
+ },
3746
+ "tag": {
3747
+ "description": "Deploy API(s) to given tag (defaults to \"default\")",
3748
+ "name": "tag",
3591
3749
  "hasDynamicHelp": false,
3592
- "helpValue": "<name>",
3593
3750
  "multiple": false,
3594
3751
  "type": "option"
3595
3752
  },
3596
- "pretty": {
3597
- "description": "Colorize JSON output",
3598
- "name": "pretty",
3753
+ "with-union-cache": {
3754
+ "description": "Cache union types (faster for schemas with many self-references)",
3755
+ "name": "with-union-cache",
3599
3756
  "allowNo": false,
3600
3757
  "type": "boolean"
3601
3758
  }
3602
3759
  },
3603
3760
  "hasDynamicHelp": false,
3604
- "hiddenAliases": [
3605
- "document:get"
3606
- ],
3607
- "id": "documents:get",
3761
+ "hiddenAliases": [],
3762
+ "id": "graphql:deploy",
3608
3763
  "pluginAlias": "@sanity/cli",
3609
3764
  "pluginName": "@sanity/cli",
3610
3765
  "pluginType": "core",
@@ -3613,95 +3768,39 @@
3613
3768
  "relativePath": [
3614
3769
  "dist",
3615
3770
  "commands",
3616
- "documents",
3617
- "get.js"
3771
+ "graphql",
3772
+ "deploy.js"
3618
3773
  ]
3619
3774
  },
3620
- "documents:query": {
3775
+ "graphql:list": {
3621
3776
  "aliases": [],
3622
- "args": {
3623
- "query": {
3624
- "description": "GROQ query to run against the dataset",
3625
- "name": "query",
3626
- "required": true
3627
- }
3628
- },
3629
- "description": "Query for documents",
3777
+ "args": {},
3778
+ "description": "List deployed GraphQL endpoints for the project",
3630
3779
  "examples": [
3631
3780
  {
3632
- "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"][0..4]'",
3633
- "description": "Fetch 5 documents of type \"movie\""
3634
- },
3635
- {
3636
- "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"]|order(releaseDate asc)[0]{title}' --dataset staging",
3637
- "description": "Fetch title of the oldest movie in the dataset named \"staging\""
3638
- },
3639
- {
3640
- "command": "<%= config.bin %> <%= command.id %> '*[_id == \"header\"] { \"headerText\": pt::text(body) }' --api-version v2021-06-07",
3641
- "description": "Use API version v2021-06-07 and do a query"
3781
+ "command": "<%= config.bin %> <%= command.id %>",
3782
+ "description": "List GraphQL endpoints for the project"
3642
3783
  },
3643
3784
  {
3644
- "command": "<%= config.bin %> <%= command.id %> '*[_type == \"post\"]' --project-id abc123 --dataset production",
3645
- "description": "Query documents in a specific project and dataset"
3785
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
3786
+ "description": "List GraphQL endpoints for a specific project"
3646
3787
  }
3647
3788
  ],
3648
3789
  "flags": {
3649
3790
  "project-id": {
3650
3791
  "char": "p",
3651
- "description": "Project ID to query (overrides CLI configuration)",
3792
+ "description": "Project ID to list GraphQL endpoints for (overrides CLI configuration)",
3652
3793
  "helpGroup": "OVERRIDE",
3653
3794
  "name": "project-id",
3654
3795
  "hasDynamicHelp": false,
3655
3796
  "helpValue": "<id>",
3656
3797
  "multiple": false,
3657
3798
  "type": "option"
3658
- },
3659
- "dataset": {
3660
- "char": "d",
3661
- "description": "Dataset to query (overrides CLI configuration)",
3662
- "helpGroup": "OVERRIDE",
3663
- "name": "dataset",
3664
- "hasDynamicHelp": false,
3665
- "helpValue": "<name>",
3666
- "multiple": false,
3667
- "type": "option"
3668
- },
3669
- "anonymous": {
3670
- "description": "Send the query without any authorization token",
3671
- "name": "anonymous",
3672
- "allowNo": false,
3673
- "type": "boolean"
3674
- },
3675
- "api-version": {
3676
- "description": "API version to use (defaults to 2025-08-15)",
3677
- "name": "api-version",
3678
- "hasDynamicHelp": false,
3679
- "multiple": false,
3680
- "type": "option"
3681
- },
3682
- "pretty": {
3683
- "description": "Colorize JSON output",
3684
- "name": "pretty",
3685
- "allowNo": false,
3686
- "type": "boolean"
3687
- },
3688
- "project": {
3689
- "deprecated": {
3690
- "to": "project-id"
3691
- },
3692
- "description": "Project ID to query",
3693
- "hidden": true,
3694
- "name": "project",
3695
- "hasDynamicHelp": false,
3696
- "multiple": false,
3697
- "type": "option"
3698
3799
  }
3699
3800
  },
3700
3801
  "hasDynamicHelp": false,
3701
- "hiddenAliases": [
3702
- "document:query"
3703
- ],
3704
- "id": "documents:query",
3802
+ "hiddenAliases": [],
3803
+ "id": "graphql:list",
3705
3804
  "pluginAlias": "@sanity/cli",
3706
3805
  "pluginName": "@sanity/cli",
3707
3806
  "pluginType": "core",
@@ -3710,123 +3809,104 @@
3710
3809
  "relativePath": [
3711
3810
  "dist",
3712
3811
  "commands",
3713
- "documents",
3714
- "query.js"
3812
+ "graphql",
3813
+ "list.js"
3715
3814
  ]
3716
3815
  },
3717
- "documents:validate": {
3816
+ "graphql:undeploy": {
3718
3817
  "aliases": [],
3719
3818
  "args": {},
3720
- "description": "Validate documents in a dataset against the studio schema",
3819
+ "description": "Remove a deployed GraphQL API",
3721
3820
  "examples": [
3722
3821
  {
3723
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
3724
- "description": "Validates all documents in a Sanity project with more than one workspace"
3822
+ "command": "<%= config.bin %> <%= command.id %>",
3823
+ "description": "Undeploy GraphQL API for current project and dataset"
3725
3824
  },
3726
3825
  {
3727
- "command": "<%= config.bin %> <%= command.id %> --workspace default --dataset staging",
3728
- "description": "Override the dataset specified in the workspace"
3826
+ "command": "<%= config.bin %> <%= command.id %> --api ios",
3827
+ "description": "Undeploy API with ID \"ios\""
3729
3828
  },
3730
3829
  {
3731
- "command": "<%= config.bin %> <%= command.id %> --yes > report.txt",
3732
- "description": "Save the results of the report into a file"
3830
+ "command": "<%= config.bin %> <%= command.id %> --dataset staging",
3831
+ "description": "Undeploy GraphQL API for staging dataset"
3733
3832
  },
3734
3833
  {
3735
- "command": "<%= config.bin %> <%= command.id %> --level info",
3736
- "description": "Report out info level validation markers too"
3834
+ "command": "<%= config.bin %> <%= command.id %> --dataset staging --tag next",
3835
+ "description": "Undeploy GraphQL API for staging dataset with \"next\" tag"
3836
+ },
3837
+ {
3838
+ "command": "<%= config.bin %> <%= command.id %> --force",
3839
+ "description": "Undeploy GraphQL API without confirmation prompt"
3737
3840
  },
3738
3841
  {
3739
3842
  "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3740
- "description": "Validate documents in a specific project and dataset"
3843
+ "description": "Undeploy GraphQL API for a specific project and dataset"
3741
3844
  }
3742
3845
  ],
3743
3846
  "flags": {
3744
3847
  "project-id": {
3745
3848
  "char": "p",
3746
- "description": "Override the project ID used. By default, this is derived from the given workspace",
3849
+ "description": "Project ID to undeploy GraphQL API from (overrides CLI configuration)",
3850
+ "helpGroup": "OVERRIDE",
3747
3851
  "name": "project-id",
3748
3852
  "hasDynamicHelp": false,
3749
3853
  "helpValue": "<id>",
3750
3854
  "multiple": false,
3751
3855
  "type": "option"
3752
3856
  },
3753
- "dataset": {
3754
- "char": "d",
3755
- "description": "Override the dataset used. By default, this is derived from the given workspace",
3756
- "name": "dataset",
3757
- "hasDynamicHelp": false,
3758
- "helpValue": "<name>",
3759
- "multiple": false,
3760
- "type": "option"
3761
- },
3762
- "file": {
3763
- "description": "Path to an NDJSON file or tar archive containing an NDJSON file (optionally gzip-compressed)",
3764
- "name": "file",
3765
- "hasDynamicHelp": false,
3766
- "multiple": false,
3767
- "type": "option"
3768
- },
3769
- "format": {
3770
- "description": "The output format used to print the found validation markers and report progress",
3771
- "name": "format",
3772
- "hasDynamicHelp": false,
3773
- "multiple": false,
3774
- "options": [
3775
- "json",
3776
- "ndjson",
3777
- "pretty"
3857
+ "api": {
3858
+ "description": "Undeploy API with this ID",
3859
+ "exclusive": [
3860
+ "project-id",
3861
+ "project"
3778
3862
  ],
3779
- "type": "option"
3780
- },
3781
- "level": {
3782
- "description": "The minimum level reported. Defaults to warning",
3783
- "name": "level",
3784
- "default": "warning",
3863
+ "name": "api",
3864
+ "required": false,
3785
3865
  "hasDynamicHelp": false,
3786
3866
  "multiple": false,
3787
- "options": [
3788
- "error",
3789
- "warning",
3790
- "info"
3791
- ],
3792
3867
  "type": "option"
3793
3868
  },
3794
- "max-custom-validation-concurrency": {
3795
- "description": "Specify how many custom validators can run concurrently",
3796
- "name": "max-custom-validation-concurrency",
3797
- "default": 5,
3869
+ "dataset": {
3870
+ "char": "d",
3871
+ "description": "Dataset to undeploy GraphQL API from (overrides CLI configuration)",
3872
+ "helpGroup": "OVERRIDE",
3873
+ "name": "dataset",
3798
3874
  "hasDynamicHelp": false,
3875
+ "helpValue": "<name>",
3799
3876
  "multiple": false,
3800
3877
  "type": "option"
3801
3878
  },
3802
- "max-fetch-concurrency": {
3803
- "description": "Specify how many `client.fetch` requests are allowed to run concurrently",
3804
- "name": "max-fetch-concurrency",
3805
- "default": 25,
3879
+ "force": {
3880
+ "description": "Skip confirmation prompt",
3881
+ "name": "force",
3882
+ "allowNo": false,
3883
+ "type": "boolean"
3884
+ },
3885
+ "project": {
3886
+ "deprecated": {
3887
+ "to": "project-id"
3888
+ },
3889
+ "description": "Project ID to delete GraphQL API for",
3890
+ "hidden": true,
3891
+ "name": "project",
3892
+ "required": false,
3806
3893
  "hasDynamicHelp": false,
3807
3894
  "multiple": false,
3808
3895
  "type": "option"
3809
3896
  },
3810
- "workspace": {
3811
- "description": "The name of the workspace to use when downloading and validating all documents",
3812
- "name": "workspace",
3897
+ "tag": {
3898
+ "description": "Tag to undeploy GraphQL API from",
3899
+ "name": "tag",
3900
+ "required": false,
3901
+ "default": "default",
3813
3902
  "hasDynamicHelp": false,
3814
3903
  "multiple": false,
3815
3904
  "type": "option"
3816
- },
3817
- "yes": {
3818
- "char": "y",
3819
- "description": "Skips the first confirmation prompt",
3820
- "name": "yes",
3821
- "allowNo": false,
3822
- "type": "boolean"
3823
3905
  }
3824
3906
  },
3825
3907
  "hasDynamicHelp": false,
3826
- "hiddenAliases": [
3827
- "document:validate"
3828
- ],
3829
- "id": "documents:validate",
3908
+ "hiddenAliases": [],
3909
+ "id": "graphql:undeploy",
3830
3910
  "pluginAlias": "@sanity/cli",
3831
3911
  "pluginName": "@sanity/cli",
3832
3912
  "pluginType": "core",
@@ -3835,8 +3915,8 @@
3835
3915
  "relativePath": [
3836
3916
  "dist",
3837
3917
  "commands",
3838
- "documents",
3839
- "validate.js"
3918
+ "graphql",
3919
+ "undeploy.js"
3840
3920
  ]
3841
3921
  },
3842
3922
  "hooks:attempt": {
@@ -4083,8 +4163,34 @@
4083
4163
  "relativePath": [
4084
4164
  "dist",
4085
4165
  "commands",
4086
- "hooks",
4087
- "logs.js"
4166
+ "hooks",
4167
+ "logs.js"
4168
+ ]
4169
+ },
4170
+ "mcp:configure": {
4171
+ "aliases": [],
4172
+ "args": {},
4173
+ "description": "Configure Sanity MCP server for AI editors (Antigravity, Claude Code, Cline, Cline CLI, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI, MCPorter, OpenCode, VS Code, VS Code Insiders, Zed)",
4174
+ "examples": [
4175
+ {
4176
+ "command": "<%= config.bin %> <%= command.id %>",
4177
+ "description": "Configure Sanity MCP server for detected AI editors"
4178
+ }
4179
+ ],
4180
+ "flags": {},
4181
+ "hasDynamicHelp": false,
4182
+ "hiddenAliases": [],
4183
+ "id": "mcp:configure",
4184
+ "pluginAlias": "@sanity/cli",
4185
+ "pluginName": "@sanity/cli",
4186
+ "pluginType": "core",
4187
+ "strict": true,
4188
+ "isESM": true,
4189
+ "relativePath": [
4190
+ "dist",
4191
+ "commands",
4192
+ "mcp",
4193
+ "configure.js"
4088
4194
  ]
4089
4195
  },
4090
4196
  "manifest:extract": {
@@ -4126,20 +4232,35 @@
4126
4232
  "extract.js"
4127
4233
  ]
4128
4234
  },
4129
- "mcp:configure": {
4235
+ "media:create-aspect": {
4130
4236
  "aliases": [],
4131
4237
  "args": {},
4132
- "description": "Configure Sanity MCP server for AI editors (Antigravity, Claude Code, Cline, Cline CLI, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI, MCPorter, OpenCode, VS Code, VS Code Insiders, Zed)",
4238
+ "description": "Create a new aspect definition file",
4133
4239
  "examples": [
4134
4240
  {
4135
4241
  "command": "<%= config.bin %> <%= command.id %>",
4136
- "description": "Configure Sanity MCP server for detected AI editors"
4242
+ "description": "Create a new aspect definition file"
4137
4243
  }
4138
4244
  ],
4139
- "flags": {},
4245
+ "flags": {
4246
+ "name": {
4247
+ "description": "Aspect name. Defaults to the title in camel case",
4248
+ "name": "name",
4249
+ "hasDynamicHelp": false,
4250
+ "multiple": false,
4251
+ "type": "option"
4252
+ },
4253
+ "title": {
4254
+ "description": "Aspect title",
4255
+ "name": "title",
4256
+ "hasDynamicHelp": false,
4257
+ "multiple": false,
4258
+ "type": "option"
4259
+ }
4260
+ },
4140
4261
  "hasDynamicHelp": false,
4141
4262
  "hiddenAliases": [],
4142
- "id": "mcp:configure",
4263
+ "id": "media:create-aspect",
4143
4264
  "pluginAlias": "@sanity/cli",
4144
4265
  "pluginName": "@sanity/cli",
4145
4266
  "pluginType": "core",
@@ -4148,64 +4269,55 @@
4148
4269
  "relativePath": [
4149
4270
  "dist",
4150
4271
  "commands",
4151
- "mcp",
4152
- "configure.js"
4272
+ "media",
4273
+ "create-aspect.js"
4153
4274
  ]
4154
4275
  },
4155
- "migrations:create": {
4276
+ "media:delete-aspect": {
4156
4277
  "aliases": [],
4157
4278
  "args": {
4158
- "title": {
4159
- "description": "Title of migration",
4160
- "name": "title",
4161
- "required": false
4279
+ "aspectName": {
4280
+ "description": "Name of the aspect to delete",
4281
+ "name": "aspectName",
4282
+ "required": true
4162
4283
  }
4163
4284
  },
4164
- "description": "Create a new migration within your project",
4285
+ "description": "Delete an aspect definition",
4165
4286
  "examples": [
4166
4287
  {
4167
- "command": "<%= config.bin %> <%= command.id %>",
4168
- "description": "Create a new migration, prompting for title and options"
4169
- },
4170
- {
4171
- "command": "<%= config.bin %> <%= command.id %> \"Rename field from location to address\"",
4172
- "description": "Create a new migration with the provided title, prompting for options"
4288
+ "command": "<%= config.bin %> <%= command.id %> someAspect",
4289
+ "description": "Delete the aspect named \"someAspect\""
4173
4290
  }
4174
4291
  ],
4175
- "flags": {},
4176
- "hasDynamicHelp": false,
4177
- "hiddenAliases": [
4178
- "migration:create"
4179
- ],
4180
- "id": "migrations:create",
4181
- "pluginAlias": "@sanity/cli",
4182
- "pluginName": "@sanity/cli",
4183
- "pluginType": "core",
4184
- "strict": true,
4185
- "isESM": true,
4186
- "relativePath": [
4187
- "dist",
4188
- "commands",
4189
- "migrations",
4190
- "create.js"
4191
- ]
4192
- },
4193
- "migrations:list": {
4194
- "aliases": [],
4195
- "args": {},
4196
- "description": "List available migrations",
4197
- "examples": [
4198
- {
4199
- "command": "<%= config.bin %> <%= command.id %>",
4200
- "description": "List all available migrations in the project"
4292
+ "flags": {
4293
+ "project-id": {
4294
+ "char": "p",
4295
+ "description": "Project ID to delete media aspect from (overrides CLI configuration)",
4296
+ "helpGroup": "OVERRIDE",
4297
+ "name": "project-id",
4298
+ "hasDynamicHelp": false,
4299
+ "helpValue": "<id>",
4300
+ "multiple": false,
4301
+ "type": "option"
4302
+ },
4303
+ "media-library-id": {
4304
+ "description": "The id of the target media library",
4305
+ "name": "media-library-id",
4306
+ "hasDynamicHelp": false,
4307
+ "multiple": false,
4308
+ "type": "option"
4309
+ },
4310
+ "yes": {
4311
+ "char": "y",
4312
+ "description": "Run without prompts and confirm deletion",
4313
+ "name": "yes",
4314
+ "allowNo": false,
4315
+ "type": "boolean"
4201
4316
  }
4202
- ],
4203
- "flags": {},
4317
+ },
4204
4318
  "hasDynamicHelp": false,
4205
- "hiddenAliases": [
4206
- "migration:list"
4207
- ],
4208
- "id": "migrations:list",
4319
+ "hiddenAliases": [],
4320
+ "id": "media:delete-aspect",
4209
4321
  "pluginAlias": "@sanity/cli",
4210
4322
  "pluginName": "@sanity/cli",
4211
4323
  "pluginType": "core",
@@ -4214,95 +4326,59 @@
4214
4326
  "relativePath": [
4215
4327
  "dist",
4216
4328
  "commands",
4217
- "migrations",
4218
- "list.js"
4329
+ "media",
4330
+ "delete-aspect.js"
4219
4331
  ]
4220
4332
  },
4221
- "migrations:run": {
4333
+ "media:deploy-aspect": {
4222
4334
  "aliases": [],
4223
4335
  "args": {
4224
- "id": {
4225
- "description": "ID",
4226
- "name": "id",
4336
+ "aspectName": {
4337
+ "description": "Name of the aspect to deploy",
4338
+ "name": "aspectName",
4227
4339
  "required": false
4228
4340
  }
4229
4341
  },
4230
- "description": "Run a migration against a dataset",
4342
+ "description": "Deploy an aspect",
4231
4343
  "examples": [
4232
4344
  {
4233
- "command": "<%= config.bin %> <%= command.id %> <id>",
4234
- "description": "dry run the migration"
4235
- },
4236
- {
4237
- "command": "<%= config.bin %> <%= command.id %> <id> --no-dry-run --project xyz --dataset staging",
4238
- "description": "execute the migration against a dataset"
4345
+ "command": "<%= config.bin %> <%= command.id %> someAspect",
4346
+ "description": "Deploy the aspect named \"someAspect\""
4239
4347
  },
4240
4348
  {
4241
- "command": "<%= config.bin %> <%= command.id %> <id> --from-export=production.tar.gz --no-dry-run --project xyz --dataset staging",
4242
- "description": "execute the migration using a dataset export as the source"
4349
+ "command": "<%= config.bin %> <%= command.id %> --all",
4350
+ "description": "Deploy all aspects"
4243
4351
  }
4244
4352
  ],
4245
4353
  "flags": {
4246
- "api-version": {
4247
- "description": "API version to use when migrating. Defaults to v2024-01-29.",
4248
- "name": "api-version",
4249
- "hasDynamicHelp": false,
4250
- "multiple": false,
4251
- "type": "option"
4252
- },
4253
- "concurrency": {
4254
- "description": "How many mutation requests to run in parallel. Must be between 1 and 10. Default: 6.",
4255
- "name": "concurrency",
4256
- "default": 6,
4257
- "hasDynamicHelp": false,
4258
- "multiple": false,
4259
- "type": "option"
4260
- },
4261
- "confirm": {
4262
- "description": "Prompt for confirmation before running the migration (default: true). Use --no-confirm to skip.",
4263
- "name": "confirm",
4264
- "allowNo": true,
4265
- "type": "boolean"
4266
- },
4267
- "dataset": {
4268
- "description": "Dataset to migrate. Defaults to the dataset configured in your Sanity CLI config.",
4269
- "name": "dataset",
4270
- "hasDynamicHelp": false,
4271
- "multiple": false,
4272
- "type": "option"
4273
- },
4274
- "dry-run": {
4275
- "description": "By default the migration runs in dry mode. Use --no-dry-run to migrate dataset.",
4276
- "name": "dry-run",
4277
- "allowNo": true,
4278
- "type": "boolean"
4279
- },
4280
- "from-export": {
4281
- "description": "Use a local dataset export as source for migration instead of calling the Sanity API. Note: this is only supported for dry runs.",
4282
- "name": "from-export",
4354
+ "project-id": {
4355
+ "char": "p",
4356
+ "description": "Project ID to deploy media aspect to (overrides CLI configuration)",
4357
+ "helpGroup": "OVERRIDE",
4358
+ "name": "project-id",
4283
4359
  "hasDynamicHelp": false,
4360
+ "helpValue": "<id>",
4284
4361
  "multiple": false,
4285
4362
  "type": "option"
4286
4363
  },
4287
- "progress": {
4288
- "description": "Display progress during migration (default: true). Use --no-progress to hide output.",
4289
- "name": "progress",
4290
- "allowNo": true,
4364
+ "all": {
4365
+ "description": "Deploy all aspects",
4366
+ "name": "all",
4367
+ "required": false,
4368
+ "allowNo": false,
4291
4369
  "type": "boolean"
4292
4370
  },
4293
- "project": {
4294
- "description": "Project ID of the dataset to migrate. Defaults to the projectId configured in your Sanity CLI config.",
4295
- "name": "project",
4371
+ "media-library-id": {
4372
+ "description": "The id of the target media library",
4373
+ "name": "media-library-id",
4296
4374
  "hasDynamicHelp": false,
4297
4375
  "multiple": false,
4298
4376
  "type": "option"
4299
4377
  }
4300
4378
  },
4301
4379
  "hasDynamicHelp": false,
4302
- "hiddenAliases": [
4303
- "migration:run"
4304
- ],
4305
- "id": "migrations:run",
4380
+ "hiddenAliases": [],
4381
+ "id": "media:deploy-aspect",
4306
4382
  "pluginAlias": "@sanity/cli",
4307
4383
  "pluginName": "@sanity/cli",
4308
4384
  "pluginType": "core",
@@ -4311,62 +4387,75 @@
4311
4387
  "relativePath": [
4312
4388
  "dist",
4313
4389
  "commands",
4314
- "migrations",
4315
- "run.js"
4390
+ "media",
4391
+ "deploy-aspect.js"
4316
4392
  ]
4317
4393
  },
4318
- "openapi:get": {
4394
+ "media:export": {
4319
4395
  "aliases": [],
4320
4396
  "args": {
4321
- "slug": {
4322
- "description": "Slug of the OpenAPI specification to retrieve",
4323
- "name": "slug",
4324
- "required": true
4397
+ "destination": {
4398
+ "description": "Output destination file path",
4399
+ "name": "destination"
4325
4400
  }
4326
4401
  },
4327
- "description": "Get an OpenAPI specification by slug",
4402
+ "description": "Export file and image assets from a media library (excludes video)",
4328
4403
  "examples": [
4329
4404
  {
4330
- "command": "<%= config.bin %> <%= command.id %> query",
4331
- "description": "Get a specification (YAML format, default)"
4332
- },
4333
- {
4334
- "command": "<%= config.bin %> <%= command.id %> query --format=json",
4335
- "description": "Get specification in JSON format"
4405
+ "command": "<%= config.bin %> <%= command.id %>",
4406
+ "description": "Export media library interactively"
4336
4407
  },
4337
4408
  {
4338
- "command": "<%= config.bin %> <%= command.id %> query --web",
4339
- "description": "Open specification in browser"
4409
+ "command": "<%= config.bin %> <%= command.id %> output.tar.gz",
4410
+ "description": "Export media library to output.tar.gz"
4340
4411
  },
4341
4412
  {
4342
- "command": "<%= config.bin %> <%= command.id %> query > query-api.yaml",
4343
- "description": "Pipe to file"
4413
+ "command": "<%= config.bin %> <%= command.id %> --media-library-id my-library-id",
4414
+ "description": "Export specific media library"
4344
4415
  }
4345
4416
  ],
4346
4417
  "flags": {
4347
- "format": {
4348
- "description": "Output format: yaml (default), json",
4349
- "name": "format",
4350
- "default": "yaml",
4418
+ "project-id": {
4419
+ "char": "p",
4420
+ "description": "Project ID to export media from (overrides CLI configuration)",
4421
+ "helpGroup": "OVERRIDE",
4422
+ "name": "project-id",
4423
+ "hasDynamicHelp": false,
4424
+ "helpValue": "<id>",
4425
+ "multiple": false,
4426
+ "type": "option"
4427
+ },
4428
+ "asset-concurrency": {
4429
+ "description": "Concurrent number of asset downloads",
4430
+ "name": "asset-concurrency",
4431
+ "default": 8,
4432
+ "hasDynamicHelp": false,
4433
+ "multiple": false,
4434
+ "type": "option"
4435
+ },
4436
+ "media-library-id": {
4437
+ "description": "The id of the target media library",
4438
+ "name": "media-library-id",
4351
4439
  "hasDynamicHelp": false,
4352
4440
  "multiple": false,
4353
- "options": [
4354
- "yaml",
4355
- "json"
4356
- ],
4357
4441
  "type": "option"
4358
4442
  },
4359
- "web": {
4360
- "char": "w",
4361
- "description": "Open in web browser",
4362
- "name": "web",
4443
+ "no-compress": {
4444
+ "description": "Skips compressing tarball entries (still generates a gzip file)",
4445
+ "name": "no-compress",
4446
+ "allowNo": false,
4447
+ "type": "boolean"
4448
+ },
4449
+ "overwrite": {
4450
+ "description": "Overwrite any file with the same name",
4451
+ "name": "overwrite",
4363
4452
  "allowNo": false,
4364
4453
  "type": "boolean"
4365
4454
  }
4366
4455
  },
4367
4456
  "hasDynamicHelp": false,
4368
4457
  "hiddenAliases": [],
4369
- "id": "openapi:get",
4458
+ "id": "media:export",
4370
4459
  "pluginAlias": "@sanity/cli",
4371
4460
  "pluginName": "@sanity/cli",
4372
4461
  "pluginType": "core",
@@ -4375,104 +4464,154 @@
4375
4464
  "relativePath": [
4376
4465
  "dist",
4377
4466
  "commands",
4378
- "openapi",
4379
- "get.js"
4467
+ "media",
4468
+ "export.js"
4380
4469
  ]
4381
4470
  },
4382
- "openapi:list": {
4471
+ "media:import": {
4383
4472
  "aliases": [],
4384
- "args": {},
4385
- "description": "List all available OpenAPI specifications",
4473
+ "args": {
4474
+ "source": {
4475
+ "description": "Directory, archive, or asset URL to import from. An https URL imports one asset that Sanity fetches itself",
4476
+ "name": "source",
4477
+ "required": true
4478
+ }
4479
+ },
4480
+ "description": "Import a set of assets to the target media library.",
4386
4481
  "examples": [
4387
4482
  {
4388
- "command": "<%= config.bin %> <%= command.id %>",
4389
- "description": "List all available OpenAPI specs"
4483
+ "command": "<%= config.bin %> <%= command.id %> products",
4484
+ "description": "Import all assets from the \"products\" directory"
4390
4485
  },
4391
4486
  {
4392
- "command": "<%= config.bin %> <%= command.id %> --json",
4393
- "description": "List with JSON output"
4487
+ "command": "<%= config.bin %> <%= command.id %> gallery.tar.gz",
4488
+ "description": "Import all assets from \"gallery\" archive"
4394
4489
  },
4395
4490
  {
4396
- "command": "<%= config.bin %> <%= command.id %> --web",
4397
- "description": "Open HTTP Reference in browser"
4491
+ "command": "<%= config.bin %> <%= command.id %> products --replace-aspects",
4492
+ "description": "Import all assets from the \"products\" directory and replace aspects"
4493
+ },
4494
+ {
4495
+ "command": "<%= config.bin %> <%= command.id %> https://example.com/hero.png",
4496
+ "description": "Have Sanity fetch a single asset from a public URL"
4497
+ },
4498
+ {
4499
+ "command": "<%= config.bin %> <%= command.id %> https://example.com/hero.png --aspect department=Brand",
4500
+ "description": "Fetch an asset from a URL and set aspect data on it"
4398
4501
  }
4399
4502
  ],
4400
4503
  "flags": {
4401
- "json": {
4402
- "description": "Format output as json.",
4403
- "helpGroup": "GLOBAL",
4404
- "name": "json",
4405
- "allowNo": false,
4406
- "type": "boolean"
4504
+ "project-id": {
4505
+ "char": "p",
4506
+ "description": "Project ID to import media to (overrides CLI configuration)",
4507
+ "helpGroup": "OVERRIDE",
4508
+ "name": "project-id",
4509
+ "hasDynamicHelp": false,
4510
+ "helpValue": "<id>",
4511
+ "multiple": false,
4512
+ "type": "option"
4407
4513
  },
4408
- "web": {
4409
- "char": "w",
4410
- "description": "Open HTTP Reference in web browser",
4411
- "name": "web",
4514
+ "aspect": {
4515
+ "description": "Aspect value to set on the imported asset, as key=value. Repeatable. Only applies when the source is a URL - directory and archive imports read aspects from their data.ndjson",
4516
+ "name": "aspect",
4517
+ "hasDynamicHelp": false,
4518
+ "helpValue": "<key=value>",
4519
+ "multiple": true,
4520
+ "type": "option"
4521
+ },
4522
+ "filename": {
4523
+ "description": "Original filename to store on the asset. Only applies when the source is a URL. Defaults to a name derived from the URL",
4524
+ "name": "filename",
4525
+ "hasDynamicHelp": false,
4526
+ "helpValue": "<filename>",
4527
+ "multiple": false,
4528
+ "type": "option"
4529
+ },
4530
+ "media-library-id": {
4531
+ "description": "The id of the target media library",
4532
+ "name": "media-library-id",
4533
+ "hasDynamicHelp": false,
4534
+ "multiple": false,
4535
+ "type": "option"
4536
+ },
4537
+ "replace-aspects": {
4538
+ "description": "Replace existing aspect data. All versions will be replaced (e.g. published and draft aspect data). Only applies to directory and archive imports",
4539
+ "name": "replace-aspects",
4412
4540
  "allowNo": false,
4413
4541
  "type": "boolean"
4414
4542
  }
4415
4543
  },
4416
4544
  "hasDynamicHelp": false,
4417
4545
  "hiddenAliases": [],
4418
- "id": "openapi:list",
4546
+ "id": "media:import",
4419
4547
  "pluginAlias": "@sanity/cli",
4420
4548
  "pluginName": "@sanity/cli",
4421
4549
  "pluginType": "core",
4422
4550
  "strict": true,
4423
- "enableJsonFlag": true,
4551
+ "telemetry": {
4552
+ "redactedFlags": [
4553
+ {
4554
+ "canonical": "--aspect",
4555
+ "flags": [
4556
+ "--aspect"
4557
+ ]
4558
+ },
4559
+ {
4560
+ "canonical": "--filename",
4561
+ "flags": [
4562
+ "--filename"
4563
+ ]
4564
+ }
4565
+ ]
4566
+ },
4424
4567
  "isESM": true,
4425
4568
  "relativePath": [
4426
4569
  "dist",
4427
4570
  "commands",
4428
- "openapi",
4429
- "list.js"
4571
+ "media",
4572
+ "import.js"
4430
4573
  ]
4431
4574
  },
4432
- "organizations:create": {
4575
+ "media:prune-aspect-data": {
4433
4576
  "aliases": [],
4434
- "args": {},
4435
- "description": "Create a new organization",
4577
+ "args": {
4578
+ "aspectName": {
4579
+ "description": "Name of the aspect whose data to remove from all assets",
4580
+ "name": "aspectName",
4581
+ "required": true
4582
+ }
4583
+ },
4584
+ "description": "Irreversibly remove an aspect's data (aspects.<name> values) from every asset of a media library",
4436
4585
  "examples": [
4437
4586
  {
4438
- "command": "<%= config.bin %> <%= command.id %>",
4439
- "description": "Interactively create an organization"
4440
- },
4441
- {
4442
- "command": "<%= config.bin %> <%= command.id %> --name \"Acme Corp\"",
4443
- "description": "Create an organization named \"Acme Corp\""
4587
+ "command": "<%= config.bin %> <%= command.id %> legacyAspect",
4588
+ "description": "Report which assets carry aspects.legacyAspect (changes nothing)"
4444
4589
  },
4445
4590
  {
4446
- "command": "<%= config.bin %> <%= command.id %> --name \"Acme Corp\" --default-role member",
4447
- "description": "Create an organization with a default member role"
4591
+ "command": "<%= config.bin %> <%= command.id %> legacyAspect --yes",
4592
+ "description": "Remove aspects.legacyAspect from every asset that carries it"
4448
4593
  }
4449
4594
  ],
4450
4595
  "flags": {
4451
- "default-role": {
4452
- "description": "Default role assigned to new members",
4453
- "name": "default-role",
4454
- "required": false,
4596
+ "media-library-id": {
4597
+ "description": "The id of the media library to prune (defaults to the single active library of the configured organization)",
4598
+ "name": "media-library-id",
4455
4599
  "hasDynamicHelp": false,
4456
4600
  "multiple": false,
4457
4601
  "type": "option"
4458
4602
  },
4459
- "name": {
4460
- "description": "Organization name",
4461
- "name": "name",
4462
- "hasDynamicHelp": false,
4463
- "multiple": false,
4464
- "type": "option"
4603
+ "yes": {
4604
+ "char": "y",
4605
+ "description": "Execute the prune. Without this flag the command only reports what would change",
4606
+ "name": "yes",
4607
+ "allowNo": false,
4608
+ "type": "boolean"
4465
4609
  }
4466
4610
  },
4467
4611
  "hasDynamicHelp": false,
4468
- "hiddenAliases": [
4469
- "organization:create",
4470
- "organisations:create",
4471
- "organisation:create",
4472
- "org:create",
4473
- "orgs:create"
4474
- ],
4475
- "id": "organizations:create",
4612
+ "hidden": true,
4613
+ "hiddenAliases": [],
4614
+ "id": "media:prune-aspect-data",
4476
4615
  "pluginAlias": "@sanity/cli",
4477
4616
  "pluginName": "@sanity/cli",
4478
4617
  "pluginType": "core",
@@ -4481,86 +4620,105 @@
4481
4620
  "relativePath": [
4482
4621
  "dist",
4483
4622
  "commands",
4484
- "organizations",
4485
- "create.js"
4623
+ "media",
4624
+ "prune-aspect-data.js"
4486
4625
  ]
4487
4626
  },
4488
- "organizations:delete": {
4627
+ "media:pull-aspects": {
4489
4628
  "aliases": [],
4490
- "args": {
4491
- "organizationId": {
4492
- "description": "Organization ID to delete",
4493
- "name": "organizationId",
4494
- "required": true
4495
- }
4496
- },
4497
- "description": "Delete an organization",
4629
+ "args": {},
4630
+ "description": "Generate field modules from a media library's stored aspect documents",
4498
4631
  "examples": [
4499
4632
  {
4500
- "command": "<%= config.bin %> <%= command.id %> org-abc123",
4501
- "description": "Delete an organization (prompts for confirmation)"
4633
+ "command": "<%= config.bin %> <%= command.id %>",
4634
+ "description": "Generate src/fields/<name>.tsx modules from the stored aspects"
4502
4635
  },
4503
4636
  {
4504
- "command": "<%= config.bin %> <%= command.id %> org-abc123 --force",
4505
- "description": "Delete an organization without confirmation"
4637
+ "command": "<%= config.bin %> <%= command.id %> --media-library-id ml123 --overwrite",
4638
+ "description": "Pull from a specific media library, overwriting existing modules"
4506
4639
  }
4507
4640
  ],
4508
4641
  "flags": {
4509
- "force": {
4510
- "description": "Do not prompt for delete confirmation - forcefully delete",
4511
- "name": "force",
4512
- "required": false,
4642
+ "media-library-id": {
4643
+ "description": "The id of the media library to pull from (defaults to the single active library of the configured organization)",
4644
+ "name": "media-library-id",
4645
+ "hasDynamicHelp": false,
4646
+ "multiple": false,
4647
+ "type": "option"
4648
+ },
4649
+ "out-dir": {
4650
+ "description": "Directory to write the generated field modules to, relative to the project root",
4651
+ "name": "out-dir",
4652
+ "default": "src/fields",
4653
+ "hasDynamicHelp": false,
4654
+ "multiple": false,
4655
+ "type": "option"
4656
+ },
4657
+ "overwrite": {
4658
+ "description": "Overwrite existing field modules and re-generate fields already declared in the config",
4659
+ "name": "overwrite",
4513
4660
  "allowNo": false,
4514
4661
  "type": "boolean"
4662
+ },
4663
+ "update-config": {
4664
+ "description": "Declare the generated fields in sanity.cli.ts (--no-update-config to skip). Prompted when omitted; unattended runs only print the entries",
4665
+ "name": "update-config",
4666
+ "allowNo": true,
4667
+ "type": "boolean"
4515
4668
  }
4516
4669
  },
4517
4670
  "hasDynamicHelp": false,
4518
- "hiddenAliases": [
4519
- "organization:delete",
4520
- "organisations:delete",
4521
- "organisation:delete",
4522
- "org:delete",
4523
- "orgs:delete"
4524
- ],
4525
- "id": "organizations:delete",
4671
+ "hidden": true,
4672
+ "hiddenAliases": [],
4673
+ "id": "media:pull-aspects",
4526
4674
  "pluginAlias": "@sanity/cli",
4527
4675
  "pluginName": "@sanity/cli",
4528
4676
  "pluginType": "core",
4529
4677
  "strict": true,
4678
+ "telemetry": {
4679
+ "redactedFlags": [
4680
+ {
4681
+ "canonical": "--out-dir",
4682
+ "flags": [
4683
+ "--out-dir"
4684
+ ]
4685
+ }
4686
+ ]
4687
+ },
4530
4688
  "isESM": true,
4531
4689
  "relativePath": [
4532
4690
  "dist",
4533
4691
  "commands",
4534
- "organizations",
4535
- "delete.js"
4692
+ "media",
4693
+ "pull-aspects.js"
4536
4694
  ]
4537
4695
  },
4538
- "organizations:get": {
4696
+ "migrations:create": {
4539
4697
  "aliases": [],
4540
4698
  "args": {
4541
- "organizationId": {
4542
- "description": "Organization ID",
4543
- "name": "organizationId",
4544
- "required": true
4699
+ "title": {
4700
+ "description": "Title of migration",
4701
+ "name": "title",
4702
+ "required": false
4545
4703
  }
4546
4704
  },
4547
- "description": "Get details of an organization",
4705
+ "description": "Create a new migration within your project",
4548
4706
  "examples": [
4549
4707
  {
4550
- "command": "<%= config.bin %> <%= command.id %> org-abc123",
4551
- "description": "Get details of a specific organization"
4708
+ "command": "<%= config.bin %> <%= command.id %>",
4709
+ "description": "Create a new migration, prompting for title and options"
4710
+ },
4711
+ {
4712
+ "command": "<%= config.bin %> <%= command.id %> \"Rename field from location to address\"",
4713
+ "description": "Create a new migration with the provided title, prompting for options"
4552
4714
  }
4553
4715
  ],
4554
4716
  "flags": {},
4555
4717
  "hasDynamicHelp": false,
4556
4718
  "hiddenAliases": [
4557
- "organization:get",
4558
- "organisations:get",
4559
- "organisation:get",
4560
- "org:get",
4561
- "orgs:get"
4719
+ "migration:create"
4562
4720
  ],
4563
- "id": "organizations:get",
4721
+ "id": "migrations:create",
4564
4722
  "pluginAlias": "@sanity/cli",
4565
4723
  "pluginName": "@sanity/cli",
4566
4724
  "pluginType": "core",
@@ -4568,31 +4726,27 @@
4568
4726
  "isESM": true,
4569
4727
  "relativePath": [
4570
4728
  "dist",
4571
- "commands",
4572
- "organizations",
4573
- "get.js"
4729
+ "commands",
4730
+ "migrations",
4731
+ "create.js"
4574
4732
  ]
4575
4733
  },
4576
- "organizations:list": {
4734
+ "migrations:list": {
4577
4735
  "aliases": [],
4578
4736
  "args": {},
4579
- "description": "List organizations you are a member of",
4737
+ "description": "List available migrations",
4580
4738
  "examples": [
4581
4739
  {
4582
4740
  "command": "<%= config.bin %> <%= command.id %>",
4583
- "description": "List all your organizations"
4741
+ "description": "List all available migrations in the project"
4584
4742
  }
4585
4743
  ],
4586
4744
  "flags": {},
4587
4745
  "hasDynamicHelp": false,
4588
4746
  "hiddenAliases": [
4589
- "organization:list",
4590
- "organisations:list",
4591
- "organisation:list",
4592
- "org:list",
4593
- "orgs:list"
4747
+ "migration:list"
4594
4748
  ],
4595
- "id": "organizations:list",
4749
+ "id": "migrations:list",
4596
4750
  "pluginAlias": "@sanity/cli",
4597
4751
  "pluginName": "@sanity/cli",
4598
4752
  "pluginType": "core",
@@ -4601,55 +4755,85 @@
4601
4755
  "relativePath": [
4602
4756
  "dist",
4603
4757
  "commands",
4604
- "organizations",
4758
+ "migrations",
4605
4759
  "list.js"
4606
4760
  ]
4607
4761
  },
4608
- "organizations:update": {
4762
+ "migrations:run": {
4609
4763
  "aliases": [],
4610
4764
  "args": {
4611
- "organizationId": {
4612
- "description": "Organization ID",
4613
- "name": "organizationId",
4614
- "required": true
4765
+ "id": {
4766
+ "description": "ID",
4767
+ "name": "id",
4768
+ "required": false
4615
4769
  }
4616
4770
  },
4617
- "description": "Update an organization",
4771
+ "description": "Run a migration against a dataset",
4618
4772
  "examples": [
4619
4773
  {
4620
- "command": "<%= config.bin %> <%= command.id %> org-abc123 --name \"New Name\"",
4621
- "description": "Rename an organization"
4774
+ "command": "<%= config.bin %> <%= command.id %> <id>",
4775
+ "description": "dry run the migration"
4622
4776
  },
4623
4777
  {
4624
- "command": "<%= config.bin %> <%= command.id %> org-abc123 --slug new-slug",
4625
- "description": "Set the organization slug (requires authSAML feature)"
4778
+ "command": "<%= config.bin %> <%= command.id %> <id> --no-dry-run --project xyz --dataset staging",
4779
+ "description": "execute the migration against a dataset"
4626
4780
  },
4627
4781
  {
4628
- "command": "<%= config.bin %> <%= command.id %> org-abc123 --default-role viewer",
4629
- "description": "Change the default member role"
4782
+ "command": "<%= config.bin %> <%= command.id %> <id> --from-export=production.tar.gz --no-dry-run --project xyz --dataset staging",
4783
+ "description": "execute the migration using a dataset export as the source"
4630
4784
  }
4631
4785
  ],
4632
4786
  "flags": {
4633
- "default-role": {
4634
- "description": "New default role for new members",
4635
- "name": "default-role",
4636
- "required": false,
4787
+ "api-version": {
4788
+ "description": "API version to use when migrating. Defaults to v2024-01-29.",
4789
+ "name": "api-version",
4637
4790
  "hasDynamicHelp": false,
4638
4791
  "multiple": false,
4639
4792
  "type": "option"
4640
4793
  },
4641
- "name": {
4642
- "description": "New organization name",
4643
- "name": "name",
4644
- "required": false,
4794
+ "concurrency": {
4795
+ "description": "How many mutation requests to run in parallel. Must be between 1 and 10. Default: 6.",
4796
+ "name": "concurrency",
4797
+ "default": 6,
4645
4798
  "hasDynamicHelp": false,
4646
4799
  "multiple": false,
4647
4800
  "type": "option"
4648
4801
  },
4649
- "slug": {
4650
- "description": "New URL slug (requires authSAML feature on the organization)",
4651
- "name": "slug",
4652
- "required": false,
4802
+ "confirm": {
4803
+ "description": "Prompt for confirmation before running the migration (default: true). Use --no-confirm to skip.",
4804
+ "name": "confirm",
4805
+ "allowNo": true,
4806
+ "type": "boolean"
4807
+ },
4808
+ "dataset": {
4809
+ "description": "Dataset to migrate. Defaults to the dataset configured in your Sanity CLI config.",
4810
+ "name": "dataset",
4811
+ "hasDynamicHelp": false,
4812
+ "multiple": false,
4813
+ "type": "option"
4814
+ },
4815
+ "dry-run": {
4816
+ "description": "By default the migration runs in dry mode. Use --no-dry-run to migrate dataset.",
4817
+ "name": "dry-run",
4818
+ "allowNo": true,
4819
+ "type": "boolean"
4820
+ },
4821
+ "from-export": {
4822
+ "description": "Use a local dataset export as source for migration instead of calling the Sanity API. Note: this is only supported for dry runs.",
4823
+ "name": "from-export",
4824
+ "hasDynamicHelp": false,
4825
+ "multiple": false,
4826
+ "type": "option"
4827
+ },
4828
+ "progress": {
4829
+ "description": "Display progress during migration (default: true). Use --no-progress to hide output.",
4830
+ "name": "progress",
4831
+ "allowNo": true,
4832
+ "type": "boolean"
4833
+ },
4834
+ "project": {
4835
+ "description": "Project ID of the dataset to migrate. Defaults to the projectId configured in your Sanity CLI config.",
4836
+ "name": "project",
4653
4837
  "hasDynamicHelp": false,
4654
4838
  "multiple": false,
4655
4839
  "type": "option"
@@ -4657,13 +4841,9 @@
4657
4841
  },
4658
4842
  "hasDynamicHelp": false,
4659
4843
  "hiddenAliases": [
4660
- "organization:update",
4661
- "organisations:update",
4662
- "organisation:update",
4663
- "org:update",
4664
- "orgs:update"
4844
+ "migration:run"
4665
4845
  ],
4666
- "id": "organizations:update",
4846
+ "id": "migrations:run",
4667
4847
  "pluginAlias": "@sanity/cli",
4668
4848
  "pluginName": "@sanity/cli",
4669
4849
  "pluginType": "core",
@@ -4672,40 +4852,90 @@
4672
4852
  "relativePath": [
4673
4853
  "dist",
4674
4854
  "commands",
4675
- "organizations",
4676
- "update.js"
4855
+ "migrations",
4856
+ "run.js"
4677
4857
  ]
4678
4858
  },
4679
- "projects:create": {
4859
+ "openapi:get": {
4680
4860
  "aliases": [],
4681
4861
  "args": {
4682
- "projectName": {
4683
- "description": "Name of the project to create",
4684
- "name": "projectName",
4685
- "required": false
4862
+ "slug": {
4863
+ "description": "Slug of the OpenAPI specification to retrieve",
4864
+ "name": "slug",
4865
+ "required": true
4686
4866
  }
4687
4867
  },
4688
- "description": "Create a new Sanity project",
4868
+ "description": "Get an OpenAPI specification by slug",
4689
4869
  "examples": [
4690
4870
  {
4691
- "command": "<%= config.bin %> <%= command.id %>",
4692
- "description": "Interactively create a project"
4871
+ "command": "<%= config.bin %> <%= command.id %> query",
4872
+ "description": "Get a specification (YAML format, default)"
4693
4873
  },
4694
4874
  {
4695
- "command": "<%= config.bin %> <%= command.id %> \"My New Project\"",
4696
- "description": "Create a project named \"My New Project\""
4875
+ "command": "<%= config.bin %> <%= command.id %> query --format=json",
4876
+ "description": "Get specification in JSON format"
4697
4877
  },
4698
4878
  {
4699
- "command": "<%= config.bin %> <%= command.id %> \"My Project\" --organization=my-org",
4700
- "description": "Create a project in a specific organization"
4879
+ "command": "<%= config.bin %> <%= command.id %> query --web",
4880
+ "description": "Open specification in browser"
4701
4881
  },
4702
4882
  {
4703
- "command": "<%= config.bin %> <%= command.id %> \"My Project\" --dataset=staging --dataset-visibility=private",
4704
- "description": "Create a project with a private dataset named \"staging\""
4883
+ "command": "<%= config.bin %> <%= command.id %> query > query-api.yaml",
4884
+ "description": "Pipe to file"
4885
+ }
4886
+ ],
4887
+ "flags": {
4888
+ "format": {
4889
+ "description": "Output format: yaml (default), json",
4890
+ "name": "format",
4891
+ "default": "yaml",
4892
+ "hasDynamicHelp": false,
4893
+ "multiple": false,
4894
+ "options": [
4895
+ "yaml",
4896
+ "json"
4897
+ ],
4898
+ "type": "option"
4899
+ },
4900
+ "web": {
4901
+ "char": "w",
4902
+ "description": "Open in web browser",
4903
+ "name": "web",
4904
+ "allowNo": false,
4905
+ "type": "boolean"
4906
+ }
4907
+ },
4908
+ "hasDynamicHelp": false,
4909
+ "hiddenAliases": [],
4910
+ "id": "openapi:get",
4911
+ "pluginAlias": "@sanity/cli",
4912
+ "pluginName": "@sanity/cli",
4913
+ "pluginType": "core",
4914
+ "strict": true,
4915
+ "isESM": true,
4916
+ "relativePath": [
4917
+ "dist",
4918
+ "commands",
4919
+ "openapi",
4920
+ "get.js"
4921
+ ]
4922
+ },
4923
+ "openapi:list": {
4924
+ "aliases": [],
4925
+ "args": {},
4926
+ "description": "List all available OpenAPI specifications",
4927
+ "examples": [
4928
+ {
4929
+ "command": "<%= config.bin %> <%= command.id %>",
4930
+ "description": "List all available OpenAPI specs"
4705
4931
  },
4706
4932
  {
4707
- "command": "<%= config.bin %> <%= command.id %> \"CI Project\" --yes --json",
4708
- "description": "Create a project non-interactively with JSON output"
4933
+ "command": "<%= config.bin %> <%= command.id %> --json",
4934
+ "description": "List with JSON output"
4935
+ },
4936
+ {
4937
+ "command": "<%= config.bin %> <%= command.id %> --web",
4938
+ "description": "Open HTTP Reference in browser"
4709
4939
  }
4710
4940
  ],
4711
4941
  "flags": {
@@ -4716,106 +4946,124 @@
4716
4946
  "allowNo": false,
4717
4947
  "type": "boolean"
4718
4948
  },
4719
- "dataset": {
4720
- "description": "Create a dataset. Prompts for visibility unless specified or --yes used",
4721
- "name": "dataset",
4722
- "hasDynamicHelp": false,
4723
- "multiple": false,
4724
- "type": "option"
4949
+ "web": {
4950
+ "char": "w",
4951
+ "description": "Open HTTP Reference in web browser",
4952
+ "name": "web",
4953
+ "allowNo": false,
4954
+ "type": "boolean"
4955
+ }
4956
+ },
4957
+ "hasDynamicHelp": false,
4958
+ "hiddenAliases": [],
4959
+ "id": "openapi:list",
4960
+ "pluginAlias": "@sanity/cli",
4961
+ "pluginName": "@sanity/cli",
4962
+ "pluginType": "core",
4963
+ "strict": true,
4964
+ "enableJsonFlag": true,
4965
+ "isESM": true,
4966
+ "relativePath": [
4967
+ "dist",
4968
+ "commands",
4969
+ "openapi",
4970
+ "list.js"
4971
+ ]
4972
+ },
4973
+ "organizations:create": {
4974
+ "aliases": [],
4975
+ "args": {},
4976
+ "description": "Create a new organization",
4977
+ "examples": [
4978
+ {
4979
+ "command": "<%= config.bin %> <%= command.id %>",
4980
+ "description": "Interactively create an organization"
4725
4981
  },
4726
- "dataset-visibility": {
4727
- "description": "Dataset visibility: public or private",
4728
- "name": "dataset-visibility",
4729
- "hasDynamicHelp": false,
4730
- "multiple": false,
4731
- "options": [
4732
- "private",
4733
- "public"
4734
- ],
4735
- "type": "option"
4982
+ {
4983
+ "command": "<%= config.bin %> <%= command.id %> --name \"Acme Corp\"",
4984
+ "description": "Create an organization named \"Acme Corp\""
4736
4985
  },
4737
- "organization": {
4738
- "description": "Organization to create the project in",
4739
- "name": "organization",
4986
+ {
4987
+ "command": "<%= config.bin %> <%= command.id %> --name \"Acme Corp\" --default-role member",
4988
+ "description": "Create an organization with a default member role"
4989
+ }
4990
+ ],
4991
+ "flags": {
4992
+ "default-role": {
4993
+ "description": "Default role assigned to new members",
4994
+ "name": "default-role",
4995
+ "required": false,
4740
4996
  "hasDynamicHelp": false,
4741
- "helpValue": "<slug|id>",
4742
4997
  "multiple": false,
4743
4998
  "type": "option"
4744
4999
  },
4745
- "yes": {
4746
- "char": "y",
4747
- "description": "Skip prompts and use defaults (project: \"My Sanity Project\", dataset: production, visibility: public)",
4748
- "name": "yes",
4749
- "allowNo": false,
4750
- "type": "boolean"
5000
+ "name": {
5001
+ "description": "Organization name",
5002
+ "name": "name",
5003
+ "hasDynamicHelp": false,
5004
+ "multiple": false,
5005
+ "type": "option"
4751
5006
  }
4752
5007
  },
4753
5008
  "hasDynamicHelp": false,
4754
5009
  "hiddenAliases": [
4755
- "project:create"
5010
+ "organization:create",
5011
+ "organisations:create",
5012
+ "organisation:create",
5013
+ "org:create",
5014
+ "orgs:create"
4756
5015
  ],
4757
- "id": "projects:create",
5016
+ "id": "organizations:create",
4758
5017
  "pluginAlias": "@sanity/cli",
4759
5018
  "pluginName": "@sanity/cli",
4760
5019
  "pluginType": "core",
4761
5020
  "strict": true,
4762
- "enableJsonFlag": true,
4763
5021
  "isESM": true,
4764
5022
  "relativePath": [
4765
5023
  "dist",
4766
5024
  "commands",
4767
- "projects",
5025
+ "organizations",
4768
5026
  "create.js"
4769
5027
  ]
4770
5028
  },
4771
- "projects:list": {
5029
+ "organizations:delete": {
4772
5030
  "aliases": [],
4773
- "args": {},
4774
- "description": "List your projects",
5031
+ "args": {
5032
+ "organizationId": {
5033
+ "description": "Organization ID to delete",
5034
+ "name": "organizationId",
5035
+ "required": true
5036
+ }
5037
+ },
5038
+ "description": "Delete an organization",
4775
5039
  "examples": [
4776
5040
  {
4777
- "command": "<%= config.bin %> <%= command.id %>",
4778
- "description": "List projects"
5041
+ "command": "<%= config.bin %> <%= command.id %> org-abc123",
5042
+ "description": "Delete an organization (prompts for confirmation)"
4779
5043
  },
4780
5044
  {
4781
- "command": "<%= config.bin %> <%= command.id %> --sort=members --order=asc",
4782
- "description": "List projects sorted by member count, ascending"
5045
+ "command": "<%= config.bin %> <%= command.id %> org-abc123 --force",
5046
+ "description": "Delete an organization without confirmation"
4783
5047
  }
4784
5048
  ],
4785
5049
  "flags": {
4786
- "order": {
4787
- "description": "Sort direction",
4788
- "name": "order",
4789
- "default": "desc",
4790
- "hasDynamicHelp": false,
4791
- "multiple": false,
4792
- "options": [
4793
- "asc",
4794
- "desc"
4795
- ],
4796
- "type": "option"
4797
- },
4798
- "sort": {
4799
- "description": "Sort field",
4800
- "name": "sort",
4801
- "default": "created",
4802
- "hasDynamicHelp": false,
4803
- "multiple": false,
4804
- "options": [
4805
- "id",
4806
- "members",
4807
- "name",
4808
- "url",
4809
- "created"
4810
- ],
4811
- "type": "option"
5050
+ "force": {
5051
+ "description": "Do not prompt for delete confirmation - forcefully delete",
5052
+ "name": "force",
5053
+ "required": false,
5054
+ "allowNo": false,
5055
+ "type": "boolean"
4812
5056
  }
4813
5057
  },
4814
5058
  "hasDynamicHelp": false,
4815
5059
  "hiddenAliases": [
4816
- "project:list"
5060
+ "organization:delete",
5061
+ "organisations:delete",
5062
+ "organisation:delete",
5063
+ "org:delete",
5064
+ "orgs:delete"
4817
5065
  ],
4818
- "id": "projects:list",
5066
+ "id": "organizations:delete",
4819
5067
  "pluginAlias": "@sanity/cli",
4820
5068
  "pluginName": "@sanity/cli",
4821
5069
  "pluginType": "core",
@@ -4824,38 +5072,36 @@
4824
5072
  "relativePath": [
4825
5073
  "dist",
4826
5074
  "commands",
4827
- "projects",
4828
- "list.js"
5075
+ "organizations",
5076
+ "delete.js"
4829
5077
  ]
4830
5078
  },
4831
- "projects:unclaimed": {
5079
+ "organizations:get": {
4832
5080
  "aliases": [],
4833
- "args": {},
4834
- "description": "Recover details for unclaimed projects created on this machine",
5081
+ "args": {
5082
+ "organizationId": {
5083
+ "description": "Organization ID",
5084
+ "name": "organizationId",
5085
+ "required": true
5086
+ }
5087
+ },
5088
+ "description": "Get details of an organization",
4835
5089
  "examples": [
4836
5090
  {
4837
- "command": "<%= config.bin %> <%= command.id %>",
4838
- "description": "List locally recorded unclaimed projects"
4839
- },
4840
- {
4841
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
4842
- "description": "Show recovery details for one project"
5091
+ "command": "<%= config.bin %> <%= command.id %> org-abc123",
5092
+ "description": "Get details of a specific organization"
4843
5093
  }
4844
5094
  ],
4845
- "flags": {
4846
- "project-id": {
4847
- "description": "Project ID to recover",
4848
- "name": "project-id",
4849
- "hasDynamicHelp": false,
4850
- "multiple": false,
4851
- "type": "option"
4852
- }
4853
- },
5095
+ "flags": {},
4854
5096
  "hasDynamicHelp": false,
4855
5097
  "hiddenAliases": [
4856
- "project:unclaimed"
5098
+ "organization:get",
5099
+ "organisations:get",
5100
+ "organisation:get",
5101
+ "org:get",
5102
+ "orgs:get"
4857
5103
  ],
4858
- "id": "projects:unclaimed",
5104
+ "id": "organizations:get",
4859
5105
  "pluginAlias": "@sanity/cli",
4860
5106
  "pluginName": "@sanity/cli",
4861
5107
  "pluginType": "core",
@@ -4864,87 +5110,30 @@
4864
5110
  "relativePath": [
4865
5111
  "dist",
4866
5112
  "commands",
4867
- "projects",
4868
- "unclaimed.js"
5113
+ "organizations",
5114
+ "get.js"
4869
5115
  ]
4870
5116
  },
4871
- "schemas:delete": {
5117
+ "organizations:list": {
4872
5118
  "aliases": [],
4873
5119
  "args": {},
4874
- "description": "Delete schema documents by id",
5120
+ "description": "List organizations you are a member of",
4875
5121
  "examples": [
4876
5122
  {
4877
- "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName",
4878
- "description": "Delete a single schema"
4879
- },
4880
- {
4881
- "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName,prefix.sanity.workspace.schema.otherWorkspace",
4882
- "description": "Delete multiple schemas"
5123
+ "command": "<%= config.bin %> <%= command.id %>",
5124
+ "description": "List all your organizations"
4883
5125
  }
4884
5126
  ],
4885
- "flags": {
4886
- "project-id": {
4887
- "char": "p",
4888
- "description": "Project ID to delete schema from (overrides CLI configuration)",
4889
- "helpGroup": "OVERRIDE",
4890
- "name": "project-id",
4891
- "hasDynamicHelp": false,
4892
- "helpValue": "<id>",
4893
- "multiple": false,
4894
- "type": "option"
4895
- },
4896
- "dataset": {
4897
- "char": "d",
4898
- "description": "Delete schemas from a specific dataset",
4899
- "name": "dataset",
4900
- "hasDynamicHelp": false,
4901
- "helpValue": "<name>",
4902
- "multiple": false,
4903
- "type": "option"
4904
- },
4905
- "extract-manifest": {
4906
- "description": "Generate manifest file (disable with --no-extract-manifest)",
4907
- "hidden": true,
4908
- "name": "extract-manifest",
4909
- "allowNo": true,
4910
- "type": "boolean"
4911
- },
4912
- "ids": {
4913
- "description": "Comma-separated list of schema ids to delete",
4914
- "name": "ids",
4915
- "required": true,
4916
- "hasDynamicHelp": false,
4917
- "multiple": false,
4918
- "type": "option"
4919
- },
4920
- "manifest-dir": {
4921
- "description": "Directory containing manifest file",
4922
- "hidden": true,
4923
- "name": "manifest-dir",
4924
- "default": "./dist/static",
4925
- "hasDynamicHelp": false,
4926
- "multiple": false,
4927
- "type": "option"
4928
- },
4929
- "verbose": {
4930
- "description": "Enable verbose logging",
4931
- "name": "verbose",
4932
- "allowNo": false,
4933
- "type": "boolean"
4934
- },
4935
- "yes": {
4936
- "char": "y",
4937
- "description": "Delete schemas without prompting for confirmation",
4938
- "name": "yes",
4939
- "allowNo": false,
4940
- "type": "boolean"
4941
- }
4942
- },
5127
+ "flags": {},
4943
5128
  "hasDynamicHelp": false,
4944
5129
  "hiddenAliases": [
4945
- "schema:delete"
5130
+ "organization:list",
5131
+ "organisations:list",
5132
+ "organisation:list",
5133
+ "org:list",
5134
+ "orgs:list"
4946
5135
  ],
4947
- "id": "schemas:delete",
5136
+ "id": "organizations:list",
4948
5137
  "pluginAlias": "@sanity/cli",
4949
5138
  "pluginName": "@sanity/cli",
4950
5139
  "pluginType": "core",
@@ -4953,68 +5142,69 @@
4953
5142
  "relativePath": [
4954
5143
  "dist",
4955
5144
  "commands",
4956
- "schemas",
4957
- "delete.js"
5145
+ "organizations",
5146
+ "list.js"
4958
5147
  ]
4959
5148
  },
4960
- "schemas:deploy": {
5149
+ "organizations:update": {
4961
5150
  "aliases": [],
4962
- "args": {},
4963
- "description": "Deploy schema documents into workspace datasets.\n\nNote: This command is experimental and subject to change.\n\nRegenerates a manifest file by default. To re-use an existing manifest, use --no-extract-manifest.",
5151
+ "args": {
5152
+ "organizationId": {
5153
+ "description": "Organization ID",
5154
+ "name": "organizationId",
5155
+ "required": true
5156
+ }
5157
+ },
5158
+ "description": "Update an organization",
4964
5159
  "examples": [
4965
5160
  {
4966
- "command": "<%= config.bin %> <%= command.id %>",
4967
- "description": "Deploy all workspace schemas"
5161
+ "command": "<%= config.bin %> <%= command.id %> org-abc123 --name \"New Name\"",
5162
+ "description": "Rename an organization"
4968
5163
  },
4969
5164
  {
4970
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
4971
- "description": "Deploy the schema for only the workspace \"default\""
5165
+ "command": "<%= config.bin %> <%= command.id %> org-abc123 --slug new-slug",
5166
+ "description": "Set the organization slug (requires authSAML feature)"
5167
+ },
5168
+ {
5169
+ "command": "<%= config.bin %> <%= command.id %> org-abc123 --default-role viewer",
5170
+ "description": "Change the default member role"
4972
5171
  }
4973
5172
  ],
4974
5173
  "flags": {
4975
- "extract-manifest": {
4976
- "description": "Regenerate manifest before deploying (use --no-extract-manifest to skip)",
4977
- "name": "extract-manifest",
4978
- "allowNo": true,
4979
- "type": "boolean"
4980
- },
4981
- "manifest-dir": {
4982
- "description": "Directory containing manifest file",
4983
- "name": "manifest-dir",
4984
- "default": "./dist/static",
5174
+ "default-role": {
5175
+ "description": "New default role for new members",
5176
+ "name": "default-role",
5177
+ "required": false,
4985
5178
  "hasDynamicHelp": false,
4986
- "helpValue": "<directory>",
4987
5179
  "multiple": false,
4988
5180
  "type": "option"
4989
5181
  },
4990
- "tag": {
4991
- "description": "Add a tag suffix to the schema id",
4992
- "name": "tag",
5182
+ "name": {
5183
+ "description": "New organization name",
5184
+ "name": "name",
5185
+ "required": false,
4993
5186
  "hasDynamicHelp": false,
4994
- "helpValue": "<tag>",
4995
5187
  "multiple": false,
4996
5188
  "type": "option"
4997
5189
  },
4998
- "verbose": {
4999
- "description": "Print detailed information during deployment",
5000
- "name": "verbose",
5001
- "allowNo": false,
5002
- "type": "boolean"
5003
- },
5004
- "workspace": {
5005
- "description": "The name of the workspace to deploy a schema for",
5006
- "name": "workspace",
5190
+ "slug": {
5191
+ "description": "New URL slug (requires authSAML feature on the organization)",
5192
+ "name": "slug",
5193
+ "required": false,
5007
5194
  "hasDynamicHelp": false,
5008
- "helpValue": "<name>",
5009
5195
  "multiple": false,
5010
5196
  "type": "option"
5011
5197
  }
5012
5198
  },
5013
5199
  "hasDynamicHelp": false,
5014
5200
  "hiddenAliases": [
5015
- "schema:deploy"
5201
+ "organization:update",
5202
+ "organisations:update",
5203
+ "organisation:update",
5204
+ "org:update",
5205
+ "orgs:update"
5016
5206
  ],
5017
- "id": "schemas:deploy",
5207
+ "id": "organizations:update",
5018
5208
  "pluginAlias": "@sanity/cli",
5019
5209
  "pluginName": "@sanity/cli",
5020
5210
  "pluginType": "core",
@@ -5023,230 +5213,180 @@
5023
5213
  "relativePath": [
5024
5214
  "dist",
5025
5215
  "commands",
5026
- "schemas",
5027
- "deploy.js"
5216
+ "organizations",
5217
+ "update.js"
5028
5218
  ]
5029
5219
  },
5030
- "schemas:extract": {
5220
+ "projects:create": {
5031
5221
  "aliases": [],
5032
- "args": {},
5033
- "description": "Extract a JSON representation of a Sanity schema within a Studio context.\n\nNote: This command is experimental and subject to change.",
5222
+ "args": {
5223
+ "projectName": {
5224
+ "description": "Name of the project to create",
5225
+ "name": "projectName",
5226
+ "required": false
5227
+ }
5228
+ },
5229
+ "description": "Create a new Sanity project",
5034
5230
  "examples": [
5035
5231
  {
5036
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
5037
- "description": "Extracts schema types in a Sanity project with more than one workspace"
5232
+ "command": "<%= config.bin %> <%= command.id %>",
5233
+ "description": "Interactively create a project"
5038
5234
  },
5039
5235
  {
5040
- "command": "<%= config.bin %> <%= command.id %> --watch",
5041
- "description": "Watch mode - re-extract on changes"
5236
+ "command": "<%= config.bin %> <%= command.id %> \"My New Project\"",
5237
+ "description": "Create a project named \"My New Project\""
5042
5238
  },
5043
5239
  {
5044
- "command": "<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"",
5045
- "description": "Watch with custom glob patterns"
5240
+ "command": "<%= config.bin %> <%= command.id %> \"My Project\" --organization=my-org",
5241
+ "description": "Create a project in a specific organization"
5242
+ },
5243
+ {
5244
+ "command": "<%= config.bin %> <%= command.id %> \"My Project\" --dataset=staging --dataset-visibility=private",
5245
+ "description": "Create a project with a private dataset named \"staging\""
5246
+ },
5247
+ {
5248
+ "command": "<%= config.bin %> <%= command.id %> \"CI Project\" --yes --json",
5249
+ "description": "Create a project non-interactively with JSON output"
5046
5250
  }
5047
5251
  ],
5048
5252
  "flags": {
5049
- "enforce-required-fields": {
5050
- "description": "Makes the schema generated treat fields marked as required as non-optional",
5051
- "name": "enforce-required-fields",
5052
- "allowNo": false,
5053
- "type": "boolean"
5054
- },
5055
- "force": {
5056
- "description": "Overwrite an existing schema file",
5057
- "name": "force",
5253
+ "json": {
5254
+ "description": "Format output as json.",
5255
+ "helpGroup": "GLOBAL",
5256
+ "name": "json",
5058
5257
  "allowNo": false,
5059
5258
  "type": "boolean"
5060
5259
  },
5061
- "format": {
5062
- "description": "Output format (currently only groq-type-nodes)",
5063
- "name": "format",
5064
- "default": "groq-type-nodes",
5260
+ "dataset": {
5261
+ "description": "Create a dataset. Prompts for visibility unless specified or --yes used",
5262
+ "name": "dataset",
5065
5263
  "hasDynamicHelp": false,
5066
- "helpValue": "<format>",
5067
5264
  "multiple": false,
5068
5265
  "type": "option"
5069
5266
  },
5070
- "path": {
5071
- "description": "Optional path to specify destination of the schema file",
5072
- "name": "path",
5267
+ "dataset-visibility": {
5268
+ "description": "Dataset visibility: public or private",
5269
+ "name": "dataset-visibility",
5073
5270
  "hasDynamicHelp": false,
5074
5271
  "multiple": false,
5272
+ "options": [
5273
+ "private",
5274
+ "public"
5275
+ ],
5075
5276
  "type": "option"
5076
5277
  },
5077
- "watch": {
5078
- "description": "Enable watch mode to re-extract schema on file changes",
5079
- "name": "watch",
5080
- "allowNo": false,
5081
- "type": "boolean"
5082
- },
5083
- "watch-patterns": {
5084
- "description": "Additional glob pattern(s) to watch (can be specified multiple times)",
5085
- "name": "watch-patterns",
5086
- "hasDynamicHelp": false,
5087
- "helpValue": "<glob>",
5088
- "multiple": true,
5089
- "type": "option"
5090
- },
5091
- "workspace": {
5092
- "description": "The name of the workspace to generate a schema for",
5093
- "name": "workspace",
5278
+ "organization": {
5279
+ "description": "Organization to create the project in",
5280
+ "name": "organization",
5094
5281
  "hasDynamicHelp": false,
5095
- "helpValue": "<name>",
5282
+ "helpValue": "<slug|id>",
5096
5283
  "multiple": false,
5097
5284
  "type": "option"
5285
+ },
5286
+ "yes": {
5287
+ "char": "y",
5288
+ "description": "Skip prompts and use defaults (project: \"My Sanity Project\", dataset: production, visibility: public)",
5289
+ "name": "yes",
5290
+ "allowNo": false,
5291
+ "type": "boolean"
5098
5292
  }
5099
5293
  },
5100
5294
  "hasDynamicHelp": false,
5101
5295
  "hiddenAliases": [
5102
- "schema:extract"
5296
+ "project:create"
5103
5297
  ],
5104
- "id": "schemas:extract",
5298
+ "id": "projects:create",
5105
5299
  "pluginAlias": "@sanity/cli",
5106
5300
  "pluginName": "@sanity/cli",
5107
5301
  "pluginType": "core",
5108
5302
  "strict": true,
5303
+ "enableJsonFlag": true,
5109
5304
  "isESM": true,
5110
5305
  "relativePath": [
5111
5306
  "dist",
5112
5307
  "commands",
5113
- "schemas",
5114
- "extract.js"
5308
+ "projects",
5309
+ "create.js"
5115
5310
  ]
5116
5311
  },
5117
- "schemas:list": {
5312
+ "projects:list": {
5118
5313
  "aliases": [],
5119
5314
  "args": {},
5120
- "description": "List all schemas in the current dataset.\n\nNote: This command is experimental and subject to change.\n\nRegenerates a manifest file by default. To reuse an existing manifest, use --no-extract-manifest.",
5315
+ "description": "List your projects",
5121
5316
  "examples": [
5122
5317
  {
5123
5318
  "command": "<%= config.bin %> <%= command.id %>",
5124
- "description": "List all schemas found in any workspace dataset in a table"
5125
- },
5126
- {
5127
- "command": "<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName",
5128
- "description": "Get a schema for a given id"
5129
- },
5130
- {
5131
- "command": "<%= config.bin %> <%= command.id %> --json",
5132
- "description": "Get stored schemas as pretty-printed json-array"
5319
+ "description": "List projects"
5133
5320
  },
5134
5321
  {
5135
- "command": "<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName",
5136
- "description": "Get singular stored schema as pretty-printed json-object"
5322
+ "command": "<%= config.bin %> <%= command.id %> --sort=members --order=asc",
5323
+ "description": "List projects sorted by member count, ascending"
5137
5324
  }
5138
5325
  ],
5139
5326
  "flags": {
5140
- "json": {
5141
- "description": "Format output as json.",
5142
- "helpGroup": "GLOBAL",
5143
- "name": "json",
5144
- "allowNo": false,
5145
- "type": "boolean"
5146
- },
5147
- "extract-manifest": {
5148
- "description": "Regenerate manifest before listing (use --no-extract-manifest to skip)",
5149
- "hidden": true,
5150
- "name": "extract-manifest",
5151
- "allowNo": true,
5152
- "type": "boolean"
5153
- },
5154
- "id": {
5155
- "description": "Fetch a single schema by id",
5156
- "name": "id",
5327
+ "order": {
5328
+ "description": "Sort direction",
5329
+ "name": "order",
5330
+ "default": "desc",
5157
5331
  "hasDynamicHelp": false,
5158
- "helpValue": "<schema_id>",
5159
5332
  "multiple": false,
5333
+ "options": [
5334
+ "asc",
5335
+ "desc"
5336
+ ],
5160
5337
  "type": "option"
5161
5338
  },
5162
- "manifest-dir": {
5163
- "description": "Directory containing manifest file",
5164
- "hidden": true,
5165
- "name": "manifest-dir",
5166
- "default": "./dist/static",
5339
+ "sort": {
5340
+ "description": "Sort field",
5341
+ "name": "sort",
5342
+ "default": "created",
5167
5343
  "hasDynamicHelp": false,
5168
- "helpValue": "<directory>",
5169
5344
  "multiple": false,
5345
+ "options": [
5346
+ "id",
5347
+ "members",
5348
+ "name",
5349
+ "url",
5350
+ "created"
5351
+ ],
5170
5352
  "type": "option"
5171
5353
  }
5172
5354
  },
5173
5355
  "hasDynamicHelp": false,
5174
5356
  "hiddenAliases": [
5175
- "schema:list"
5357
+ "project:list"
5176
5358
  ],
5177
- "id": "schemas:list",
5359
+ "id": "projects:list",
5178
5360
  "pluginAlias": "@sanity/cli",
5179
5361
  "pluginName": "@sanity/cli",
5180
5362
  "pluginType": "core",
5181
5363
  "strict": true,
5182
- "enableJsonFlag": true,
5183
5364
  "isESM": true,
5184
5365
  "relativePath": [
5185
5366
  "dist",
5186
5367
  "commands",
5187
- "schemas",
5368
+ "projects",
5188
5369
  "list.js"
5189
5370
  ]
5190
5371
  },
5191
- "schemas:validate": {
5372
+ "projects:unclaimed": {
5192
5373
  "aliases": [],
5193
5374
  "args": {},
5194
- "description": "Validates all schema types specified in a workspace",
5375
+ "description": "Recover details for unclaimed projects created on this machine",
5195
5376
  "examples": [
5196
5377
  {
5197
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
5198
- "description": "Validates all schema types in a Sanity project with more than one workspace"
5199
- },
5200
- {
5201
- "command": "<%= config.bin %> <%= command.id %> > report.txt",
5202
- "description": "Save the results of the report into a file"
5203
- },
5204
- {
5205
- "command": "<%= config.bin %> <%= command.id %> --level error",
5206
- "description": "Report out only errors"
5378
+ "command": "<%= config.bin %> <%= command.id %>",
5379
+ "description": "List locally recorded unclaimed projects"
5207
5380
  },
5208
5381
  {
5209
- "command": "<%= config.bin %> <%= command.id %> --debug-metafile-path metafile.json",
5210
- "description": "Generate a report which can be analyzed with https://esbuild.github.io/analyze/"
5382
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
5383
+ "description": "Show recovery details for one project"
5211
5384
  }
5212
5385
  ],
5213
5386
  "flags": {
5214
- "debug-metafile-path": {
5215
- "description": "Optional path where a metafile will be written for build analysis. Only written on successful validation. Can be analyzed at https://esbuild.github.io/analyze/",
5216
- "helpGroup": "DEBUG",
5217
- "name": "debug-metafile-path",
5218
- "hasDynamicHelp": false,
5219
- "multiple": false,
5220
- "type": "option"
5221
- },
5222
- "format": {
5223
- "description": "The output format used to print schema errors and warnings",
5224
- "name": "format",
5225
- "default": "pretty",
5226
- "hasDynamicHelp": false,
5227
- "multiple": false,
5228
- "options": [
5229
- "pretty",
5230
- "ndjson",
5231
- "json"
5232
- ],
5233
- "type": "option"
5234
- },
5235
- "level": {
5236
- "description": "The minimum level reported out",
5237
- "name": "level",
5238
- "default": "warning",
5239
- "hasDynamicHelp": false,
5240
- "multiple": false,
5241
- "options": [
5242
- "error",
5243
- "warning"
5244
- ],
5245
- "type": "option"
5246
- },
5247
- "workspace": {
5248
- "description": "The name of the workspace to use when validating all schema types",
5249
- "name": "workspace",
5387
+ "project-id": {
5388
+ "description": "Project ID to recover",
5389
+ "name": "project-id",
5250
5390
  "hasDynamicHelp": false,
5251
5391
  "multiple": false,
5252
5392
  "type": "option"
@@ -5254,9 +5394,9 @@
5254
5394
  },
5255
5395
  "hasDynamicHelp": false,
5256
5396
  "hiddenAliases": [
5257
- "schema:validate"
5397
+ "project:unclaimed"
5258
5398
  ],
5259
- "id": "schemas:validate",
5399
+ "id": "projects:unclaimed",
5260
5400
  "pluginAlias": "@sanity/cli",
5261
5401
  "pluginName": "@sanity/cli",
5262
5402
  "pluginType": "core",
@@ -5265,8 +5405,8 @@
5265
5405
  "relativePath": [
5266
5406
  "dist",
5267
5407
  "commands",
5268
- "schemas",
5269
- "validate.js"
5408
+ "projects",
5409
+ "unclaimed.js"
5270
5410
  ]
5271
5411
  },
5272
5412
  "skills:install": {
@@ -5295,35 +5435,83 @@
5295
5435
  "install.js"
5296
5436
  ]
5297
5437
  },
5298
- "media:create-aspect": {
5438
+ "schemas:delete": {
5299
5439
  "aliases": [],
5300
5440
  "args": {},
5301
- "description": "Create a new aspect definition file",
5441
+ "description": "Delete schema documents by id",
5302
5442
  "examples": [
5303
5443
  {
5304
- "command": "<%= config.bin %> <%= command.id %>",
5305
- "description": "Create a new aspect definition file"
5444
+ "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName",
5445
+ "description": "Delete a single schema"
5446
+ },
5447
+ {
5448
+ "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName,prefix.sanity.workspace.schema.otherWorkspace",
5449
+ "description": "Delete multiple schemas"
5306
5450
  }
5307
5451
  ],
5308
5452
  "flags": {
5309
- "name": {
5310
- "description": "Aspect name. Defaults to the title in camel case",
5311
- "name": "name",
5453
+ "project-id": {
5454
+ "char": "p",
5455
+ "description": "Project ID to delete schema from (overrides CLI configuration)",
5456
+ "helpGroup": "OVERRIDE",
5457
+ "name": "project-id",
5312
5458
  "hasDynamicHelp": false,
5459
+ "helpValue": "<id>",
5313
5460
  "multiple": false,
5314
5461
  "type": "option"
5315
5462
  },
5316
- "title": {
5317
- "description": "Aspect title",
5318
- "name": "title",
5463
+ "dataset": {
5464
+ "char": "d",
5465
+ "description": "Delete schemas from a specific dataset",
5466
+ "name": "dataset",
5467
+ "hasDynamicHelp": false,
5468
+ "helpValue": "<name>",
5469
+ "multiple": false,
5470
+ "type": "option"
5471
+ },
5472
+ "extract-manifest": {
5473
+ "description": "Generate manifest file (disable with --no-extract-manifest)",
5474
+ "hidden": true,
5475
+ "name": "extract-manifest",
5476
+ "allowNo": true,
5477
+ "type": "boolean"
5478
+ },
5479
+ "ids": {
5480
+ "description": "Comma-separated list of schema ids to delete",
5481
+ "name": "ids",
5482
+ "required": true,
5483
+ "hasDynamicHelp": false,
5484
+ "multiple": false,
5485
+ "type": "option"
5486
+ },
5487
+ "manifest-dir": {
5488
+ "description": "Directory containing manifest file",
5489
+ "hidden": true,
5490
+ "name": "manifest-dir",
5491
+ "default": "./dist/static",
5319
5492
  "hasDynamicHelp": false,
5320
5493
  "multiple": false,
5321
5494
  "type": "option"
5495
+ },
5496
+ "verbose": {
5497
+ "description": "Enable verbose logging",
5498
+ "name": "verbose",
5499
+ "allowNo": false,
5500
+ "type": "boolean"
5501
+ },
5502
+ "yes": {
5503
+ "char": "y",
5504
+ "description": "Delete schemas without prompting for confirmation",
5505
+ "name": "yes",
5506
+ "allowNo": false,
5507
+ "type": "boolean"
5322
5508
  }
5323
5509
  },
5324
5510
  "hasDynamicHelp": false,
5325
- "hiddenAliases": [],
5326
- "id": "media:create-aspect",
5511
+ "hiddenAliases": [
5512
+ "schema:delete"
5513
+ ],
5514
+ "id": "schemas:delete",
5327
5515
  "pluginAlias": "@sanity/cli",
5328
5516
  "pluginName": "@sanity/cli",
5329
5517
  "pluginType": "core",
@@ -5332,55 +5520,68 @@
5332
5520
  "relativePath": [
5333
5521
  "dist",
5334
5522
  "commands",
5335
- "media",
5336
- "create-aspect.js"
5523
+ "schemas",
5524
+ "delete.js"
5337
5525
  ]
5338
5526
  },
5339
- "media:delete-aspect": {
5527
+ "schemas:deploy": {
5340
5528
  "aliases": [],
5341
- "args": {
5342
- "aspectName": {
5343
- "description": "Name of the aspect to delete",
5344
- "name": "aspectName",
5345
- "required": true
5346
- }
5347
- },
5348
- "description": "Delete an aspect definition",
5529
+ "args": {},
5530
+ "description": "Deploy schema documents into workspace datasets.\n\nNote: This command is experimental and subject to change.\n\nRegenerates a manifest file by default. To re-use an existing manifest, use --no-extract-manifest.",
5349
5531
  "examples": [
5350
5532
  {
5351
- "command": "<%= config.bin %> <%= command.id %> someAspect",
5352
- "description": "Delete the aspect named \"someAspect\""
5533
+ "command": "<%= config.bin %> <%= command.id %>",
5534
+ "description": "Deploy all workspace schemas"
5535
+ },
5536
+ {
5537
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
5538
+ "description": "Deploy the schema for only the workspace \"default\""
5353
5539
  }
5354
5540
  ],
5355
5541
  "flags": {
5356
- "project-id": {
5357
- "char": "p",
5358
- "description": "Project ID to delete media aspect from (overrides CLI configuration)",
5359
- "helpGroup": "OVERRIDE",
5360
- "name": "project-id",
5542
+ "extract-manifest": {
5543
+ "description": "Regenerate manifest before deploying (use --no-extract-manifest to skip)",
5544
+ "name": "extract-manifest",
5545
+ "allowNo": true,
5546
+ "type": "boolean"
5547
+ },
5548
+ "manifest-dir": {
5549
+ "description": "Directory containing manifest file",
5550
+ "name": "manifest-dir",
5551
+ "default": "./dist/static",
5361
5552
  "hasDynamicHelp": false,
5362
- "helpValue": "<id>",
5553
+ "helpValue": "<directory>",
5363
5554
  "multiple": false,
5364
5555
  "type": "option"
5365
5556
  },
5366
- "media-library-id": {
5367
- "description": "The id of the target media library",
5368
- "name": "media-library-id",
5557
+ "tag": {
5558
+ "description": "Add a tag suffix to the schema id",
5559
+ "name": "tag",
5369
5560
  "hasDynamicHelp": false,
5561
+ "helpValue": "<tag>",
5370
5562
  "multiple": false,
5371
5563
  "type": "option"
5372
5564
  },
5373
- "yes": {
5374
- "char": "y",
5375
- "description": "Run without prompts and confirm deletion",
5376
- "name": "yes",
5565
+ "verbose": {
5566
+ "description": "Print detailed information during deployment",
5567
+ "name": "verbose",
5377
5568
  "allowNo": false,
5378
5569
  "type": "boolean"
5570
+ },
5571
+ "workspace": {
5572
+ "description": "The name of the workspace to deploy a schema for",
5573
+ "name": "workspace",
5574
+ "hasDynamicHelp": false,
5575
+ "helpValue": "<name>",
5576
+ "multiple": false,
5577
+ "type": "option"
5379
5578
  }
5380
5579
  },
5381
5580
  "hasDynamicHelp": false,
5382
- "hiddenAliases": [],
5383
- "id": "media:delete-aspect",
5581
+ "hiddenAliases": [
5582
+ "schema:deploy"
5583
+ ],
5584
+ "id": "schemas:deploy",
5384
5585
  "pluginAlias": "@sanity/cli",
5385
5586
  "pluginName": "@sanity/cli",
5386
5587
  "pluginType": "core",
@@ -5389,59 +5590,85 @@
5389
5590
  "relativePath": [
5390
5591
  "dist",
5391
5592
  "commands",
5392
- "media",
5393
- "delete-aspect.js"
5593
+ "schemas",
5594
+ "deploy.js"
5394
5595
  ]
5395
5596
  },
5396
- "media:deploy-aspect": {
5597
+ "schemas:extract": {
5397
5598
  "aliases": [],
5398
- "args": {
5399
- "aspectName": {
5400
- "description": "Name of the aspect to deploy",
5401
- "name": "aspectName",
5402
- "required": false
5403
- }
5404
- },
5405
- "description": "Deploy an aspect",
5599
+ "args": {},
5600
+ "description": "Extract a JSON representation of a Sanity schema within a Studio context.\n\nNote: This command is experimental and subject to change.",
5406
5601
  "examples": [
5407
5602
  {
5408
- "command": "<%= config.bin %> <%= command.id %> someAspect",
5409
- "description": "Deploy the aspect named \"someAspect\""
5603
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
5604
+ "description": "Extracts schema types in a Sanity project with more than one workspace"
5410
5605
  },
5411
5606
  {
5412
- "command": "<%= config.bin %> <%= command.id %> --all",
5413
- "description": "Deploy all aspects"
5607
+ "command": "<%= config.bin %> <%= command.id %> --watch",
5608
+ "description": "Watch mode - re-extract on changes"
5609
+ },
5610
+ {
5611
+ "command": "<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"",
5612
+ "description": "Watch with custom glob patterns"
5414
5613
  }
5415
5614
  ],
5416
5615
  "flags": {
5417
- "project-id": {
5418
- "char": "p",
5419
- "description": "Project ID to deploy media aspect to (overrides CLI configuration)",
5420
- "helpGroup": "OVERRIDE",
5421
- "name": "project-id",
5616
+ "enforce-required-fields": {
5617
+ "description": "Makes the schema generated treat fields marked as required as non-optional",
5618
+ "name": "enforce-required-fields",
5619
+ "allowNo": false,
5620
+ "type": "boolean"
5621
+ },
5622
+ "force": {
5623
+ "description": "Overwrite an existing schema file",
5624
+ "name": "force",
5625
+ "allowNo": false,
5626
+ "type": "boolean"
5627
+ },
5628
+ "format": {
5629
+ "description": "Output format (currently only groq-type-nodes)",
5630
+ "name": "format",
5631
+ "default": "groq-type-nodes",
5422
5632
  "hasDynamicHelp": false,
5423
- "helpValue": "<id>",
5633
+ "helpValue": "<format>",
5424
5634
  "multiple": false,
5425
5635
  "type": "option"
5426
5636
  },
5427
- "all": {
5428
- "description": "Deploy all aspects",
5429
- "name": "all",
5430
- "required": false,
5637
+ "path": {
5638
+ "description": "Optional path to specify destination of the schema file",
5639
+ "name": "path",
5640
+ "hasDynamicHelp": false,
5641
+ "multiple": false,
5642
+ "type": "option"
5643
+ },
5644
+ "watch": {
5645
+ "description": "Enable watch mode to re-extract schema on file changes",
5646
+ "name": "watch",
5431
5647
  "allowNo": false,
5432
5648
  "type": "boolean"
5433
5649
  },
5434
- "media-library-id": {
5435
- "description": "The id of the target media library",
5436
- "name": "media-library-id",
5650
+ "watch-patterns": {
5651
+ "description": "Additional glob pattern(s) to watch (can be specified multiple times)",
5652
+ "name": "watch-patterns",
5653
+ "hasDynamicHelp": false,
5654
+ "helpValue": "<glob>",
5655
+ "multiple": true,
5656
+ "type": "option"
5657
+ },
5658
+ "workspace": {
5659
+ "description": "The name of the workspace to generate a schema for",
5660
+ "name": "workspace",
5437
5661
  "hasDynamicHelp": false,
5662
+ "helpValue": "<name>",
5438
5663
  "multiple": false,
5439
5664
  "type": "option"
5440
5665
  }
5441
5666
  },
5442
5667
  "hasDynamicHelp": false,
5443
- "hiddenAliases": [],
5444
- "id": "media:deploy-aspect",
5668
+ "hiddenAliases": [
5669
+ "schema:extract"
5670
+ ],
5671
+ "id": "schemas:extract",
5445
5672
  "pluginAlias": "@sanity/cli",
5446
5673
  "pluginName": "@sanity/cli",
5447
5674
  "pluginType": "core",
@@ -5450,189 +5677,163 @@
5450
5677
  "relativePath": [
5451
5678
  "dist",
5452
5679
  "commands",
5453
- "media",
5454
- "deploy-aspect.js"
5680
+ "schemas",
5681
+ "extract.js"
5455
5682
  ]
5456
5683
  },
5457
- "media:export": {
5684
+ "schemas:list": {
5458
5685
  "aliases": [],
5459
- "args": {
5460
- "destination": {
5461
- "description": "Output destination file path",
5462
- "name": "destination"
5463
- }
5464
- },
5465
- "description": "Export file and image assets from a media library (excludes video)",
5686
+ "args": {},
5687
+ "description": "List all schemas in the current dataset.\n\nNote: This command is experimental and subject to change.\n\nRegenerates a manifest file by default. To reuse an existing manifest, use --no-extract-manifest.",
5466
5688
  "examples": [
5467
5689
  {
5468
5690
  "command": "<%= config.bin %> <%= command.id %>",
5469
- "description": "Export media library interactively"
5691
+ "description": "List all schemas found in any workspace dataset in a table"
5692
+ },
5693
+ {
5694
+ "command": "<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName",
5695
+ "description": "Get a schema for a given id"
5470
5696
  },
5471
5697
  {
5472
- "command": "<%= config.bin %> <%= command.id %> output.tar.gz",
5473
- "description": "Export media library to output.tar.gz"
5698
+ "command": "<%= config.bin %> <%= command.id %> --json",
5699
+ "description": "Get stored schemas as pretty-printed json-array"
5474
5700
  },
5475
5701
  {
5476
- "command": "<%= config.bin %> <%= command.id %> --media-library-id my-library-id",
5477
- "description": "Export specific media library"
5702
+ "command": "<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName",
5703
+ "description": "Get singular stored schema as pretty-printed json-object"
5478
5704
  }
5479
5705
  ],
5480
5706
  "flags": {
5481
- "project-id": {
5482
- "char": "p",
5483
- "description": "Project ID to export media from (overrides CLI configuration)",
5484
- "helpGroup": "OVERRIDE",
5485
- "name": "project-id",
5486
- "hasDynamicHelp": false,
5487
- "helpValue": "<id>",
5488
- "multiple": false,
5489
- "type": "option"
5707
+ "json": {
5708
+ "description": "Format output as json.",
5709
+ "helpGroup": "GLOBAL",
5710
+ "name": "json",
5711
+ "allowNo": false,
5712
+ "type": "boolean"
5490
5713
  },
5491
- "asset-concurrency": {
5492
- "description": "Concurrent number of asset downloads",
5493
- "name": "asset-concurrency",
5494
- "default": 8,
5714
+ "extract-manifest": {
5715
+ "description": "Regenerate manifest before listing (use --no-extract-manifest to skip)",
5716
+ "hidden": true,
5717
+ "name": "extract-manifest",
5718
+ "allowNo": true,
5719
+ "type": "boolean"
5720
+ },
5721
+ "id": {
5722
+ "description": "Fetch a single schema by id",
5723
+ "name": "id",
5495
5724
  "hasDynamicHelp": false,
5725
+ "helpValue": "<schema_id>",
5496
5726
  "multiple": false,
5497
5727
  "type": "option"
5498
5728
  },
5499
- "media-library-id": {
5500
- "description": "The id of the target media library",
5501
- "name": "media-library-id",
5729
+ "manifest-dir": {
5730
+ "description": "Directory containing manifest file",
5731
+ "hidden": true,
5732
+ "name": "manifest-dir",
5733
+ "default": "./dist/static",
5502
5734
  "hasDynamicHelp": false,
5735
+ "helpValue": "<directory>",
5503
5736
  "multiple": false,
5504
5737
  "type": "option"
5505
- },
5506
- "no-compress": {
5507
- "description": "Skips compressing tarball entries (still generates a gzip file)",
5508
- "name": "no-compress",
5509
- "allowNo": false,
5510
- "type": "boolean"
5511
- },
5512
- "overwrite": {
5513
- "description": "Overwrite any file with the same name",
5514
- "name": "overwrite",
5515
- "allowNo": false,
5516
- "type": "boolean"
5517
5738
  }
5518
5739
  },
5519
5740
  "hasDynamicHelp": false,
5520
- "hiddenAliases": [],
5521
- "id": "media:export",
5741
+ "hiddenAliases": [
5742
+ "schema:list"
5743
+ ],
5744
+ "id": "schemas:list",
5522
5745
  "pluginAlias": "@sanity/cli",
5523
5746
  "pluginName": "@sanity/cli",
5524
5747
  "pluginType": "core",
5525
5748
  "strict": true,
5749
+ "enableJsonFlag": true,
5526
5750
  "isESM": true,
5527
5751
  "relativePath": [
5528
5752
  "dist",
5529
5753
  "commands",
5530
- "media",
5531
- "export.js"
5754
+ "schemas",
5755
+ "list.js"
5532
5756
  ]
5533
5757
  },
5534
- "media:import": {
5758
+ "schemas:validate": {
5535
5759
  "aliases": [],
5536
- "args": {
5537
- "source": {
5538
- "description": "Directory, archive, or asset URL to import from. An https URL imports one asset that Sanity fetches itself",
5539
- "name": "source",
5540
- "required": true
5541
- }
5542
- },
5543
- "description": "Import a set of assets to the target media library.",
5760
+ "args": {},
5761
+ "description": "Validates all schema types specified in a workspace",
5544
5762
  "examples": [
5545
5763
  {
5546
- "command": "<%= config.bin %> <%= command.id %> products",
5547
- "description": "Import all assets from the \"products\" directory"
5548
- },
5549
- {
5550
- "command": "<%= config.bin %> <%= command.id %> gallery.tar.gz",
5551
- "description": "Import all assets from \"gallery\" archive"
5764
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
5765
+ "description": "Validates all schema types in a Sanity project with more than one workspace"
5552
5766
  },
5553
5767
  {
5554
- "command": "<%= config.bin %> <%= command.id %> products --replace-aspects",
5555
- "description": "Import all assets from the \"products\" directory and replace aspects"
5768
+ "command": "<%= config.bin %> <%= command.id %> > report.txt",
5769
+ "description": "Save the results of the report into a file"
5556
5770
  },
5557
5771
  {
5558
- "command": "<%= config.bin %> <%= command.id %> https://example.com/hero.png",
5559
- "description": "Have Sanity fetch a single asset from a public URL"
5772
+ "command": "<%= config.bin %> <%= command.id %> --level error",
5773
+ "description": "Report out only errors"
5560
5774
  },
5561
5775
  {
5562
- "command": "<%= config.bin %> <%= command.id %> https://example.com/hero.png --aspect department=Brand",
5563
- "description": "Fetch an asset from a URL and set aspect data on it"
5776
+ "command": "<%= config.bin %> <%= command.id %> --debug-metafile-path metafile.json",
5777
+ "description": "Generate a report which can be analyzed with https://esbuild.github.io/analyze/"
5564
5778
  }
5565
5779
  ],
5566
5780
  "flags": {
5567
- "project-id": {
5568
- "char": "p",
5569
- "description": "Project ID to import media to (overrides CLI configuration)",
5570
- "helpGroup": "OVERRIDE",
5571
- "name": "project-id",
5781
+ "debug-metafile-path": {
5782
+ "description": "Optional path where a metafile will be written for build analysis. Only written on successful validation. Can be analyzed at https://esbuild.github.io/analyze/",
5783
+ "helpGroup": "DEBUG",
5784
+ "name": "debug-metafile-path",
5572
5785
  "hasDynamicHelp": false,
5573
- "helpValue": "<id>",
5574
5786
  "multiple": false,
5575
5787
  "type": "option"
5576
5788
  },
5577
- "aspect": {
5578
- "description": "Aspect value to set on the imported asset, as key=value. Repeatable. Only applies when the source is a URL - directory and archive imports read aspects from their data.ndjson",
5579
- "name": "aspect",
5789
+ "format": {
5790
+ "description": "The output format used to print schema errors and warnings",
5791
+ "name": "format",
5792
+ "default": "pretty",
5580
5793
  "hasDynamicHelp": false,
5581
- "helpValue": "<key=value>",
5582
- "multiple": true,
5794
+ "multiple": false,
5795
+ "options": [
5796
+ "pretty",
5797
+ "ndjson",
5798
+ "json"
5799
+ ],
5583
5800
  "type": "option"
5584
5801
  },
5585
- "filename": {
5586
- "description": "Original filename to store on the asset. Only applies when the source is a URL. Defaults to a name derived from the URL",
5587
- "name": "filename",
5802
+ "level": {
5803
+ "description": "The minimum level reported out",
5804
+ "name": "level",
5805
+ "default": "warning",
5588
5806
  "hasDynamicHelp": false,
5589
- "helpValue": "<filename>",
5590
5807
  "multiple": false,
5808
+ "options": [
5809
+ "error",
5810
+ "warning"
5811
+ ],
5591
5812
  "type": "option"
5592
5813
  },
5593
- "media-library-id": {
5594
- "description": "The id of the target media library",
5595
- "name": "media-library-id",
5814
+ "workspace": {
5815
+ "description": "The name of the workspace to use when validating all schema types",
5816
+ "name": "workspace",
5596
5817
  "hasDynamicHelp": false,
5597
5818
  "multiple": false,
5598
5819
  "type": "option"
5599
- },
5600
- "replace-aspects": {
5601
- "description": "Replace existing aspect data. All versions will be replaced (e.g. published and draft aspect data). Only applies to directory and archive imports",
5602
- "name": "replace-aspects",
5603
- "allowNo": false,
5604
- "type": "boolean"
5605
5820
  }
5606
5821
  },
5607
5822
  "hasDynamicHelp": false,
5608
- "hiddenAliases": [],
5609
- "id": "media:import",
5823
+ "hiddenAliases": [
5824
+ "schema:validate"
5825
+ ],
5826
+ "id": "schemas:validate",
5610
5827
  "pluginAlias": "@sanity/cli",
5611
5828
  "pluginName": "@sanity/cli",
5612
5829
  "pluginType": "core",
5613
5830
  "strict": true,
5614
- "telemetry": {
5615
- "redactedFlags": [
5616
- {
5617
- "canonical": "--aspect",
5618
- "flags": [
5619
- "--aspect"
5620
- ]
5621
- },
5622
- {
5623
- "canonical": "--filename",
5624
- "flags": [
5625
- "--filename"
5626
- ]
5627
- }
5628
- ]
5629
- },
5630
5831
  "isESM": true,
5631
5832
  "relativePath": [
5632
5833
  "dist",
5633
5834
  "commands",
5634
- "media",
5635
- "import.js"
5835
+ "schemas",
5836
+ "validate.js"
5636
5837
  ]
5637
5838
  },
5638
5839
  "telemetry:disable": {
@@ -6727,24 +6928,121 @@
6727
6928
  }
6728
6929
  },
6729
6930
  "hasDynamicHelp": false,
6730
- "hiddenAliases": [
6731
- "dataset:visibility:set"
6732
- ],
6733
- "id": "datasets:visibility:set",
6931
+ "hiddenAliases": [
6932
+ "dataset:visibility:set"
6933
+ ],
6934
+ "id": "datasets:visibility:set",
6935
+ "pluginAlias": "@sanity/cli",
6936
+ "pluginName": "@sanity/cli",
6937
+ "pluginType": "core",
6938
+ "strict": true,
6939
+ "isESM": true,
6940
+ "relativePath": [
6941
+ "dist",
6942
+ "commands",
6943
+ "datasets",
6944
+ "visibility",
6945
+ "set.js"
6946
+ ]
6947
+ },
6948
+ "context:entries:get": {
6949
+ "aliases": [],
6950
+ "args": {
6951
+ "knowledgeBaseId": {
6952
+ "description": "Knowledge base ID",
6953
+ "name": "knowledgeBaseId",
6954
+ "required": true
6955
+ },
6956
+ "path": {
6957
+ "description": "Entry path, as listed by `sanity context entries list`",
6958
+ "name": "path",
6959
+ "required": true
6960
+ }
6961
+ },
6962
+ "description": "Get an entry and its content",
6963
+ "examples": [
6964
+ {
6965
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 billing/refunds",
6966
+ "description": "Print an entry and its content"
6967
+ },
6968
+ {
6969
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 billing/refunds --json",
6970
+ "description": "Output the entry, including citations, as JSON"
6971
+ }
6972
+ ],
6973
+ "flags": {
6974
+ "json": {
6975
+ "description": "Format output as json.",
6976
+ "helpGroup": "GLOBAL",
6977
+ "name": "json",
6978
+ "allowNo": false,
6979
+ "type": "boolean"
6980
+ }
6981
+ },
6982
+ "hasDynamicHelp": false,
6983
+ "hiddenAliases": [],
6984
+ "id": "context:entries:get",
6985
+ "pluginAlias": "@sanity/cli",
6986
+ "pluginName": "@sanity/cli",
6987
+ "pluginType": "core",
6988
+ "strict": true,
6989
+ "enableJsonFlag": true,
6990
+ "isESM": true,
6991
+ "relativePath": [
6992
+ "dist",
6993
+ "commands",
6994
+ "context",
6995
+ "entries",
6996
+ "get.js"
6997
+ ]
6998
+ },
6999
+ "context:entries:list": {
7000
+ "aliases": [],
7001
+ "args": {
7002
+ "knowledgeBaseId": {
7003
+ "description": "Knowledge base ID",
7004
+ "name": "knowledgeBaseId",
7005
+ "required": true
7006
+ }
7007
+ },
7008
+ "description": "List the entries a knowledge base build produced",
7009
+ "examples": [
7010
+ {
7011
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123",
7012
+ "description": "List all entries for a knowledge base"
7013
+ },
7014
+ {
7015
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 --json",
7016
+ "description": "Output entries as JSON"
7017
+ }
7018
+ ],
7019
+ "flags": {
7020
+ "json": {
7021
+ "description": "Format output as json.",
7022
+ "helpGroup": "GLOBAL",
7023
+ "name": "json",
7024
+ "allowNo": false,
7025
+ "type": "boolean"
7026
+ }
7027
+ },
7028
+ "hasDynamicHelp": false,
7029
+ "hiddenAliases": [],
7030
+ "id": "context:entries:list",
6734
7031
  "pluginAlias": "@sanity/cli",
6735
7032
  "pluginName": "@sanity/cli",
6736
7033
  "pluginType": "core",
6737
7034
  "strict": true,
7035
+ "enableJsonFlag": true,
6738
7036
  "isESM": true,
6739
7037
  "relativePath": [
6740
7038
  "dist",
6741
7039
  "commands",
6742
- "datasets",
6743
- "visibility",
6744
- "set.js"
7040
+ "context",
7041
+ "entries",
7042
+ "list.js"
6745
7043
  ]
6746
7044
  },
6747
- "context:jobs:get": {
7045
+ "context:entries:rebuild": {
6748
7046
  "aliases": [],
6749
7047
  "args": {
6750
7048
  "knowledgeBaseId": {
@@ -6752,33 +7050,26 @@
6752
7050
  "name": "knowledgeBaseId",
6753
7051
  "required": true
6754
7052
  },
6755
- "jobId": {
6756
- "description": "Job ID",
6757
- "name": "jobId",
7053
+ "path": {
7054
+ "description": "Entry path, as listed by `sanity context entries list`",
7055
+ "name": "path",
6758
7056
  "required": true
6759
7057
  }
6760
7058
  },
6761
- "description": "Get the status of a knowledge base job",
7059
+ "description": "Rebuild one entry from its sources",
6762
7060
  "examples": [
6763
7061
  {
6764
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456",
6765
- "description": "Get the current status of a job"
7062
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 billing/refunds",
7063
+ "description": "Start a rebuild and return the job ID"
6766
7064
  },
6767
7065
  {
6768
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456 --watch",
6769
- "description": "Wait for the job to finish (non-zero exit if it does not succeed)"
7066
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 billing/refunds --watch",
7067
+ "description": "Rebuild an entry and wait for it to finish (non-zero exit on failure)"
6770
7068
  }
6771
7069
  ],
6772
7070
  "flags": {
6773
- "json": {
6774
- "description": "Format output as json.",
6775
- "helpGroup": "GLOBAL",
6776
- "name": "json",
6777
- "allowNo": false,
6778
- "type": "boolean"
6779
- },
6780
7071
  "watch": {
6781
- "description": "Poll until the job reaches a terminal state",
7072
+ "description": "Wait for the rebuild to finish, exiting non-zero if it fails",
6782
7073
  "name": "watch",
6783
7074
  "allowNo": false,
6784
7075
  "type": "boolean"
@@ -6786,19 +7077,18 @@
6786
7077
  },
6787
7078
  "hasDynamicHelp": false,
6788
7079
  "hiddenAliases": [],
6789
- "id": "context:jobs:get",
7080
+ "id": "context:entries:rebuild",
6790
7081
  "pluginAlias": "@sanity/cli",
6791
7082
  "pluginName": "@sanity/cli",
6792
7083
  "pluginType": "core",
6793
7084
  "strict": true,
6794
- "enableJsonFlag": true,
6795
7085
  "isESM": true,
6796
7086
  "relativePath": [
6797
7087
  "dist",
6798
7088
  "commands",
6799
7089
  "context",
6800
- "jobs",
6801
- "get.js"
7090
+ "entries",
7091
+ "rebuild.js"
6802
7092
  ]
6803
7093
  },
6804
7094
  "context:imports:create": {
@@ -6931,55 +7221,249 @@
6931
7221
  },
6932
7222
  "hasDynamicHelp": false,
6933
7223
  "hiddenAliases": [],
6934
- "id": "context:imports:create",
7224
+ "id": "context:imports:create",
7225
+ "pluginAlias": "@sanity/cli",
7226
+ "pluginName": "@sanity/cli",
7227
+ "pluginType": "core",
7228
+ "strict": true,
7229
+ "telemetry": {
7230
+ "redactedFlags": [
7231
+ {
7232
+ "canonical": "--text",
7233
+ "flags": [
7234
+ "--text"
7235
+ ]
7236
+ },
7237
+ {
7238
+ "canonical": "--file",
7239
+ "flags": [
7240
+ "--file"
7241
+ ]
7242
+ },
7243
+ {
7244
+ "canonical": "--url",
7245
+ "flags": [
7246
+ "--url"
7247
+ ]
7248
+ },
7249
+ {
7250
+ "canonical": "--title",
7251
+ "flags": [
7252
+ "--title"
7253
+ ]
7254
+ },
7255
+ {
7256
+ "canonical": "--query",
7257
+ "flags": [
7258
+ "--query"
7259
+ ]
7260
+ }
7261
+ ]
7262
+ },
7263
+ "isESM": true,
7264
+ "relativePath": [
7265
+ "dist",
7266
+ "commands",
7267
+ "context",
7268
+ "imports",
7269
+ "create.js"
7270
+ ]
7271
+ },
7272
+ "context:imports:delete": {
7273
+ "aliases": [],
7274
+ "args": {
7275
+ "knowledgeBaseId": {
7276
+ "description": "Knowledge base ID",
7277
+ "name": "knowledgeBaseId",
7278
+ "required": true
7279
+ },
7280
+ "importId": {
7281
+ "description": "Import ID",
7282
+ "name": "importId",
7283
+ "required": true
7284
+ }
7285
+ },
7286
+ "description": "Delete an import from a knowledge base",
7287
+ "examples": [
7288
+ {
7289
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456",
7290
+ "description": "Delete an import after confirmation"
7291
+ },
7292
+ {
7293
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456 --yes",
7294
+ "description": "Delete an import without confirmation prompt"
7295
+ }
7296
+ ],
7297
+ "flags": {
7298
+ "yes": {
7299
+ "char": "y",
7300
+ "description": "Skip confirmation prompt (unattended mode)",
7301
+ "name": "yes",
7302
+ "allowNo": false,
7303
+ "type": "boolean"
7304
+ }
7305
+ },
7306
+ "hasDynamicHelp": false,
7307
+ "hiddenAliases": [],
7308
+ "id": "context:imports:delete",
7309
+ "pluginAlias": "@sanity/cli",
7310
+ "pluginName": "@sanity/cli",
7311
+ "pluginType": "core",
7312
+ "strict": true,
7313
+ "isESM": true,
7314
+ "relativePath": [
7315
+ "dist",
7316
+ "commands",
7317
+ "context",
7318
+ "imports",
7319
+ "delete.js"
7320
+ ]
7321
+ },
7322
+ "context:imports:download": {
7323
+ "aliases": [],
7324
+ "args": {
7325
+ "knowledgeBaseId": {
7326
+ "description": "Knowledge base ID",
7327
+ "name": "knowledgeBaseId",
7328
+ "required": true
7329
+ },
7330
+ "importId": {
7331
+ "description": "Import ID",
7332
+ "name": "importId",
7333
+ "required": true
7334
+ }
7335
+ },
7336
+ "description": "Get a short-lived signed URL for the original uploaded bytes of a file import",
7337
+ "examples": [
7338
+ {
7339
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456",
7340
+ "description": "Get a download URL for an uploaded file"
7341
+ }
7342
+ ],
7343
+ "flags": {
7344
+ "json": {
7345
+ "description": "Format output as json.",
7346
+ "helpGroup": "GLOBAL",
7347
+ "name": "json",
7348
+ "allowNo": false,
7349
+ "type": "boolean"
7350
+ }
7351
+ },
7352
+ "hasDynamicHelp": false,
7353
+ "hiddenAliases": [],
7354
+ "id": "context:imports:download",
7355
+ "pluginAlias": "@sanity/cli",
7356
+ "pluginName": "@sanity/cli",
7357
+ "pluginType": "core",
7358
+ "strict": true,
7359
+ "enableJsonFlag": true,
7360
+ "isESM": true,
7361
+ "relativePath": [
7362
+ "dist",
7363
+ "commands",
7364
+ "context",
7365
+ "imports",
7366
+ "download.js"
7367
+ ]
7368
+ },
7369
+ "context:imports:get": {
7370
+ "aliases": [],
7371
+ "args": {
7372
+ "knowledgeBaseId": {
7373
+ "description": "Knowledge base ID",
7374
+ "name": "knowledgeBaseId",
7375
+ "required": true
7376
+ },
7377
+ "importId": {
7378
+ "description": "Import ID",
7379
+ "name": "importId",
7380
+ "required": true
7381
+ }
7382
+ },
7383
+ "description": "Get details of an import",
7384
+ "examples": [
7385
+ {
7386
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456",
7387
+ "description": "Get details of a specific import"
7388
+ },
7389
+ {
7390
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456 --json",
7391
+ "description": "Output the import as JSON"
7392
+ }
7393
+ ],
7394
+ "flags": {
7395
+ "json": {
7396
+ "description": "Format output as json.",
7397
+ "helpGroup": "GLOBAL",
7398
+ "name": "json",
7399
+ "allowNo": false,
7400
+ "type": "boolean"
7401
+ }
7402
+ },
7403
+ "hasDynamicHelp": false,
7404
+ "hiddenAliases": [],
7405
+ "id": "context:imports:get",
7406
+ "pluginAlias": "@sanity/cli",
7407
+ "pluginName": "@sanity/cli",
7408
+ "pluginType": "core",
7409
+ "strict": true,
7410
+ "enableJsonFlag": true,
7411
+ "isESM": true,
7412
+ "relativePath": [
7413
+ "dist",
7414
+ "commands",
7415
+ "context",
7416
+ "imports",
7417
+ "get.js"
7418
+ ]
7419
+ },
7420
+ "context:imports:list": {
7421
+ "aliases": [],
7422
+ "args": {
7423
+ "knowledgeBaseId": {
7424
+ "description": "Knowledge base ID",
7425
+ "name": "knowledgeBaseId",
7426
+ "required": true
7427
+ }
7428
+ },
7429
+ "description": "List imports for a knowledge base",
7430
+ "examples": [
7431
+ {
7432
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123",
7433
+ "description": "List all imports for a knowledge base"
7434
+ },
7435
+ {
7436
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 --json",
7437
+ "description": "Output imports as JSON"
7438
+ }
7439
+ ],
7440
+ "flags": {
7441
+ "json": {
7442
+ "description": "Format output as json.",
7443
+ "helpGroup": "GLOBAL",
7444
+ "name": "json",
7445
+ "allowNo": false,
7446
+ "type": "boolean"
7447
+ }
7448
+ },
7449
+ "hasDynamicHelp": false,
7450
+ "hiddenAliases": [],
7451
+ "id": "context:imports:list",
6935
7452
  "pluginAlias": "@sanity/cli",
6936
7453
  "pluginName": "@sanity/cli",
6937
7454
  "pluginType": "core",
6938
7455
  "strict": true,
6939
- "telemetry": {
6940
- "redactedFlags": [
6941
- {
6942
- "canonical": "--text",
6943
- "flags": [
6944
- "--text"
6945
- ]
6946
- },
6947
- {
6948
- "canonical": "--file",
6949
- "flags": [
6950
- "--file"
6951
- ]
6952
- },
6953
- {
6954
- "canonical": "--url",
6955
- "flags": [
6956
- "--url"
6957
- ]
6958
- },
6959
- {
6960
- "canonical": "--title",
6961
- "flags": [
6962
- "--title"
6963
- ]
6964
- },
6965
- {
6966
- "canonical": "--query",
6967
- "flags": [
6968
- "--query"
6969
- ]
6970
- }
6971
- ]
6972
- },
7456
+ "enableJsonFlag": true,
6973
7457
  "isESM": true,
6974
7458
  "relativePath": [
6975
7459
  "dist",
6976
7460
  "commands",
6977
7461
  "context",
6978
7462
  "imports",
6979
- "create.js"
7463
+ "list.js"
6980
7464
  ]
6981
7465
  },
6982
- "context:imports:delete": {
7466
+ "context:issues:apply": {
6983
7467
  "aliases": [],
6984
7468
  "args": {
6985
7469
  "knowledgeBaseId": {
@@ -6987,35 +7471,35 @@
6987
7471
  "name": "knowledgeBaseId",
6988
7472
  "required": true
6989
7473
  },
6990
- "importId": {
6991
- "description": "Import ID",
6992
- "name": "importId",
7474
+ "issueId": {
7475
+ "description": "ID of an issue to accept and apply (pass several to apply them in one batch). Conflicts can't be applied; resolve them with `sanity context issues resolve`",
7476
+ "multiple": true,
7477
+ "name": "issueId",
6993
7478
  "required": true
6994
7479
  }
6995
7480
  },
6996
- "description": "Delete an import from a knowledge base",
7481
+ "description": "Accept and apply issues to a knowledge base",
6997
7482
  "examples": [
6998
7483
  {
6999
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456",
7000
- "description": "Delete an import after confirmation"
7484
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456 issue.ghi789",
7485
+ "description": "Accept and apply two issues in one batch"
7001
7486
  },
7002
7487
  {
7003
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456 --yes",
7004
- "description": "Delete an import without confirmation prompt"
7488
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456 --watch",
7489
+ "description": "Apply an issue and wait for it to finish (non-zero exit on failure)"
7005
7490
  }
7006
7491
  ],
7007
7492
  "flags": {
7008
- "yes": {
7009
- "char": "y",
7010
- "description": "Skip confirmation prompt (unattended mode)",
7011
- "name": "yes",
7493
+ "watch": {
7494
+ "description": "Wait for the apply to finish, exiting non-zero if it fails",
7495
+ "name": "watch",
7012
7496
  "allowNo": false,
7013
7497
  "type": "boolean"
7014
7498
  }
7015
7499
  },
7016
7500
  "hasDynamicHelp": false,
7017
7501
  "hiddenAliases": [],
7018
- "id": "context:imports:delete",
7502
+ "id": "context:issues:apply",
7019
7503
  "pluginAlias": "@sanity/cli",
7020
7504
  "pluginName": "@sanity/cli",
7021
7505
  "pluginType": "core",
@@ -7025,11 +7509,11 @@
7025
7509
  "dist",
7026
7510
  "commands",
7027
7511
  "context",
7028
- "imports",
7029
- "delete.js"
7512
+ "issues",
7513
+ "apply.js"
7030
7514
  ]
7031
7515
  },
7032
- "context:imports:download": {
7516
+ "context:issues:dismiss": {
7033
7517
  "aliases": [],
7034
7518
  "args": {
7035
7519
  "knowledgeBaseId": {
@@ -7037,17 +7521,59 @@
7037
7521
  "name": "knowledgeBaseId",
7038
7522
  "required": true
7039
7523
  },
7040
- "importId": {
7041
- "description": "Import ID",
7042
- "name": "importId",
7524
+ "issueId": {
7525
+ "description": "Issue ID",
7526
+ "name": "issueId",
7043
7527
  "required": true
7044
7528
  }
7045
7529
  },
7046
- "description": "Get a short-lived signed URL for the original uploaded bytes of a file import",
7530
+ "description": "Dismiss an issue\n\nDismissing is permanent: dismissed issues can't be reopened.",
7047
7531
  "examples": [
7048
7532
  {
7049
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456",
7050
- "description": "Get a download URL for an uploaded file"
7533
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456",
7534
+ "description": "Dismiss an issue"
7535
+ }
7536
+ ],
7537
+ "flags": {},
7538
+ "hasDynamicHelp": false,
7539
+ "hiddenAliases": [],
7540
+ "id": "context:issues:dismiss",
7541
+ "pluginAlias": "@sanity/cli",
7542
+ "pluginName": "@sanity/cli",
7543
+ "pluginType": "core",
7544
+ "strict": true,
7545
+ "isESM": true,
7546
+ "relativePath": [
7547
+ "dist",
7548
+ "commands",
7549
+ "context",
7550
+ "issues",
7551
+ "dismiss.js"
7552
+ ]
7553
+ },
7554
+ "context:issues:get": {
7555
+ "aliases": [],
7556
+ "args": {
7557
+ "knowledgeBaseId": {
7558
+ "description": "Knowledge base ID",
7559
+ "name": "knowledgeBaseId",
7560
+ "required": true
7561
+ },
7562
+ "issueId": {
7563
+ "description": "Issue ID",
7564
+ "name": "issueId",
7565
+ "required": true
7566
+ }
7567
+ },
7568
+ "description": "Get details of an issue",
7569
+ "examples": [
7570
+ {
7571
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456",
7572
+ "description": "Get details of a specific issue"
7573
+ },
7574
+ {
7575
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456 --json",
7576
+ "description": "Output the issue as JSON"
7051
7577
  }
7052
7578
  ],
7053
7579
  "flags": {
@@ -7061,7 +7587,7 @@
7061
7587
  },
7062
7588
  "hasDynamicHelp": false,
7063
7589
  "hiddenAliases": [],
7064
- "id": "context:imports:download",
7590
+ "id": "context:issues:get",
7065
7591
  "pluginAlias": "@sanity/cli",
7066
7592
  "pluginName": "@sanity/cli",
7067
7593
  "pluginType": "core",
@@ -7072,33 +7598,40 @@
7072
7598
  "dist",
7073
7599
  "commands",
7074
7600
  "context",
7075
- "imports",
7076
- "download.js"
7601
+ "issues",
7602
+ "get.js"
7077
7603
  ]
7078
7604
  },
7079
- "context:imports:get": {
7605
+ "context:issues:list": {
7080
7606
  "aliases": [],
7081
7607
  "args": {
7082
7608
  "knowledgeBaseId": {
7083
7609
  "description": "Knowledge base ID",
7084
7610
  "name": "knowledgeBaseId",
7085
7611
  "required": true
7086
- },
7087
- "importId": {
7088
- "description": "Import ID",
7089
- "name": "importId",
7090
- "required": true
7091
7612
  }
7092
7613
  },
7093
- "description": "Get details of an import",
7614
+ "description": "List issues found by knowledge base builds",
7094
7615
  "examples": [
7095
7616
  {
7096
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456",
7097
- "description": "Get details of a specific import"
7617
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123",
7618
+ "description": "List all issues for a knowledge base"
7098
7619
  },
7099
7620
  {
7100
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 import-def456 --json",
7101
- "description": "Output the import as JSON"
7621
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 --status open",
7622
+ "description": "List issues awaiting triage"
7623
+ },
7624
+ {
7625
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 --kind conflict --severity critical",
7626
+ "description": "List critical conflicts"
7627
+ },
7628
+ {
7629
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 --scope billing",
7630
+ "description": "List issues about entries under billing/"
7631
+ },
7632
+ {
7633
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 --json",
7634
+ "description": "Output issues as JSON"
7102
7635
  }
7103
7636
  ],
7104
7637
  "flags": {
@@ -7108,11 +7641,58 @@
7108
7641
  "name": "json",
7109
7642
  "allowNo": false,
7110
7643
  "type": "boolean"
7644
+ },
7645
+ "kind": {
7646
+ "description": "Only list issues of this kind",
7647
+ "name": "kind",
7648
+ "hasDynamicHelp": false,
7649
+ "multiple": false,
7650
+ "options": [
7651
+ "add_entry",
7652
+ "conflict",
7653
+ "gap",
7654
+ "merge_entry",
7655
+ "remove_entry",
7656
+ "split_entry",
7657
+ "update_required"
7658
+ ],
7659
+ "type": "option"
7660
+ },
7661
+ "scope": {
7662
+ "description": "Only list issues about this entry path or anything under it (`*` for knowledge-base-wide issues)",
7663
+ "name": "scope",
7664
+ "hasDynamicHelp": false,
7665
+ "helpValue": "<path>",
7666
+ "multiple": false,
7667
+ "type": "option"
7668
+ },
7669
+ "severity": {
7670
+ "description": "Only list issues of this severity",
7671
+ "name": "severity",
7672
+ "hasDynamicHelp": false,
7673
+ "multiple": false,
7674
+ "options": [
7675
+ "critical",
7676
+ "suggestion"
7677
+ ],
7678
+ "type": "option"
7679
+ },
7680
+ "status": {
7681
+ "description": "Only list issues with this status (rejected = dismissed, accepted = resolved or applied)",
7682
+ "name": "status",
7683
+ "hasDynamicHelp": false,
7684
+ "multiple": false,
7685
+ "options": [
7686
+ "open",
7687
+ "accepted",
7688
+ "rejected"
7689
+ ],
7690
+ "type": "option"
7111
7691
  }
7112
7692
  },
7113
7693
  "hasDynamicHelp": false,
7114
7694
  "hiddenAliases": [],
7115
- "id": "context:imports:get",
7695
+ "id": "context:issues:list",
7116
7696
  "pluginAlias": "@sanity/cli",
7117
7697
  "pluginName": "@sanity/cli",
7118
7698
  "pluginType": "core",
@@ -7123,28 +7703,131 @@
7123
7703
  "dist",
7124
7704
  "commands",
7125
7705
  "context",
7126
- "imports",
7127
- "get.js"
7706
+ "issues",
7707
+ "list.js"
7128
7708
  ]
7129
7709
  },
7130
- "context:imports:list": {
7710
+ "context:issues:reopen": {
7131
7711
  "aliases": [],
7132
7712
  "args": {
7133
7713
  "knowledgeBaseId": {
7134
7714
  "description": "Knowledge base ID",
7135
7715
  "name": "knowledgeBaseId",
7136
7716
  "required": true
7717
+ },
7718
+ "issueId": {
7719
+ "description": "Issue ID",
7720
+ "name": "issueId",
7721
+ "required": true
7137
7722
  }
7138
7723
  },
7139
- "description": "List imports for a knowledge base",
7724
+ "description": "Reopen a resolved conflict issue",
7140
7725
  "examples": [
7141
7726
  {
7142
- "command": "<%= config.bin %> <%= command.id %> kb-abc123",
7143
- "description": "List all imports for a knowledge base"
7727
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456",
7728
+ "description": "Return a resolved conflict issue to triage"
7729
+ }
7730
+ ],
7731
+ "flags": {},
7732
+ "hasDynamicHelp": false,
7733
+ "hiddenAliases": [],
7734
+ "id": "context:issues:reopen",
7735
+ "pluginAlias": "@sanity/cli",
7736
+ "pluginName": "@sanity/cli",
7737
+ "pluginType": "core",
7738
+ "strict": true,
7739
+ "isESM": true,
7740
+ "relativePath": [
7741
+ "dist",
7742
+ "commands",
7743
+ "context",
7744
+ "issues",
7745
+ "reopen.js"
7746
+ ]
7747
+ },
7748
+ "context:issues:resolve": {
7749
+ "aliases": [],
7750
+ "args": {
7751
+ "knowledgeBaseId": {
7752
+ "description": "Knowledge base ID",
7753
+ "name": "knowledgeBaseId",
7754
+ "required": true
7144
7755
  },
7756
+ "issueId": {
7757
+ "description": "Issue ID",
7758
+ "name": "issueId",
7759
+ "required": true
7760
+ }
7761
+ },
7762
+ "description": "Resolve a conflict issue by choosing the correct side\n\nResolving also creates a standing instruction that future builds follow. `sanity context issues reopen` removes it.",
7763
+ "examples": [
7145
7764
  {
7146
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 --json",
7147
- "description": "Output imports as JSON"
7765
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456",
7766
+ "description": "Interactively choose the correct side of a conflict"
7767
+ },
7768
+ {
7769
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456 --side 1 --watch",
7770
+ "description": "Choose side 1 and wait for the entry to be rewritten"
7771
+ },
7772
+ {
7773
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 issue.def456 --side 0",
7774
+ "description": "Keep the entry as it is (for a conflict on a single entry)"
7775
+ }
7776
+ ],
7777
+ "flags": {
7778
+ "side": {
7779
+ "description": "Index of the correct side, as listed by `sanity context issues get`",
7780
+ "name": "side",
7781
+ "hasDynamicHelp": false,
7782
+ "multiple": false,
7783
+ "type": "option"
7784
+ },
7785
+ "watch": {
7786
+ "description": "Wait for the entry rewrite to finish, exiting non-zero if it fails",
7787
+ "name": "watch",
7788
+ "allowNo": false,
7789
+ "type": "boolean"
7790
+ }
7791
+ },
7792
+ "hasDynamicHelp": false,
7793
+ "hiddenAliases": [],
7794
+ "id": "context:issues:resolve",
7795
+ "pluginAlias": "@sanity/cli",
7796
+ "pluginName": "@sanity/cli",
7797
+ "pluginType": "core",
7798
+ "strict": true,
7799
+ "isESM": true,
7800
+ "relativePath": [
7801
+ "dist",
7802
+ "commands",
7803
+ "context",
7804
+ "issues",
7805
+ "resolve.js"
7806
+ ]
7807
+ },
7808
+ "context:jobs:get": {
7809
+ "aliases": [],
7810
+ "args": {
7811
+ "knowledgeBaseId": {
7812
+ "description": "Knowledge base ID",
7813
+ "name": "knowledgeBaseId",
7814
+ "required": true
7815
+ },
7816
+ "jobId": {
7817
+ "description": "Job ID",
7818
+ "name": "jobId",
7819
+ "required": true
7820
+ }
7821
+ },
7822
+ "description": "Get the status of a knowledge base job",
7823
+ "examples": [
7824
+ {
7825
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456",
7826
+ "description": "Get the current status of a job"
7827
+ },
7828
+ {
7829
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456 --watch",
7830
+ "description": "Wait for the job to finish (non-zero exit if it does not succeed)"
7148
7831
  }
7149
7832
  ],
7150
7833
  "flags": {
@@ -7154,11 +7837,17 @@
7154
7837
  "name": "json",
7155
7838
  "allowNo": false,
7156
7839
  "type": "boolean"
7840
+ },
7841
+ "watch": {
7842
+ "description": "Poll until the job reaches a terminal state",
7843
+ "name": "watch",
7844
+ "allowNo": false,
7845
+ "type": "boolean"
7157
7846
  }
7158
7847
  },
7159
7848
  "hasDynamicHelp": false,
7160
7849
  "hiddenAliases": [],
7161
- "id": "context:imports:list",
7850
+ "id": "context:jobs:get",
7162
7851
  "pluginAlias": "@sanity/cli",
7163
7852
  "pluginName": "@sanity/cli",
7164
7853
  "pluginType": "core",
@@ -7169,10 +7858,10 @@
7169
7858
  "dist",
7170
7859
  "commands",
7171
7860
  "context",
7172
- "imports",
7173
- "list.js"
7861
+ "jobs",
7862
+ "get.js"
7174
7863
  ]
7175
7864
  }
7176
7865
  },
7177
- "version": "8.22.1"
7866
+ "version": "8.24.0"
7178
7867
  }