← 开源
Nomadcxx

opencode-cursor

Use Cursor Pro models in OpenCode via HTTP proxy with OAuth

AI EngineeringAccess modelsGive agent toolsTypeScript
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
708
Star
94
Fork
+4
本周
23
贡献者
创建于 2026-01-22 · 更新于 2026-10-16 · 今日第 14730 名
主要开发者
Nomadcxxrodrigoperaltadevhawkff
README

Documentation

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.

Installation

You need OpenCode, a Cursor subscription, the cursor-agent CLI, and Node.js 20 or newer.

1. Sign in to Cursor

cursor-agent login

That login is all open-cursor needs. An API key is optional (see Authentication).

2. Add the plugin

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.

OpenCode 1.x

npm install -g @rama_nigg/open-cursor
open-cursor install

The 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.

3. Check it works

opencode models | grep cursor-acp
opencode run -m cursor-acp/auto "Reply with PONG"

Authentication

open-cursor uses your cursor-agent login by default. You do not need to store anything in OpenCode.

You want to Do this
Use your Cursor login (default) cursor-agent login
Log in from inside OpenCode 2.x opencode auth login → Cursor → Log in with cursor-agent (browser)
Use an API key instead opencode auth login → Cursor → API key (1.x: opencode auth login --provider cursor-acp), or set CURSOR_API_KEY

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.

Moving from OpenCode 1.x to 2.x

OpenCode 2.x reads the same opencode.json, so 1.x entries carry over. To switch cleanly:

  1. Replace "cursor-acp" (or @rama_nigg/open-cursor) in the 1.x plugin list with the plugins entry above.
  2. Delete the provider.cursor-acp block. On 2.x the plugin supplies models itself.
  3. Remove ~/.config/opencode/plugin/cursor-acp.js if the 1.x installer created it.
  4. If requests fail with Cursor rejected the API key, remove the old stored key with opencode auth logout cursor-acp.

More detail: OpenCode 2.0 setup.

Usage

Run a prompt with automatic model selection:

opencode run "Summarise this repository in five bullets." \
  --model cursor-acp/auto

You can also start opencode and choose a cursor-acp/* model from its model picker.

Documentation

License

BSD-3-Clause


— terminal-native tooling for the linux desktop. More projects → · Sponsor ❤️

排名相邻
同类项目