@sanity/cli 6.4.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/README.md +14 -8
  2. package/dist/actions/build/buildApp.js +12 -4
  3. package/dist/actions/build/buildApp.js.map +1 -1
  4. package/dist/actions/build/buildStaticFiles.js +3 -1
  5. package/dist/actions/build/buildStaticFiles.js.map +1 -1
  6. package/dist/actions/build/buildStudio.js +29 -7
  7. package/dist/actions/build/buildStudio.js.map +1 -1
  8. package/dist/actions/build/buildVendorDependencies.js +7 -7
  9. package/dist/actions/build/buildVendorDependencies.js.map +1 -1
  10. package/dist/actions/build/checkRequiredDependencies.js +4 -4
  11. package/dist/actions/build/checkRequiredDependencies.js.map +1 -1
  12. package/dist/actions/build/checkStudioDependencyVersions.js +9 -9
  13. package/dist/actions/build/checkStudioDependencyVersions.js.map +1 -1
  14. package/dist/actions/build/getAutoUpdatesImportMap.js +9 -0
  15. package/dist/actions/build/getAutoUpdatesImportMap.js.map +1 -1
  16. package/dist/actions/build/getViteConfig.js +2 -1
  17. package/dist/actions/build/getViteConfig.js.map +1 -1
  18. package/dist/actions/build/renderDocument.js.map +1 -1
  19. package/dist/actions/build/renderDocumentWorker/addTimestampImportMapScriptToHtml.js +34 -14
  20. package/dist/actions/build/renderDocumentWorker/addTimestampImportMapScriptToHtml.js.map +1 -1
  21. package/dist/actions/build/renderDocumentWorker/getDocumentHtml.js +2 -2
  22. package/dist/actions/build/renderDocumentWorker/getDocumentHtml.js.map +1 -1
  23. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js +2 -2
  24. package/dist/actions/build/renderDocumentWorker/renderDocumentWorker.js.map +1 -1
  25. package/dist/actions/codemods/reactIconsV3.js +2 -2
  26. package/dist/actions/codemods/reactIconsV3.js.map +1 -1
  27. package/dist/actions/dev/startStudioDevServer.js +2 -2
  28. package/dist/actions/dev/startStudioDevServer.js.map +1 -1
  29. package/dist/actions/doctor/types.js.map +1 -1
  30. package/dist/actions/graphql/resolveGraphQLApisFromWorkspaces.js.map +1 -1
  31. package/dist/actions/init/bootstrapTemplate.js.map +1 -1
  32. package/dist/actions/init/checkNextJsReactCompatibility.js +3 -3
  33. package/dist/actions/init/checkNextJsReactCompatibility.js.map +1 -1
  34. package/dist/actions/init/initAction.js +287 -0
  35. package/dist/actions/init/initAction.js.map +1 -0
  36. package/dist/actions/init/initApp.js +7 -16
  37. package/dist/actions/init/initApp.js.map +1 -1
  38. package/dist/actions/init/initError.js +10 -0
  39. package/dist/actions/init/initError.js.map +1 -0
  40. package/dist/actions/init/initHelpers.js +3 -12
  41. package/dist/actions/init/initHelpers.js.map +1 -1
  42. package/dist/actions/init/initNextJs.js +17 -20
  43. package/dist/actions/init/initNextJs.js.map +1 -1
  44. package/dist/actions/init/initStudio.js +11 -20
  45. package/dist/actions/init/initStudio.js.map +1 -1
  46. package/dist/actions/init/plan/getPlan.js +15 -0
  47. package/dist/actions/init/plan/getPlan.js.map +1 -0
  48. package/dist/actions/init/plan/verifyCoupon.js +35 -0
  49. package/dist/actions/init/plan/verifyCoupon.js.map +1 -0
  50. package/dist/actions/init/plan/verifyPlan.js +34 -0
  51. package/dist/actions/init/plan/verifyPlan.js.map +1 -0
  52. package/dist/actions/init/project/createProjectFromName.js +44 -0
  53. package/dist/actions/init/project/createProjectFromName.js.map +1 -0
  54. package/dist/actions/init/project/getOrCreateDataset.js +126 -0
  55. package/dist/actions/init/project/getOrCreateDataset.js.map +1 -0
  56. package/dist/actions/init/project/getOrCreateProject.js +128 -0
  57. package/dist/actions/init/project/getOrCreateProject.js.map +1 -0
  58. package/dist/actions/init/project/getProjectDetails.js +87 -0
  59. package/dist/actions/init/project/getProjectDetails.js.map +1 -0
  60. package/dist/actions/init/project/getProjectOutputPath.js +17 -0
  61. package/dist/actions/init/project/getProjectOutputPath.js.map +1 -0
  62. package/dist/actions/init/project/promptForAppTemplateSetup.js +112 -0
  63. package/dist/actions/init/project/promptForAppTemplateSetup.js.map +1 -0
  64. package/dist/actions/init/project/promptForProjectCreation.js +40 -0
  65. package/dist/actions/init/project/promptForProjectCreation.js.map +1 -0
  66. package/dist/actions/init/project/promptUserForNewOrganization.js +12 -0
  67. package/dist/actions/init/project/promptUserForNewOrganization.js.map +1 -0
  68. package/dist/actions/init/project/promptUserForOrganization.js +38 -0
  69. package/dist/actions/init/project/promptUserForOrganization.js.map +1 -0
  70. package/dist/actions/init/scaffoldTemplate.js +23 -29
  71. package/dist/actions/init/scaffoldTemplate.js.map +1 -1
  72. package/dist/actions/init/types.js +47 -1
  73. package/dist/actions/init/types.js.map +1 -1
  74. package/dist/actions/manifest/types.js +0 -1
  75. package/dist/actions/manifest/types.js.map +1 -1
  76. package/dist/actions/versions/buildPackageArray.js +2 -2
  77. package/dist/actions/versions/buildPackageArray.js.map +1 -1
  78. package/dist/actions/versions/findSanityModulesVersions.js +3 -3
  79. package/dist/actions/versions/findSanityModulesVersions.js.map +1 -1
  80. package/dist/commands/datasets/copy.js.map +1 -1
  81. package/dist/commands/init.js +11 -911
  82. package/dist/commands/init.js.map +1 -1
  83. package/dist/server/vite/plugin-sanity-build-entries.js +2 -1
  84. package/dist/server/vite/plugin-sanity-build-entries.js.map +1 -1
  85. package/dist/services/datasets.js.map +1 -1
  86. package/dist/telemetry/init.telemetry.js.map +1 -1
  87. package/dist/util/compareDependencyVersions.js +4 -4
  88. package/dist/util/compareDependencyVersions.js.map +1 -1
  89. package/dist/util/createExpiringConfig.js +1 -1
  90. package/dist/util/createExpiringConfig.js.map +1 -1
  91. package/dist/util/packageManager/installationInfo/analyzeIssues.js +7 -7
  92. package/dist/util/packageManager/installationInfo/analyzeIssues.js.map +1 -1
  93. package/dist/util/packageManager/installationInfo/types.js.map +1 -1
  94. package/dist/util/packageManager/packageManagerChoice.js +2 -2
  95. package/dist/util/packageManager/packageManagerChoice.js.map +1 -1
  96. package/dist/util/packageManager/preferredPm.js +106 -0
  97. package/dist/util/packageManager/preferredPm.js.map +1 -0
  98. package/oclif.manifest.json +526 -526
  99. package/package.json +23 -22
@@ -3193,58 +3193,81 @@
3193
3193
  "configure.js"
3194
3194
  ]
3195
3195
  },
