@sanity/cli 8.19.0 → 8.21.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.
@@ -1390,6 +1390,42 @@
1390
1390
  "versions.js"
1391
1391
  ]
1392
1392
  },
1393
+ "whoami": {
1394
+ "aliases": [],
1395
+ "args": {},
1396
+ "description": "Show the user or API token the CLI is authenticated as",
1397
+ "examples": [
1398
+ {
1399
+ "command": "<%= config.bin %> <%= command.id %>",
1400
+ "description": "Show the currently authenticated user"
1401
+ },
1402
+ {
1403
+ "command": "<%= config.bin %> <%= command.id %> --json",
1404
+ "description": "Output the current user as JSON, for scripts and agents"
1405
+ }
1406
+ ],
1407
+ "flags": {
1408
+ "json": {
1409
+ "description": "Output as JSON",
1410
+ "name": "json",
1411
+ "allowNo": false,
1412
+ "type": "boolean"
1413
+ }
1414
+ },
1415
+ "hasDynamicHelp": false,
1416
+ "hiddenAliases": [],
1417
+ "id": "whoami",
1418
+ "pluginAlias": "@sanity/cli",
1419
+ "pluginName": "@sanity/cli",
1420
+ "pluginType": "core",
1421
+ "strict": true,
1422
+ "isESM": true,
1423
+ "relativePath": [
1424
+ "dist",
1425
+ "commands",
1426
+ "whoami.js"
1427
+ ]
1428
+ },
1393
1429
  "assets:upload": {
1394
1430
  "aliases": [],
1395
1431
  "args": {},
@@ -2946,96 +2982,69 @@
2946
2982
  "list.js"
2947
2983
  ]
2948
2984
  },
