CLI Configuration
New CLI Commands, Content Migration Tooling, Schema Validation, and Enhanced Localization & Validation Support
v3.27.0
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
injson
andndjson
formats forsanity documents validate
Studio APIs for internationalization (i18n) and localization (l10n)
v3.22.0
Installation and upgrading
To initiate a new Studio without installing the CLI globally:
npm create sanity@latest
To upgrade a v3 Studio, run this command in its folder:
npm install sanity@latest
✨ Highlights
🌍 Publish! Veröffentlichen! Publicar! 公開!: Sanity Studio UI Localization! 🌍
The Translate the studio UI #1603 issue has been one of our most popular feature requests on GitHub. Now we can finally close it, because we have launched Studio UI localization.
What's New?
- Multilingual support: You can now configure the Sanity Studio user interface to use languages other than English. We're starting with many languages, including Spanish, French, Norwegian, German, Portuguese, Korean, Turkish, Icelandic, Thai, Vietnamese, Swedish, Finnish, Czech, Italian, Japanese, Chinese, and Polish. Don’t see your preferred language? It's easy to request additional language plugins!
- AI-Translated language plugins: These initial translations are generated by AI — we're inviting the community (that’s you!) to help us improve and maintain these translations for accuracy and cultural relevance. Interested? Read more about how to contribute over on GitHub.
First steps to a localized Studio
This is our first step towards a fully global studio. The support for localization will grow, starting with our official plugins. We appreciate your patience and contributions as we expand these capabilities!
Getting started:
- Choose your language: Visit github.com/sanity-io/locales to find the plugin for your desired language. If it's not listed, we’d love you to request it - we can do a first auto-translated pass, and you can help us review and improve the automated translations.
- Plugin setup:
- Ensure you are using Sanity version
3.22.0
or newer - Install the plugin for your desired language (
npm install @sanity/locale-nb-no
) - Import it (
import {nbNOLocale} from @sanity/locale-nb-no
- Add it to your studio's plugins array (
plugins: [nbNOLocale()]
) - You’ll find full instructions on the locale plugin’s README!
- Ensure you are using Sanity version
- Documentation:
We're eager to hear from you and welcome any feedback. This is just the beginning, and your insights are invaluable in making Sanity Studio even better.
Introducing telemetry 📡
As a product company, we have to prioritize what to work on. Ideally, those decisions are based on a healthy amount of vision (how we think things could be better) and insight (how people use the product). We have had a good amount of the former but less of the latter.
With this release, we’re introducing telemetry data collection in the CLI and Studio. Participation is optional, and you can easily opt-out by running npx sanity telemetry disable
, setting the DO_NOT_TRACK=1 environment variable, or visiting Account Settings in Manage. For more details on what data is collected, how it’s being used, and how consent is handled, go to sanity.io/telemetry.
Other features
- Adds experimental support for using Bun as package manager when creating new Sanity projects (
bun create sanity
) - Adds the ability to customize the suffix added to auto-generated GraphQL filter types (
Filter
by default), by configuringfilterSuffix
in the GraphQL configuration ofsanity.cli.ts
🐛 Notable bugfixes
- Fixes issue where annotation popover would open in the wrong location when selecting annotation text in the Portable Text editor
- Fixes removal of marks in the Portable Text editor, not always cleaning up unused mark definitions
- Fixes issue where Portable Text editor would crash when attempting to use annotations on text over multiple blocks
- Fixes issue in which new empty text blocks were added when adding a non-text block in the Portable Text editor
- Fixes an issue where selecting a custom API version in the Vision tool would sometimes crash