3196
- "openapi:get": {
3196
+ "media:create-aspect": {
3197
+ "aliases": [],
3198
+ "args": {},
3199
+ "description": "Create a new aspect definition file",
3200
+ "examples": [
3201
+ {
3202
+ "command": "<%= config.bin %> <%= command.id %>",
3203
+ "description": "Create a new aspect definition file"
3204
+ }
3205
+ ],
3206
+ "flags": {},
3207
+ "hasDynamicHelp": false,
3208
+ "hiddenAliases": [],
3209
+ "id": "media:create-aspect",
3210
+ "pluginAlias": "@sanity/cli",
3211
+ "pluginName": "@sanity/cli",
3212
+ "pluginType": "core",
3213
+ "strict": true,
3214
+ "isESM": true,
3215
+ "relativePath": [
3216
+ "dist",
3217
+ "commands",
3218
+ "media",
3219
+ "create-aspect.js"
3220
+ ]
3221
+ },
3222
+ "media:delete-aspect": {
3197
3223
  "aliases": [],
3198
3224
  "args": {
3199
- "slug": {
3200
- "description": "Slug of the OpenAPI specification to retrieve",
3201
- "name": "slug",
3225
+ "aspectName": {
3226
+ "description": "Name of the aspect to delete",
3227
+ "name": "aspectName",
3202
3228
  "required": true
3203
3229
  }
3204
3230
  },
3205
- "description": "Get an OpenAPI specification by slug",
3231
+ "description": "Delete an aspect definition",
3206
3232
  "examples": [
3207
3233
  {
3208
- "command": "<%= config.bin %> <%= command.id %> query",
3209
- "description": "Get a specification (YAML format, default)"
3210
- },
3211
- {
3212
- "command": "<%= config.bin %> <%= command.id %> query --format=json",
3213
- "description": "Get specification in JSON format"
3214
- },
3215
- {
3216
- "command": "<%= config.bin %> <%= command.id %> query --web",
3217
- "description": "Open specification in browser"
3218
- },
3219
- {
3220
- "command": "<%= config.bin %> <%= command.id %> query > query-api.yaml",
3221
- "description": "Pipe to file"
3234
+ "command": "<%= config.bin %> <%= command.id %> someAspect",
3235
+ "description": "Delete the aspect named \"someAspect\""
3222
3236
  }
3223
3237
  ],
3224
3238
  "flags": {
3225
- "format": {
3226
- "description": "Output format: yaml (default), json",
3227
- "name": "format",
3228
- "default": "yaml",
3239
+ "project-id": {
3240
+ "char": "p",
3241
+ "description": "Project ID to delete media aspect from (overrides CLI configuration)",
3242
+ "helpGroup": "OVERRIDE",
3243
+ "name": "project-id",
3229
3244
  "hasDynamicHelp": false,
3245
+ "helpValue": "<id>",
3230
3246
  "multiple": false,
3231
- "options": [
3232
- "yaml",
3233
- "json"
3234
- ],
3235
3247
  "type": "option"
3236
3248
  },
3237
- "web": {
3238
- "char": "w",
3239
- "description": "Open in web browser",
3240
- "name": "web",
3249
+ "media-library-id": {
3250
+ "description": "The id of the target media library",
3251
+ "name": "media-library-id",
3252
+ "required": false,
3253
+ "hasDynamicHelp": false,
3254
+ "multiple": false,
3255
+ "type": "option"
3256
+ },
3257
+ "yes": {
3258
+ "aliases": [
3259
+ "y"
3260
+ ],
3261
+ "description": "Skip confirmation prompt",
3262
+ "name": "yes",
3263
+ "required": false,
3241
3264
  "allowNo": false,
3242
3265
  "type": "boolean"
3243
3266
  }
3244
3267
  },
3245
3268
  "hasDynamicHelp": false,
3246
3269
  "hiddenAliases": [],
3247
- "id": "openapi:get",
3270
+ "id": "media:delete-aspect",
3248
3271
  "pluginAlias": "@sanity/cli",
3249
3272
  "pluginName": "@sanity/cli",
3250
3273
  "pluginType": "core",
@@ -3253,46 +3276,60 @@
3253
3276
  "relativePath": [
3254
3277
  "dist",
3255
3278
  "commands",
3256
- "openapi",
3257
- "get.js"
3279
+ "media",
3280
+ "delete-aspect.js"
3258
3281
  ]
3259
3282
  },
3260
- "openapi:list": {
3283
+ "media:deploy-aspect": {
3261
3284
  "aliases": [],
3262
- "args": {},
3263
- "description": "List all available OpenAPI specifications",
3285
+ "args": {
3286
+ "aspectName": {
3287
+ "description": "Name of the aspect to deploy",
3288
+ "name": "aspectName",
3289
+ "required": false
3290
+ }
3291
+ },
3292
+ "description": "Deploy an aspect",
3264
3293
  "examples": [
3265
3294
  {
3266
- "command": "<%= config.bin %> <%= command.id %>",
3267
- "description": "List all available OpenAPI specs"
3268
- },
3269
- {
3270
- "command": "<%= config.bin %> <%= command.id %> --json",
3271
- "description": "List with JSON output"
3295
+ "command": "<%= config.bin %> <%= command.id %> someAspect",
3296
+ "description": "Deploy the aspect named \"someAspect\""
3272
3297
  },
3273
3298
  {
3274
- "command": "<%= config.bin %> <%= command.id %> --web",
3275
- "description": "Open HTTP Reference in browser"
3299
+ "command": "<%= config.bin %> <%= command.id %> --all",
3300
+ "description": "Deploy all aspects"
3276
3301
  }
3277
3302
  ],
3278
3303
  "flags": {
3279
- "json": {
3280
- "description": "Output JSON",
3281
- "name": "json",
3282
- "allowNo": false,
3283
- "type": "boolean"
3304
+ "project-id": {
3305
+ "char": "p",
3306
+ "description": "Project ID to deploy media aspect to (overrides CLI configuration)",
3307
+ "helpGroup": "OVERRIDE",
3308
+ "name": "project-id",
3309
+ "hasDynamicHelp": false,
3310
+ "helpValue": "<id>",
3311
+ "multiple": false,
3312
+ "type": "option"
3284
3313
  },
3285
- "web": {
3286
- "char": "w",
3287
- "description": "Open HTTP Reference in web browser",
3288
- "name": "web",
3314
+ "all": {
3315
+ "description": "Deploy all aspects",
3316
+ "name": "all",
3317
+ "required": false,
3289
3318
  "allowNo": false,
3290
3319
  "type": "boolean"
3320
+ },
3321
+ "media-library-id": {
3322
+ "description": "The id of the target media library",
3323
+ "name": "media-library-id",
3324
+ "required": false,
3325
+ "hasDynamicHelp": false,
3326
+ "multiple": false,
3327
+ "type": "option"
3291
3328
  }
3292
3329
  },
3293
3330
  "hasDynamicHelp": false,
3294
3331
  "hiddenAliases": [],
3295
- "id": "openapi:list",
3332
+ "id": "media:deploy-aspect",
3296
3333
  "pluginAlias": "@sanity/cli",
3297
3334
  "pluginName": "@sanity/cli",
3298
3335
  "pluginType": "core",
@@ -3301,88 +3338,75 @@
3301
3338
  "relativePath": [
3302
3339
  "dist",
3303
3340
  "commands",
3304
- "openapi",
3305
- "list.js"
3341
+ "media",
3342
+ "deploy-aspect.js"
3306
3343
  ]
3307
3344
  },
3308
- "projects:create": {
3345
+ "media:export": {
3309
3346
  "aliases": [],
3310
3347
  "args": {
3311
- "projectName": {
3312
- "description": "Name of the project to create",
3313
- "name": "projectName",
3314
- "required": false
3348
+ "destination": {
3349
+ "description": "Output destination file path",
3350
+ "name": "destination"
3315
3351
  }
3316
3352
  },
3317
- "description": "Create a new Sanity project",
3353
+ "description": "Export file and image assets from a media library (excludes video)",
3318
3354
  "examples": [
3319
3355
  {
3320
3356
  "command": "<%= config.bin %> <%= command.id %>",
3321
- "description": "Interactively create a project"
3322
- },
3323
- {
3324
- "command": "<%= config.bin %> <%= command.id %> \"My New Project\"",
3325
- "description": "Create a project named \"My New Project\""
3326
- },
3327
- {
3328
- "command": "<%= config.bin %> <%= command.id %> \"My Project\" --organization=my-org",
3329
- "description": "Create a project in a specific organization"
3357
+ "description": "Export media library interactively"
3330
3358
  },
3331
3359
  {
3332
- "command": "<%= config.bin %> <%= command.id %> \"My Project\" --dataset=staging --dataset-visibility=private",
3333
- "description": "Create a project with a private dataset named \"staging\""
3360
+ "command": "<%= config.bin %> <%= command.id %> output.tar.gz",
3361
+ "description": "Export media library to output.tar.gz"
3334
3362
  },
3335
3363
  {
3336
- "command": "<%= config.bin %> <%= command.id %> \"CI Project\" --yes --json",
3337
- "description": "Create a project non-interactively with JSON output"
3364
+ "command": "<%= config.bin %> <%= command.id %> --media-library-id my-library-id",
3365
+ "description": "Export specific media library"
3338
3366
  }
3339
3367
  ],
3340
3368
  "flags": {
3341
- "dataset": {
3342
- "description": "Create a dataset. Prompts for visibility unless specified or --yes used",
3343
- "name": "dataset",
3369
+ "project-id": {
3370
+ "char": "p",
3371
+ "description": "Project ID to export media from (overrides CLI configuration)",
3372
+ "helpGroup": "OVERRIDE",
3373
+ "name": "project-id",
3344
3374
  "hasDynamicHelp": false,
3375
+ "helpValue": "<id>",
3345
3376
  "multiple": false,
3346
3377
  "type": "option"
3347
3378
  },
3348
- "dataset-visibility": {
3349
- "description": "Dataset visibility: public or private",
3350
- "name": "dataset-visibility",
3379
+ "asset-concurrency": {
3380
+ "description": "Concurrent number of asset downloads",
3381
+ "name": "asset-concurrency",
3382
+ "default": 8,
3351
3383
  "hasDynamicHelp": false,
3352
3384
  "multiple": false,
3353
- "options": [
3354
- "private",
3355
- "public"
3356
- ],
3357
3385
  "type": "option"
3358
3386
  },
3359
- "json": {
3360
- "description": "Output in JSON format",
3361
- "name": "json",
3362
- "allowNo": false,
3363
- "type": "boolean"
3364
- },
3365
- "organization": {
3366
- "description": "Organization to create the project in",
3367
- "name": "organization",
3387
+ "media-library-id": {
3388
+ "description": "The id of the target media library",
3389
+ "name": "media-library-id",
3368
3390
  "hasDynamicHelp": false,
3369
- "helpValue": "<slug|id>",
3370
3391
  "multiple": false,
3371
3392
  "type": "option"
3372
3393
  },
3373
- "yes": {
3374
- "char": "y",
3375
- "description": "Skip prompts and use defaults (project: \"My Sanity Project\", dataset: production, visibility: public)",
3376
- "name": "yes",
3394
+ "no-compress": {
3395
+ "description": "Skips compressing tarball entries (still generates a gzip file)",
3396
+ "name": "no-compress",
3397
+ "allowNo": false,
3398
+ "type": "boolean"
3399
+ },
3400
+ "overwrite": {
3401
+ "description": "Overwrite any file with the same name",
3402
+ "name": "overwrite",
3377
3403
  "allowNo": false,
3378
3404
  "type": "boolean"
3379
3405
  }
3380
3406
  },
3381
3407
  "hasDynamicHelp": false,
3382
- "hiddenAliases": [
3383
- "project:create"
3384
- ],
3385
- "id": "projects:create",
3408
+ "hiddenAliases": [],
3409
+ "id": "media:export",
3386
3410
  "pluginAlias": "@sanity/cli",
3387
3411
  "pluginName": "@sanity/cli",
3388
3412
  "pluginType": "core",
@@ -3391,58 +3415,62 @@
3391
3415
  "relativePath": [
3392
3416
  "dist",
3393
3417
  "commands",
3394
- "projects",
3395
- "create.js"
3418
+ "media",
3419
+ "export.js"
3396
3420
  ]
3397
3421
  },
3398
- "projects:list": {
3422
+ "media:import": {
3399
3423
  "aliases": [],
3400
- "args": {},
3401
- "description": "List your projects",
3424
+ "args": {
3425
+ "source": {
3426
+ "description": "Image file or folder to import from",
3427
+ "name": "source",
3428
+ "required": true
3429
+ }
3430
+ },
3431
+ "description": "Import a set of assets to the target media library.",
3402
3432
  "examples": [
3403
3433
  {
3404
- "command": "<%= config.bin %> <%= command.id %>",
3405
- "description": "List projects"
3434
+ "command": "<%= config.bin %> <%= command.id %> products",
3435
+ "description": "Import all assets from the \"products\" directory"
3406
3436
  },
3407
3437
  {
3408
- "command": "<%= config.bin %> <%= command.id %> --sort=members --order=asc",
3409
- "description": "List projects sorted by member count, ascending"
3410
- }
3411
- ],
3438
+ "command": "<%= config.bin %> <%= command.id %> gallery.tar.gz",
3439
+ "description": "Import all assets from \"gallery\" archive"
3440
+ },
3441
+ {
3442
+ "command": "<%= config.bin %> <%= command.id %> products --replace-aspects",
3443
+ "description": "Import all assets from the \"products\" directory and replace aspects"
3444
+ }
3445
+ ],
3412
3446
  "flags": {
3413
- "order": {
3414
- "description": "Sort direction",
3415
- "name": "order",
3416
- "default": "desc",
3447
+ "project-id": {
3448
+ "char": "p",
3449
+ "description": "Project ID to import media to (overrides CLI configuration)",
3450
+ "helpGroup": "OVERRIDE",
3451
+ "name": "project-id",
3417
3452
  "hasDynamicHelp": false,
3453
+ "helpValue": "<id>",
3418
3454
  "multiple": false,
3419
- "options": [
3420
- "asc",
3421
- "desc"
3422
- ],
3423
3455
  "type": "option"
3424
3456
  },
3425
- "sort": {
3426
- "description": "Sort field",
3427
- "name": "sort",
3428
- "default": "created",
3457
+ "media-library-id": {
3458
+ "description": "The id of the target media library",
3459
+ "name": "media-library-id",
3429
3460
  "hasDynamicHelp": false,
3430
3461
  "multiple": false,
3431
- "options": [
3432
- "id",
3433
- "members",
3434
- "name",
3435
- "url",
3436
- "created"
3437
- ],
3438
3462
  "type": "option"
3463
+ },
3464
+ "replace-aspects": {
3465
+ "description": "Replace existing aspect data. All versions will be replaced (e.g. published and draft aspect data)",
3466
+ "name": "replace-aspects",
3467
+ "allowNo": false,
3468
+ "type": "boolean"
3439
3469
  }
3440
3470
  },
3441
3471
  "hasDynamicHelp": false,
3442
- "hiddenAliases": [
3443
- "project:list"
3444
- ],
3445
- "id": "projects:list",
3472
+ "hiddenAliases": [],
3473
+ "id": "media:import",
3446
3474
  "pluginAlias": "@sanity/cli",
3447
3475
  "pluginName": "@sanity/cli",
3448
3476
  "pluginType": "core",
@@ -3451,80 +3479,62 @@
3451
3479
  "relativePath": [
3452
3480
  "dist",
3453
3481
  "commands",
3454
- "projects",
3455
- "list.js"
3482
+ "media",
3483
+ "import.js"
3456
3484
  ]
3457
3485
  },
3458
- "schemas:delete": {
3486
+ "openapi:get": {
3459
3487
  "aliases": [],
3460
- "args": {},
3461
- "description": "Delete schema documents by id",
3488
+ "args": {
3489
+ "slug": {
3490
+ "description": "Slug of the OpenAPI specification to retrieve",
3491
+ "name": "slug",
3492
+ "required": true
3493
+ }
3494
+ },
3495
+ "description": "Get an OpenAPI specification by slug",
3462
3496
  "examples": [
3463
3497
  {
3464
- "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName",
3465
- "description": "Delete a single schema"
3498
+ "command": "<%= config.bin %> <%= command.id %> query",
3499
+ "description": "Get a specification (YAML format, default)"
3466
3500
  },
3467
3501
  {
3468
- "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName,prefix.sanity.workspace.schema.otherWorkspace",
3469
- "description": "Delete multiple schemas"
3502
+ "command": "<%= config.bin %> <%= command.id %> query --format=json",
3503
+ "description": "Get specification in JSON format"
3504
+ },
3505
+ {
3506
+ "command": "<%= config.bin %> <%= command.id %> query --web",
3507
+ "description": "Open specification in browser"
3508
+ },
3509
+ {
3510
+ "command": "<%= config.bin %> <%= command.id %> query > query-api.yaml",
3511
+ "description": "Pipe to file"
3470
3512
  }
3471
3513
  ],
3472
3514
  "flags": {
3473
- "project-id": {
3474
- "char": "p",
3475
- "description": "Project ID to delete schema from (overrides CLI configuration)",
3476
- "helpGroup": "OVERRIDE",
3477
- "name": "project-id",
3478
- "hasDynamicHelp": false,
3479
- "helpValue": "<id>",
3480
- "multiple": false,
3481
- "type": "option"
3482
- },
3483
- "dataset": {
3484
- "char": "d",
3485
- "description": "Delete schemas from a specific dataset",
3486
- "name": "dataset",
3487
- "hasDynamicHelp": false,
3488
- "helpValue": "<name>",
3489
- "multiple": false,
3490
- "type": "option"
3491
- },
3492
- "extract-manifest": {
3493
- "description": "Generate manifest file (disable with --no-extract-manifest)",
3494
- "hidden": true,
3495
- "name": "extract-manifest",
3496
- "allowNo": true,
3497
- "type": "boolean"
3498
- },
3499
- "ids": {
3500
- "description": "Comma-separated list of schema ids to delete",
3501
- "name": "ids",
3502
- "required": true,
3503
- "hasDynamicHelp": false,
3504
- "multiple": false,
3505
- "type": "option"
3506
- },
3507
- "manifest-dir": {
3508
- "description": "Directory containing manifest file",
3509
- "hidden": true,
3510
- "name": "manifest-dir",
3511
- "default": "./dist/static",
3515
+ "format": {
3516
+ "description": "Output format: yaml (default), json",
3517
+ "name": "format",
3518
+ "default": "yaml",
3512
3519
  "hasDynamicHelp": false,
3513
3520
  "multiple": false,
3521
+ "options": [
3522
+ "yaml",
3523
+ "json"
3524
+ ],
3514
3525
  "type": "option"
3515
3526
  },
3516
- "verbose": {
3517
- "description": "Enable verbose logging",
3518
- "name": "verbose",
3527
+ "web": {
3528
+ "char": "w",
3529
+ "description": "Open in web browser",
3530
+ "name": "web",
3519
3531
  "allowNo": false,
3520
3532
  "type": "boolean"
3521
3533
  }
3522
3534
  },
3523
3535
  "hasDynamicHelp": false,
3524
- "hiddenAliases": [
3525
- "schema:delete"
3526
- ],
3527
- "id": "schemas:delete",
3536
+ "hiddenAliases": [],
3537
+ "id": "openapi:get",
3528
3538
  "pluginAlias": "@sanity/cli",
3529
3539
  "pluginName": "@sanity/cli",
3530
3540
  "pluginType": "core",
@@ -3533,68 +3543,46 @@
3533
3543
  "relativePath": [
3534
3544
  "dist",
3535
3545
  "commands",
3536
- "schemas",
3537
- "delete.js"
3546
+ "openapi",
3547
+ "get.js"
3538
3548
  ]
3539
3549
  },
3540
- "schemas:deploy": {
3550
+ "openapi:list": {
3541
3551
  "aliases": [],
3542
3552
  "args": {},
3543
- "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.",
3553
+ "description": "List all available OpenAPI specifications",
3544
3554
  "examples": [
3545
3555
  {
3546
3556
  "command": "<%= config.bin %> <%= command.id %>",
3547
- "description": "Deploy all workspace schemas"
3557
+ "description": "List all available OpenAPI specs"
3548
3558
  },
3549
3559
  {
3550
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
3551
- "description": "Deploy the schema for only the workspace \"default\""
3560
+ "command": "<%= config.bin %> <%= command.id %> --json",
3561
+ "description": "List with JSON output"
3562
+ },
3563
+ {
3564
+ "command": "<%= config.bin %> <%= command.id %> --web",
3565
+ "description": "Open HTTP Reference in browser"
3552
3566
  }
3553
3567
  ],
3554
3568
  "flags": {
3555
- "extract-manifest": {
3556
- "description": "Regenerate manifest before deploying (use --no-extract-manifest to skip)",
3557
- "name": "extract-manifest",
3558
- "allowNo": true,
3569
+ "json": {
3570
+ "description": "Output JSON",
3571
+ "name": "json",
3572
+ "allowNo": false,
3559
3573
  "type": "boolean"
3560
3574
  },
3561
- "manifest-dir": {
3562
- "description": "Directory containing manifest file",
3563
- "name": "manifest-dir",
3564
- "default": "./dist/static",
3565
- "hasDynamicHelp": false,
3566
- "helpValue": "<directory>",
3567
- "multiple": false,
3568
- "type": "option"
3569
- },
3570
- "tag": {
3571
- "description": "Add a tag suffix to the schema id",
3572
- "name": "tag",
3573
- "hasDynamicHelp": false,
3574
- "helpValue": "<tag>",
3575
- "multiple": false,
3576
- "type": "option"
3577
- },
3578
- "verbose": {
3579
- "description": "Print detailed information during deployment",
3580
- "name": "verbose",
3575
+ "web": {
3576
+ "char": "w",
3577
+ "description": "Open HTTP Reference in web browser",
3578
+ "name": "web",
3581
3579
  "allowNo": false,
3582
3580
  "type": "boolean"
3583
- },
3584
- "workspace": {
3585
- "description": "The name of the workspace to deploy a schema for",
3586
- "name": "workspace",
3587
- "hasDynamicHelp": false,
3588
- "helpValue": "<name>",
3589
- "multiple": false,
3590
- "type": "option"
3591
3581
  }
3592
3582
  },
3593
3583
  "hasDynamicHelp": false,
3594
- "hiddenAliases": [
3595
- "schema:deploy"
3596
- ],
3597
- "id": "schemas:deploy",
3584
+ "hiddenAliases": [],
3585
+ "id": "openapi:list",
3598
3586
  "pluginAlias": "@sanity/cli",
3599
3587
  "pluginName": "@sanity/cli",
3600
3588
  "pluginType": "core",
@@ -3603,79 +3591,88 @@
3603
3591
  "relativePath": [
3604
3592
  "dist",
3605
3593
  "commands",
3606
- "schemas",
3607
- "deploy.js"
3594
+ "openapi",
3595
+ "list.js"
3608
3596
  ]
3609
3597
  },
3610
- "schemas:extract": {
3598
+ "projects:create": {
3611
3599
  "aliases": [],
3612
- "args": {},
3613
- "description": "Extract a JSON representation of a Sanity schema within a Studio context.\n\nNote: This command is experimental and subject to change.",
3600
+ "args": {
3601
+ "projectName": {
3602
+ "description": "Name of the project to create",
3603
+ "name": "projectName",
3604
+ "required": false
3605
+ }
3606
+ },
3607
+ "description": "Create a new Sanity project",
3614
3608
  "examples": [
3615
3609
  {
3616
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
3617
- "description": "Extracts schema types in a Sanity project with more than one workspace"
3610
+ "command": "<%= config.bin %> <%= command.id %>",
3611
+ "description": "Interactively create a project"
3618
3612
  },
3619
3613
  {
3620
- "command": "<%= config.bin %> <%= command.id %> --watch",
3621
- "description": "Watch mode - re-extract on changes"
3614
+ "command": "<%= config.bin %> <%= command.id %> \"My New Project\"",
3615
+ "description": "Create a project named \"My New Project\""
3622
3616
  },
3623
3617
  {
3624
- "command": "<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"",
3625
- "description": "Watch with custom glob patterns"
3618
+ "command": "<%= config.bin %> <%= command.id %> \"My Project\" --organization=my-org",
3619
+ "description": "Create a project in a specific organization"
3620
+ },
3621
+ {
3622
+ "command": "<%= config.bin %> <%= command.id %> \"My Project\" --dataset=staging --dataset-visibility=private",
3623
+ "description": "Create a project with a private dataset named \"staging\""
3624
+ },
3625
+ {
3626
+ "command": "<%= config.bin %> <%= command.id %> \"CI Project\" --yes --json",
3627
+ "description": "Create a project non-interactively with JSON output"
3626
3628
  }
3627
3629
  ],
3628
3630
  "flags": {
3629
- "enforce-required-fields": {
3630
- "description": "Makes the schema generated treat fields marked as required as non-optional",
3631
- "name": "enforce-required-fields",
3632
- "allowNo": false,
3633
- "type": "boolean"
3634
- },
3635
- "format": {
3636
- "description": "Output format (currently only groq-type-nodes)",
3637
- "name": "format",
3638
- "default": "groq-type-nodes",
3631
+ "dataset": {
3632
+ "description": "Create a dataset. Prompts for visibility unless specified or --yes used",
3633
+ "name": "dataset",
3639
3634
  "hasDynamicHelp": false,
3640
- "helpValue": "<format>",
3641
3635
  "multiple": false,
3642
3636
  "type": "option"
3643
3637
  },
3644
- "path": {
3645
- "description": "Optional path to specify destination of the schema file",
3646
- "name": "path",
3638
+ "dataset-visibility": {
3639
+ "description": "Dataset visibility: public or private",
3640
+ "name": "dataset-visibility",
3647
3641
  "hasDynamicHelp": false,
3648
3642
  "multiple": false,
3643
+ "options": [
3644
+ "private",
3645
+ "public"
3646
+ ],
3649
3647
  "type": "option"
3650
3648
  },
3651
- "watch": {
3652
- "description": "Enable watch mode to re-extract schema on file changes",
3653
- "name": "watch",
3649
+ "json": {
3650
+ "description": "Output in JSON format",
3651
+ "name": "json",
3654
3652
  "allowNo": false,
3655
3653
  "type": "boolean"
3656
- },
3657
- "watch-patterns": {
3658
- "description": "Additional glob pattern(s) to watch (can be specified multiple times)",
3659
- "name": "watch-patterns",
3660
- "hasDynamicHelp": false,
3661
- "helpValue": "<glob>",
3662
- "multiple": true,
3663
- "type": "option"
3664
- },
3665
- "workspace": {
3666
- "description": "The name of the workspace to generate a schema for",
3667
- "name": "workspace",
3654
+ },
3655
+ "organization": {
3656
+ "description": "Organization to create the project in",
3657
+ "name": "organization",
3668
3658
  "hasDynamicHelp": false,
3669
- "helpValue": "<name>",
3659
+ "helpValue": "<slug|id>",
3670
3660
  "multiple": false,
3671
3661
  "type": "option"
3662
+ },
3663
+ "yes": {
3664
+ "char": "y",
3665
+ "description": "Skip prompts and use defaults (project: \"My Sanity Project\", dataset: production, visibility: public)",
3666
+ "name": "yes",
3667
+ "allowNo": false,
3668
+ "type": "boolean"
3672
3669
  }
3673
3670
  },
3674
3671
  "hasDynamicHelp": false,
3675
3672
  "hiddenAliases": [
3676
- "schema:extract"
3673
+ "project:create"
3677
3674
  ],
3678
- "id": "schemas:extract",
3675
+ "id": "projects:create",
3679
3676
  "pluginAlias": "@sanity/cli",
3680
3677
  "pluginName": "@sanity/cli",
3681
3678
  "pluginType": "core",
@@ -3684,70 +3681,58 @@
3684
3681
  "relativePath": [
3685
3682
  "dist",
3686
3683
  "commands",
3687
- "schemas",
3688
- "extract.js"
3684
+ "projects",
3685
+ "create.js"
3689
3686
  ]
3690
3687
  },
3691
- "schemas:list": {
3688
+ "projects:list": {
3692
3689
  "aliases": [],
3693
3690
  "args": {},
3694
- "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.",
3691
+ "description": "List your projects",
3695
3692
  "examples": [
3696
3693
  {
3697
3694
  "command": "<%= config.bin %> <%= command.id %>",
3698
- "description": "List all schemas found in any workspace dataset in a table"
3699
- },
3700
- {
3701
- "command": "<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName",
3702
- "description": "Get a schema for a given id"
3703
- },
3704
- {
3705
- "command": "<%= config.bin %> <%= command.id %> --json",
3706
- "description": "Get stored schemas as pretty-printed json-array"
3695
+ "description": "List projects"
3707
3696
  },
3708
3697
  {
3709
- "command": "<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName",
3710
- "description": "Get singular stored schema as pretty-printed json-object"
3698
+ "command": "<%= config.bin %> <%= command.id %> --sort=members --order=asc",
3699
+ "description": "List projects sorted by member count, ascending"
3711
3700
  }
3712
3701
  ],
3713
3702
  "flags": {
3714
- "extract-manifest": {
3715
- "description": "Regenerate manifest before listing (use --no-extract-manifest to skip)",
3716
- "hidden": true,
3717
- "name": "extract-manifest",
3718
- "allowNo": true,
3719
- "type": "boolean"
3720
- },
3721
- "id": {
3722
- "description": "Fetch a single schema by id",
3723
- "name": "id",
3703
+ "order": {
3704
+ "description": "Sort direction",
3705
+ "name": "order",
3706
+ "default": "desc",
3724
3707
  "hasDynamicHelp": false,
3725
- "helpValue": "<schema_id>",
3726
3708
  "multiple": false,
3709
+ "options": [
3710
+ "asc",
3711
+ "desc"
3712
+ ],
3727
3713
  "type": "option"
3728
3714
  },
3729
- "json": {
3730
- "description": "Get schema as json",
3731
- "name": "json",
3732
- "allowNo": false,
3733
- "type": "boolean"
3734
- },
3735
- "manifest-dir": {
3736
- "description": "Directory containing manifest file",
3737
- "hidden": true,
3738
- "name": "manifest-dir",
3739
- "default": "./dist/static",
3715
+ "sort": {
3716
+ "description": "Sort field",
3717
+ "name": "sort",
3718
+ "default": "created",
3740
3719
  "hasDynamicHelp": false,
3741
- "helpValue": "<directory>",
3742
3720
  "multiple": false,
3721
+ "options": [
3722
+ "id",
3723
+ "members",
3724
+ "name",
3725
+ "url",
3726
+ "created"
3727
+ ],
3743
3728
  "type": "option"
3744
3729
  }
3745
3730
  },
3746
3731
  "hasDynamicHelp": false,
3747
3732
  "hiddenAliases": [
3748
- "schema:list"
3733
+ "project:list"
3749
3734
  ],
3750
- "id": "schemas:list",
3735
+ "id": "projects:list",
3751
3736
  "pluginAlias": "@sanity/cli",
3752
3737
  "pluginName": "@sanity/cli",
3753
3738
  "pluginType": "core",
@@ -3756,79 +3741,80 @@
3756
3741
  "relativePath": [
3757
3742
  "dist",
3758
3743
  "commands",
3759
- "schemas",
3744
+ "projects",
3760
3745
  "list.js"
3761
3746
  ]
3762
3747
  },
3763
- "schemas:validate": {
3748
+ "schemas:delete": {
3764
3749
  "aliases": [],
3765
3750
  "args": {},
3766
- "description": "Validates all schema types specified in a workspace",
3751
+ "description": "Delete schema documents by id",
3767
3752
  "examples": [
3768
3753
  {
3769
- "command": "<%= config.bin %> <%= command.id %> --workspace default",
3770
- "description": "Validates all schema types in a Sanity project with more than one workspace"
3771
- },
3772
- {
3773
- "command": "<%= config.bin %> <%= command.id %> > report.txt",
3774
- "description": "Save the results of the report into a file"
3775
- },
3776
- {
3777
- "command": "<%= config.bin %> <%= command.id %> --level error",
3778
- "description": "Report out only errors"
3754
+ "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName",
3755
+ "description": "Delete a single schema"
3779
3756
  },
3780
3757
  {
3781
- "command": "<%= config.bin %> <%= command.id %> --debug-metafile-path metafile.json",
3782
- "description": "Generate a report which can be analyzed with https://esbuild.github.io/analyze/"
3758
+ "command": "<%= config.bin %> <%= command.id %> --ids sanity.workspace.schema.workspaceName,prefix.sanity.workspace.schema.otherWorkspace",
3759
+ "description": "Delete multiple schemas"
3783
3760
  }
3784
3761
  ],
3785
3762
  "flags": {
3786
- "debug-metafile-path": {
3787
- "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/",
3788
- "helpGroup": "DEBUG",
3789
- "name": "debug-metafile-path",
3763
+ "project-id": {
3764
+ "char": "p",
3765
+ "description": "Project ID to delete schema from (overrides CLI configuration)",
3766
+ "helpGroup": "OVERRIDE",
3767
+ "name": "project-id",
3790
3768
  "hasDynamicHelp": false,
3769
+ "helpValue": "<id>",
3791
3770
  "multiple": false,
3792
3771
  "type": "option"
3793
3772
  },
3794
- "format": {
3795
- "description": "The output format used to print schema errors and warnings",
3796
- "name": "format",
3797
- "default": "pretty",
3773
+ "dataset": {
3774
+ "char": "d",
3775
+ "description": "Delete schemas from a specific dataset",
3776
+ "name": "dataset",
3798
3777
  "hasDynamicHelp": false,
3778
+ "helpValue": "<name>",
3799
3779
  "multiple": false,
3800
- "options": [
3801
- "pretty",
3802
- "ndjson",
3803
- "json"
3804
- ],
3805
3780
  "type": "option"
3806
3781
  },
3807
- "level": {
3808
- "description": "The minimum level reported out",
3809
- "name": "level",
3810
- "default": "warning",
3782
+ "extract-manifest": {
3783
+ "description": "Generate manifest file (disable with --no-extract-manifest)",
3784
+ "hidden": true,
3785
+ "name": "extract-manifest",
3786
+ "allowNo": true,
3787
+ "type": "boolean"
3788
+ },
3789
+ "ids": {
3790
+ "description": "Comma-separated list of schema ids to delete",
3791
+ "name": "ids",
3792
+ "required": true,
3811
3793
  "hasDynamicHelp": false,
3812
3794
  "multiple": false,
3813
- "options": [
3814
- "error",
3815
- "warning"
3816
- ],
3817
3795
  "type": "option"
3818
3796
  },
3819
- "workspace": {
3820
- "description": "The name of the workspace to use when validating all schema types",
3821
- "name": "workspace",
3797
+ "manifest-dir": {
3798
+ "description": "Directory containing manifest file",
3799
+ "hidden": true,
3800
+ "name": "manifest-dir",
3801
+ "default": "./dist/static",
3822
3802
  "hasDynamicHelp": false,
3823
3803
  "multiple": false,
3824
3804
  "type": "option"
3805
+ },
3806
+ "verbose": {
3807
+ "description": "Enable verbose logging",
3808
+ "name": "verbose",
3809
+ "allowNo": false,
3810
+ "type": "boolean"
3825
3811
  }
3826
3812
  },
3827
3813
  "hasDynamicHelp": false,
3828
3814
  "hiddenAliases": [
3829
- "schema:validate"
3815
+ "schema:delete"
3830
3816
  ],
3831
- "id": "schemas:validate",
3817
+ "id": "schemas:delete",
3832
3818
  "pluginAlias": "@sanity/cli",
3833
3819
  "pluginName": "@sanity/cli",
3834
3820
  "pluginType": "core",
@@ -3838,84 +3824,67 @@
3838
3824
  "dist",
3839
3825
  "commands",
3840
3826
  "schemas",
3841
- "validate.js"
3827
+ "delete.js"
3842
3828
  ]
3843
3829
  },
3844
- "media:create-aspect": {
3830
+ "schemas:deploy": {
3845
3831
  "aliases": [],
3846
3832
  "args": {},
3847
- "description": "Create a new aspect definition file",
3833
+ "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.",
3848
3834
  "examples": [
3849
3835
  {
3850
3836
  "command": "<%= config.bin %> <%= command.id %>",
3851
- "description": "Create a new aspect definition file"
3852
- }
3853
- ],
3854
- "flags": {},
3855
- "hasDynamicHelp": false,
3856
- "hiddenAliases": [],
3857
- "id": "media:create-aspect",
3858
- "pluginAlias": "@sanity/cli",
3859
- "pluginName": "@sanity/cli",
3860
- "pluginType": "core",
3861
- "strict": true,
3862
- "isESM": true,
3863
- "relativePath": [
3864
- "dist",
3865
- "commands",
3866
- "media",
3867
- "create-aspect.js"
3868
- ]
3869
- },
3870
- "media:delete-aspect": {
3871
- "aliases": [],
3872
- "args": {
3873
- "aspectName": {
3874
- "description": "Name of the aspect to delete",
3875
- "name": "aspectName",
3876
- "required": true
3877
- }
3878
- },
3879
- "description": "Delete an aspect definition",
3880
- "examples": [
3837
+ "description": "Deploy all workspace schemas"
3838
+ },
3881
3839
  {
3882
- "command": "<%= config.bin %> <%= command.id %> someAspect",
3883
- "description": "Delete the aspect named \"someAspect\""
3840
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
3841
+ "description": "Deploy the schema for only the workspace \"default\""
3884
3842
  }
3885
3843
  ],
3886
3844
  "flags": {
3887
- "project-id": {
3888
- "char": "p",
3889
- "description": "Project ID to delete media aspect from (overrides CLI configuration)",
3890
- "helpGroup": "OVERRIDE",
3891
- "name": "project-id",
3845
+ "extract-manifest": {
3846
+ "description": "Regenerate manifest before deploying (use --no-extract-manifest to skip)",
3847
+ "name": "extract-manifest",
3848
+ "allowNo": true,
3849
+ "type": "boolean"
3850
+ },
3851
+ "manifest-dir": {
3852
+ "description": "Directory containing manifest file",
3853
+ "name": "manifest-dir",
3854
+ "default": "./dist/static",
3892
3855
  "hasDynamicHelp": false,
3893
- "helpValue": "<id>",
3856
+ "helpValue": "<directory>",
3894
3857
  "multiple": false,
3895
3858
  "type": "option"
3896
3859
  },
3897
- "media-library-id": {
3898
- "description": "The id of the target media library",
3899
- "name": "media-library-id",
3900
- "required": false,
3860
+ "tag": {
3861
+ "description": "Add a tag suffix to the schema id",
3862
+ "name": "tag",
3901
3863
  "hasDynamicHelp": false,
3864
+ "helpValue": "<tag>",
3902
3865
  "multiple": false,
3903
3866
  "type": "option"
3904
3867
  },
3905
- "yes": {
3906
- "aliases": [
3907
- "y"
3908
- ],
3909
- "description": "Skip confirmation prompt",
3910
- "name": "yes",
3911
- "required": false,
3868
+ "verbose": {
3869
+ "description": "Print detailed information during deployment",
3870
+ "name": "verbose",
3912
3871
  "allowNo": false,
3913
3872
  "type": "boolean"
3873
+ },
3874
+ "workspace": {
3875
+ "description": "The name of the workspace to deploy a schema for",
3876
+ "name": "workspace",
3877
+ "hasDynamicHelp": false,
3878
+ "helpValue": "<name>",
3879
+ "multiple": false,
3880
+ "type": "option"
3914
3881
  }
3915
3882
  },
3916
3883
  "hasDynamicHelp": false,
3917
- "hiddenAliases": [],
3918
- "id": "media:delete-aspect",
3884
+ "hiddenAliases": [
3885
+ "schema:deploy"
3886
+ ],
3887
+ "id": "schemas:deploy",
3919
3888
  "pluginAlias": "@sanity/cli",
3920
3889
  "pluginName": "@sanity/cli",
3921
3890
  "pluginType": "core",
@@ -3924,60 +3893,79 @@
3924
3893
  "relativePath": [
3925
3894
  "dist",
3926
3895
  "commands",
3927
- "media",
3928
- "delete-aspect.js"
3896
+ "schemas",
3897
+ "deploy.js"
3929
3898
  ]
3930
3899
  },
3931
- "media:deploy-aspect": {
3900
+ "schemas:extract": {
3932
3901
  "aliases": [],
3933
- "args": {
3934
- "aspectName": {
3935
- "description": "Name of the aspect to deploy",
3936
- "name": "aspectName",
3937
- "required": false
3938
- }
3939
- },
3940
- "description": "Deploy an aspect",
3902
+ "args": {},
3903
+ "description": "Extract a JSON representation of a Sanity schema within a Studio context.\n\nNote: This command is experimental and subject to change.",
3941
3904
  "examples": [
3942
3905
  {
3943
- "command": "<%= config.bin %> <%= command.id %> someAspect",
3944
- "description": "Deploy the aspect named \"someAspect\""
3906
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
3907
+ "description": "Extracts schema types in a Sanity project with more than one workspace"
3945
3908
  },
3946
3909
  {
3947
- "command": "<%= config.bin %> <%= command.id %> --all",
3948
- "description": "Deploy all aspects"
3910
+ "command": "<%= config.bin %> <%= command.id %> --watch",
3911
+ "description": "Watch mode - re-extract on changes"
3912
+ },
3913
+ {
3914
+ "command": "<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"",
3915
+ "description": "Watch with custom glob patterns"
3949
3916
  }
3950
3917
  ],
3951
3918
  "flags": {
3952
- "project-id": {
3953
- "char": "p",
3954
- "description": "Project ID to deploy media aspect to (overrides CLI configuration)",
3955
- "helpGroup": "OVERRIDE",
3956
- "name": "project-id",
3919
+ "enforce-required-fields": {
3920
+ "description": "Makes the schema generated treat fields marked as required as non-optional",
3921
+ "name": "enforce-required-fields",
3922
+ "allowNo": false,
3923
+ "type": "boolean"
3924
+ },
3925
+ "format": {
3926
+ "description": "Output format (currently only groq-type-nodes)",
3927
+ "name": "format",
3928
+ "default": "groq-type-nodes",
3957
3929
  "hasDynamicHelp": false,
3958
- "helpValue": "<id>",
3930
+ "helpValue": "<format>",
3959
3931
  "multiple": false,
3960
3932
  "type": "option"
3961
3933
  },
3962
- "all": {
3963
- "description": "Deploy all aspects",
3964
- "name": "all",
3965
- "required": false,
3934
+ "path": {
3935
+ "description": "Optional path to specify destination of the schema file",
3936
+ "name": "path",
3937
+ "hasDynamicHelp": false,
3938
+ "multiple": false,
3939
+ "type": "option"
3940
+ },
3941
+ "watch": {
3942
+ "description": "Enable watch mode to re-extract schema on file changes",
3943
+ "name": "watch",
3966
3944
  "allowNo": false,
3967
3945
  "type": "boolean"
3968
3946
  },
3969
- "media-library-id": {
3970
- "description": "The id of the target media library",
3971
- "name": "media-library-id",
3972
- "required": false,
3947
+ "watch-patterns": {
3948
+ "description": "Additional glob pattern(s) to watch (can be specified multiple times)",
3949
+ "name": "watch-patterns",
3950
+ "hasDynamicHelp": false,
3951
+ "helpValue": "<glob>",
3952
+ "multiple": true,
3953
+ "type": "option"
3954
+ },
3955
+ "workspace": {
3956
+ "description": "The name of the workspace to generate a schema for",
3957
+ "name": "workspace",
3973
3958
  "hasDynamicHelp": false,
3959
+ "helpValue": "<name>",
3974
3960
  "multiple": false,
3975
3961
  "type": "option"
3976
3962
  }
3977
3963
  },
3978
3964
  "hasDynamicHelp": false,
3979
- "hiddenAliases": [],
3980
- "id": "media:deploy-aspect",
3965
+ "hiddenAliases": [
3966
+ "schema:extract"
3967
+ ],
3968
+ "id": "schemas:extract",
3981
3969
  "pluginAlias": "@sanity/cli",
3982
3970
  "pluginName": "@sanity/cli",
3983
3971
  "pluginType": "core",
@@ -3986,75 +3974,70 @@
3986
3974
  "relativePath": [
3987
3975
  "dist",
3988
3976
  "commands",
3989
- "media",
3990
- "deploy-aspect.js"
3977
+ "schemas",
3978
+ "extract.js"
3991
3979
  ]
3992
3980
  },
3993
- "media:export": {
3981
+ "schemas:list": {
3994
3982
  "aliases": [],
3995
- "args": {
3996
- "destination": {
3997
- "description": "Output destination file path",
3998
- "name": "destination"
3999
- }
4000
- },
4001
- "description": "Export file and image assets from a media library (excludes video)",
3983
+ "args": {},
3984
+ "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.",
4002
3985
  "examples": [
4003
3986
  {
4004
3987
  "command": "<%= config.bin %> <%= command.id %>",
4005
- "description": "Export media library interactively"
3988
+ "description": "List all schemas found in any workspace dataset in a table"
4006
3989
  },
4007
3990
  {
4008
- "command": "<%= config.bin %> <%= command.id %> output.tar.gz",
4009
- "description": "Export media library to output.tar.gz"
3991
+ "command": "<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName",
3992
+ "description": "Get a schema for a given id"
4010
3993
  },
4011
3994
  {
4012
- "command": "<%= config.bin %> <%= command.id %> --media-library-id my-library-id",
4013
- "description": "Export specific media library"
3995
+ "command": "<%= config.bin %> <%= command.id %> --json",
3996
+ "description": "Get stored schemas as pretty-printed json-array"
3997
+ },
3998
+ {
3999
+ "command": "<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName",
4000
+ "description": "Get singular stored schema as pretty-printed json-object"
4014
4001
  }
4015
4002
  ],
4016
4003
  "flags": {
4017
- "project-id": {
4018
- "char": "p",
4019
- "description": "Project ID to export media from (overrides CLI configuration)",
4020
- "helpGroup": "OVERRIDE",
4021
- "name": "project-id",
4022
- "hasDynamicHelp": false,
4023
- "helpValue": "<id>",
4024
- "multiple": false,
4025
- "type": "option"
4026
- },
4027
- "asset-concurrency": {
4028
- "description": "Concurrent number of asset downloads",
4029
- "name": "asset-concurrency",
4030
- "default": 8,
4031
- "hasDynamicHelp": false,
4032
- "multiple": false,
4033
- "type": "option"
4004
+ "extract-manifest": {
4005
+ "description": "Regenerate manifest before listing (use --no-extract-manifest to skip)",
4006
+ "hidden": true,
4007
+ "name": "extract-manifest",
4008
+ "allowNo": true,
4009
+ "type": "boolean"
4034
4010
  },
4035
- "media-library-id": {
4036
- "description": "The id of the target media library",
4037
- "name": "media-library-id",
4011
+ "id": {
4012
+ "description": "Fetch a single schema by id",
4013
+ "name": "id",
4038
4014
  "hasDynamicHelp": false,
4015
+ "helpValue": "<schema_id>",
4039
4016
  "multiple": false,
4040
4017
  "type": "option"
4041
4018
  },
4042
- "no-compress": {
4043
- "description": "Skips compressing tarball entries (still generates a gzip file)",
4044
- "name": "no-compress",
4019
+ "json": {
4020
+ "description": "Get schema as json",
4021
+ "name": "json",
4045
4022
  "allowNo": false,
4046
4023
  "type": "boolean"
4047
4024
  },
4048
- "overwrite": {
4049
- "description": "Overwrite any file with the same name",
4050
- "name": "overwrite",
4051
- "allowNo": false,
4052
- "type": "boolean"
4025
+ "manifest-dir": {
4026
+ "description": "Directory containing manifest file",
4027
+ "hidden": true,
4028
+ "name": "manifest-dir",
4029
+ "default": "./dist/static",
4030
+ "hasDynamicHelp": false,
4031
+ "helpValue": "<directory>",
4032
+ "multiple": false,
4033
+ "type": "option"
4053
4034
  }
4054
4035
  },
4055
4036
  "hasDynamicHelp": false,
4056
- "hiddenAliases": [],
4057
- "id": "media:export",
4037
+ "hiddenAliases": [
4038
+ "schema:list"
4039
+ ],
4040
+ "id": "schemas:list",
4058
4041
  "pluginAlias": "@sanity/cli",
4059
4042
  "pluginName": "@sanity/cli",
4060
4043
  "pluginType": "core",
@@ -4063,62 +4046,79 @@
4063
4046
  "relativePath": [
4064
4047
  "dist",
4065
4048
  "commands",
4066
- "media",
4067
- "export.js"
4049
+ "schemas",
4050
+ "list.js"
4068
4051
  ]
4069
4052
  },
4070
- "media:import": {
4053
+ "schemas:validate": {
4071
4054
  "aliases": [],
4072
- "args": {
4073
- "source": {
4074
- "description": "Image file or folder to import from",
4075
- "name": "source",
4076
- "required": true
4077
- }
4078
- },
4079
- "description": "Import a set of assets to the target media library.",
4055
+ "args": {},
4056
+ "description": "Validates all schema types specified in a workspace",
4080
4057
  "examples": [
4081
4058
  {
4082
- "command": "<%= config.bin %> <%= command.id %> products",
4083
- "description": "Import all assets from the \"products\" directory"
4059
+ "command": "<%= config.bin %> <%= command.id %> --workspace default",
4060
+ "description": "Validates all schema types in a Sanity project with more than one workspace"
4084
4061
  },
4085
4062
  {
4086
- "command": "<%= config.bin %> <%= command.id %> gallery.tar.gz",
4087
- "description": "Import all assets from \"gallery\" archive"
4063
+ "command": "<%= config.bin %> <%= command.id %> > report.txt",
4064
+ "description": "Save the results of the report into a file"
4088
4065
  },
4089
4066
  {
4090
- "command": "<%= config.bin %> <%= command.id %> products --replace-aspects",
4091
- "description": "Import all assets from the \"products\" directory and replace aspects"
4067
+ "command": "<%= config.bin %> <%= command.id %> --level error",
4068
+ "description": "Report out only errors"
4069
+ },
4070
+ {
4071
+ "command": "<%= config.bin %> <%= command.id %> --debug-metafile-path metafile.json",
4072
+ "description": "Generate a report which can be analyzed with https://esbuild.github.io/analyze/"
4092
4073
  }
4093
4074
  ],
4094
4075
  "flags": {
4095
- "project-id": {
4096
- "char": "p",
4097
- "description": "Project ID to import media to (overrides CLI configuration)",
4098
- "helpGroup": "OVERRIDE",
4099
- "name": "project-id",
4076
+ "debug-metafile-path": {
4077
+ "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/",
4078
+ "helpGroup": "DEBUG",
4079
+ "name": "debug-metafile-path",
4100
4080
  "hasDynamicHelp": false,
4101
- "helpValue": "<id>",
4102
4081
  "multiple": false,
4103
4082
  "type": "option"
4104
4083
  },
4105
- "media-library-id": {
4106
- "description": "The id of the target media library",
4107
- "name": "media-library-id",
4084
+ "format": {
4085
+ "description": "The output format used to print schema errors and warnings",
4086
+ "name": "format",
4087
+ "default": "pretty",
4108
4088
  "hasDynamicHelp": false,
4109
4089
  "multiple": false,
4090
+ "options": [
4091
+ "pretty",
4092
+ "ndjson",
4093
+ "json"
4094
+ ],
4110
4095
  "type": "option"
4111
4096
  },
4112
- "replace-aspects": {
4113
- "description": "Replace existing aspect data. All versions will be replaced (e.g. published and draft aspect data)",
4114
- "name": "replace-aspects",
4115
- "allowNo": false,
4116
- "type": "boolean"
4097
+ "level": {
4098
+ "description": "The minimum level reported out",
4099
+ "name": "level",
4100
+ "default": "warning",
4101
+ "hasDynamicHelp": false,
4102
+ "multiple": false,
4103
+ "options": [
4104
+ "error",
4105
+ "warning"
4106
+ ],
4107
+ "type": "option"
4108
+ },
4109
+ "workspace": {
4110
+ "description": "The name of the workspace to use when validating all schema types",
4111
+ "name": "workspace",
4112
+ "hasDynamicHelp": false,
4113
+ "multiple": false,
4114
+ "type": "option"
4117
4115
  }
4118
4116
  },
4119
4117
  "hasDynamicHelp": false,
4120
- "hiddenAliases": [],
4121
- "id": "media:import",
4118
+ "hiddenAliases": [
4119
+ "schema:validate"
4120
+ ],
4121
+ "id": "schemas:validate",
4122
4122
  "pluginAlias": "@sanity/cli",
4123
4123
  "pluginName": "@sanity/cli",
4124
4124
  "pluginType": "core",
@@ -4127,8 +4127,8 @@
4127
4127
  "relativePath": [
4128
4128
  "dist",
4129
4129
  "commands",
4130
- "media",
4131
- "import.js"
4130
+ "schemas",
4131
+ "validate.js"
4132
4132
  ]
4133
4133
  },
4134
4134
  "telemetry:disable": {
@@ -5082,5 +5082,5 @@
5082
5082
  ]
5083
5083
  }
5084
5084
  },
5085
- "version": "6.4.0"
5085
+ "version": "6.5.0"
5086
5086
  }