Getting Started with Cursor CLI: A Complete Guide
Jumping between an editor, documentation, and the terminal can feel like running in circles. It breaks your rhythm, makes errors easier to miss, and slows down even the basic tasks. Cursor CLI eliminates this friction by keeping you in one environment while you interact with AI using natural language prompts.
In this article, we will look at what Cursor CLI is, how to install it, how to build with it, and its key features.
What is Cursor CLI?
Cursor CLI is a terminal-based AI assistant designed to help developers write, review, debug, and test code directly from the command line. Instead of moving back and forth between an IDE, documentation, and terminal windows, you can stay in one environment and interact with Cursor using natural language prompts.
Cursor CLI is often compared to Claude Code, Anthropic’s terminal-based AI assistant, since both bring AI coding capabilities directly to the command line. However, they have distinct differences:
Cursor CLI connects to the Cursor IDE ecosystem and supports multiple AI models (GPT-5, Claude 4 Sonnet, Claude 4 Opus). It works across any IDE or terminal—VS Code, JetBrains, Android Studio—giving you flexibility to use the same commands regardless of your development environment.
Claude Code takes a minimalist, terminal-first approach where tasks are completed through direct prompts without IDE integration.
Cursor CLI requires a Cursor subscription to use. You can check current pricing and subscription options on the Cursor website before installing.
Let’s begin by setting up Cursor CLI and walking through the installation steps for your system.
How to install Cursor CLI?
Installing Cursor CLI is straightforward across macOS, Linux, and Windows (using WSL). Here are the steps to get started:
Step 1: Install Cursor CLI
Open your terminal and run:
curl https://cursor.com/install -fsS | bash
This command downloads and installs Cursor CLI on your system.
Step 2: Verify the installation
After installation, make sure Cursor CLI is working correctly by running:
cursor-agent --version
You should see the installed version of Cursor CLI displayed in your terminal.
Step 3: Add Cursor CLI to the PATH
To run Cursor CLI from anywhere, add its installation directory to your PATH:
For bash:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
For zsh:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrcsource ~/.zshrc
With these steps complete, Cursor CLI is installed and ready. Let’s start using Cursor CLI to build a travel app.
Build a travel booking app with Cursor CLI
In this tutorial, we will build a travel booking app that will allow users to search for destinations, add them to a travel list, and retrieve basic information about each location. We’ll also demonstrate Cursor CLI features like code generation, review, debugging, and testing.
Step 1: Set up the environment
Start by choosing an IDE of your choice. We are using VS Code. Create a folder in the IDE where Cursor can place all the files it will create.
Start Cursor CLI by running the following command in your terminal:
cursor-agent
Note: You can use the built-in terminal of the IDE or the command prompt. If you are using command prompt, make sure to navigate to the directory using the
cdcommand.
This will launch the Cursor AI assistant, ready to accept prompts for generating, reviewing, and debugging your code.
Note: If you are on Windows OS, make sure to run the
wslcommand beforecursor-agentcommand.

Now that the Cursor CLI is running, let’s proceed with planning the project structure and defining its features.
Step 2: Plan the app with prompt
Before diving into code generation, it’s essential to establish a plan for our project. Cursor CLI can help us outline the structure and functionality of our app through detailed prompts. Let’s enter this prompt in Cursor CLI:
Plan the UI and main features for a travel app that lets users view, add, and search destinations. Suggest pages, buttons, and data fields.

As we can see, Cursor CLI generated a detailed plan, including suggested pages, button placements, data fields, and main functionalities. This gives a clear roadmap for building the app.
Cursor CLI provided an in-depth plan that covers the complete structure of the app and the necessary UI elements. In comparison, Claude Code would have likely given a shorter, less detailed outline, which might require more refinement before coding.
Once the plan is ready, we can move on to generating the code with Cursor CLI based on this roadmap.
Step 3: Generate code with prompt
Now let’s start generating the actual code using Cursor CLI. You provide prompt in the terminal, and the AI creates the boilerplate and core functions for your travel app. Let’s try a basic prompt to see what output it generates:
Build the code for the travel app based on the plan you created, including functionality to view, add, and search destinations.
Cursor CLI will generate:
- A project folder structure with necessary files.
- Core functions and endpoints as outlined in your plan.
- Data handling logic for storing and retrieving destinations. This step gives you a working foundation without manually writing repetitive boilerplate code. In order to execute this code, Cursor CLI will give you the commands. For us, it says we first need to perform:
npm install
And then:
npm start
This command runs the app locally, allowing us to see your travel app in action. Open your browser and navigate to the provided local URL to interact with the app.

