Skip to content

Cursor Agent CLI

The in-app agent id is cursor. It runs the Cursor Agent CLI, whose binary is agent on your PATH (not to be confused with this project’s agent config key in JSON — that is the default agent id).

Terminal window
# macOS, Linux, WSL
curl https://cursor.com/install -fsS | bash
Terminal window
# Windows PowerShell
irm 'https://cursor.com/install?win32=true' | iex

See CLI installation for details. The CLI is not published on npm; the production Docker image only pre-installs opencode and claude via npm install -g. For containers, install the Cursor CLI in a custom image layer or on the host.

In config/default.json (or local.json):

{
"agent": "cursor",
"agents": {
"cursor": {
"defaultModel": "gpt-5.2"
}
}
}

Or set AGENT=cursor and optional AGENTS_CURSOR_MODEL=... (see configuration.md).

  • Non-interactive runs use print mode: -p, --output-format json, and --model.
  • readOnly: when the runner passes readOnly: true (e.g. Jira analysis), the adapter adds --mode=ask (modes).
  • Session resume: when threadId is set on the run (task context, POST /api/core/events, or options.threadId on POST /api/core/agent/run), the adapter adds --resume=<id> (sessions).

Auth for the CLI (login, API keys, etc.) is handled by the Cursor tool and environment; see the official docs. The Node app does not store Cursor credentials in config JSON.

Featureopencodeclaudecursor
Default model in configagents.opencode.defaultModelagents.claude.defaultModelagents.cursor.defaultModel
readOnly in runnerOPENCODE_PERMISSION deny listnot mapped--mode=ask
threadId / resume--continue + --session--resume (UUID)--resume
Subprocessno PTYPTYno PTY
ConcurrencysingleInstance: truenormalnormal

threadId is passed from RunAgentOptions through the agent runner into each adapter’s buildCommand.