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

3 replies
Last updated: Nov 29, 2025
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

Great question! This can definitely be confusing for newcomers. Let me break down the different approaches you've found:

This is the current, recommended approach for starting new Sanity projects. The npm create sanity@latest command:

  • Doesn't require global CLI installation
  • Walks you through an interactive setup
  • Automatically installs dependencies
  • Sets up your project with modern defaults
  • Uses npm run dev to start the development server

The command you found with all the flags (--template clean --create-project "Sanity Project" --dataset production) is just the non-interactive version of this same approach, where you specify everything upfront instead of answering prompts.

The Legacy Way: npm install -g @sanity/cli + sanity init

This is the older approach that involves:

  1. Installing the Sanity CLI globally
  2. Running sanity init to set up your project
  3. Using sanity start to run the development server

While this still works, it's considered the legacy method. The main differences:

  • sanity start is the old command for running the dev server
  • sanity dev (or npm run dev) is the modern equivalent used with Studio v3+, with better performance and Vite-powered live reloading

What You Should Use

Go with npm create sanity@latest - it's simpler, doesn't pollute your global npm packages, and follows modern JavaScript tooling conventions. After setup, you'll use npm run dev to start your Studio at http://localhost:3333.

The documentation showing different approaches likely reflects different versions or specific use cases. The video tutorial showing just npm create sanity@latest (without flags) is the most beginner-friendly - it'll walk you through everything interactively.

No need to feel embarrassed - Sanity's documentation does show multiple paths, and it's totally reasonable to be confused when you're just starting out! 😊

Show original thread
3 replies

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.

Was this answer helpful?