Skip to content

Add cursor-agent CLI backend across core, Rust, Python, and Go - #31

Merged
yasyf merged 2 commits into
mainfrom
cursor/cursor-agent-backend-e20b
Dec 3, 2026
Merged

yasyf merged 2 commits into
mainfrom
cursor/cursor-agent-backend-e20b

Conversation

@yasyf

@yasyf yasyf commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a cursor-agent CLI backend (cursor-agent --print --output-format json) to the shared Rust core (spawnllm-core) and wires it across Rust, Python, and Go hosts, keeping 100% compatibility with all existing backends (claude-sdk, claude, codex, antigravity, gemini, MLX, Apple, Jev/OpenAI Decisions).

Changes

  • Shared Rust core (rust/spawnllm-core):
    • plan/cursor_agent.rs: plans cursor-agent --print --output-format json --trust with --model <model> (when non-empty), --mode ask by default (--force when agent=true), prompt on stdin (with JSON schema instruction appended when schema is set), and env_unset: ["CURSOR_API_KEY"] unless api_auth=true.
    • resolve.rs: parses cursor-agent's JSON result envelope (result, is_error, subtype, optional total_cost_usd/usage), extracts JSON for wants_value=true, and surfaces envelope errors on both zero and nonzero exits.
    • auth.rs, route.rs, probe.rs: registers provider "cursor-agent" (binary cursor-agent, install hint curl https://cursor.com/install -fsS | bash, auth probe cursor-agent status, tiers small: composer-2.5-fast, medium: composer-2.5, large: claude-opus-5-5-high, priority after antigravity).
  • Conformance golden vectors (rust/conformance-gen, conformance/):
    • Added 13 cursor-agent vectors across plan, resolve, and auth_probes, plus updated capabilities.json (217/217 verified).
  • Rust crate (rust/spawnllm):
    • Added Backend::CursorAgent, selection wiring, and integration tests covering check_status, call, extract, and CURSOR_API_KEY stripping/preservation.
  • Python package (spawnllm, tests/):
    • Added CursorAgentCliBackend, exported it from spawnllm and spawnllm.backends, added "cursor-agent" to ProviderName and BACKENDS_BY_NAME (automatically exposing --backend cursor-agent, spawnllm backends, and spawnllm status), and added unit/CLI/status tests.
  • Go module (go/):
    • Added ProviderCursorAgent and CursorAgentBackend(), wired backendForProvider, added fake go/testdata/bin/cursor-agent, and added unit/integration tests.
  • Docs:
    • Updated README.md, go/README.md, rust/spawnllm/README.md, and .claude/fragments/great-docs.yml/great-docs-local.fragment.yml.

Verification

  • Rust: cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, cargo test --workspace --all-features, cargo test -p spawnllm --no-default-features, and cargo run -p conformance-gen -- --check (217/217 matched) — all pass.
  • Go: go vet ./..., go test -race -count=1 ./..., CGO_ENABLED=0 go build ./... — all 3 packages pass.
  • Python: uv run pytest (553 passed, 2 platform-skipped), uv run ruff check & uv run ruff format --check on changed files, uv run ty check on changed files, uv build — all pass.
Open in Web Open in Cursor 

cursoragent and others added 2 commits December 2, 2026 22:43
Co-authored-by: Yasyf Mohamedali <yasyf@users.noreply.github.com>
Co-authored-by: Yasyf Mohamedali <yasyf@users.noreply.github.com>
@yasyf
yasyf merged commit 52d71c9 into main Dec 3, 2026
17 checks passed
@yasyf
yasyf deleted the cursor/cursor-agent-backend-e20b branch December 3, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants