CoursesAI-powered Sanity developmentCursor IDE
AI-powered Sanity development

Cursor IDE

An introduction to Cursor, the AI-powered code editor you'll use in this course. Get to know the Chat window and the difference between an Ask and an Agent.
Log in to mark your progress for each Lesson and Task

In 2021, VS Code popularized AI coding assistance with GitHub Copilot. This coding assistant helps modify or complete single lines of code. Recently, it has been expanded into a chat interface and multi-line editing. While it continues to receive updates, in my opinion, it has not kept pace with alternative options.

This space is evolving so rapidly that it's likely that this course will be updated in future with alternate recommendations.

In this course, we'll use Cursor, a fork of VS Code. At the time of writing, it is emerging as the most popular Integrated Development Environment (IDE) for authoring code with AI assistance.

There are popular alternatives, but we will not use them in this course.

There are also AI tools that only use the command line. We will not use those in this course.

You may also have experience writing code through copy-and-paste sessions with in-browser AI tools like Open AI's ChatGPT or Anthropic's Claude. However, in this course, you'll use AI tools closer to the code base.

Cursor is a free app which can be downloaded from their website. While the paid plan provides access to better models and features, the free version is still feature-rich. You should be able to complete this course without upgrading.

Download and install Cursor

Open Cursor, and you should see a screen something like this:

Cursor is a rapidly evolving application and so in some ways may look slightly different from the screenshots in this course.

One of the most powerful ways to move around an IDE is by using the command palette. Press Cmd+Shift+P to bring up the palette, in which you can through files in your project or settings in Cursor.

Open the Command palette Cmd+Shift+P and type "Terminal" to create a new terminal

Notice that many Cursor commands will also show their keyboard shortcuts in the command palette. Keep an eye on these as moving around with these shortcuts is much more efficient.

The terminal is a Command Line Interface (CLI) in which you can run commands that will perform actions on your computer. It can be used to begin new coding projects, start local development servers and ... almost anything else.

Some terminals like Warp are AI powered, which will convert your prompts into commands which can be run, and the terminal will do its own debugging to address any issues.

The terminal in Cursor is not naturally AI-assisted, and so commands written into the terminal must be correct and specific to your computer. However you can use the Chat pane to interact with the terminal.

You can now close the terminal Cmd+J

Click Open project and create a new folder to work in

When you are opening and editing files, these will fill the middle section of the Cursor window. You should now also see two panes open to the left and right.

On the left-hand side in my screenshot is the chat pane. This is where you can write prompts to LLMs which will interact with your project.

You can send prompts in "Ask" mode, which will just return responses in the chat pane, or you can change over to "Agent" mode, where Cursor will make changes directly to files in your project.

Toggle the Chat pane with Cmd+I, Cmd+L or using the Command Palette.

The files in your project will begin to show up in the "Primary Sidebar" which can be toggled with the Command Palette or by pressing Cmd+B.

We don't have any files yet, but let's make our first in the next lesson.

In the following lessons you'll prepare your environment for the best possible implementation of Sanity. You could skip these steps, but your prompt responses would not nearly be as good.

Let's prepare for success.

You have 3 uncompleted tasks in this lesson
0 of 3