2949
- "documents:create": {
2985
+ "docs:browse": {
2986
+ "aliases": [],
2987
+ "args": {},
2988
+ "description": "Open Sanity docs in your browser",
2989
+ "flags": {},
2990
+ "hasDynamicHelp": false,
2991
+ "hiddenAliases": [],
2992
+ "id": "docs:browse",
2993
+ "pluginAlias": "@sanity/cli",
2994
+ "pluginName": "@sanity/cli",
2995
+ "pluginType": "core",
2996
+ "strict": true,
2997
+ "enableJsonFlag": false,
2998
+ "isESM": true,
2999
+ "relativePath": [
3000
+ "dist",
3001
+ "commands",
3002
+ "docs",
3003
+ "browse.js"
3004
+ ]
3005
+ },
3006
+ "docs:read": {
2950
3007
  "aliases": [],
2951
3008
  "args": {
2952
- "file": {
2953
- "description": "JSON file to create document(s) from",
2954
- "name": "file",
2955
- "required": false
3009
+ "path": {
3010
+ "description": "Path or URL to article, found in search results and docs content as links",
3011
+ "name": "path",
3012
+ "required": true
2956
3013
  }
2957
3014
  },
2958
- "description": "Create one or more documents",
3015
+ "description": "Read an article in terminal",
2959
3016
  "examples": [
2960
3017
  {
2961
- "command": "<%= config.bin %> <%= command.id %> myDocument.json",
2962
- "description": "Create the document specified in \"myDocument.json\""
2963
- },
2964
- {
2965
- "command": "<%= config.bin %> <%= command.id %>",
2966
- "description": "Open configured $EDITOR and create the specified document(s)"
3018
+ "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation",
3019
+ "description": "Read as markdown in terminal"
2967
3020
  },
2968
3021
  {
2969
- "command": "<%= config.bin %> <%= command.id %> --id myDocId --replace",
2970
- "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"
3022
+ "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
3023
+ "description": "Read using full URL"
2971
3024
  },
2972
3025
  {
2973
- "command": "<%= config.bin %> <%= command.id %> --id myDocId --watch --replace --json5",
2974
- "description": "Open configured $EDITOR and replace the document with the given content on each save. Use JSON5 file extension and parser for simplified syntax."
3026
+ "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation --web",
3027
+ "description": "Open in web browser"
2975
3028
  },
2976
3029
  {
2977
- "command": "<%= config.bin %> <%= command.id %> myDocument.json --project-id abc123",
2978
- "description": "Create documents in a specific project"
3030
+ "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation -w",
3031
+ "description": "Open using full URL in web browser"
2979
3032
  }
2980
3033
  ],
2981
3034
  "flags": {
2982
- "project-id": {
2983
- "char": "p",
2984
- "description": "Project ID to create document(s) in (overrides CLI configuration)",
2985
- "helpGroup": "OVERRIDE",
2986
- "name": "project-id",
2987
- "hasDynamicHelp": false,
2988
- "helpValue": "<id>",
2989
- "multiple": false,
2990
- "type": "option"
2991
- },
2992
- "dataset": {
2993
- "char": "d",
2994
- "description": "Dataset to create document(s) in (overrides CLI configuration)",
2995
- "helpGroup": "OVERRIDE",
2996
- "name": "dataset",
2997
- "hasDynamicHelp": false,
2998
- "helpValue": "<name>",
2999
- "multiple": false,
3000
- "type": "option"
3001
- },
3002
- "id": {
3003
- "description": "Specify a document ID to use. Will fetch remote document ID and populate editor.",
3004
- "name": "id",
3005
- "hasDynamicHelp": false,
3006
- "multiple": false,
3007
- "type": "option"
3008
- },
3009
- "json5": {
3010
- "description": "Use JSON5 file type to allow a \"simplified\" version of JSON",
3011
- "name": "json5",
3012
- "allowNo": false,
3013
- "type": "boolean"
3014
- },
3015
- "missing": {
3016
- "description": "On duplicate document IDs, don't modify the target document(s)",
3017
- "name": "missing",
3018
- "allowNo": false,
3019
- "type": "boolean"
3020
- },
3021
- "replace": {
3022
- "description": "On duplicate document IDs, replace existing document with specified document(s)",
3023
- "name": "replace",
3024
- "allowNo": false,
3025
- "type": "boolean"
3026
- },
3027
- "watch": {
3028
- "description": "Write the documents whenever the target file or buffer changes",
3029
- "name": "watch",
3035
+ "web": {
3036
+ "aliases": [
3037
+ "w"
3038
+ ],
3039
+ "description": "Open in a web browser",
3040
+ "name": "web",
3030
3041
  "allowNo": false,
3031
3042
  "type": "boolean"
3032
3043
  }
3033
3044
  },
3034
3045
  "hasDynamicHelp": false,
3035
- "hiddenAliases": [
3036
- "document:create"
3037
- ],
3038
- "id": "documents:create",
3046
+ "hiddenAliases": [],
3047
+ "id": "docs:read",
3039
3048
  "pluginAlias": "@sanity/cli",
3040
3049
  "pluginName": "@sanity/cli",
3041
3050
  "pluginType": "core",
@@ -3044,147 +3053,151 @@
3044
3053
  "relativePath": [
3045
3054
  "dist",
3046
3055
  "commands",
3047
- "documents",
3048
- "create.js"
3056
+ "docs",
3057
+ "read.js"
3049
3058
  ]
3050
3059
  },
3051
- "documents:delete": {
3060
+ "docs:search": {
3052
3061
  "aliases": [],
3053
3062
  "args": {
3054
- "id": {
3055
- "description": "Document ID to delete",
3056
- "name": "id",
3063
+ "query": {
3064
+ "description": "Search query for documentation",
3065
+ "name": "query",
3057
3066
  "required": true
3058
- },
3059
- "ids": {
3060
- "description": "Additional document IDs to delete",
3061
- "name": "ids",
3062
- "required": false
3063
3067
  }
3064
3068
  },
3065
- "description": "Delete one or more documents from the project's configured dataset",
3069
+ "description": "Search Sanity docs",
3066
3070
  "examples": [
3067
3071
  {
3068
- "command": "<%= config.bin %> <%= command.id %> myDocId",
3069
- "description": "Delete the document with the ID \"myDocId\""
3070
- },
3071
- {
3072
- "command": "<%= config.bin %> <%= command.id %> 'myDocId'",
3073
- "description": "ID wrapped in double or single quote works equally well"
3074
- },
3075
- {
3076
- "command": "<%= config.bin %> <%= command.id %> --dataset=blog someDocId",
3077
- "description": "Delete document with ID \"someDocId\" from dataset \"blog\""
3072
+ "command": "<%= config.bin %> <%= command.id %> schema",
3073
+ "description": "Search for documentation about schemas"
3078
3074
  },
3079
3075
  {
3080
- "command": "<%= config.bin %> <%= command.id %> doc1 doc2",
3081
- "description": "Delete the document with ID \"doc1\" and \"doc2\""
3076
+ "command": "<%= config.bin %> <%= command.id %> \"groq functions\"",
3077
+ "description": "Search with phrase"
3082
3078
  },
3083
3079
  {
3084
- "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3085
- "description": "Delete a document from a specific project"
3080
+ "command": "<%= config.bin %> <%= command.id %> \"deployment\" --limit=5",
3081
+ "description": "Limit search results"
3086
3082
  }
3087
3083
  ],
3088
3084
  "flags": {
3089
- "project-id": {
3090
- "char": "p",
3091
- "description": "Project ID to delete from (overrides CLI configuration)",
3092
- "helpGroup": "OVERRIDE",
3093
- "name": "project-id",
3094
- "hasDynamicHelp": false,
3095
- "helpValue": "<id>",
3096
- "multiple": false,
3097
- "type": "option"
3098
- },
3099
- "dataset": {
3100
- "char": "d",
3101
- "description": "Dataset to delete from (overrides CLI configuration)",
3102
- "helpGroup": "OVERRIDE",
3103
- "name": "dataset",
3085
+ "limit": {
3086
+ "description": "Maximum number of results to return",
3087
+ "name": "limit",
3088
+ "default": 10,
3104
3089
  "hasDynamicHelp": false,
3105
- "helpValue": "<name>",
3106
3090
  "multiple": false,
3107
3091
  "type": "option"
3108
3092
  }
3109
3093
  },
3110
3094
  "hasDynamicHelp": false,
3111
- "hiddenAliases": [
3112
- "document:delete"
3113
- ],
3114
- "id": "documents:delete",
3095
+ "hiddenAliases": [],
3096
+ "id": "docs:search",
3115
3097
  "pluginAlias": "@sanity/cli",
3116
3098
  "pluginName": "@sanity/cli",
3117
3099
  "pluginType": "core",
3118
- "strict": false,
3100
+ "strict": true,
3119
3101
  "isESM": true,
3120
3102
  "relativePath": [
3121
3103
  "dist",
3122
3104
  "commands",
3123
- "documents",
3124
- "delete.js"
3105
+ "docs",
3106
+ "search.js"
3125
3107
  ]
3126
3108
  },
3127
- "documents:get": {
3109
+ "graphql:deploy": {
3128
3110
  "aliases": [],
3129
- "args": {
3130
- "documentId": {
3131
- "description": "Document ID to retrieve",
3132
- "name": "documentId",
3133
- "required": true
3134
- }
3135
- },
3136
- "description": "Get and print a document by ID",
3111
+ "args": {},
3112
+ "description": "Deploy a GraphQL API from the current Sanity schema",
3137
3113
  "examples": [
3138
3114
  {
3139
- "command": "<%= config.bin %> <%= command.id %> myDocId",
3140
- "description": "Get the document with ID \"myDocId\""
3115
+ "command": "<%= config.bin %> <%= command.id %>",
3116
+ "description": "Deploy all defined GraphQL APIs"
3141
3117
  },
3142
3118
  {
3143
- "command": "<%= config.bin %> <%= command.id %> myDocId --pretty",
3144
- "description": "Get document with colorized JSON output"
3119
+ "command": "<%= config.bin %> <%= command.id %> --dry-run",
3120
+ "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy"
3145
3121
  },
3146
3122
  {
3147
- "command": "<%= config.bin %> <%= command.id %> myDocId --dataset production",
3148
- "description": "Get document from a specific dataset"
3123
+ "command": "<%= config.bin %> <%= command.id %> --api staging --api ios",
3124
+ "description": "Deploy only the GraphQL APIs with the IDs \"staging\" and \"ios\""
3149
3125
  },
3150
3126
  {
3151
- "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3152
- "description": "Get a document from a specific project"
3127
+ "command": "<%= config.bin %> <%= command.id %> --playground",
3128
+ "description": "Deploy all defined GraphQL APIs, overriding any playground setting"
3153
3129
  }
3154
3130
  ],
3155
3131
  "flags": {
3156
- "project-id": {
3157
- "char": "p",
3158
- "description": "Project ID to get document from (overrides CLI configuration)",
3159
- "helpGroup": "OVERRIDE",
3160
- "name": "project-id",
3132
+ "api": {
3133
+ "description": "Only deploy API with this ID (can be specified multiple times)",
3134
+ "name": "api",
3161
3135
  "hasDynamicHelp": false,
3162
- "helpValue": "<id>",
3163
- "multiple": false,
3136
+ "multiple": true,
3164
3137
  "type": "option"
3165
3138
  },
3166
3139
  "dataset": {
3167
3140
  "char": "d",
3168
- "description": "Dataset to get document from (overrides CLI configuration)",
3169
- "helpGroup": "OVERRIDE",
3141
+ "description": "Deploy API for the given dataset",
3170
3142
  "name": "dataset",
3171
3143
  "hasDynamicHelp": false,
3172
3144
  "helpValue": "<name>",
3173
3145
  "multiple": false,
3174
3146
  "type": "option"
3175
3147
  },
3176
- "pretty": {
3177
- "description": "Colorize JSON output",
3178
- "name": "pretty",
3148
+ "dry-run": {
3149
+ "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy",
3150
+ "name": "dry-run",
3151
+ "allowNo": false,
3152
+ "type": "boolean"
3153
+ },
3154
+ "force": {
3155
+ "description": "Deploy API without confirming breaking changes",
3156
+ "name": "force",
3157
+ "allowNo": false,
3158
+ "type": "boolean"
3159
+ },
3160
+ "generation": {
3161
+ "description": "API generation to deploy (defaults to \"gen3\")",
3162
+ "name": "generation",
3163
+ "hasDynamicHelp": false,
3164
+ "multiple": false,
3165
+ "options": [
3166
+ "gen1",
3167
+ "gen2",
3168
+ "gen3"
3169
+ ],
3170
+ "type": "option"
3171
+ },
3172
+ "non-null-document-fields": {
3173
+ "description": "Use non-null document fields (_id, _type etc)",
3174
+ "name": "non-null-document-fields",
3175
+ "allowNo": false,
3176
+ "type": "boolean"
3177
+ },
3178
+ "playground": {
3179
+ "description": "Enable GraphQL playground for easier debugging",
3180
+ "name": "playground",
3181
+ "allowNo": true,
3182
+ "type": "boolean"
3183
+ },
3184
+ "tag": {
3185
+ "description": "Deploy API(s) to given tag (defaults to \"default\")",
3186
+ "name": "tag",
3187
+ "hasDynamicHelp": false,
3188
+ "multiple": false,
3189
+ "type": "option"
3190
+ },
3191
+ "with-union-cache": {
3192
+ "description": "Cache union types (faster for schemas with many self-references)",
3193
+ "name": "with-union-cache",
3179
3194
  "allowNo": false,
3180
3195
  "type": "boolean"
3181
3196
  }
3182
3197
  },
3183
3198
  "hasDynamicHelp": false,
3184
- "hiddenAliases": [
3185
- "document:get"
3186
- ],
3187
- "id": "documents:get",
3199
+ "hiddenAliases": [],
3200
+ "id": "graphql:deploy",
3188
3201
  "pluginAlias": "@sanity/cli",
3189
3202
  "pluginName": "@sanity/cli",
3190
3203
  "pluginType": "core",
@@ -3193,42 +3206,85 @@
3193
3206
  "relativePath": [
3194
3207
  "dist",
3195
3208
  "commands",
3196
- "documents",
3197
- "get.js"
3209
+ "graphql",
3210
+ "deploy.js"
3198
3211
  ]
3199
3212
  },
3200
- "documents:query": {
3213
+ "graphql:list": {
3201
3214
  "aliases": [],
3202
- "args": {
3203
- "query": {
3204
- "description": "GROQ query to run against the dataset",
3205
- "name": "query",
3206
- "required": true
3215
+ "args": {},
3216
+ "description": "List deployed GraphQL endpoints for the project",
3217
+ "examples": [
3218
+ {
3219
+ "command": "<%= config.bin %> <%= command.id %>",
3220
+ "description": "List GraphQL endpoints for the project"
3221
+ },
3222
+ {
3223
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
3224
+ "description": "List GraphQL endpoints for a specific project"
3225
+ }
3226
+ ],
3227
+ "flags": {
3228
+ "project-id": {
3229
+ "char": "p",
3230
+ "description": "Project ID to list GraphQL endpoints for (overrides CLI configuration)",
3231
+ "helpGroup": "OVERRIDE",
3232
+ "name": "project-id",
3233
+ "hasDynamicHelp": false,
3234
+ "helpValue": "<id>",
3235
+ "multiple": false,
3236
+ "type": "option"
3207
3237
  }
3208
3238
  },
3209
- "description": "Query for documents",
3239
+ "hasDynamicHelp": false,
3240
+ "hiddenAliases": [],
3241
+ "id": "graphql:list",
3242
+ "pluginAlias": "@sanity/cli",
3243
+ "pluginName": "@sanity/cli",
3244
+ "pluginType": "core",
3245
+ "strict": true,
3246
+ "isESM": true,
3247
+ "relativePath": [
3248
+ "dist",
3249
+ "commands",
3250
+ "graphql",
3251
+ "list.js"
3252
+ ]
3253
+ },
3254
+ "graphql:undeploy": {
3255
+ "aliases": [],
3256
+ "args": {},
3257
+ "description": "Remove a deployed GraphQL API",
3210
3258
  "examples": [
3211
3259
  {
3212
- "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"][0..4]'",
3213
- "description": "Fetch 5 documents of type \"movie\""
3260
+ "command": "<%= config.bin %> <%= command.id %>",
3261
+ "description": "Undeploy GraphQL API for current project and dataset"
3214
3262
  },
3215
3263
  {
3216
- "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"]|order(releaseDate asc)[0]{title}' --dataset staging",
3217
- "description": "Fetch title of the oldest movie in the dataset named \"staging\""
3264
+ "command": "<%= config.bin %> <%= command.id %> --api ios",
3265
+ "description": "Undeploy API with ID \"ios\""
3218
3266
  },
3219
3267
  {
3220
- "command": "<%= config.bin %> <%= command.id %> '*[_id == \"header\"] { \"headerText\": pt::text(body) }' --api-version v2021-06-07",
3221
- "description": "Use API version v2021-06-07 and do a query"
3268
+ "command": "<%= config.bin %> <%= command.id %> --dataset staging",
3269
+ "description": "Undeploy GraphQL API for staging dataset"
3222
3270
  },
3223
3271
  {
3224
- "command": "<%= config.bin %> <%= command.id %> '*[_type == \"post\"]' --project-id abc123 --dataset production",
3225
- "description": "Query documents in a specific project and dataset"
3272
+ "command": "<%= config.bin %> <%= command.id %> --dataset staging --tag next",
3273
+ "description": "Undeploy GraphQL API for staging dataset with \"next\" tag"
3274
+ },
3275
+ {
3276
+ "command": "<%= config.bin %> <%= command.id %> --force",
3277
+ "description": "Undeploy GraphQL API without confirmation prompt"
3278
+ },
3279
+ {
3280
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3281
+ "description": "Undeploy GraphQL API for a specific project and dataset"
3226
3282
  }
3227
3283
  ],
3228
3284
  "flags": {
3229
3285
  "project-id": {
3230
3286
  "char": "p",
3231
- "description": "Project ID to query (overrides CLI configuration)",
3287
+ "description": "Project ID to undeploy GraphQL API from (overrides CLI configuration)",
3232
3288
  "helpGroup": "OVERRIDE",
3233
3289
  "name": "project-id",
3234
3290
  "hasDynamicHelp": false,
@@ -3236,9 +3292,21 @@
3236
3292
  "multiple": false,
3237
3293
  "type": "option"
3238
3294
  },
3295
+ "api": {
3296
+ "description": "Undeploy API with this ID",
3297
+ "exclusive": [
3298
+ "project-id",
3299
+ "project"
3300
+ ],
3301
+ "name": "api",
3302
+ "required": false,
3303
+ "hasDynamicHelp": false,
3304
+ "multiple": false,
3305
+ "type": "option"
3306
+ },
3239
3307
  "dataset": {
3240
3308
  "char": "d",
3241
- "description": "Dataset to query (overrides CLI configuration)",
3309
+ "description": "Dataset to undeploy GraphQL API from (overrides CLI configuration)",
3242
3310
  "helpGroup": "OVERRIDE",
3243
3311
  "name": "dataset",
3244
3312
  "hasDynamicHelp": false,
@@ -3246,22 +3314,9 @@
3246
3314
  "multiple": false,
3247
3315
  "type": "option"
3248
3316
  },
3249
- "anonymous": {
3250
- "description": "Send the query without any authorization token",
3251
- "name": "anonymous",
3252
- "allowNo": false,
3253
- "type": "boolean"
3254
- },
3255
- "api-version": {
3256
- "description": "API version to use (defaults to 2025-08-15)",
3257
- "name": "api-version",
3258
- "hasDynamicHelp": false,
3259
- "multiple": false,
3260
- "type": "option"
3261
- },
3262
- "pretty": {
3263
- "description": "Colorize JSON output",
3264
- "name": "pretty",
3317
+ "force": {
3318
+ "description": "Skip confirmation prompt",
3319
+ "name": "force",
3265
3320
  "allowNo": false,
3266
3321
  "type": "boolean"
3267
3322
  },
@@ -3269,19 +3324,27 @@
3269
3324
  "deprecated": {
3270
3325
  "to": "project-id"
3271
3326
  },
3272
- "description": "Project ID to query",
3327
+ "description": "Project ID to delete GraphQL API for",
3273
3328
  "hidden": true,
3274
3329
  "name": "project",
3330
+ "required": false,
3331
+ "hasDynamicHelp": false,
3332
+ "multiple": false,
3333
+ "type": "option"
3334
+ },
3335
+ "tag": {
3336
+ "description": "Tag to undeploy GraphQL API from",
3337
+ "name": "tag",
3338
+ "required": false,
3339
+ "default": "default",
3275
3340
  "hasDynamicHelp": false,
3276
3341
  "multiple": false,
3277
3342
  "type": "option"
3278
3343
  }
3279
3344
  },
3280
3345
  "hasDynamicHelp": false,
3281
- "hiddenAliases": [
3282
- "document:query"
3283
- ],
3284
- "id": "documents:query",
3346
+ "hiddenAliases": [],
3347
+ "id": "graphql:undeploy",
3285
3348
  "pluginAlias": "@sanity/cli",
3286
3349
  "pluginName": "@sanity/cli",
3287
3350
  "pluginType": "core",
@@ -3290,40 +3353,47 @@
3290
3353
  "relativePath": [
3291
3354
  "dist",
3292
3355
  "commands",
3293
- "documents",
3294
- "query.js"
3356
+ "graphql",
3357
+ "undeploy.js"
3295
3358
  ]
3296
3359
  },
3297
- "documents:validate": {
3360
+ "documents:create": {
3298
3361
  "aliases": [],
3299
- "args": {},
3300
- "description": "Validate documents in a dataset against the studio schema",
3362
+ "args": {
3363
+ "file": {
3364
+ "description": "JSON file to create document(s) from",
3365
+ "name": "file",
3366
+ "required": false
3367
+ }
3368
+ },
3369
+ "description": "Create one or more documents",
3301
3370
  "examples": [
3302
3371
  {
3303
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
3304
- "description": "Validates all documents in a Sanity project with more than one workspace"
3372
+ "command": "<%= config.bin %> <%= command.id %> myDocument.json",
3373
+ "description": "Create the document specified in \"myDocument.json\""
3305
3374
  },
3306
3375
  {
3307
- "command": "<%= config.bin %> <%= command.id %> --workspace default --dataset staging",
3308
- "description": "Override the dataset specified in the workspace"
3376
+ "command": "<%= config.bin %> <%= command.id %>",
3377
+ "description": "Open configured $EDITOR and create the specified document(s)"
3309
3378
  },
3310
3379
  {
3311
- "command": "<%= config.bin %> <%= command.id %> --yes > report.txt",
3312
- "description": "Save the results of the report into a file"
3380
+ "command": "<%= config.bin %> <%= command.id %> --id myDocId --replace",
3381
+ "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"
3313
3382
  },
3314
3383
  {
3315
- "command": "<%= config.bin %> <%= command.id %> --level info",
3316
- "description": "Report out info level validation markers too"
3384
+ "command": "<%= config.bin %> <%= command.id %> --id myDocId --watch --replace --json5",
3385
+ "description": "Open configured $EDITOR and replace the document with the given content on each save. Use JSON5 file extension and parser for simplified syntax."
3317
3386
  },
3318
3387
  {
3319
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3320
- "description": "Validate documents in a specific project and dataset"
3388
+ "command": "<%= config.bin %> <%= command.id %> myDocument.json --project-id abc123",
3389
+ "description": "Create documents in a specific project"
3321
3390
  }
3322
3391
  ],
3323
3392
  "flags": {
3324
3393
  "project-id": {
3325
3394
  "char": "p",
3326
- "description": "Override the project ID used. By default, this is derived from the given workspace",
3395
+ "description": "Project ID to create document(s) in (overrides CLI configuration)",
3396
+ "helpGroup": "OVERRIDE",
3327
3397
  "name": "project-id",
3328
3398
  "hasDynamicHelp": false,
3329
3399
  "helpValue": "<id>",
@@ -3332,81 +3402,51 @@
3332
3402
  },
3333
3403
  "dataset": {
3334
3404
  "char": "d",
3335
- "description": "Override the dataset used. By default, this is derived from the given workspace",
3405
+ "description": "Dataset to create document(s) in (overrides CLI configuration)",
3406
+ "helpGroup": "OVERRIDE",
3336
3407
  "name": "dataset",
3337
3408
  "hasDynamicHelp": false,
3338
3409
  "helpValue": "<name>",
3339
3410
  "multiple": false,
3340
3411
  "type": "option"
3341
3412
  },
3342
- "file": {
3343
- "description": "Path to an NDJSON file or tar archive containing an NDJSON file (optionally gzip-compressed)",
3344
- "name": "file",
3413
+ "id": {
3414
+ "description": "Specify a document ID to use. Will fetch remote document ID and populate editor.",
3415
+ "name": "id",
3345
3416
  "hasDynamicHelp": false,
3346
3417
  "multiple": false,
3347
3418
  "type": "option"
3348
3419
  },
3349
- "format": {
3350
- "description": "The output format used to print the found validation markers and report progress",
3351
- "name": "format",
3352
- "hasDynamicHelp": false,
3353
- "multiple": false,
3354
- "options": [
3355
- "json",
3356
- "ndjson",
3357
- "pretty"
3358
- ],
3359
- "type": "option"
3420
+ "json5": {
3421
+ "description": "Use JSON5 file type to allow a \"simplified\" version of JSON",
3422
+ "name": "json5",
3423
+ "allowNo": false,
3424
+ "type": "boolean"
3360
3425
  },
3361
- "level": {
3362
- "description": "The minimum level reported. Defaults to warning",
3363
- "name": "level",
3364
- "default": "warning",
3365
- "hasDynamicHelp": false,
3366
- "multiple": false,
3367
- "options": [
3368
- "error",
3369
- "warning",
3370
- "info"
3371
- ],
3372
- "type": "option"
3373
- },
3374
- "max-custom-validation-concurrency": {
3375
- "description": "Specify how many custom validators can run concurrently",
3376
- "name": "max-custom-validation-concurrency",
3377
- "default": 5,
3378
- "hasDynamicHelp": false,
3379
- "multiple": false,
3380
- "type": "option"
3381
- },
3382
- "max-fetch-concurrency": {
3383
- "description": "Specify how many `client.fetch` requests are allowed to run concurrently",
3384
- "name": "max-fetch-concurrency",
3385
- "default": 25,
3386
- "hasDynamicHelp": false,
3387
- "multiple": false,
3388
- "type": "option"
3426
+ "missing": {
3427
+ "description": "On duplicate document IDs, don't modify the target document(s)",
3428
+ "name": "missing",
3429
+ "allowNo": false,
3430
+ "type": "boolean"
3389
3431
  },
3390
- "workspace": {
3391
- "description": "The name of the workspace to use when downloading and validating all documents",
3392
- "name": "workspace",
3393
- "hasDynamicHelp": false,
3394
- "multiple": false,
3395
- "type": "option"
3432
+ "replace": {
3433
+ "description": "On duplicate document IDs, replace existing document with specified document(s)",
3434
+ "name": "replace",
3435
+ "allowNo": false,
3436
+ "type": "boolean"
3396
3437
  },
3397
- "yes": {
3398
- "char": "y",
3399
- "description": "Skips the first confirmation prompt",
3400
- "name": "yes",
3438
+ "watch": {
3439
+ "description": "Write the documents whenever the target file or buffer changes",
3440
+ "name": "watch",
3401
3441
  "allowNo": false,
3402
3442
  "type": "boolean"
3403
3443
  }
3404
3444
  },
3405
3445
  "hasDynamicHelp": false,
3406
3446
  "hiddenAliases": [
3407
- "document:validate"
3447
+ "document:create"
3408
3448
  ],
3409
- "id": "documents:validate",
3449
+ "id": "documents:create",
3410
3450
  "pluginAlias": "@sanity/cli",
3411
3451
  "pluginName": "@sanity/cli",
3412
3452
  "pluginType": "core",
@@ -3416,142 +3456,146 @@
3416
3456
  "dist",
3417
3457
  "commands",
3418
3458
  "documents",
3419
- "validate.js"
3459
+ "create.js"
3420
3460
  ]
3421
3461
  },
3422
- "graphql:deploy": {
3462
+ "documents:delete": {
3423
3463
  "aliases": [],
3424
- "args": {},
3425
- "description": "Deploy a GraphQL API from the current Sanity schema",
3464
+ "args": {
3465
+ "id": {
3466
+ "description": "Document ID to delete",
3467
+ "name": "id",
3468
+ "required": true
3469
+ },
3470
+ "ids": {
3471
+ "description": "Additional document IDs to delete",
3472
+ "name": "ids",
3473
+ "required": false
3474
+ }
3475
+ },
3476
+ "description": "Delete one or more documents from the project's configured dataset",
3426
3477
  "examples": [
3427
3478
  {
3428
- "command": "<%= config.bin %> <%= command.id %>",
3429
- "description": "Deploy all defined GraphQL APIs"
3479
+ "command": "<%= config.bin %> <%= command.id %> myDocId",
3480
+ "description": "Delete the document with the ID \"myDocId\""
3430
3481
  },
3431
3482
  {
3432
- "command": "<%= config.bin %> <%= command.id %> --dry-run",
3433
- "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy"
3483
+ "command": "<%= config.bin %> <%= command.id %> 'myDocId'",
3484
+ "description": "ID wrapped in double or single quote works equally well"
3434
3485
  },
3435
3486
  {
3436
- "command": "<%= config.bin %> <%= command.id %> --api staging --api ios",
3437
- "description": "Deploy only the GraphQL APIs with the IDs \"staging\" and \"ios\""
3487
+ "command": "<%= config.bin %> <%= command.id %> --dataset=blog someDocId",
3488
+ "description": "Delete document with ID \"someDocId\" from dataset \"blog\""
3438
3489
  },
3439
3490
  {
3440
- "command": "<%= config.bin %> <%= command.id %> --playground",
3441
- "description": "Deploy all defined GraphQL APIs, overriding any playground setting"
3491
+ "command": "<%= config.bin %> <%= command.id %> doc1 doc2",
3492
+ "description": "Delete the document with ID \"doc1\" and \"doc2\""
3493
+ },
3494
+ {
3495
+ "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3496
+ "description": "Delete a document from a specific project"
3442
3497
  }
3443
3498
  ],
3444
3499
  "flags": {
3445
- "api": {
3446
- "description": "Only deploy API with this ID (can be specified multiple times)",
3447
- "name": "api",
3500
+ "project-id": {
3501
+ "char": "p",
3502
+ "description": "Project ID to delete from (overrides CLI configuration)",
3503
+ "helpGroup": "OVERRIDE",
3504
+ "name": "project-id",
3448
3505
  "hasDynamicHelp": false,
3449
- "multiple": true,
3506
+ "helpValue": "<id>",
3507
+ "multiple": false,
3450
3508
  "type": "option"
3451
3509
  },
3452
3510
  "dataset": {
3453
3511
  "char": "d",
3454
- "description": "Deploy API for the given dataset",
3512
+ "description": "Dataset to delete from (overrides CLI configuration)",
3513
+ "helpGroup": "OVERRIDE",
3455
3514
  "name": "dataset",
3456
3515
  "hasDynamicHelp": false,
3457
3516
  "helpValue": "<name>",
3458
3517
  "multiple": false,
3459
3518
  "type": "option"
3460
- },
3461
- "dry-run": {
3462
- "description": "Validate defined GraphQL APIs, check for breaking changes, skip deploy",
3463
- "name": "dry-run",
3464
- "allowNo": false,
3465
- "type": "boolean"
3466
- },
3467
- "force": {
3468
- "description": "Deploy API without confirming breaking changes",
3469
- "name": "force",
3470
- "allowNo": false,
3471
- "type": "boolean"
3472
- },
3473
- "generation": {
3474
- "description": "API generation to deploy (defaults to \"gen3\")",
3475
- "name": "generation",
3476
- "hasDynamicHelp": false,
3477
- "multiple": false,
3478
- "options": [
3479
- "gen1",
3480
- "gen2",
3481
- "gen3"
3482
- ],
3483
- "type": "option"
3484
- },
3485
- "non-null-document-fields": {
3486
- "description": "Use non-null document fields (_id, _type etc)",
3487
- "name": "non-null-document-fields",
3488
- "allowNo": false,
3489
- "type": "boolean"
3490
- },
3491
- "playground": {
3492
- "description": "Enable GraphQL playground for easier debugging",
3493
- "name": "playground",
3494
- "allowNo": true,
3495
- "type": "boolean"
3496
- },
3497
- "tag": {
3498
- "description": "Deploy API(s) to given tag (defaults to \"default\")",
3499
- "name": "tag",
3500
- "hasDynamicHelp": false,
3501
- "multiple": false,
3502
- "type": "option"
3503
- },
3504
- "with-union-cache": {
3505
- "description": "Cache union types (faster for schemas with many self-references)",
3506
- "name": "with-union-cache",
3507
- "allowNo": false,
3508
- "type": "boolean"
3509
3519
  }
3510
3520
  },
3511
3521
  "hasDynamicHelp": false,
3512
- "hiddenAliases": [],
3513
- "id": "graphql:deploy",
3522
+ "hiddenAliases": [
3523
+ "document:delete"
3524
+ ],
3525
+ "id": "documents:delete",
3514
3526
  "pluginAlias": "@sanity/cli",
3515
3527
  "pluginName": "@sanity/cli",
3516
3528
  "pluginType": "core",
3517
- "strict": true,
3529
+ "strict": false,
3518
3530
  "isESM": true,
3519
3531
  "relativePath": [
3520
3532
  "dist",
3521
3533
  "commands",
3522
- "graphql",
3523
- "deploy.js"
3534
+ "documents",
3535
+ "delete.js"
3524
3536
  ]
3525
3537
  },
3526
- "graphql:list": {
3538
+ "documents:get": {
3527
3539
  "aliases": [],
3528
- "args": {},
3529
- "description": "List deployed GraphQL endpoints for the project",
3540
+ "args": {
3541
+ "documentId": {
3542
+ "description": "Document ID to retrieve",
3543
+ "name": "documentId",
3544
+ "required": true
3545
+ }
3546
+ },
3547
+ "description": "Get and print a document by ID",
3530
3548
  "examples": [
3531
3549
  {
3532
- "command": "<%= config.bin %> <%= command.id %>",
3533
- "description": "List GraphQL endpoints for the project"
3550
+ "command": "<%= config.bin %> <%= command.id %> myDocId",
3551
+ "description": "Get the document with ID \"myDocId\""
3534
3552
  },
3535
3553
  {
3536
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
3537
- "description": "List GraphQL endpoints for a specific project"
3554
+ "command": "<%= config.bin %> <%= command.id %> myDocId --pretty",
3555
+ "description": "Get document with colorized JSON output"
3556
+ },
3557
+ {
3558
+ "command": "<%= config.bin %> <%= command.id %> myDocId --dataset production",
3559
+ "description": "Get document from a specific dataset"
3560
+ },
3561
+ {
3562
+ "command": "<%= config.bin %> <%= command.id %> myDocId --project-id abc123",
3563
+ "description": "Get a document from a specific project"
3538
3564
  }
3539
3565
  ],
3540
3566
  "flags": {
3541
3567
  "project-id": {
3542
3568
  "char": "p",
3543
- "description": "Project ID to list GraphQL endpoints for (overrides CLI configuration)",
3569
+ "description": "Project ID to get document from (overrides CLI configuration)",
3544
3570
  "helpGroup": "OVERRIDE",
3545
3571
  "name": "project-id",
3546
3572
  "hasDynamicHelp": false,
3547
3573
  "helpValue": "<id>",
3548
3574
  "multiple": false,
3549
3575
  "type": "option"
3576
+ },
3577
+ "dataset": {
3578
+ "char": "d",
3579
+ "description": "Dataset to get document from (overrides CLI configuration)",
3580
+ "helpGroup": "OVERRIDE",
3581
+ "name": "dataset",
3582
+ "hasDynamicHelp": false,
3583
+ "helpValue": "<name>",
3584
+ "multiple": false,
3585
+ "type": "option"
3586
+ },
3587
+ "pretty": {
3588
+ "description": "Colorize JSON output",
3589
+ "name": "pretty",
3590
+ "allowNo": false,
3591
+ "type": "boolean"
3550
3592
  }
3551
3593
  },
3552
3594
  "hasDynamicHelp": false,
3553
- "hiddenAliases": [],
3554
- "id": "graphql:list",
3595
+ "hiddenAliases": [
3596
+ "document:get"
3597
+ ],
3598
+ "id": "documents:get",
3555
3599
  "pluginAlias": "@sanity/cli",
3556
3600
  "pluginName": "@sanity/cli",
3557
3601
  "pluginType": "core",
@@ -3560,44 +3604,42 @@
3560
3604
  "relativePath": [
3561
3605
  "dist",
3562
3606
  "commands",
3563
- "graphql",
3564
- "list.js"
3607
+ "documents",
3608
+ "get.js"
3565
3609
  ]
3566
3610
  },
3567
- "graphql:undeploy": {
3611
+ "documents:query": {
3568
3612
  "aliases": [],
3569
- "args": {},
3570
- "description": "Remove a deployed GraphQL API",
3613
+ "args": {
3614
+ "query": {
3615
+ "description": "GROQ query to run against the dataset",
3616
+ "name": "query",
3617
+ "required": true
3618
+ }
3619
+ },
3620
+ "description": "Query for documents",
3571
3621
  "examples": [
3572
3622
  {
3573
- "command": "<%= config.bin %> <%= command.id %>",
3574
- "description": "Undeploy GraphQL API for current project and dataset"
3575
- },
3576
- {
3577
- "command": "<%= config.bin %> <%= command.id %> --api ios",
3578
- "description": "Undeploy API with ID \"ios\""
3579
- },
3580
- {
3581
- "command": "<%= config.bin %> <%= command.id %> --dataset staging",
3582
- "description": "Undeploy GraphQL API for staging dataset"
3623
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"][0..4]'",
3624
+ "description": "Fetch 5 documents of type \"movie\""
3583
3625
  },
3584
3626
  {
3585
- "command": "<%= config.bin %> <%= command.id %> --dataset staging --tag next",
3586
- "description": "Undeploy GraphQL API for staging dataset with \"next\" tag"
3627
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"movie\"]|order(releaseDate asc)[0]{title}' --dataset staging",
3628
+ "description": "Fetch title of the oldest movie in the dataset named \"staging\""
3587
3629
  },
3588
3630
  {
3589
- "command": "<%= config.bin %> <%= command.id %> --force",
3590
- "description": "Undeploy GraphQL API without confirmation prompt"
3631
+ "command": "<%= config.bin %> <%= command.id %> '*[_id == \"header\"] { \"headerText\": pt::text(body) }' --api-version v2021-06-07",
3632
+ "description": "Use API version v2021-06-07 and do a query"
3591
3633
  },
3592
3634
  {
3593
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3594
- "description": "Undeploy GraphQL API for a specific project and dataset"
3635
+ "command": "<%= config.bin %> <%= command.id %> '*[_type == \"post\"]' --project-id abc123 --dataset production",
3636
+ "description": "Query documents in a specific project and dataset"
3595
3637
  }
3596
3638
  ],
3597
3639
  "flags": {
3598
3640
  "project-id": {
3599
3641
  "char": "p",
3600
- "description": "Project ID to undeploy GraphQL API from (overrides CLI configuration)",
3642
+ "description": "Project ID to query (overrides CLI configuration)",
3601
3643
  "helpGroup": "OVERRIDE",
3602
3644
  "name": "project-id",
3603
3645
  "hasDynamicHelp": false,
@@ -3605,21 +3647,9 @@
3605
3647
  "multiple": false,
3606
3648
  "type": "option"
3607
3649
  },
3608
- "api": {
3609
- "description": "Undeploy API with this ID",
3610
- "exclusive": [
3611
- "project-id",
3612
- "project"
3613
- ],
3614
- "name": "api",
3615
- "required": false,
3616
- "hasDynamicHelp": false,
3617
- "multiple": false,
3618
- "type": "option"
3619
- },
3620
3650
  "dataset": {
3621
3651
  "char": "d",
3622
- "description": "Dataset to undeploy GraphQL API from (overrides CLI configuration)",
3652
+ "description": "Dataset to query (overrides CLI configuration)",
3623
3653
  "helpGroup": "OVERRIDE",
3624
3654
  "name": "dataset",
3625
3655
  "hasDynamicHelp": false,
@@ -3627,9 +3657,22 @@
3627
3657
  "multiple": false,
3628
3658
  "type": "option"
3629
3659
  },
3630
- "force": {
3631
- "description": "Skip confirmation prompt",
3632
- "name": "force",
3660
+ "anonymous": {
3661
+ "description": "Send the query without any authorization token",
3662
+ "name": "anonymous",
3663
+ "allowNo": false,
3664
+ "type": "boolean"
3665
+ },
3666
+ "api-version": {
3667
+ "description": "API version to use (defaults to 2025-08-15)",
3668
+ "name": "api-version",
3669
+ "hasDynamicHelp": false,
3670
+ "multiple": false,
3671
+ "type": "option"
3672
+ },
3673
+ "pretty": {
3674
+ "description": "Colorize JSON output",
3675
+ "name": "pretty",
3633
3676
  "allowNo": false,
3634
3677
  "type": "boolean"
3635
3678
  },
@@ -3637,27 +3680,19 @@
3637
3680
  "deprecated": {
3638
3681
  "to": "project-id"
3639
3682
  },
3640
- "description": "Project ID to delete GraphQL API for",
3683
+ "description": "Project ID to query",
3641
3684
  "hidden": true,
3642
3685
  "name": "project",
3643
- "required": false,
3644
- "hasDynamicHelp": false,
3645
- "multiple": false,
3646
- "type": "option"
3647
- },
3648
- "tag": {
3649
- "description": "Tag to undeploy GraphQL API from",
3650
- "name": "tag",
3651
- "required": false,
3652
- "default": "default",
3653
3686
  "hasDynamicHelp": false,
3654
3687
  "multiple": false,
3655
3688
  "type": "option"
3656
3689
  }
3657
3690
  },
3658
3691
  "hasDynamicHelp": false,
3659
- "hiddenAliases": [],
3660
- "id": "graphql:undeploy",
3692
+ "hiddenAliases": [
3693
+ "document:query"
3694
+ ],
3695
+ "id": "documents:query",
3661
3696
  "pluginAlias": "@sanity/cli",
3662
3697
  "pluginName": "@sanity/cli",
3663
3698
  "pluginType": "core",
@@ -3666,122 +3701,123 @@
3666
3701
  "relativePath": [
3667
3702
  "dist",
3668
3703
  "commands",
3669
- "graphql",
3670
- "undeploy.js"
3704
+ "documents",
3705
+ "query.js"
3671
3706
  ]
3672
3707
  },
3673
- "docs:browse": {
3708
+ "documents:validate": {
3674
3709
  "aliases": [],
3675
3710
  "args": {},
3676
- "description": "Open Sanity docs in your browser",
3677
- "flags": {},
3678
- "hasDynamicHelp": false,
3679
- "hiddenAliases": [],
3680
- "id": "docs:browse",
3681
- "pluginAlias": "@sanity/cli",
3682
- "pluginName": "@sanity/cli",
3683
- "pluginType": "core",
3684
- "strict": true,
3685
- "enableJsonFlag": false,
3686
- "isESM": true,
3687
- "relativePath": [
3688
- "dist",
3689
- "commands",
3690
- "docs",
3691
- "browse.js"
3692
- ]
3693
- },
3694
- "docs:read": {
3695
- "aliases": [],
3696
- "args": {
3697
- "path": {
3698
- "description": "Path or URL to article, found in search results and docs content as links",
3699
- "name": "path",
3700
- "required": true
3701
- }
3702
- },
3703
- "description": "Read an article in terminal",
3711
+ "description": "Validate documents in a dataset against the studio schema",
3704
3712
  "examples": [
3705
3713
  {
3706
- "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation",
3707
- "description": "Read as markdown in terminal"
3714
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
3715
+ "description": "Validates all documents in a Sanity project with more than one workspace"
3708
3716
  },
3709
3717
  {
3710
- "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
3711
- "description": "Read using full URL"
3718
+ "command": "<%= config.bin %> <%= command.id %> --workspace default --dataset staging",
3719
+ "description": "Override the dataset specified in the workspace"
3712
3720
  },
3713
3721
  {
3714
- "command": "<%= config.bin %> <%= command.id %> /docs/studio/installation --web",
3715
- "description": "Open in web browser"
3722
+ "command": "<%= config.bin %> <%= command.id %> --yes > report.txt",
3723
+ "description": "Save the results of the report into a file"
3716
3724
  },
3717
3725
  {
3718
- "command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation -w",
3719
- "description": "Open using full URL in web browser"
3726
+ "command": "<%= config.bin %> <%= command.id %> --level info",
3727
+ "description": "Report out info level validation markers too"
3728
+ },
3729
+ {
3730
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123 --dataset production",
3731
+ "description": "Validate documents in a specific project and dataset"
3720
3732
  }
3721
3733
  ],
3722
3734
  "flags": {
3723
- "web": {
3724
- "aliases": [
3725
- "w"
3735
+ "project-id": {
3736
+ "char": "p",
3737
+ "description": "Override the project ID used. By default, this is derived from the given workspace",
3738
+ "name": "project-id",
3739
+ "hasDynamicHelp": false,
3740
+ "helpValue": "<id>",
3741
+ "multiple": false,
3742
+ "type": "option"
3743
+ },
3744
+ "dataset": {
3745
+ "char": "d",
3746
+ "description": "Override the dataset used. By default, this is derived from the given workspace",
3747
+ "name": "dataset",
3748
+ "hasDynamicHelp": false,
3749
+ "helpValue": "<name>",
3750
+ "multiple": false,
3751
+ "type": "option"
3752
+ },
3753
+ "file": {
3754
+ "description": "Path to an NDJSON file or tar archive containing an NDJSON file (optionally gzip-compressed)",
3755
+ "name": "file",
3756
+ "hasDynamicHelp": false,
3757
+ "multiple": false,
3758
+ "type": "option"
3759
+ },
3760
+ "format": {
3761
+ "description": "The output format used to print the found validation markers and report progress",
3762
+ "name": "format",
3763
+ "hasDynamicHelp": false,
3764
+ "multiple": false,
3765
+ "options": [
3766
+ "json",
3767
+ "ndjson",
3768
+ "pretty"
3726
3769
  ],
3727
- "description": "Open in a web browser",
3728
- "name": "web",
3729
- "allowNo": false,
3730
- "type": "boolean"
3731
- }
3732
- },
3733
- "hasDynamicHelp": false,
3734
- "hiddenAliases": [],
3735
- "id": "docs:read",
3736
- "pluginAlias": "@sanity/cli",
3737
- "pluginName": "@sanity/cli",
3738
- "pluginType": "core",
3739
- "strict": true,
3740
- "isESM": true,
3741
- "relativePath": [
3742
- "dist",
3743
- "commands",
3744
- "docs",
3745
- "read.js"
3746
- ]
3747
- },
3748
- "docs:search": {
3749
- "aliases": [],
3750
- "args": {
3751
- "query": {
3752
- "description": "Search query for documentation",
3753
- "name": "query",
3754
- "required": true
3755
- }
3756
- },
3757
- "description": "Search Sanity docs",
3758
- "examples": [
3759
- {
3760
- "command": "<%= config.bin %> <%= command.id %> schema",
3761
- "description": "Search for documentation about schemas"
3770
+ "type": "option"
3762
3771
  },
3763
- {
3764
- "command": "<%= config.bin %> <%= command.id %> \"groq functions\"",
3765
- "description": "Search with phrase"
3772
+ "level": {
3773
+ "description": "The minimum level reported. Defaults to warning",
3774
+ "name": "level",
3775
+ "default": "warning",
3776
+ "hasDynamicHelp": false,
3777
+ "multiple": false,
3778
+ "options": [
3779
+ "error",
3780
+ "warning",
3781
+ "info"
3782
+ ],
3783
+ "type": "option"
3766
3784
  },
3767
- {
3768
- "command": "<%= config.bin %> <%= command.id %> \"deployment\" --limit=5",
3769
- "description": "Limit search results"
3770
- }
3771
- ],
3772
- "flags": {
3773
- "limit": {
3774
- "description": "Maximum number of results to return",
3775
- "name": "limit",
3776
- "default": 10,
3785
+ "max-custom-validation-concurrency": {
3786
+ "description": "Specify how many custom validators can run concurrently",
3787
+ "name": "max-custom-validation-concurrency",
3788
+ "default": 5,
3777
3789
  "hasDynamicHelp": false,
3778
3790
  "multiple": false,
3779
3791
  "type": "option"
3792
+ },
3793
+ "max-fetch-concurrency": {
3794
+ "description": "Specify how many `client.fetch` requests are allowed to run concurrently",
3795
+ "name": "max-fetch-concurrency",
3796
+ "default": 25,
3797
+ "hasDynamicHelp": false,
3798
+ "multiple": false,
3799
+ "type": "option"
3800
+ },
3801
+ "workspace": {
3802
+ "description": "The name of the workspace to use when downloading and validating all documents",
3803
+ "name": "workspace",
3804
+ "hasDynamicHelp": false,
3805
+ "multiple": false,
3806
+ "type": "option"
3807
+ },
3808
+ "yes": {
3809
+ "char": "y",
3810
+ "description": "Skips the first confirmation prompt",
3811
+ "name": "yes",
3812
+ "allowNo": false,
3813
+ "type": "boolean"
3780
3814
  }
3781
3815
  },
3782
3816
  "hasDynamicHelp": false,
3783
- "hiddenAliases": [],
3784
- "id": "docs:search",
3817
+ "hiddenAliases": [
3818
+ "document:validate"
3819
+ ],
3820
+ "id": "documents:validate",
3785
3821
  "pluginAlias": "@sanity/cli",
3786
3822
  "pluginName": "@sanity/cli",
3787
3823
  "pluginType": "core",
@@ -3790,8 +3826,8 @@
3790
3826
  "relativePath": [
3791
3827
  "dist",
3792
3828
  "commands",
3793
- "docs",
3794
- "search.js"
3829
+ "documents",
3830
+ "validate.js"
3795
3831
  ]
3796
3832
  },
3797
3833
  "hooks:attempt": {
@@ -4042,23 +4078,88 @@
4042
4078
  "logs.js"
4043
4079
  ]
4044
4080
  },
4045
- "media:create-aspect": {
4081
+ "manifest:extract": {
4046
4082
  "aliases": [],
4047
4083
  "args": {},
4048
- "description": "Create a new aspect definition file",
4084
+ "description": "Extract studio configuration as JSON manifest files.\n\nNote: This command is experimental and subject to change. It is currently intended for use with Create only.",
4049
4085
  "examples": [
4050
4086
  {
4051
4087
  "command": "<%= config.bin %> <%= command.id %>",
4052
- "description": "Create a new aspect definition file"
4088
+ "description": "Extracts manifests"
4089
+ },
4090
+ {
4091
+ "command": "<%= config.bin %> <%= command.id %> --path /public/static",
4092
+ "description": "Extracts manifests into /public/static"
4053
4093
  }
4054
4094
  ],
4055
4095
  "flags": {
4056
- "name": {
4057
- "description": "Aspect name. Defaults to the title in camel case",
4058
- "name": "name",
4059
- "hasDynamicHelp": false,
4060
- "multiple": false,
4061
- "type": "option"
4096
+ "path": {
4097
+ "description": "Optional path to specify destination directory of the manifest files",
4098
+ "name": "path",
4099
+ "default": "dist/static",
4100
+ "hasDynamicHelp": false,
4101
+ "multiple": false,
4102
+ "type": "option"
4103
+ }
4104
+ },
4105
+ "hasDynamicHelp": false,
4106
+ "hiddenAliases": [],
4107
+ "id": "manifest:extract",
4108
+ "pluginAlias": "@sanity/cli",
4109
+ "pluginName": "@sanity/cli",
4110
+ "pluginType": "core",
4111
+ "strict": true,
4112
+ "isESM": true,
4113
+ "relativePath": [
4114
+ "dist",
4115
+ "commands",
4116
+ "manifest",
4117
+ "extract.js"
4118
+ ]
4119
+ },
4120
+ "mcp:configure": {
4121
+ "aliases": [],
4122
+ "args": {},
4123
+ "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)",
4124
+ "examples": [
4125
+ {
4126
+ "command": "<%= config.bin %> <%= command.id %>",
4127
+ "description": "Configure Sanity MCP server for detected AI editors"
4128
+ }
4129
+ ],
4130
+ "flags": {},
4131
+ "hasDynamicHelp": false,
4132
+ "hiddenAliases": [],
4133
+ "id": "mcp:configure",
4134
+ "pluginAlias": "@sanity/cli",
4135
+ "pluginName": "@sanity/cli",
4136
+ "pluginType": "core",
4137
+ "strict": true,
4138
+ "isESM": true,
4139
+ "relativePath": [
4140
+ "dist",
4141
+ "commands",
4142
+ "mcp",
4143
+ "configure.js"
4144
+ ]
4145
+ },
4146
+ "media:create-aspect": {
4147
+ "aliases": [],
4148
+ "args": {},
4149
+ "description": "Create a new aspect definition file",
4150
+ "examples": [
4151
+ {
4152
+ "command": "<%= config.bin %> <%= command.id %>",
4153
+ "description": "Create a new aspect definition file"
4154
+ }
4155
+ ],
4156
+ "flags": {
4157
+ "name": {
4158
+ "description": "Aspect name. Defaults to the title in camel case",
4159
+ "name": "name",
4160
+ "hasDynamicHelp": false,
4161
+ "multiple": false,
4162
+ "type": "option"
4062
4163
  },
4063
4164
  "title": {
4064
4165
  "description": "Aspect title",
@@ -5094,83 +5195,20 @@
5094
5195
  "unclaimed.js"
5095
5196
  ]
5096
5197
  },
5097
- "schemas:delete": {
5198
+ "skills:install": {
5098
5199
  "aliases": [],
5099
5200
  "args": {},
5100
- "description": "Delete schema documents by id",
5201
+ "description": "Install Sanity agent skills for detected AI editors (Antigravity, Claude Code, Cline, Cline CLI, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, VS Code, VS Code Insiders)",
5101
5202
  "examples": [
5102
5203
  {
5103
- "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName",
5104
- "description": "Delete a single schema"
5105
- },
5106
- {
5107
- "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName,prefix.sanity.workspace.schema.otherWorkspace",
5108
- "description": "Delete multiple schemas"
5204
+ "command": "<%= config.bin %> <%= command.id %>",
5205
+ "description": "Install Sanity agent skills for detected AI editors"
5109
5206
  }
5110
5207
  ],
5111
- "flags": {
5112
- "project-id": {
5113
- "char": "p",
5114
- "description": "Project ID to delete schema from (overrides CLI configuration)",
5115
- "helpGroup": "OVERRIDE",
5116
- "name": "project-id",
5117
- "hasDynamicHelp": false,
5118
- "helpValue": "<id>",
5119
- "multiple": false,
5120
- "type": "option"
5121
- },
5122
- "dataset": {
5123
- "char": "d",
5124
- "description": "Delete schemas from a specific dataset",
5125
- "name": "dataset",
5126
- "hasDynamicHelp": false,
5127
- "helpValue": "<name>",
5128
- "multiple": false,
5129
- "type": "option"
5130
- },
5131
- "extract-manifest": {
5132
- "description": "Generate manifest file (disable with --no-extract-manifest)",
5133
- "hidden": true,
5134
- "name": "extract-manifest",
5135
- "allowNo": true,
5136
- "type": "boolean"
5137
- },
5138
- "ids": {
5139
- "description": "Comma-separated list of schema ids to delete",
5140
- "name": "ids",
5141
- "required": true,
5142
- "hasDynamicHelp": false,
5143
- "multiple": false,
5144
- "type": "option"
5145
- },
5146
- "manifest-dir": {
5147
- "description": "Directory containing manifest file",
5148
- "hidden": true,
5149
- "name": "manifest-dir",
5150
- "default": "./dist/static",
5151
- "hasDynamicHelp": false,
5152
- "multiple": false,
5153
- "type": "option"
5154
- },
5155
- "verbose": {
5156
- "description": "Enable verbose logging",
5157
- "name": "verbose",
5158
- "allowNo": false,
5159
- "type": "boolean"
5160
- },
5161
- "yes": {
5162
- "char": "y",
5163
- "description": "Delete schemas without prompting for confirmation",
5164
- "name": "yes",
5165
- "allowNo": false,
5166
- "type": "boolean"
5167
- }
5168
- },
5208
+ "flags": {},
5169
5209
  "hasDynamicHelp": false,
5170
- "hiddenAliases": [
5171
- "schema:delete"
5172
- ],
5173
- "id": "schemas:delete",
5210
+ "hiddenAliases": [],
5211
+ "id": "skills:install",
5174
5212
  "pluginAlias": "@sanity/cli",
5175
5213
  "pluginName": "@sanity/cli",
5176
5214
  "pluginType": "core",
@@ -5179,68 +5217,24 @@
5179
5217
  "relativePath": [
5180
5218
  "dist",
5181
5219
  "commands",
5182
- "schemas",
5183
- "delete.js"
5220
+ "skills",
5221
+ "install.js"
5184
5222
  ]
5185
5223
  },
5186
- "schemas:deploy": {
5224
+ "telemetry:disable": {
5187
5225
  "aliases": [],
5188
5226
  "args": {},
5189
- "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.",
5227
+ "description": "Disable telemetry for your account",
5190
5228
  "examples": [
5191
5229
  {
5192
- "command": "<%= config.bin %> <%= command.id %>",
5193
- "description": "Deploy all workspace schemas"
5194
- },
5195
- {
5196
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
5197
- "description": "Deploy the schema for only the workspace \"default\""
5230
+ "command": "<%= config.bin %> telemetry <%= command.id %>",
5231
+ "description": "Disable telemetry for your account"
5198
5232
  }
5199
5233
  ],
5200
- "flags": {
5201
- "extract-manifest": {
5202
- "description": "Regenerate manifest before deploying (use --no-extract-manifest to skip)",
5203
- "name": "extract-manifest",
5204
- "allowNo": true,
5205
- "type": "boolean"
5206
- },
5207
- "manifest-dir": {
5208
- "description": "Directory containing manifest file",
5209
- "name": "manifest-dir",
5210
- "default": "./dist/static",
5211
- "hasDynamicHelp": false,
5212
- "helpValue": "<directory>",
5213
- "multiple": false,
5214
- "type": "option"
5215
- },
5216
- "tag": {
5217
- "description": "Add a tag suffix to the schema id",
5218
- "name": "tag",
5219
- "hasDynamicHelp": false,
5220
- "helpValue": "<tag>",
5221
- "multiple": false,
5222
- "type": "option"
5223
- },
5224
- "verbose": {
5225
- "description": "Print detailed information during deployment",
5226
- "name": "verbose",
5227
- "allowNo": false,
5228
- "type": "boolean"
5229
- },
5230
- "workspace": {
5231
- "description": "The name of the workspace to deploy a schema for",
5232
- "name": "workspace",
5233
- "hasDynamicHelp": false,
5234
- "helpValue": "<name>",
5235
- "multiple": false,
5236
- "type": "option"
5237
- }
5238
- },
5234
+ "flags": {},
5239
5235
  "hasDynamicHelp": false,
5240
- "hiddenAliases": [
5241
- "schema:deploy"
5242
- ],
5243
- "id": "schemas:deploy",
5236
+ "hiddenAliases": [],
5237
+ "id": "telemetry:disable",
5244
5238
  "pluginAlias": "@sanity/cli",
5245
5239
  "pluginName": "@sanity/cli",
5246
5240
  "pluginType": "core",
@@ -5249,85 +5243,163 @@
5249
5243
  "relativePath": [
5250
5244
  "dist",
5251
5245
  "commands",
5252
- "schemas",
5253
- "deploy.js"
5246
+ "telemetry",
5247
+ "disable.js"
5254
5248
  ]
5255
5249
  },
5256
- "schemas:extract": {
5250
+ "telemetry:enable": {
5257
5251
  "aliases": [],
5258
5252
  "args": {},
5259
- "description": "Extract a JSON representation of a Sanity schema within a Studio context.\n\nNote: This command is experimental and subject to change.",
5253
+ "description": "Enable telemetry for your account",
5260
5254
  "examples": [
5261
5255
  {
5262
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
5263
- "description": "Extracts schema types in a Sanity project with more than one workspace"
5264
- },
5265
- {
5266
- "command": "<%= config.bin %> <%= command.id %> --watch",
5267
- "description": "Watch mode - re-extract on changes"
5268
- },
5256
+ "command": "<%= config.bin %> telemetry <%= command.id %>",
5257
+ "description": "Enable telemetry for your account"
5258
+ }
5259
+ ],
5260
+ "flags": {},
5261
+ "hasDynamicHelp": false,
5262
+ "hiddenAliases": [],
5263
+ "id": "telemetry:enable",
5264
+ "pluginAlias": "@sanity/cli",
5265
+ "pluginName": "@sanity/cli",
5266
+ "pluginType": "core",
5267
+ "strict": true,
5268
+ "isESM": true,
5269
+ "relativePath": [
5270
+ "dist",
5271
+ "commands",
5272
+ "telemetry",
5273
+ "enable.js"
5274
+ ]
5275
+ },
5276
+ "telemetry:status": {
5277
+ "aliases": [],
5278
+ "args": {},
5279
+ "description": "Check telemetry status for your account",
5280
+ "examples": [
5269
5281
  {
5270
- "command": "<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"",
5271
- "description": "Watch with custom glob patterns"
5282
+ "command": "<%= config.bin %> telemetry <%= command.id %>",
5283
+ "description": "Check telemetry status for your account"
5272
5284
  }
5273
5285
  ],
5274
- "flags": {
5275
- "enforce-required-fields": {
5276
- "description": "Makes the schema generated treat fields marked as required as non-optional",
5277
- "name": "enforce-required-fields",
5278
- "allowNo": false,
5279
- "type": "boolean"
5286
+ "flags": {},
5287
+ "hasDynamicHelp": false,
5288
+ "hiddenAliases": [],
5289
+ "id": "telemetry:status",
5290
+ "pluginAlias": "@sanity/cli",
5291
+ "pluginName": "@sanity/cli",
5292
+ "pluginType": "core",
5293
+ "strict": true,
5294
+ "isESM": true,
5295
+ "relativePath": [
5296
+ "dist",
5297
+ "commands",
5298
+ "telemetry",
5299
+ "status.js"
5300
+ ]
5301
+ },
5302
+ "tokens:create": {
5303
+ "aliases": [],
5304
+ "args": {
5305
+ "label": {
5306
+ "description": "Label for the new token",
5307
+ "name": "label",
5308
+ "required": false
5309
+ }
5310
+ },
5311
+ "description": "Create a new API token with access to an organization and its projects",
5312
+ "examples": [
5313
+ {
5314
+ "command": "<%= config.bin %> <%= command.id %> \"My API Token\"",
5315
+ "description": "Create a token, choosing its access interactively"
5280
5316
  },
5281
- "force": {
5282
- "description": "Overwrite an existing schema file",
5283
- "name": "force",
5284
- "allowNo": false,
5285
- "type": "boolean"
5317
+ {
5318
+ "command": "<%= config.bin %> <%= command.id %> \"CI Token\" --grant context=developer --grant blueprints --grant project:abc123=editor",
5319
+ "description": "Create an organization token with Context, Blueprints and project access"
5286
5320
  },
5287
- "format": {
5288
- "description": "Output format (currently only groq-type-nodes)",
5289
- "name": "format",
5290
- "default": "groq-type-nodes",
5321
+ {
5322
+ "command": "<%= config.bin %> <%= command.id %> \"My Token\" --project-id abc123 --role=editor",
5323
+ "description": "Create a project token with editor role"
5324
+ },
5325
+ {
5326
+ "command": "<%= config.bin %> <%= command.id %> \"CI Token\" --role=editor --yes",
5327
+ "description": "Create a project token in unattended mode"
5328
+ },
5329
+ {
5330
+ "command": "<%= config.bin %> <%= command.id %> \"Build Token\" --expires-at 2027-01-01",
5331
+ "description": "Create a token that expires on a given date"
5332
+ },
5333
+ {
5334
+ "command": "<%= config.bin %> <%= command.id %> \"API Token\" --json",
5335
+ "description": "Output token information as JSON"
5336
+ }
5337
+ ],
5338
+ "flags": {
5339
+ "project-id": {
5340
+ "char": "p",
5341
+ "description": "Project ID to create token in (overrides CLI configuration)",
5342
+ "helpGroup": "OVERRIDE",
5343
+ "name": "project-id",
5291
5344
  "hasDynamicHelp": false,
5292
- "helpValue": "<format>",
5345
+ "helpValue": "<id>",
5293
5346
  "multiple": false,
5294
5347
  "type": "option"
5295
5348
  },
5296
- "path": {
5297
- "description": "Optional path to specify destination of the schema file",
5298
- "name": "path",
5349
+ "organization": {
5350
+ "description": "Organization to create an organization token in (overrides CLI configuration)",
5351
+ "helpGroup": "OVERRIDE",
5352
+ "name": "organization",
5299
5353
  "hasDynamicHelp": false,
5354
+ "helpValue": "<id>",
5300
5355
  "multiple": false,
5301
5356
  "type": "option"
5302
5357
  },
5303
- "watch": {
5304
- "description": "Enable watch mode to re-extract schema on file changes",
5305
- "name": "watch",
5306
- "allowNo": false,
5307
- "type": "boolean"
5358
+ "expires-at": {
5359
+ "description": "Date or timestamp the token expires (ISO 8601; tokens never expire by default)",
5360
+ "name": "expires-at",
5361
+ "hasDynamicHelp": false,
5362
+ "helpValue": "2027-01-01",
5363
+ "multiple": false,
5364
+ "type": "option"
5308
5365
  },
5309
- "watch-patterns": {
5310
- "description": "Additional glob pattern(s) to watch (can be specified multiple times)",
5311
- "name": "watch-patterns",
5366
+ "grant": {
5367
+ "description": "Access to grant, as <permission>[=<role>] or project:<projectId>=<role>[,<role>]. Permissions: context, blueprints, media-library, canvas, sdk-apps, access, deploy-studios. Repeatable",
5368
+ "name": "grant",
5312
5369
  "hasDynamicHelp": false,
5313
- "helpValue": "<glob>",
5370
+ "helpValue": "context=editor",
5314
5371
  "multiple": true,
5315
5372
  "type": "option"
5316
5373
  },
5317
- "workspace": {
5318
- "description": "The name of the workspace to generate a schema for",
5319
- "name": "workspace",
5374
+ "json": {
5375
+ "description": "Output as JSON",
5376
+ "name": "json",
5377
+ "allowNo": false,
5378
+ "type": "boolean"
5379
+ },
5380
+ "role": {
5381
+ "description": "Role to assign on the project (defaults to viewer in unattended mode)",
5382
+ "name": "role",
5320
5383
  "hasDynamicHelp": false,
5321
- "helpValue": "<name>",
5384
+ "helpValue": "viewer",
5322
5385
  "multiple": false,
5323
5386
  "type": "option"
5387
+ },
5388
+ "yes": {
5389
+ "char": "y",
5390
+ "description": "Skip prompts and use defaults (unattended mode)",
5391
+ "name": "yes",
5392
+ "allowNo": false,
5393
+ "type": "boolean"
5324
5394
  }
5325
5395
  },
5326
5396
  "hasDynamicHelp": false,
5327
5397
  "hiddenAliases": [
5328
- "schema:extract"
5398
+ "tokens:add",
5399
+ "token:add",
5400
+ "token:create"
5329
5401
  ],
5330
- "id": "schemas:extract",
5402
+ "id": "tokens:create",
5331
5403
  "pluginAlias": "@sanity/cli",
5332
5404
  "pluginName": "@sanity/cli",
5333
5405
  "pluginType": "core",
@@ -5336,70 +5408,81 @@
5336
5408
  "relativePath": [
5337
5409
  "dist",
5338
5410
  "commands",
5339
- "schemas",
5340
- "extract.js"
5411
+ "tokens",
5412
+ "create.js"
5341
5413
  ]
5342
5414
  },
5343
- "schemas:list": {
5415
+ "tokens:delete": {
5344
5416
  "aliases": [],
5345
- "args": {},
5346
- "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.",
5417
+ "args": {
5418
+ "tokenId": {
5419
+ "description": "Token ID to delete (will prompt if not provided)",
5420
+ "name": "tokenId",
5421
+ "required": false
5422
+ }
5423
+ },
5424
+ "description": "Delete an API token from a project or organization",
5347
5425
  "examples": [
5426
+ {
5427
+ "command": "<%= config.bin %> <%= command.id %> --organization org123",
5428
+ "description": "Interactively select and delete an organization token"
5429
+ },
5430
+ {
5431
+ "command": "<%= config.bin %> <%= command.id %> silJ2lFmK6dONB --organization org123 --yes",
5432
+ "description": "Delete an organization token without confirmation"
5433
+ },
5348
5434
  {
5349
5435
  "command": "<%= config.bin %> <%= command.id %>",
5350
- "description": "List all schemas found in any workspace dataset in a table"
5436
+ "description": "Interactively select and delete a token"
5351
5437
  },
5352
5438
  {
5353
- "command": "<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName",
5354
- "description": "Get a schema for a given id"
5439
+ "command": "<%= config.bin %> <%= command.id %> silJ2lFmK6dONB",
5440
+ "description": "Delete a specific token by ID"
5355
5441
  },
5356
5442
  {
5357
- "command": "<%= config.bin %> <%= command.id %> --json",
5358
- "description": "Get stored schemas as pretty-printed json-array"
5443
+ "command": "<%= config.bin %> <%= command.id %> silJ2lFmK6dONB --yes",
5444
+ "description": "Delete a specific token without confirmation prompt"
5359
5445
  },
5360
5446
  {
5361
- "command": "<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName",
5362
- "description": "Get singular stored schema as pretty-printed json-object"
5447
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
5448
+ "description": "Delete a token from a specific project"
5363
5449
  }
5364
5450
  ],
5365
5451
  "flags": {
5366
- "extract-manifest": {
5367
- "description": "Regenerate manifest before listing (use --no-extract-manifest to skip)",
5368
- "hidden": true,
5369
- "name": "extract-manifest",
5370
- "allowNo": true,
5371
- "type": "boolean"
5372
- },
5373
- "id": {
5374
- "description": "Fetch a single schema by id",
5375
- "name": "id",
5452
+ "organization": {
5453
+ "description": "Delete a token managed by this organization",
5454
+ "exclusive": [
5455
+ "project-id"
5456
+ ],
5457
+ "name": "organization",
5376
5458
  "hasDynamicHelp": false,
5377
- "helpValue": "<schema_id>",
5459
+ "helpValue": "<id>",
5378
5460
  "multiple": false,
5379
5461
  "type": "option"
5380
5462
  },
5381
- "json": {
5382
- "description": "Get schema as json",
5383
- "name": "json",
5384
- "allowNo": false,
5385
- "type": "boolean"
5386
- },
5387
- "manifest-dir": {
5388
- "description": "Directory containing manifest file",
5389
- "hidden": true,
5390
- "name": "manifest-dir",
5391
- "default": "./dist/static",
5463
+ "project-id": {
5464
+ "char": "p",
5465
+ "description": "Project ID to delete token from (overrides CLI configuration)",
5466
+ "helpGroup": "OVERRIDE",
5467
+ "name": "project-id",
5392
5468
  "hasDynamicHelp": false,
5393
- "helpValue": "<directory>",
5469
+ "helpValue": "<id>",
5394
5470
  "multiple": false,
5395
5471
  "type": "option"
5472
+ },
5473
+ "yes": {
5474
+ "char": "y",
5475
+ "description": "Skip confirmation prompt (unattended mode)",
5476
+ "name": "yes",
5477
+ "allowNo": false,
5478
+ "type": "boolean"
5396
5479
  }
5397
5480
  },
5398
5481
  "hasDynamicHelp": false,
5399
5482
  "hiddenAliases": [
5400
- "schema:list"
5483
+ "token:delete"
5401
5484
  ],
5402
- "id": "schemas:list",
5485
+ "id": "tokens:delete",
5403
5486
  "pluginAlias": "@sanity/cli",
5404
5487
  "pluginName": "@sanity/cli",
5405
5488
  "pluginType": "core",
@@ -5408,79 +5491,66 @@
5408
5491
  "relativePath": [
5409
5492
  "dist",
5410
5493
  "commands",
5411
- "schemas",
5412
- "list.js"
5494
+ "tokens",
5495
+ "delete.js"
5413
5496
  ]
5414
5497
  },
5415
- "schemas:validate": {
5498
+ "tokens:list": {
5416
5499
  "aliases": [],
5417
5500
  "args": {},
5418
- "description": "Validates all schema types specified in a workspace",
5501
+ "description": "List API tokens for a project or organization",
5419
5502
  "examples": [
5420
5503
  {
5421
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
5422
- "description": "Validates all schema types in a Sanity project with more than one workspace"
5504
+ "command": "<%= config.bin %> <%= command.id %> --organization org123",
5505
+ "description": "List tokens managed by an organization"
5423
5506
  },
5424
5507
  {
5425
- "command": "<%= config.bin %> <%= command.id %> > report.txt",
5426
- "description": "Save the results of the report into a file"
5508
+ "command": "<%= config.bin %> <%= command.id %>",
5509
+ "description": "List tokens for the project"
5427
5510
  },
5428
5511
  {
5429
- "command": "<%= config.bin %> <%= command.id %> --level error",
5430
- "description": "Report out only errors"
5512
+ "command": "<%= config.bin %> <%= command.id %> --json",
5513
+ "description": "List tokens in JSON format"
5431
5514
  },
5432
5515
  {
5433
- "command": "<%= config.bin %> <%= command.id %> --debug-metafile-path metafile.json",
5434
- "description": "Generate a report which can be analyzed with https://esbuild.github.io/analyze/"
5516
+ "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
5517
+ "description": "List tokens for a specific project"
5435
5518
  }
5436
5519
  ],
5437
5520
  "flags": {
5438
- "debug-metafile-path": {
5439
- "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/",
5440
- "helpGroup": "DEBUG",
5441
- "name": "debug-metafile-path",
5442
- "hasDynamicHelp": false,
5443
- "multiple": false,
5444
- "type": "option"
5445
- },
5446
- "format": {
5447
- "description": "The output format used to print schema errors and warnings",
5448
- "name": "format",
5449
- "default": "pretty",
5450
- "hasDynamicHelp": false,
5451
- "multiple": false,
5452
- "options": [
5453
- "pretty",
5454
- "ndjson",
5455
- "json"
5521
+ "organization": {
5522
+ "description": "List tokens managed by this organization",
5523
+ "exclusive": [
5524
+ "project-id"
5456
5525
  ],
5457
- "type": "option"
5458
- },
5459
- "level": {
5460
- "description": "The minimum level reported out",
5461
- "name": "level",
5462
- "default": "warning",
5526
+ "name": "organization",
5463
5527
  "hasDynamicHelp": false,
5528
+ "helpValue": "<id>",
5464
5529
  "multiple": false,
5465
- "options": [
5466
- "error",
5467
- "warning"
5468
- ],
5469
5530
  "type": "option"
5470
5531
  },
5471
- "workspace": {
5472
- "description": "The name of the workspace to use when validating all schema types",
5473
- "name": "workspace",
5532
+ "project-id": {
5533
+ "char": "p",
5534
+ "description": "Project ID to list tokens for (overrides CLI configuration)",
5535
+ "helpGroup": "OVERRIDE",
5536
+ "name": "project-id",
5474
5537
  "hasDynamicHelp": false,
5538
+ "helpValue": "<id>",
5475
5539
  "multiple": false,
5476
5540
  "type": "option"
5541
+ },
5542
+ "json": {
5543
+ "description": "Output tokens in JSON format",
5544
+ "name": "json",
5545
+ "allowNo": false,
5546
+ "type": "boolean"
5477
5547
  }
5478
5548
  },
5479
5549
  "hasDynamicHelp": false,
5480
5550
  "hiddenAliases": [
5481
- "schema:validate"
5551
+ "token:list"
5482
5552
  ],
5483
- "id": "schemas:validate",
5553
+ "id": "tokens:list",
5484
5554
  "pluginAlias": "@sanity/cli",
5485
5555
  "pluginName": "@sanity/cli",
5486
5556
  "pluginType": "core",
@@ -5489,76 +5559,50 @@
5489
5559
  "relativePath": [
5490
5560
  "dist",
5491
5561
  "commands",
5492
- "schemas",
5493
- "validate.js"
5562
+ "tokens",
5563
+ "list.js"
5494
5564
  ]
5495
5565
  },
5496
- "skills:install": {
5566
+ "tokens:rotate": {
5497
5567
  "aliases": [],
5498
5568
  "args": {},
5499
- "description": "Install Sanity agent skills for detected AI editors (Antigravity, Claude Code, Cline, Cline CLI, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI, OpenCode, VS Code, VS Code Insiders)",
5569
+ "description": "Rotate an API token, replacing its secret with a new one",
5500
5570
  "examples": [
5501
5571
  {
5502
- "command": "<%= config.bin %> <%= command.id %>",
5503
- "description": "Install Sanity agent skills for detected AI editors"
5504
- }
5505
- ],
5506
- "flags": {},
5507
- "hasDynamicHelp": false,
5508
- "hiddenAliases": [],
5509
- "id": "skills:install",
5510
- "pluginAlias": "@sanity/cli",
5511
- "pluginName": "@sanity/cli",
5512
- "pluginType": "core",
5513
- "strict": true,
5514
- "isESM": true,
5515
- "relativePath": [
5516
- "dist",
5517
- "commands",
5518
- "skills",
5519
- "install.js"
5520
- ]
5521
- },
5522
- "telemetry:disable": {
5523
- "aliases": [],
5524
- "args": {},
5525
- "description": "Disable telemetry for your account",
5526
- "examples": [
5572
+ "command": "echo \"$SANITY_TOKEN\" | <%= config.bin %> <%= command.id %>",
5573
+ "description": "Rotate the token piped on standard input"
5574
+ },
5527
5575
  {
5528
- "command": "<%= config.bin %> telemetry <%= command.id %>",
5529
- "description": "Disable telemetry for your account"
5530
- }
5531
- ],
5532
- "flags": {},
5533
- "hasDynamicHelp": false,
5534
- "hiddenAliases": [],
5535
- "id": "telemetry:disable",
5536
- "pluginAlias": "@sanity/cli",
5537
- "pluginName": "@sanity/cli",
5538
- "pluginType": "core",
5539
- "strict": true,
5540
- "isESM": true,
5541
- "relativePath": [
5542
- "dist",
5543
- "commands",
5544
- "telemetry",
5545
- "disable.js"
5546
- ]
5547
- },
5548
- "telemetry:enable": {
5549
- "aliases": [],
5550
- "args": {},
5551
- "description": "Enable telemetry for your account",
5552
- "examples": [
5576
+ "command": "<%= config.bin %> <%= command.id %> < token.txt",
5577
+ "description": "Rotate a token read from a file"
5578
+ },
5553
5579
  {
5554
- "command": "<%= config.bin %> telemetry <%= command.id %>",
5555
- "description": "Enable telemetry for your account"
5580
+ "command": "echo \"$SANITY_TOKEN\" | <%= config.bin %> <%= command.id %> --json",
5581
+ "description": "Output the rotated token as JSON"
5556
5582
  }
5557
5583
  ],
5558
- "flags": {},
5584
+ "flags": {
5585
+ "json": {
5586
+ "description": "Output as JSON",
5587
+ "name": "json",
5588
+ "allowNo": false,
5589
+ "type": "boolean"
5590
+ },
5591
+ "token": {
5592
+ "char": "t",
5593
+ "description": "Token to rotate (prefer standard input to keep it out of shell history)",
5594
+ "name": "token",
5595
+ "hasDynamicHelp": false,
5596
+ "helpValue": "<token>",
5597
+ "multiple": false,
5598
+ "type": "option"
5599
+ }
5600
+ },
5559
5601
  "hasDynamicHelp": false,
5560
- "hiddenAliases": [],
5561
- "id": "telemetry:enable",
5602
+ "hiddenAliases": [
5603
+ "token:rotate"
5604
+ ],
5605
+ "id": "tokens:rotate",
5562
5606
  "pluginAlias": "@sanity/cli",
5563
5607
  "pluginName": "@sanity/cli",
5564
5608
  "pluginType": "core",
@@ -5567,24 +5611,40 @@
5567
5611
  "relativePath": [
5568
5612
  "dist",
5569
5613
  "commands",
5570
- "telemetry",
5571
- "enable.js"
5614
+ "tokens",
5615
+ "rotate.js"
5572
5616
  ]
5573
5617
  },
5574
- "telemetry:status": {
5618
+ "typegen:generate": {
5575
5619
  "aliases": [],
5576
5620
  "args": {},
5577
- "description": "Check telemetry status for your account",
5621
+ "description": "Sanity TypeGen\n\nConfiguration:\nThis command can utilize configuration settings defined in a `sanity-typegen.json` file. These settings include:\n\n- \"path\": Specifies a glob pattern to locate your TypeScript or JavaScript files.\n Default: \"./src/**/*.{ts,tsx,js,jsx}\"\n\n- \"schema\": Defines the path to your Sanity schema file. This file should be generated using the `sanity schema extract` command.\n Default: \"schema.json\"\n\n- \"generates\": Indicates the path where the generated TypeScript type definitions will be saved.\n Default: \"./sanity.types.ts\"\n\nThe default configuration values listed above are used if not overridden in your `sanity-typegen.json` configuration file. To customize the behavior of the type generation, adjust these properties in the configuration file according to your project's needs.\n\nNote:\n- The `sanity schema extract` command is a prerequisite for extracting your Sanity Studio schema into a `schema.json` file, which is then used by the `sanity typegen generate` command to generate type definitions.\n- To generate types for several datasets, list them in `typegen.resources` in `sanity.cli.ts` (beta). Each resource uses its own `schema` file, or the schema bound to its dataset when `schema` is omitted.",
5578
5622
  "examples": [
5579
5623
  {
5580
- "command": "<%= config.bin %> telemetry <%= command.id %>",
5581
- "description": "Check telemetry status for your account"
5624
+ "command": "<%= config.bin %> <%= command.id %>",
5625
+ "description": "Generate TypeScript type definitions from a Sanity Studio schema extracted using the `sanity schema extract` command."
5582
5626
  }
5583
5627
  ],
5584
- "flags": {},
5628
+ "flags": {
5629
+ "config-path": {
5630
+ "description": "[Default: sanity-typegen.json] Specifies the path to the typegen configuration file. This file should be a JSON file that contains settings for the type generation process.",
5631
+ "name": "config-path",
5632
+ "hasDynamicHelp": false,
5633
+ "multiple": false,
5634
+ "type": "option"
5635
+ },
5636
+ "watch": {
5637
+ "description": "[Default: false] Run the typegen in watch mode",
5638
+ "name": "watch",
5639
+ "allowNo": false,
5640
+ "type": "boolean"
5641
+ }
5642
+ },
5585
5643
  "hasDynamicHelp": false,
5586
- "hiddenAliases": [],
5587
- "id": "telemetry:status",
5644
+ "hiddenAliases": [
5645
+ "typegen:generate"
5646
+ ],
5647
+ "id": "typegen:generate",
5588
5648
  "pluginAlias": "@sanity/cli",
5589
5649
  "pluginName": "@sanity/cli",
5590
5650
  "pluginType": "core",
@@ -5593,50 +5653,28 @@
5593
5653
  "relativePath": [
5594
5654
  "dist",
5595
5655
  "commands",
5596
- "telemetry",
5597
- "status.js"
5656
+ "typegen",
5657
+ "generate.js"
5598
5658
  ]
5599
5659
  },
5600
- "tokens:create": {
5660
+ "schemas:delete": {
5601
5661
  "aliases": [],
5602
- "args": {
5603
- "label": {
5604
- "description": "Label for the new token",
5605
- "name": "label",
5606
- "required": false
5607
- }
5608
- },
5609
- "description": "Create a new API token with access to an organization and its projects",
5662
+ "args": {},
5663
+ "description": "Delete schema documents by id",
5610
5664
  "examples": [
5611
5665
  {
5612
- "command": "<%= config.bin %> <%= command.id %> \"My API Token\"",
5613
- "description": "Create a token, choosing its access interactively"
5614
- },
5615
- {
5616
- "command": "<%= config.bin %> <%= command.id %> \"CI Token\" --grant context=developer --grant blueprints --grant project:abc123=editor",
5617
- "description": "Create an organization token with Context, Blueprints and project access"
5618
- },
5619
- {
5620
- "command": "<%= config.bin %> <%= command.id %> \"My Token\" --project-id abc123 --role=editor",
5621
- "description": "Create a project token with editor role"
5622
- },
5623
- {
5624
- "command": "<%= config.bin %> <%= command.id %> \"CI Token\" --role=editor --yes",
5625
- "description": "Create a project token in unattended mode"
5626
- },
5627
- {
5628
- "command": "<%= config.bin %> <%= command.id %> \"Build Token\" --expires-at 2027-01-01",
5629
- "description": "Create a token that expires on a given date"
5666
+ "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName",
5667
+ "description": "Delete a single schema"
5630
5668
  },
5631
5669
  {
5632
- "command": "<%= config.bin %> <%= command.id %> \"API Token\" --json",
5633
- "description": "Output token information as JSON"
5670
+ "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName,prefix.sanity.workspace.schema.otherWorkspace",
5671
+ "description": "Delete multiple schemas"
5634
5672
  }
5635
5673
  ],
5636
5674
  "flags": {
5637
5675
  "project-id": {
5638
5676
  "char": "p",
5639
- "description": "Project ID to create token in (overrides CLI configuration)",
5677
+ "description": "Project ID to delete schema from (overrides CLI configuration)",
5640
5678
  "helpGroup": "OVERRIDE",
5641
5679
  "name": "project-id",
5642
5680
  "hasDynamicHelp": false,
@@ -5644,48 +5682,48 @@
5644
5682
  "multiple": false,
5645
5683
  "type": "option"
5646
5684
  },
5647
- "organization": {
5648
- "description": "Organization to create an organization token in (overrides CLI configuration)",
5649
- "helpGroup": "OVERRIDE",
5650
- "name": "organization",
5685
+ "dataset": {
5686
+ "char": "d",
5687
+ "description": "Delete schemas from a specific dataset",
5688
+ "name": "dataset",
5651
5689
  "hasDynamicHelp": false,
5652
- "helpValue": "<id>",
5690
+ "helpValue": "<name>",
5653
5691
  "multiple": false,
5654
5692
  "type": "option"
5655
5693
  },
5656
- "expires-at": {
5657
- "description": "Date or timestamp the token expires (ISO 8601; tokens never expire by default)",
5658
- "name": "expires-at",
5694
+ "extract-manifest": {
5695
+ "description": "Generate manifest file (disable with --no-extract-manifest)",
5696
+ "hidden": true,
5697
+ "name": "extract-manifest",
5698
+ "allowNo": true,
5699
+ "type": "boolean"
5700
+ },
5701
+ "ids": {
5702
+ "description": "Comma-separated list of schema ids to delete",
5703
+ "name": "ids",
5704
+ "required": true,
5659
5705
  "hasDynamicHelp": false,
5660
- "helpValue": "2027-01-01",
5661
5706
  "multiple": false,
5662
5707
  "type": "option"
5663
5708
  },
5664
- "grant": {
5665
- "description": "Access to grant, as <permission>[=<role>] or project:<projectId>=<role>[,<role>]. Permissions: context, blueprints, media-library, canvas, sdk-apps, access, deploy-studios. Repeatable",
5666
- "name": "grant",
5709
+ "manifest-dir": {
5710
+ "description": "Directory containing manifest file",
5711
+ "hidden": true,
5712
+ "name": "manifest-dir",
5713
+ "default": "./dist/static",
5667
5714
  "hasDynamicHelp": false,
5668
- "helpValue": "context=editor",
5669
- "multiple": true,
5715
+ "multiple": false,
5670
5716
  "type": "option"
5671
5717
  },
5672
- "json": {
5673
- "description": "Output as JSON",
5674
- "name": "json",
5718
+ "verbose": {
5719
+ "description": "Enable verbose logging",
5720
+ "name": "verbose",
5675
5721
  "allowNo": false,
5676
5722
  "type": "boolean"
5677
5723
  },
5678
- "role": {
5679
- "description": "Role to assign on the project (defaults to viewer in unattended mode)",
5680
- "name": "role",
5681
- "hasDynamicHelp": false,
5682
- "helpValue": "viewer",
5683
- "multiple": false,
5684
- "type": "option"
5685
- },
5686
5724
  "yes": {
5687
5725
  "char": "y",
5688
- "description": "Skip prompts and use defaults (unattended mode)",
5726
+ "description": "Delete schemas without prompting for confirmation",
5689
5727
  "name": "yes",
5690
5728
  "allowNo": false,
5691
5729
  "type": "boolean"
@@ -5693,11 +5731,9 @@
5693
5731
  },
5694
5732
  "hasDynamicHelp": false,
5695
5733
  "hiddenAliases": [
5696
- "tokens:add",
5697
- "token:add",
5698
- "token:create"
5734
+ "schema:delete"
5699
5735
  ],
5700
- "id": "tokens:create",
5736
+ "id": "schemas:delete",
5701
5737
  "pluginAlias": "@sanity/cli",
5702
5738
  "pluginName": "@sanity/cli",
5703
5739
  "pluginType": "core",
@@ -5706,62 +5742,68 @@
5706
5742
  "relativePath": [
5707
5743
  "dist",
5708
5744
  "commands",
5709
- "tokens",
5710
- "create.js"
5745
+ "schemas",
5746
+ "delete.js"
5711
5747
  ]
5712
5748
  },
5713
- "tokens:delete": {
5749
+ "schemas:deploy": {
5714
5750
  "aliases": [],
5715
- "args": {
5716
- "tokenId": {
5717
- "description": "Token ID to delete (will prompt if not provided)",
5718
- "name": "tokenId",
5719
- "required": false
5720
- }
5721
- },
5722
- "description": "Delete an API token from the project",
5751
+ "args": {},
5752
+ "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.",
5723
5753
  "examples": [
5724
5754
  {
5725
5755
  "command": "<%= config.bin %> <%= command.id %>",
5726
- "description": "Interactively select and delete a token"
5727
- },
5728
- {
5729
- "command": "<%= config.bin %> <%= command.id %> silJ2lFmK6dONB",
5730
- "description": "Delete a specific token by ID"
5731
- },
5732
- {
5733
- "command": "<%= config.bin %> <%= command.id %> silJ2lFmK6dONB --yes",
5734
- "description": "Delete a specific token without confirmation prompt"
5756
+ "description": "Deploy all workspace schemas"
5735
5757
  },
5736
5758
  {
5737
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
5738
- "description": "Delete a token from a specific project"
5759
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
5760
+ "description": "Deploy the schema for only the workspace \"default\""
5739
5761
  }
5740
5762
  ],
5741
5763
  "flags": {
5742
- "project-id": {
5743
- "char": "p",
5744
- "description": "Project ID to delete token from (overrides CLI configuration)",
5745
- "helpGroup": "OVERRIDE",
5746
- "name": "project-id",
5764
+ "extract-manifest": {
5765
+ "description": "Regenerate manifest before deploying (use --no-extract-manifest to skip)",
5766
+ "name": "extract-manifest",
5767
+ "allowNo": true,
5768
+ "type": "boolean"
5769
+ },
5770
+ "manifest-dir": {
5771
+ "description": "Directory containing manifest file",
5772
+ "name": "manifest-dir",
5773
+ "default": "./dist/static",
5747
5774
  "hasDynamicHelp": false,
5748
- "helpValue": "<id>",
5775
+ "helpValue": "<directory>",
5749
5776
  "multiple": false,
5750
5777
  "type": "option"
5751
5778
  },
5752
- "yes": {
5753
- "char": "y",
5754
- "description": "Skip confirmation prompt (unattended mode)",
5755
- "name": "yes",
5779
+ "tag": {
5780
+ "description": "Add a tag suffix to the schema id",
5781
+ "name": "tag",
5782
+ "hasDynamicHelp": false,
5783
+ "helpValue": "<tag>",
5784
+ "multiple": false,
5785
+ "type": "option"
5786
+ },
5787
+ "verbose": {
5788
+ "description": "Print detailed information during deployment",
5789
+ "name": "verbose",
5756
5790
  "allowNo": false,
5757
5791
  "type": "boolean"
5792
+ },
5793
+ "workspace": {
5794
+ "description": "The name of the workspace to deploy a schema for",
5795
+ "name": "workspace",
5796
+ "hasDynamicHelp": false,
5797
+ "helpValue": "<name>",
5798
+ "multiple": false,
5799
+ "type": "option"
5758
5800
  }
5759
5801
  },
5760
5802
  "hasDynamicHelp": false,
5761
5803
  "hiddenAliases": [
5762
- "token:delete"
5804
+ "schema:deploy"
5763
5805
  ],
5764
- "id": "tokens:delete",
5806
+ "id": "schemas:deploy",
5765
5807
  "pluginAlias": "@sanity/cli",
5766
5808
  "pluginName": "@sanity/cli",
5767
5809
  "pluginType": "core",
@@ -5770,51 +5812,85 @@
5770
5812
  "relativePath": [
5771
5813
  "dist",
5772
5814
  "commands",
5773
- "tokens",
5774
- "delete.js"
5815
+ "schemas",
5816
+ "deploy.js"
5775
5817
  ]
5776
5818
  },
5777
- "tokens:list": {
5819
+ "schemas:extract": {
5778
5820
  "aliases": [],
5779
5821
  "args": {},
5780
- "description": "List API tokens for the project",
5822
+ "description": "Extract a JSON representation of a Sanity schema within a Studio context.\n\nNote: This command is experimental and subject to change.",
5781
5823
  "examples": [
5782
5824
  {
5783
- "command": "<%= config.bin %> <%= command.id %>",
5784
- "description": "List tokens for the project"
5825
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
5826
+ "description": "Extracts schema types in a Sanity project with more than one workspace"
5785
5827
  },
5786
5828
  {
5787
- "command": "<%= config.bin %> <%= command.id %> --json",
5788
- "description": "List tokens in JSON format"
5829
+ "command": "<%= config.bin %> <%= command.id %> --watch",
5830
+ "description": "Watch mode - re-extract on changes"
5789
5831
  },
5790
5832
  {
5791
- "command": "<%= config.bin %> <%= command.id %> --project-id abc123",
5792
- "description": "List tokens for a specific project"
5833
+ "command": "<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"",
5834
+ "description": "Watch with custom glob patterns"
5793
5835
  }
5794
5836
  ],
5795
5837
  "flags": {
5796
- "project-id": {
5797
- "char": "p",
5798
- "description": "Project ID to list tokens for (overrides CLI configuration)",
5799
- "helpGroup": "OVERRIDE",
5800
- "name": "project-id",
5838
+ "enforce-required-fields": {
5839
+ "description": "Makes the schema generated treat fields marked as required as non-optional",
5840
+ "name": "enforce-required-fields",
5841
+ "allowNo": false,
5842
+ "type": "boolean"
5843
+ },
5844
+ "force": {
5845
+ "description": "Overwrite an existing schema file",
5846
+ "name": "force",
5847
+ "allowNo": false,
5848
+ "type": "boolean"
5849
+ },
5850
+ "format": {
5851
+ "description": "Output format (currently only groq-type-nodes)",
5852
+ "name": "format",
5853
+ "default": "groq-type-nodes",
5801
5854
  "hasDynamicHelp": false,
5802
- "helpValue": "<id>",
5855
+ "helpValue": "<format>",
5803
5856
  "multiple": false,
5804
5857
  "type": "option"
5805
5858
  },
5806
- "json": {
5807
- "description": "Output tokens in JSON format",
5808
- "name": "json",
5859
+ "path": {
5860
+ "description": "Optional path to specify destination of the schema file",
5861
+ "name": "path",
5862
+ "hasDynamicHelp": false,
5863
+ "multiple": false,
5864
+ "type": "option"
5865
+ },
5866
+ "watch": {
5867
+ "description": "Enable watch mode to re-extract schema on file changes",
5868
+ "name": "watch",
5809
5869
  "allowNo": false,
5810
5870
  "type": "boolean"
5871
+ },
5872
+ "watch-patterns": {
5873
+ "description": "Additional glob pattern(s) to watch (can be specified multiple times)",
5874
+ "name": "watch-patterns",
5875
+ "hasDynamicHelp": false,
5876
+ "helpValue": "<glob>",
5877
+ "multiple": true,
5878
+ "type": "option"
5879
+ },
5880
+ "workspace": {
5881
+ "description": "The name of the workspace to generate a schema for",
5882
+ "name": "workspace",
5883
+ "hasDynamicHelp": false,
5884
+ "helpValue": "<name>",
5885
+ "multiple": false,
5886
+ "type": "option"
5811
5887
  }
5812
5888
  },
5813
5889
  "hasDynamicHelp": false,
5814
5890
  "hiddenAliases": [
5815
- "token:list"
5891
+ "schema:extract"
5816
5892
  ],
5817
- "id": "tokens:list",
5893
+ "id": "schemas:extract",
5818
5894
  "pluginAlias": "@sanity/cli",
5819
5895
  "pluginName": "@sanity/cli",
5820
5896
  "pluginType": "core",
@@ -5823,50 +5899,70 @@
5823
5899
  "relativePath": [
5824
5900
  "dist",
5825
5901
  "commands",
5826
- "tokens",
5827
- "list.js"
5902
+ "schemas",
5903
+ "extract.js"
5828
5904
  ]
5829
5905
  },
5830
- "tokens:rotate": {
5906
+ "schemas:list": {
5831
5907
  "aliases": [],
5832
5908
  "args": {},
5833
- "description": "Rotate an API token, replacing its secret with a new one",
5909
+ "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.",
5834
5910
  "examples": [
5835
5911
  {
5836
- "command": "echo \"$SANITY_TOKEN\" | <%= config.bin %> <%= command.id %>",
5837
- "description": "Rotate the token piped on standard input"
5912
+ "command": "<%= config.bin %> <%= command.id %>",
5913
+ "description": "List all schemas found in any workspace dataset in a table"
5838
5914
  },
5839
5915
  {
5840
- "command": "<%= config.bin %> <%= command.id %> < token.txt",
5841
- "description": "Rotate a token read from a file"
5916
+ "command": "<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName",
5917
+ "description": "Get a schema for a given id"
5842
5918
  },
5843
5919
  {
5844
- "command": "echo \"$SANITY_TOKEN\" | <%= config.bin %> <%= command.id %> --json",
5845
- "description": "Output the rotated token as JSON"
5920
+ "command": "<%= config.bin %> <%= command.id %> --json",
5921
+ "description": "Get stored schemas as pretty-printed json-array"
5922
+ },
5923
+ {
5924
+ "command": "<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName",
5925
+ "description": "Get singular stored schema as pretty-printed json-object"
5846
5926
  }
5847
5927
  ],
5848
5928
  "flags": {
5929
+ "extract-manifest": {
5930
+ "description": "Regenerate manifest before listing (use --no-extract-manifest to skip)",
5931
+ "hidden": true,
5932
+ "name": "extract-manifest",
5933
+ "allowNo": true,
5934
+ "type": "boolean"
5935
+ },
5936
+ "id": {
5937
+ "description": "Fetch a single schema by id",
5938
+ "name": "id",
5939
+ "hasDynamicHelp": false,
5940
+ "helpValue": "<schema_id>",
5941
+ "multiple": false,
5942
+ "type": "option"
5943
+ },
5849
5944
  "json": {
5850
- "description": "Output as JSON",
5945
+ "description": "Get schema as json",
5851
5946
  "name": "json",
5852
5947
  "allowNo": false,
5853
5948
  "type": "boolean"
5854
5949
  },
5855
- "token": {
5856
- "char": "t",
5857
- "description": "Token to rotate (prefer standard input to keep it out of shell history)",
5858
- "name": "token",
5950
+ "manifest-dir": {
5951
+ "description": "Directory containing manifest file",
5952
+ "hidden": true,
5953
+ "name": "manifest-dir",
5954
+ "default": "./dist/static",
5859
5955
  "hasDynamicHelp": false,
5860
- "helpValue": "<token>",
5956
+ "helpValue": "<directory>",
5861
5957
  "multiple": false,
5862
5958
  "type": "option"
5863
5959
  }
5864
5960
  },
5865
5961
  "hasDynamicHelp": false,
5866
5962
  "hiddenAliases": [
5867
- "token:rotate"
5963
+ "schema:list"
5868
5964
  ],
5869
- "id": "tokens:rotate",
5965
+ "id": "schemas:list",
5870
5966
  "pluginAlias": "@sanity/cli",
5871
5967
  "pluginName": "@sanity/cli",
5872
5968
  "pluginType": "core",
@@ -5875,40 +5971,79 @@
5875
5971
  "relativePath": [
5876
5972
  "dist",
5877
5973
  "commands",
5878
- "tokens",
5879
- "rotate.js"
5974
+ "schemas",
5975
+ "list.js"
5880
5976
  ]
5881
5977
  },
5882
- "typegen:generate": {
5978
+ "schemas:validate": {
5883
5979
  "aliases": [],
5884
5980
  "args": {},
5885
- "description": "Sanity TypeGen\n\nConfiguration:\nThis command can utilize configuration settings defined in a `sanity-typegen.json` file. These settings include:\n\n- \"path\": Specifies a glob pattern to locate your TypeScript or JavaScript files.\n Default: \"./src/**/*.{ts,tsx,js,jsx}\"\n\n- \"schema\": Defines the path to your Sanity schema file. This file should be generated using the `sanity schema extract` command.\n Default: \"schema.json\"\n\n- \"generates\": Indicates the path where the generated TypeScript type definitions will be saved.\n Default: \"./sanity.types.ts\"\n\nThe default configuration values listed above are used if not overridden in your `sanity-typegen.json` configuration file. To customize the behavior of the type generation, adjust these properties in the configuration file according to your project's needs.\n\nNote:\n- The `sanity schema extract` command is a prerequisite for extracting your Sanity Studio schema into a `schema.json` file, which is then used by the `sanity typegen generate` command to generate type definitions.\n- To generate types for several datasets, list them in `typegen.resources` in `sanity.cli.ts` (beta). Each resource uses its own `schema` file, or the schema bound to its dataset when `schema` is omitted.",
5981
+ "description": "Validates all schema types specified in a workspace",
5886
5982
  "examples": [
5887
5983
  {
5888
- "command": "<%= config.bin %> <%= command.id %>",
5889
- "description": "Generate TypeScript type definitions from a Sanity Studio schema extracted using the `sanity schema extract` command."
5984
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
5985
+ "description": "Validates all schema types in a Sanity project with more than one workspace"
5986
+ },
5987
+ {
5988
+ "command": "<%= config.bin %> <%= command.id %> > report.txt",
5989
+ "description": "Save the results of the report into a file"
5990
+ },
5991
+ {
5992
+ "command": "<%= config.bin %> <%= command.id %> --level error",
5993
+ "description": "Report out only errors"
5994
+ },
5995
+ {
5996
+ "command": "<%= config.bin %> <%= command.id %> --debug-metafile-path metafile.json",
5997
+ "description": "Generate a report which can be analyzed with https://esbuild.github.io/analyze/"
5890
5998
  }
5891
5999
  ],
5892
6000
  "flags": {
5893
- "config-path": {
5894
- "description": "[Default: sanity-typegen.json] Specifies the path to the typegen configuration file. This file should be a JSON file that contains settings for the type generation process.",
5895
- "name": "config-path",
6001
+ "debug-metafile-path": {
6002
+ "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/",
6003
+ "helpGroup": "DEBUG",
6004
+ "name": "debug-metafile-path",
5896
6005
  "hasDynamicHelp": false,
5897
6006
  "multiple": false,
5898
6007
  "type": "option"
5899
6008
  },
5900
- "watch": {
5901
- "description": "[Default: false] Run the typegen in watch mode",
5902
- "name": "watch",
5903
- "allowNo": false,
5904
- "type": "boolean"
6009
+ "format": {
6010
+ "description": "The output format used to print schema errors and warnings",
6011
+ "name": "format",
6012
+ "default": "pretty",
6013
+ "hasDynamicHelp": false,
6014
+ "multiple": false,
6015
+ "options": [
6016
+ "pretty",
6017
+ "ndjson",
6018
+ "json"
6019
+ ],
6020
+ "type": "option"
6021
+ },
6022
+ "level": {
6023
+ "description": "The minimum level reported out",
6024
+ "name": "level",
6025
+ "default": "warning",
6026
+ "hasDynamicHelp": false,
6027
+ "multiple": false,
6028
+ "options": [
6029
+ "error",
6030
+ "warning"
6031
+ ],
6032
+ "type": "option"
6033
+ },
6034
+ "workspace": {
6035
+ "description": "The name of the workspace to use when validating all schema types",
6036
+ "name": "workspace",
6037
+ "hasDynamicHelp": false,
6038
+ "multiple": false,
6039
+ "type": "option"
5905
6040
  }
5906
6041
  },
5907
6042
  "hasDynamicHelp": false,
5908
6043
  "hiddenAliases": [
5909
- "typegen:generate"
6044
+ "schema:validate"
5910
6045
  ],
5911
- "id": "typegen:generate",
6046
+ "id": "schemas:validate",
5912
6047
  "pluginAlias": "@sanity/cli",
5913
6048
  "pluginName": "@sanity/cli",
5914
6049
  "pluginType": "core",
@@ -5917,8 +6052,8 @@
5917
6052
  "relativePath": [
5918
6053
  "dist",
5919
6054
  "commands",
5920
- "typegen",
5921
- "generate.js"
6055
+ "schemas",
6056
+ "validate.js"
5922
6057
  ]
5923
6058
  },
5924
6059
  "users:invite": {
@@ -6074,126 +6209,6 @@
6074
6209
  "list.js"
6075
6210
  ]
6076
6211
  },
6077
- "mcp:configure": {
6078
- "aliases": [],
6079
- "args": {},
6080
- "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)",
6081
- "examples": [
6082
- {
6083
- "command": "<%= config.bin %> <%= command.id %>",
6084
- "description": "Configure Sanity MCP server for detected AI editors"
6085
- }
6086
- ],
6087
- "flags": {},
6088
- "hasDynamicHelp": false,
6089
- "hiddenAliases": [],
6090
- "id": "mcp:configure",
6091
- "pluginAlias": "@sanity/cli",
6092
- "pluginName": "@sanity/cli",
6093
- "pluginType": "core",
6094
- "strict": true,
6095
- "isESM": true,
6096
- "relativePath": [
6097
- "dist",
6098
- "commands",
6099
- "mcp",
6100
- "configure.js"
6101
- ]
6102
- },
6103
- "manifest:extract": {
6104
- "aliases": [],
6105
- "args": {},
6106
- "description": "Extract studio configuration as JSON manifest files.\n\nNote: This command is experimental and subject to change. It is currently intended for use with Create only.",
6107
- "examples": [
6108
- {
6109
- "command": "<%= config.bin %> <%= command.id %>",
6110
- "description": "Extracts manifests"
6111
- },
6112
- {
6113
- "command": "<%= config.bin %> <%= command.id %> --path /public/static",
6114
- "description": "Extracts manifests into /public/static"
6115
- }
6116
- ],
6117
- "flags": {
6118
- "path": {
6119
- "description": "Optional path to specify destination directory of the manifest files",
6120
- "name": "path",
6121
- "default": "dist/static",
6122
- "hasDynamicHelp": false,
6123
- "multiple": false,
6124
- "type": "option"
6125
- }
6126
- },
6127
- "hasDynamicHelp": false,
6128
- "hiddenAliases": [],
6129
- "id": "manifest:extract",
6130
- "pluginAlias": "@sanity/cli",
6131
- "pluginName": "@sanity/cli",
6132
- "pluginType": "core",
6133
- "strict": true,
6134
- "isESM": true,
6135
- "relativePath": [
6136
- "dist",
6137
- "commands",
6138
- "manifest",
6139
- "extract.js"
6140
- ]
6141
- },
6142
- "context:jobs:get": {
6143
- "aliases": [],
6144
- "args": {
6145
- "knowledgeBaseId": {
6146
- "description": "Knowledge base ID",
6147
- "name": "knowledgeBaseId",
6148
- "required": true
6149
- },
6150
- "jobId": {
6151
- "description": "Job ID",
6152
- "name": "jobId",
6153
- "required": true
6154
- }
6155
- },
6156
- "description": "Get the status of a knowledge base job",
6157
- "examples": [
6158
- {
6159
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456",
6160
- "description": "Get the current status of a job"
6161
- },
6162
- {
6163
- "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456 --watch",
6164
- "description": "Wait for the job to finish (non-zero exit if it does not succeed)"
6165
- }
6166
- ],
6167
- "flags": {
6168
- "json": {
6169
- "description": "Output the job in JSON format",
6170
- "name": "json",
6171
- "allowNo": false,
6172
- "type": "boolean"
6173
- },
6174
- "watch": {
6175
- "description": "Poll until the job reaches a terminal state",
6176
- "name": "watch",
6177
- "allowNo": false,
6178
- "type": "boolean"
6179
- }
6180
- },
6181
- "hasDynamicHelp": false,
6182
- "hiddenAliases": [],
6183
- "id": "context:jobs:get",
6184
- "pluginAlias": "@sanity/cli",
6185
- "pluginName": "@sanity/cli",
6186
- "pluginType": "core",
6187
- "strict": true,
6188
- "isESM": true,
6189
- "relativePath": [
6190
- "dist",
6191
- "commands",
6192
- "context",
6193
- "jobs",
6194
- "get.js"
6195
- ]
6196
- },
6197
6212
  "context:imports:create": {
6198
6213
  "aliases": [],
6199
6214
  "args": {
@@ -6560,6 +6575,61 @@
6560
6575
  "list.js"
6561
6576
  ]
6562
6577
  },
6578
+ "context:jobs:get": {
6579
+ "aliases": [],
6580
+ "args": {
6581
+ "knowledgeBaseId": {
6582
+ "description": "Knowledge base ID",
6583
+ "name": "knowledgeBaseId",
6584
+ "required": true
6585
+ },
6586
+ "jobId": {
6587
+ "description": "Job ID",
6588
+ "name": "jobId",
6589
+ "required": true
6590
+ }
6591
+ },
6592
+ "description": "Get the status of a knowledge base job",
6593
+ "examples": [
6594
+ {
6595
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456",
6596
+ "description": "Get the current status of a job"
6597
+ },
6598
+ {
6599
+ "command": "<%= config.bin %> <%= command.id %> kb-abc123 job-def456 --watch",
6600
+ "description": "Wait for the job to finish (non-zero exit if it does not succeed)"
6601
+ }
6602
+ ],
6603
+ "flags": {
6604
+ "json": {
6605
+ "description": "Output the job in JSON format",
6606
+ "name": "json",
6607
+ "allowNo": false,
6608
+ "type": "boolean"
6609
+ },
6610
+ "watch": {
6611
+ "description": "Poll until the job reaches a terminal state",
6612
+ "name": "watch",
6613
+ "allowNo": false,
6614
+ "type": "boolean"
6615
+ }
6616
+ },
6617
+ "hasDynamicHelp": false,
6618
+ "hiddenAliases": [],
6619
+ "id": "context:jobs:get",
6620
+ "pluginAlias": "@sanity/cli",
6621
+ "pluginName": "@sanity/cli",
6622
+ "pluginType": "core",
6623
+ "strict": true,
6624
+ "isESM": true,
6625
+ "relativePath": [
6626
+ "dist",
6627
+ "commands",
6628
+ "context",
6629
+ "jobs",
6630
+ "get.js"
6631
+ ]
6632
+ },
6563
6633
  "datasets:alias:create": {
6564
6634
  "aliases": [],
6565
6635
  "args": {
@@ -7075,5 +7145,5 @@
7075
7145
  ]
7076
7146
  }
7077
7147
  },
7078
- "version": "8.19.0"
7148
+ "version": "8.21.0"
7079
7149
  }