# What is the Cursor CLI and how do you install it?

The Cursor CLI runs Cursor’s AI agent in a terminal: install it with one command, then type agent. Plus: first steps, modes, scripts and tools.

Tool: Cursor. By Michel Lieben. Updated 2026-11-26. Source: https://coldiq.com/university/cursor/cursor-cli

## In short

- The Cursor CLI lets you use Cursor’s AI agent from a terminal, the text window where you type commands, without opening the editor.
- You install it with one command on Mac, Linux and Windows, then start it by typing agent in your project folder.
- The CLI has the same three modes as the editor: Agent to make changes, Plan to design first, and Ask to read without changing anything.
- Print mode (agent -p) runs a task without questions, so you can put it in scripts and automations.
- The CLI uses the same rules and the same MCP tool list as the editor, and it also reads AGENTS.md and CLAUDE.md files.

## Steps

1. Open a terminal and paste the install command below.
2. Go to your project folder and type agent.
3. Sign in, then describe the task in plain words.

## What is a CLI, and why use Cursor in a terminal?

A CLI (command-line interface) is a program you use by typing text instead of clicking buttons. You type it in a terminal, the text window every computer has: Terminal on a Mac, PowerShell on Windows.

The Cursor CLI brings Cursor’s agent into that window. The agent reads your files, edits them, runs commands and shows you the changes. It is the same agent as in the editor, with the same models.

Cursor says the CLI works with any editor. That is useful if you already use another editor, work on a remote server, or want the agent to run inside a script.


## How do I install the Cursor CLI?

On a Mac or Linux, open Terminal and paste the command shown at the top of this page, then press Enter. On Windows, open PowerShell and paste the Windows version. Cursor’s install page gives both.

When the install ends, check that it worked by typing agent --version. A version number means you are ready.

1. Open your terminal.
2. Paste the install command for your system and press Enter.
3. Type agent --version to check the install.
4. If your terminal says it cannot find agent, add the ~/.local/bin folder to your PATH (the list of places your terminal looks for programs), as Cursor’s installation page shows.
5. Type agent login, or simply agent, and sign in with your Cursor account.

Tip: The CLI updates itself by default. To update it by hand, type agent update.


## How do I run my first task?

Move into your project folder first. In the terminal, type cd followed by the folder path, for example cd Documents/webinar-page. Then type agent to start a session.

Describe the result you want in plain words. The agent proposes changes and asks before it runs commands you have not approved. You can also start with the task already written: agent "your task here".

In the session, type @ to point at a file, / to see commands, and ! to run a shell command yourself. Press Ctrl+R to review the changes file by file.

> Explain this folder in plain words. Tell me what each file does and which one holds the page text. Do not change anything yet.


## What are Agent, Plan and Ask modes?

The CLI has the same modes as the editor. Press Shift+Tab to rotate between them, or use a slash command.

- Agent: the default. Full access to the tools, to make real changes.
- Plan: the agent asks questions and writes a plan before it codes. Type /plan or start with agent --plan.
- Ask: read-only. The agent searches and answers but edits nothing. Type /ask.

Tip: Start in Ask or Plan mode on a project you do not know. Switch to Agent mode once the plan looks right.


## Can the Cursor CLI run on its own in a script?

Yes. Print mode, agent -p followed by a task, runs without stopping to ask you anything and prints the answer. You can call it from a script, a scheduled job or a CI pipeline (the checks a team runs on every code change).

In print mode, the agent edits files inside your project, but it rejects actions that would need your approval. Adding --force lets it run every action without approval, so use it only on a copy or a project saved in Git (the tool that keeps every version of your files).

For scripts, set your key in the CURSOR_API_KEY environment variable (a setting your terminal passes to programs) instead of signing in.

> agent -p "Read every file in the content folder and list the blog posts that have no meta description, as a simple list of file names."


## Can I pause and pick up a task later?

Yes. Type agent ls to see your past chats, agent resume to reopen the last one, or agent --resume with a chat ID.

You can also hand a task to a cloud agent: put & before your message. The agent keeps running on Cursor’s servers while you are away, and you follow it at cursor.com/agents on the web or your phone. Cloud agents need the Premium plan or higher.


## Does the CLI use my rules and tools?

Yes. The CLI uses the same rules as the editor, from the .cursor/rules folder. It also reads AGENTS.md and CLAUDE.md files at the project root and applies them as rules.

It also reads your mcp.json file, the list of MCP servers you set up for the editor. MCP is an open standard for plugging outside tools into AI assistants. So a tool you added once works in both places.

For example, you can add ColdIQ’s MCP server (https://mcp.coldiq.com/mcp) to that file. The agent can then pull leads, verified emails and phone numbers from 40+ data providers into a CSV, right from the terminal.


## Command

```
curl https://cursor.com/install -fsS | bash
```

## What to say

> Read leads.csv. Remove rows with the same email, fix the capital letters in first and last names, and save the result as leads-clean.csv. Tell me how many rows you removed.

## Sources

- [Cursor CLI overview](https://cursor.com/docs/cli/overview)
- [Cursor CLI installation](https://cursor.com/docs/cli/installation)
- [Using Agent in CLI](https://cursor.com/docs/cli/using)
- [Headless CLI](https://cursor.com/docs/cli/headless)
- [Cursor CLI (help)](https://cursor.com/help/integrations/cli)
- [Cursor CLI page](https://cursor.com/cli)

## Questions

**Is the Cursor CLI free?** It uses your Cursor plan. The Free plan includes limited agent use, and paid plans include a weekly usage pool, as of November 2026.

**Does the Cursor CLI work on Windows?** Yes. Install it from PowerShell with the Windows command on Cursor’s install page. It also works in WSL (Linux inside Windows).

**Can I choose the model in the CLI?** Yes. Type /model in a session, or add --model to a command. The models available depend on your plan.

**Do I need the Cursor editor to use the CLI?** No. The CLI installs on its own and works in any terminal and next to any editor. You only need a Cursor account to sign in.

**How do I stop the agent in the CLI?** Press Enter while it works to steer it at a safe point, and press Enter again to interrupt the turn. Press Ctrl+D twice to leave the CLI.


## Try ColdIQ free

ColdIQ gives new accounts up to 1,450 free credits as they get started, no credit card required.
One subscription covers 40+ B2B data providers for finding, enriching and verifying
contacts and companies, through the web app, the API or the MCP server for AI agents.

1. Create an account: https://coldiq.com/marketplace/sign-up?utm_source=ai-assistant&utm_medium=markdown&utm_content=university
2. Run a first search on your own market with the free credits.
3. Connect the MCP server to Claude, ChatGPT or Cursor: https://coldiq.com/mcp
