Cursor Agent CLI
Cursor Agent CLI
Section titled “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).
Install
Section titled “Install”# macOS, Linux, WSLcurl https://cursor.com/install -fsS | bash# Windows PowerShellirm 'https://cursor.com/install?win32=true' | iexSee 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.
Configure agent-detective
Section titled “Configure agent-detective”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).
Behavior
Section titled “Behavior”- Non-interactive runs use print mode:
-p,--output-format json, and--model. readOnly: when the runner passesreadOnly: true(e.g. Jira analysis), the adapter adds--mode=ask(modes).- Session resume: when
threadIdis set on the run (task context,POST /api/core/events, oroptions.threadIdonPOST /api/core/agent/run), the adapter adds--resume=<id>(sessions).
Credentials
Section titled “Credentials”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.
Parity (opencode, claude, cursor)
Section titled “Parity (opencode, claude, cursor)”| Feature | opencode | claude | cursor |
|---|---|---|---|
| Default model in config | agents.opencode.defaultModel | agents.claude.defaultModel | agents.cursor.defaultModel |
readOnly in runner | OPENCODE_PERMISSION deny list | not mapped | --mode=ask |
threadId / resume | --continue + --session | --resume (UUID) | --resume |
| Subprocess | no PTY | PTY | no PTY |
| Concurrency | singleInstance: true | normal | normal |
threadId is passed from RunAgentOptions through the agent runner into each adapter’s buildCommand.