CLI reference
Init CLI command reference
Initialize a new Sanity project or plugin
USAGE
$ sanity init [--yes] [--auto-updates] [--bare] [--coupon <code>] [--dataset <name>] [--dataset-default] [--env <filename>] [--git <message>] [--import-dataset] [--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>] [--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)
--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
--mcp Enable AI editor integration (MCP) setup
--organization=<id> Organization ID to use for the project
--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
--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