-
Notifications
You must be signed in to change notification settings - Fork 548
feat: add Cursor Agent CLI driver (agent acp) #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
milind-soni
merged 4 commits into
milind-soni:main
from
NocturnusCoder:NCT-cursor-agent-acp-45eb
Aug 20, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b01bb82
feat: add Cursor Agent CLI driver over ACP stdio
cursoragent d13bd70
fix(cursor): parse plain agent models text instead of --format json
cursoragent acfbdbc
fix(cursor): show full agent models list in main picker rail
cursoragent 4d05e80
fix(cursor): avoid CLI collisions and auth false negatives
milind-soni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # Cursor Agent CLI | ||
|
|
||
| Cursor is an optional OpenMausBot engine. OpenMausBot runs the official | ||
| [`cursor-agent` CLI](https://cursor.com/docs/cli) in ACP stdio mode (`cursor-agent acp`), so | ||
| sessions, streaming, coding tools, permission requests, MCP integrations, | ||
| resume, and cancellation use the same runtime as the other ACP engines. | ||
|
|
||
| Bots on this engine consume the user's Cursor subscription (or a | ||
| `CURSOR_API_KEY` / `CURSOR_AUTH_TOKEN`), not a separate Anthropic/OpenAI/xAI | ||
| key. | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Install Cursor CLI: | ||
|
|
||
| ```sh | ||
| curl https://cursor.com/install -fsS | bash # macOS / Linux | ||
| ``` | ||
|
|
||
| Windows (native): `irm 'https://cursor.com/install?win32=true' | iex` | ||
|
|
||
| 2. Sign in with `cursor-agent login`, or set `CURSOR_API_KEY` / `CURSOR_AUTH_TOKEN` | ||
| in the environment of the Cursor instance. | ||
|
|
||
| 3. Confirm `cursor-agent --version` works. The binary installs to `~/.local/bin` by | ||
| default; OpenMausBot already looks there when launched from a GUI. | ||
|
|
||
| The engine stays unavailable until the `cursor-agent` executable is on PATH. A | ||
| missing login shows as unauthenticated rather than crashing the fleet. | ||
|
|
||
| ## Models | ||
|
|
||
| The picker starts from a small static catalog and refreshes from plain | ||
| `cursor-agent models` output (`slug - Label`, with `(default)` / `(current)` markers). | ||
| Live ids are merged into the main cloud rail (not the local-models pane). A | ||
| failed listing keeps the last usable catalog (then the static fallback) rather | ||
| than emptying the rail. | ||
|
|
||
| `--model <id>` is passed as a global CLI flag before `acp`. When the running | ||
| CLI also implements ACP `session/set_model`, OpenMausBot pins the same id over | ||
| the wire. If that method is missing (`-32601`), the argv pin is left to stand | ||
| and the turn continues. | ||
|
|
||
| ## Autonomy | ||
|
|
||
| Instance `fullAuto: true` adds `--force` (the CLI's documented auto-approve | ||
| switch). OpenMausBot still answers ACP `session/request_permission` itself: | ||
| full-auto selects an allow option when the CLI offered one. | ||
|
|
||
| ## What this driver does not do yet | ||
|
|
||
| - Cursor ACP extension methods (`cursor/ask_question`, `cursor/create_plan`, | ||
| todos/tasks/images) are not given a dedicated UI. Unknown JSON-RPC requests | ||
| are rejected with method-not-found so the CLI is not left blocked. | ||
| - MCP servers passed in `session/new` follow Cursor's ACP limitations; prefer | ||
| project or user `.cursor/mcp.json` where needed. | ||
| - Live smoke (`cursor-agent login`, `cursor-agent models`, one real turn) should be run on | ||
| a machine with the CLI installed and signed in before relying on this in | ||
| production. | ||
|
|
||
| ## Testing | ||
|
|
||
| Normal unit and ACP protocol tests use the scripted fake CLI and do not | ||
| require a Cursor subscription. Do not print credentials or upload native | ||
| protocol logs from a credentialed live run. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 26464
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 36997
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 18313
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 358
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 7111
Preserve the last usable Cursor catalog on refresh failure.
fetchCursorModelsreturnsSTATIC_CURSOR_MODELSwhen listing fails.refreshModelstreats this non-empty fallback as successful and replaces the previous live catalog. Return a failure signal fromfetchCursorModelsand add a regression test for a failed refresh.🤖 Prompt for AI Agents