Skip to main content

Cursor CLI Adapter

The cursor adapter runs Cursor Agent CLI on the host machine as a SLAW agent, resuming sessions across Heartbeats with --resume.

Type key: cursor

Prerequisites

  • Cursor Agent CLI installed: curl https://cursor.com/install -fsS | bash
  • Cursor authenticated on the host machine

Configuration

Set adapterType: cursor on the agent and provide the config below.

Config fields

FieldTypeDefaultDescription
cwdstringAbsolute working directory; created if missing
instructionsFilePathstringAbsolute path to a markdown file prepended to the run prompt
promptTemplatestringTemplate for the run prompt
modelstringautoCursor model ID (see Models)
modestringCursor execution mode: plan or ask. Omit for normal autonomous runs
commandstringagentOverride the Cursor Agent CLI binary
extraArgsstring[]Additional CLI arguments
envobjectEnvironment variables injected into the agent process
timeoutSecnumber0Run timeout in seconds
graceSecnumber15SIGTERM grace period

Models

Cursor exposes many model IDs. A representative selection:

Model IDNotes
autoDefault — Cursor selects the model
composer-1.5Latest Composer model
gpt-5.3-codexStandard Codex lane
gpt-5.3-codex-highHigh-effort Codex lane
sonnet-4.6Claude Sonnet 4.6 via Cursor
opus-4.6Claude Opus 4.6 via Cursor
gemini-3.1-proGemini Pro via Cursor
gpt-5.1-codex-miniBudget Codex lane (cheap profile)

Run agent --list-models to enumerate all available model IDs on your account.

Minimal example

{
"adapterType": "cursor",
"adapterConfig": {
"cwd": "/home/agent/workspace",
"model": "auto",
"timeoutSec": 0,
"graceSec": 15
}
}

Session behaviour

SLAW stores the session ID and cwd after each run. On the next Heartbeat, Cursor Agent CLI resumes the prior session with --resume when the stored cwd matches the current working directory.

Notes

  • Runs are executed as: agent -p --output-format stream-json …
  • Prompts are piped to Cursor via stdin.
  • SLAW auto-adds --yolo unless --trust, --yolo, or -f is already present in extraArgs.
  • SLAW auto-injects local skills into ~/.cursor/skills so Cursor can discover $slaw and related skills.
  • On remote sandbox runs, SLAW prepends ~/.cursor/bin and ~/.local/bin to PATH and prefers the installed absolute entrypoint from those directories, so installer-managed sandbox leases do not need hardcoded command paths.

Next steps