CoursesAI-powered Sanity developmentInitialize a new Studio
AI-powered Sanity development

Initialize a new Studio

Log in to mark your progress for each Lesson and Task

Open Cursor and open the Terminal from the Command Palette or press Cmd+J

We could have "prompted" a new Sanity project into existence, but I wanted to make sure you start with this specific experience.

Run the following command to create a new Sanity project. If you are not logged into Sanity in the terminal, you will be asked to do so. If you do not yet have a Sanity account, you can create one for free.

The install command below has a few opinionated options preselected so that you won’t need to weigh up the options.

Run the following from the command line to create a new Sanity project
npm create sanity@latest -- --template blog --create-project "AI-powered Sanity" --dataset production --typescript --output-path apps/studio
cd apps/studio
Getting errors during the install process? If this is your first time developing you may not have the necessary software installed. Copy any errors you see in the terminal into a new chat and the LLM should help you debug your system.

The files in your project (press Cmd+B to open the file browser pane) should now look like this:

ai-demo
├── .cursor/
│ └── rules
├── apps/
│ └── studio/
│ └── ...other files and folders
└── PRD.md

Install the dependencies as instructed in the apps/studio directory.

Run the following from the command line to start the development server
# in apps/studio
npm run dev

You can now open the Studio at http://localhost:3333 and log in.

You now have a configured Sanity project that is a cloud-hosted real-time content database and a local Sanity Studio development server that is an admin interface for authoring content.

In the script that created this project we chose the “blog” template to create a new Sanity Studio. This is why you can currently see Post, Author, and Category document schema types in your studio.

This course won't cover Hosting and deployment—see our documentation and other courses on Sanity Learn for more details.

You now have a Sanity Studio locally but it's only configured with a default blog template, let's prompt updates to the Studio to make it ours.

You have 2 uncompleted tasks in this lesson
0 of 2