Next, you’ll move on to reviewing the code for quality and improvements.
Step 4: Review the code generated
Once your code is generated, the next step is to review it to ensure it works correctly and follows your intended guidelines. With Cursor CLI, you have two ways to do this.
Method 1: Guided review using a document
You can create a review guideline document that outlines coding standards, expected structure, or specific requirements. Then, give Cursor CLI a prompt like:
Review the travel app code using the guidelines in @<file_name> document. Suggest improvements and identify any issues.
Cursor CLI will analyze your code against the guidelines, highlight potential problems, and suggest optimizations.
Method 2: Manual review mode
Alternatively, you can manually review the code directly in the editor. In VS Code, press CTRL + R to open Cursor CLI’s review mode. From there, you can:
- Inspect functions and modules interactively.
- Highlight code sections for suggestions.
- Get inline recommendations from the AI agent.
Both methods ensure your code aligns with the plan and follows good practices, setting you up for a smoother debugging and testing phase.
Step 5: Debug the code
While reviewing your travel app code, you might notice errors in specific files. For example, in our components folder, DestinationCard.tsx has some issues with props and rendering. Similar errors could exist in other files as well.
To fix these, we can prompt Cursor CLI:
Find and fix any bugs in the travel app code. Ensure that adding, viewing, and searching destinations works correctly.
Cursor CLI will help you:
- Identify syntax errors or exceptions.
- Suggest corrections for logical mistakes in functions.
- Highlight missing functionality based on the original plan.
- Provide inline fixes or code snippets to patch issues quickly.
Debugging with Cursor CLI keeps your workflow smooth and reduces the time spent manually hunting for errors. The next step is to recreate or enhance anything as needed.
Step 6: Iterative improvement
With the help of Cursor CLI you can keep refining your project without rewriting everything from scratch.
You can use prompts to add new features, polish existing code, or even restructure parts of your app. For example, if you want to enhance the travel app’s user experience, you could ask Cursor CLI to:
Now improve the destination card design by adding images, better typography, and a hover effect.
Or, if you decide the app needs additional functionality, like user authentication or a booking form, you can simply describe what you want:
Add a login page with email and password fields and connect it to a simple authentication flow.
Each prompt builds upon the existing project, allowing you to layer improvements step by step. This makes iteration faster and helps you evolve the app into a more polished and feature-rich version.
By the end of these steps, the travel app will be fully functional, and this shows how you can build real projects using Cursor CLI with just prompts and iteration.
Next, let’s go over the key features that make Cursor CLI powerful.
Key features of Cursor CLI
Cursor CLI gives you multiple modes, robust integrations, and flexibility to scale. Below are some of the standout capabilities to illustrate their use.
1. Interactive mode:
You can have a conversational session in your terminal. For instance, you might start with:
cursor-agent
and then say:
Refactor the search endpoint to accept query parameters and return paginated results.
You’ll see inline suggestions, edits, or prompts asking for confirmation.
2. Non-interactive mode:
You can run prompts directly without entering a full interactive session. For example:
cursor-agent chat "generate tests for the travel app's search functionality"
This is useful in scripts or CI pipelines when you want Cursor to act automatically.
3. Model switching / Multi-model support:
Cursor CLI allows you to choose which AI model your agent uses. You can use the /model command and that’ll show you the different agents available to use:

4. Multi-agent support & background execution:
Cursor supports running agents in the background, so long-running tasks don’t block your terminal. The changelog mentions improvements in Background Agents that let you run multiple tasks in parallel.
You could, for instance, have one agent generating new endpoints while another runs tests or analyses the codebase.
5. Model context protocol (MCP):
Cursor CLI supports MCP so it can use external tools, data sources, or servers to provide more informed responses. The CLI automatically detects and respects your mcp.json config. For example, you might connect a database schema or a project’s API spec via MCP so the AI knows external context beyond just your code files.
So, Cursor CLI is more than just a coding assistant, it is a way to keep your entire workflow inside the terminal without losing depth or control. Whether you are building, debugging, or refining, it helps you move faster while staying focused.
Conclusion
Cursor CLI is a powerful tool that brings AI directly into your terminal, making coding faster, smarter, and more efficient. It helps you generate, review, debug, and test code seamlessly, all without leaving your workflow. With features like multi-agent support, background execution, and model flexibility, it adapts to your project needs and empowers developers to focus on building rather than managing tasks.
To explore how to craft effective prompts and fully leverage tools like Cursor CLI, check out the Codecademy’s Learn Prompt Engineering course.
Frequently asked questions
1. What is Cursor used for?
Cursor is an AI-powered tool designed to help developers write, review, debug, and test code. It brings coding assistance directly into your workflow, reducing context switching and improving productivity.
2. How to use Cursor CLI in Windows?
On Windows, you can install Cursor CLI using the official install script via WSL (Windows Subsystem for Linux) or any compatible terminal. Once installed, run cursor-agent to start interacting with the AI assistant.
3. What is the cursor command?
The cursor-agent command launches Cursor CLI in the terminal. You can then provide prompts for code generation, review, debugging, testing, and more.
4. Why Cursor CLI?
Cursor CLI reduces context switching, speeds up development, and integrates AI into your workflow. Its interactive and non-interactive modes, multi-agent support, and background execution make it a versatile tool for any developer.
5. Can I use Cursor in the CLI?
Yes, Cursor is specifically designed for terminal usage. You interact with it entirely through prompts, either in real-time interactive mode or via scripted commands, making your CLI a full AI-assisted development environment.
'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'
Meet the full teamRelated articles
- Article
How To Use Cursor AI: A Complete Guide With Practical Example
Learn how to use Cursor AI to code faster and smarter. Complete guide covering installation, key features, and building your first project with this AI-powered editor. - Article
Cursor 2.0: New AI Model Explained
Explore Cursor 2.0 to code faster with Composer, run multi-agent workflows, and try its new agent-first interface. - Article
Cursor vs Windsurf AI: Which AI Code Editor Should You Choose?
Discover which AI code editor best suits your needs. Compare Cursor vs. Windsurf AI features, pricing, and performance to make an informed choice.
Learn more on Codecademy
- Learn to code faster with Cursor AI — the IDE that brings powerful AI features to your familiar VS Code setup.
- Beginner Friendly.< 1 hour
- Learn to build and ship a weather app with AI using Bolt AI coding tools — no prior experience needed.
- Beginner Friendly.1 hour