How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Init Sanity project from CLI without creating files using custom template

13 repliesLast updated: Nov 29, 2025

Hi there! Is there the option to init a new project from the cli without creating all the files? Ideally it would even work with a custom template created using sanity-template....
AI Update

Yes! There are actually a couple of options for initializing a Sanity project without creating all the Studio files:

The --bare Flag

As of Sanity CLI v3.9.0 (April 2023), the sanity init command supports a --bare flag that does exactly what you're looking for:

sanity init --bare

or with npm create:

npm create sanity@latest -- --bare

What --bare does:

The --env Flag

The same update also introduced the --env flag, which is useful when setting up environment variables:

sanity init --env

This flag:

Using with Custom Templates

While the documentation doesn't explicitly cover using --bare with custom templates created via sanity-template, you can combine these approaches:

The sanity projects create Command

For even more control, you can use the sanity projects create command directly to create just a project without any Studio files at all, then set up your Studio or application separately.

These flags are particularly useful when you're integrating Sanity into an existing application, working with custom templates, or when you only need the Content Lake capabilities without a full Studio setup.

Show original thread
13 replies

Was this answer helpful?

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.

Related contributions