CLI reference

New CLI command reference

Reference documentation for the Sanity CLI new command.

USAGE
  $ sanity new [PROJECTNAME] [--yes] [--instructions] [--json] [--scaffold]

ARGUMENTS
  [PROJECTNAME]  Display name for the new project

FLAGS
  -y, --yes           Skip prompts and use defaults (project: "My Sanity project")
      --instructions  Print the full setup guide from https://sanity.new and exit, creating nothing
      --scaffold      Set up a Studio in ./sanity and a Next.js website in ./web (on by default)

GLOBAL FLAGS
      --json  Format output as json.

DESCRIPTION
  Sets up two folders here: ./sanity, a Studio where you write and edit your
  content, and ./web, a Next.js website that reads it. Both are already
  connected to your new project, so you can start them straight away. Use
  --no-scaffold if you just want the project and nothing else.
  
  The project is real and works immediately, but it is only yours for 72 hours.
  Claim it with a Sanity account before the deadline and everything you have
  built stays exactly as it is. Claiming is free and takes about a minute. Miss
  the deadline and the project and its content are deleted.
  
  Two things to keep private: the claim link, because anyone who opens it
  becomes the owner, and the access token saved in ./sanity/.env.local, because
  it can read and change everything in the project. ./web/.env.local has only
  the project ID and dataset. Keep both env files out of git, and never put the
  token in code that runs in the browser.
  
  Run this command with --instructions for the full agent setup guide.

EXAMPLES
  Create a project with a Studio and a website

    $ sanity new

  Create a project called "My New Project"

    $ sanity new "My New Project"

  Create a project without being asked anything

    $ sanity new --yes

  Create the project only, with no Studio or website

    $ sanity new --no-scaffold

  Create a project and print its details as JSON

    $ sanity new --json

  Print the full setup guide for an AI agent, without creating anything

    $ sanity new --instructions

Was this page helpful?

Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change site theme