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
| Field | Type | Default | Description |
|---|---|---|---|
cwd | string | — | Absolute working directory; created if missing |
instructionsFilePath | string | — | Absolute path to a markdown file prepended to the run prompt |
promptTemplate | string | — | Template for the run prompt |
model | string | auto | Cursor model ID (see Models) |
mode | string | — | Cursor execution mode: plan or ask. Omit for normal autonomous runs |
command | string | agent | Override the Cursor Agent CLI binary |
extraArgs | string[] | — | Additional CLI arguments |
env | object | — | Environment variables injected into the agent process |
timeoutSec | number | 0 | Run timeout in seconds |
graceSec | number | 15 | SIGTERM grace period |
Models
Cursor exposes many model IDs. A representative selection:
| Model ID | Notes |
|---|---|
auto | Default — Cursor selects the model |
composer-1.5 | Latest Composer model |
gpt-5.3-codex | Standard Codex lane |
gpt-5.3-codex-high | High-effort Codex lane |
sonnet-4.6 | Claude Sonnet 4.6 via Cursor |
opus-4.6 | Claude Opus 4.6 via Cursor |
gemini-3.1-pro | Gemini Pro via Cursor |
gpt-5.1-codex-mini | Budget 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
--yolounless--trust,--yolo, or-fis already present inextraArgs. - SLAW auto-injects local skills into
~/.cursor/skillsso Cursor can discover$slawand related skills. - On remote sandbox runs, SLAW prepends
~/.cursor/binand~/.local/bintoPATHand prefers the installed absolute entrypoint from those directories, so installer-managed sandbox leases do not need hardcoded command paths.