@5x-ai/provider-cursor-agent
v1.0.0
Published
Cursor Agent CLI provider plugin for @5x-ai/5x-cli
Maintainers
Readme
@5x-ai/provider-cursor-agent
Cursor Agent CLI provider plugin for @5x-ai/5x-cli. Runs 5x author/reviewer invocations through the agent binary (cursor-agent) in headless print mode with streamed JSON output.
Requirements
- Bun >= 1.1.0 (same runtime as the CLI)
- The Cursor
agentCLI installed and authenticated (or credentials supplied via config, see below) @5x-ai/5x-cli>= 1.3.0 (peer dependency)
Install
npm install @5x-ai/provider-cursor-agent
# or
bun add @5x-ai/provider-cursor-agentInstall it in the project where you run 5x so the CLI can resolve it.
Configure
Set the provider on a role in 5x.toml. The short name cursor-agent resolves to this package automatically:
[author]
provider = "cursor-agent"
model = "..." # passed to `agent --model`
[reviewer]
provider = "cursor-agent"
model = "..."Provider options live in an optional [cursor-agent] table:
[cursor-agent]
# agentBinary = "cursor-agent" # path or name of the `agent` executable
# force = true # default true: pass --force for headless file/command execution
# trust = true # default true: pass --trust in print mode
# sandbox = "enabled" # "enabled" | "disabled" → --sandbox
# approveMcps = false # pass --approve-mcps
# pluginDir = ["path/to/dir"] # repeated --plugin-dir entriesCredentials can be forwarded to the subprocess via config instead of relying on ambient login state — they are passed as environment variables, never argv:
[cursor-agent]
# apiKey = "..." # forwarded as CURSOR_API_KEY
# authToken = "..." # forwarded as CURSOR_AUTH_TOKENPrefer putting credentials in 5x.toml.local (gitignored) rather than 5x.toml.
Behavior notes
- Sessions are created with
agent create-chatand resumed per invocation with--resume, so continued reviews keep their session context. - Prompts exceeding the CLI's argv-safe size limit fail fast with a structured error instead of a truncated invocation.
- Structured output is extracted from the streamed assistant output, including output emitted in the final assistant flush.
License
MIT
