Cursor
Use the Cursor CLI through AnyAgent: what you can ask for, how it behaves, and the flags underneath.
The cursor adapter drives the Cursor CLI in headless print mode, detected as the agent binary on PATH (the legacy cursor-agent name also resolves); import cursor from anyagent/cursor.
What you can ask for
readOnly, model, effort, and resume work on the CLI’s own flags; systemPrompt and schema are provided by AnyAgent. mcp is undeclared: reach Cursor’s own agent mcp configuration via extraArgs. readOnly runs plan mode, which the CLI enforces read-only. authStatus() asks agent status --format json and models() parses agent --list-models, every listed id valid verbatim as model. The full grid is on the support matrix.
Good to know
efforthas no standalone flag; it rides in the model id’s bracket overrides, soeffortwithoutmodelthrowsInvalidOptions.model: "m", effort: "high"becomes--model m[effort=high].- Effort and speed variants are also baked into model ids (
gpt-5.3-codex-low,…-high-fast); picking one of those needs noeffort. - The init event’s session id lands on
result.sessionId; pass it back asresume. - Usage reports cache reads and writes as separate line items; no cost and no reasoning tokens are reported.
Under the hood
Every run executes agent -p --output-format stream-json --trust --force with the prompt piped over stdin. Run options change the mode and append flags:
| Option | Flag |
|---|---|
readOnly: true | --mode plan in place of --force |
model | --model <id>, bracket overrides pass through verbatim ("claude-opus-4-8[context=1m]") |
effort | compiled into the model’s bracket overrides |
resume | --resume <chatId> |