Installer Cursor CLI Agent : connexion et première tâche dépôt
Script d’install officiel, agent login, un diff relisible dans le dépôt. Compte Cursor requis.
The first hour with Cursor Agent in the terminal usually breaks on PATH, skipping agent login, or never landing a reviewable diff. Install the official agent binary, sign in, then change one small thing in a repo you own.
The query is how to install and use Cursor CLI Agent. This page follows Cursor docs at cursor.com/docs/cli/installation, cursor.com/docs/cli/overview, and cursor.com/docs/cli/reference/authentication. It is Cursor’s terminal agent, not this site’s meeting product. To walk a diff on a short call, open a room on wbmeet; see how to create and join a room.
What Cursor CLI does
Cursor CLI lets you work with an AI agent in the terminal: read files, propose edits, and run commands (with sandbox controls). Run agent interactively, or use non-interactive flags such as agent -p "…" in scripts. Default mode is Agent; /plan or Shift+Tab switches to Plan, and /ask is read-only. Usage and models follow your Cursor account plan—see official pricing.
Install Cursor CLI
- 1
Run the official installer
macOS, Linux, WSL:
curl https://cursor.com/install -fsS | bash. Native Windows PowerShell:irm 'https://cursor.com/install?win32=true' | iex. Add~/.local/binto PATH per the installation page (bash/zsh profile +source). - 2
Verify
New terminal:
agent --version.command not foundmeans PATH is missing$HOME/.local/bin—this is the standalone CLI, not only the IDE integrated terminal. - 3
Optional manual update
The CLI tries to auto-update. Run
agent updatewhen you want to pull the latest build explicitly.
Authenticate: browser or API key
- 1
Browser login (recommended)
agent loginopens your browser to sign in with your Cursor account. SetNO_OPEN_BROWSER=1to print the URL for headless machines.agent statusshould show you as authenticated. - 2
API key (scripts/CI)
Create a user API key in Cursor Dashboard → API Keys. Export
CURSOR_API_KEYor pass--api-keyonce. Never commit live keys. - 3
Switch or sign out
agent logoutclears stored credentials. Billing and model access follow your subscription—official Cursor docs are the source of truth.
First task in your repo
- 1
cd to the repo root
Work in a Git repo you own. Run
git statusbefore the agent edits files. - 2
Start a session
Run
agent, oragent "explain the entry module in one paragraph". On large trees, start with/askor read-only questions. - 3
Land a reviewable change
Follow up with a concrete ask: add a unit test for one untested helper or input validation on one public function—show the diff first. Read
git diffline by line. Useagent resumeto continue context.
# First hour · Cursor CLI · 2026-09
curl https://cursor.com/install -fsS | bash
agent --version
cd /path/to/your/project
agent login
agent
# task: one unit test; show diff firstModes and pitfalls
| Scenario | Mode / command | First-hour note |
|---|---|---|
| Daily coding | Default Agent | Read tool output before approving |
| Design first | /plan, Shift+Tab | Large refactors start in Plan |
| Read-only | /ask, --mode=ask | No file writes |
| CI review | agent -p "…" | Use CURSOR_API_KEY |
| Sandbox | /sandbox | Control network per policy |
agent: command not found
Add ~/.local/bin to PATH and open a new terminal.
Not authenticated
Run agent login or set CURSOR_API_KEY. Headless: NO_OPEN_BROWSER=1.
First task too large
Split tasks; use Ask first; insist on diff-first.
Official path: curl install →
agent --version→agent login→agentin your repo → review diff. Trust cursor.com/docs/cli for details.
- Vs Claude Code / Copilot CLI
- Different install and auth. See our Claude Code and Copilot CLI notes.
- Cursor IDE required?
- The CLI runs standalone; IDE and CLI share account login but are separate entry points.
- Not a meeting-product guide
- Only Cursor CLI’s first hour. Short call: wbmeet.
Questions worth checking
Can I use the CLI without a Cursor account?
agent login requires a Cursor account; API keys are created in the Dashboard. Plans and usage limits follow Cursor’s terms.
What if the browser does not open?
Set NO_OPEN_BROWSER=1 and open the printed URL manually.
How do I run agent in CI?
Set CURSOR_API_KEY and use non-interactive agent -p prompts. Do not commit keys.
Must the first task touch production code?
No. Start read-only, then one reversible test or validation.