CLI reference
Init CLI command reference
Initialize a new Sanity project or plugin
USAGE
$ sanity init
FLAGS
--json Format output as json.
--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=<COUPON> Optionally select a coupon for a new project (cannot be used with --project-plan)
--create-project=<CREATE-PROJECT>Create a new project with the given name
--dataset=<DATASET> Dataset name for the studio
--dataset-default Set up a project with a public dataset named "production"
--env=<ENV> Write environment variables to file
--git=<GIT> Specify a commit message for initial commit, or disable git init
--mcp Enable AI editor integration (MCP) setup
--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
--organization=<ORGANIZATION> Organization ID to use for the project
--output-path=<OUTPUT-PATH> Path to write studio project to
--overwrite-files Overwrite existing files
--package-manager=<PACKAGE-MANAGER>Specify which package manager to use [allowed: npm, yarn, pnpm]
--project=<PROJECT> Project ID to use for the studio
--project-plan=<PROJECT-PLAN> Optionally select a plan for a new project
--provider=<PROVIDER> Login provider to use
--template=<TEMPLATE> Project template to use [default: "clean"]
--typescript Enable TypeScript support
--visibility=<VISIBILITY> Visibility mode for dataset
-y, --yes Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
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 --create-project "Movies Unlimited" --dataset moviedb --visibility private --template moviedb --output-path /Users/espenh/movies-unlimited