Init CLI command reference

Initialize a new Sanity project or plugin

USAGE
  $ sanity init [--yes] [--auto-updates] [--bare] [--coupon <code>] [--dashboard] [--dataset <name>] [--dataset-default] [--env <filename>] [--git <message>] [--import-dataset] [--install] [--json] [--mcp] [--nextjs-add-config-files] [--nextjs-append-env] [--nextjs-embed-studio] [--organization <id>] [--output-path <path>] [--overwrite-files] [--package-manager <manager>] [--project <id>] [--project-name <name>] [--project-plan <name>] [--provider <provider>] [--skills] [--template <template>] [--typescript] [--visibility <mode>]

FLAGS
  -y, --yes                        Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
      --auto-updates               Enable auto updates of studio versions
      --bare                       Skip the Studio initialization and only print the selected project ID and dataset name to stdout
      --coupon=<code>              Optionally select a coupon for a new project (cannot be used with --project-plan)
      --dashboard                  Set up the project to run in the Sanity Dashboard (beta)
      --dataset=<name>             Dataset name for the studio
      --dataset-default            Set up a project with a public dataset named "production"
      --env=<filename>             Write environment variables to file
      --git=<message>              Specify a commit message for initial commit, or disable git init
      --import-dataset             Import template sample dataset
      --install                    Install dependencies after scaffolding
      --mcp                        Enable AI editor integration (MCP) setup
      --organization=<id>          Organization ID to use for the project (required for unattended project creation)
      --output-path=<path>         Path to write studio project to
      --overwrite-files            Overwrite existing files
      --package-manager=<manager>  Specify which package manager to use [allowed: npm, yarn, pnpm]
      --project=<id>               Project ID to use for the studio
      --project-name=<name>        Create a new project with the given name
      --project-plan=<name>        Optionally select a plan for a new project
      --provider=<provider>        Login provider to use
      --skills                     Install Sanity agent skills globally for detected AI editors
      --template=<template>        Project template to use [default: "clean"]
      --typescript                 Enable TypeScript support
      --visibility=<mode>          Visibility mode for dataset

GLOBAL FLAGS
      --json  Format output as json.

Next.js FLAGS
      --nextjs-add-config-files  Add config files to Next.js project
      --nextjs-append-env        Append project ID and dataset to .env file
      --nextjs-embed-studio      Embed the Studio in Next.js application

DESCRIPTION
  Initialize a new Sanity Studio, project and/or app

EXAMPLES
    $ sanity init

  Initialize a new project with a public dataset named "production"

    $ sanity init --dataset-default

  Initialize a project with the given project ID and dataset to the given path

    $ sanity init -y --project abc123 --dataset production --output-path ~/myproj

  Initialize a project with the given project ID and dataset using the moviedb template to the given path

    $ sanity init -y --project abc123 --dataset staging --template moviedb --output-path .

  Create a brand new project with name "Movies Unlimited"

    $ sanity init -y --project-name "Movies Unlimited" --dataset moviedb --visibility private --template moviedb --output-path /Users/espenh/movies-unlimited

Available templates

Pass a template slug to the --template flag when running sanity init. The following named templates are available: clean (default, minimal Studio setup), moviedb (movies dataset with sample schema and data), and page-builder (page builder setup using the @sanity/presets library).

npm create sanity@latest -- --template page-builder

Was this page helpful?

sanity.ioAll Systems Operational© Sanity 2026
Change site theme