open-cursor connects OpenCode to the models available through your Cursor
subscription. It translates prompts, streaming responses, thinking, and tool
calls between OpenCode and Cursor (via a local openai-compatible proxy backed
by @cursor/sdk).
Also worth a look: oakimov/cursor-opencode-provider takes a different approach, speaking Cursor's native agent protocol directly so OpenCode owns the tool loop. opencode-plugin-compat runs it unchanged on Kilo Code, MiMo Code, pi, oh-my-pi, and DeepSeek Harness. Excellent work.
You need OpenCode, a Cursor subscription, the
cursor-agent CLI, and Node.js 20 or newer
(22.13 or newer if you use an API key, which runs the Cursor SDK).
cursor-agent loginThat login is all open-cursor needs. An API key is optional (see Authentication).
OpenCode 2.x (the current default). Add the package to plugins in
~/.config/opencode/opencode.json and restart OpenCode:
{
"plugins": ["@rama_nigg/open-cursor"]
}Use the bare package name. OpenCode installs and updates it for you.
Coming from OpenCode 1.x? Delete ~/.config/opencode/plugin/cursor-acp.js
first. OpenCode 2.x still loads files in that folder, so the old copy runs
next to the new one and requests can fail. See
Moving from OpenCode 1.x to 2.x.
OpenCode 1.x
npm install -g @rama_nigg/open-cursor
open-cursor installThe installer adds the plugin and a cursor-acp provider block to your
OpenCode config, backing up the existing file first. Upgrade with
npm update -g @rama_nigg/open-cursor.
opencode models | grep cursor-acp
opencode run -m cursor-acp/auto "Reply with PONG"If cursor-agent login worked, you are done. open-cursor uses that login,
and you do not need to store anything in OpenCode.
On OpenCode 2.x, run cursor-agent login before you use /connect. The
Log in with cursor-agent (browser) option then picks up that login and
connects straight away.
| You want to | Do this |
|---|---|
| Use your Cursor login (default) | cursor-agent login |
| Connect Cursor in OpenCode 2.x | After cursor-agent login: /connect (TUI and Desktop) or opencode auth login → Cursor → Log in with cursor-agent (browser). If cursor-agent is not logged in yet, it shows Cursor's sign-in link instead |
| Use an API key instead | opencode auth login → Cursor → API key (1.x: opencode auth login --provider cursor-acp), or set CURSOR_API_KEY |
| Remove a stored key (2.x) | opencode auth logout cursor-acp. Without an interactive terminal, add the credential label from opencode auth list: opencode auth logout cursor-acp Cursor |
API keys come from cursor.com/settings. With a
key stored, OpenCode 2.x runs requests through the Cursor SDK. If Cursor
rejects the key and cursor-agent is installed, open-cursor switches to
cursor-agent and logs a warning (keys set in CURSOR_API_KEY excepted:
cursor-agent reads that variable too, so unset a bad one). Do not enter a placeholder key to get past
the login prompt; choose Log in with cursor-agent (browser) instead.
On 2.x the newest login becomes the active account, so this also replaces a
stored key; opencode auth switch cursor-acp <label> switches back.
OpenCode 2.x reads the same opencode.json, so 1.x entries carry over. To
switch cleanly:
- Delete
~/.config/opencode/plugin/cursor-acp.jsif the 1.x installer created it. OpenCode 2.x still loads it, so an old copy runs beside the new one and requests can fail withcursor-agent exited with code 1 and no output.open-cursor doctorflags the file. - Replace
"cursor-acp"(or@rama_nigg/open-cursor) in the 1.xpluginlist with thepluginsentry above. - Delete the
provider.cursor-acpblock. On 2.x the plugin supplies models itself. - If requests fail with
Cursor rejected the API key, remove the old stored key withopencode auth logout cursor-acp.
More detail: OpenCode 2.0 setup.
Run a prompt with automatic model selection:
opencode run "Summarise this repository in five bullets." \
--model cursor-acp/autoYou can also start opencode and choose a cursor-acp/* model from its model
picker.
- Installation
- OpenCode 2.0 setup
- Authentication
- Configuration
- Choosing a model
- MCP servers
- Troubleshooting
- Architecture
- Development
BSD-3-Clause
— terminal-native tooling for the linux desktop.
More projects → · Sponsor ❤️