Skip to content

Different ways to initialize a Sanity project: npm create vs sanity init

3repliesLast updated: Nov 13, 2026

Hi, Sanity newbie here!
I'm currently working through the Sanity Documentation to get Sanity up and running but I've discovered several ways to do this and I'm finding it confusing. For instance, in the section
Getting Started, the following commands are used:

npm create sanity@latest -- --template clean --create-project "Sanity Project" --dataset production

npm run dev

then in the section
Setting up with Sanity, these commands:

npm install -g @sanity/cli

sanity init

sanity start

and the video tutorial:


npm create sanity@latest


I was wondering if anyone could help me to gain some clarity with this and explain the differences between the approaches?
Please forgive me if this question seems really simple
😳
Thanks!
AI Update

These are mostly the same tool in different forms. npm create sanity@latest and npx sanity@latest init run the same project initializer. Adding flags just answers the setup questions ahead of time. The npm install -g @sanity/cli → sanity init → sanity start sequence is the old Studio v2 setup, which is deprecated, so don't follow it for a new project.

1. Create a new Studio (interactive)

You need Node.js v22.12 or later (installation docs).

npm create sanity@latest

The CLI asks you to sign in or create an account, then to pick a Studio template, TypeScript and a package manager. It then creates a folder and sets up the Studio config. Start it with:

cd your-studio-folder
npm run dev

Then open http://localhost:3333 and log in with the same provider you used for the CLI (quickstart).

2. The same command, with flags

Flags skip the prompts. The -- passes them through npm to the Sanity initializer:

npm create sanity@latest -- --template clean --dataset production --typescript --output-path my-studio

Run npx sanity@latest help init to see every flag.

3. Adding Sanity to an existing project

Inside an existing app, such as a Next.js app, run:

npx sanity@latest init

This is the same initializer. In a supported framework, it sets up Sanity in the current directory instead of creating a new folder (installation docs).

4. About the global install and sanity start

Which to use

If a tutorial tells you to install @sanity/cli globally or run sanity start, it was written for v2.

Show original thread
3 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions