Unlock seamless workflows and faster delivery with our latest releases – get the details
Back to changelog

New CLI Commands, Content Migration Tooling, Schema Validation, and Enhanced Localization & Validation Support

Installation and upgrading

To initiate a new Sanity Studio without installing the CLI globally:

npm create sanity@latest

To upgrade a Sanity Studio, run this command in its folder:

npm install sanity@latest

✨ Highlights

New CLI command sanity migration create|list|run

You can now create, list, and run content migrations from the Sanity CLI. The new tooling lets you scaffold content migrations as code and run them in dry and production mode. It also introduces a new API for defining content migration with helper functions (defineMigration()).

You can explore the documentation for schema and content migrations; or learn more by running the following CLI commands in a Sanity Studio project folder:

sanity migration --help

You can run sanity migration create to explore our new content migration templates.

New CLI command: sanity schema validate

You can now validate a Sanity Studio schema with the CLI command sanity schema validate. Among other things, it will identify problems with your schema-type definitions. This tooling can be useful for running in CI/CD pipelines or debugging your schema configuration.

Learn more by running:

sanity schema validate ---help

Other features

  • Adds Studio UI localization support to the comments plugin
  • Adds support for validating dataset import and export files with sanity documents validate
  • Adds intentUrl in json and ndjson formats for sanity documents validate

Published February 01, 2024