| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Community integration between Cursor and OpenCode.
This repo is intentionally built around documented Cursor surfaces:
It does not attempt to reverse-engineer private Cursor endpoints.
Important distinction:
WSL2 Users: See docs/WSL2_SETUP.md for detailed WSL2-specific setup instructions, including fixes for common issues like IPv6 networking problems in corporate environments.
Copy/paste this whole block as a prompt in OpenCode:
Install the Cursor provider + tools from /path/to/cursor-opencode-auth.
Requirements:
- Use the existing local checkout at /path/to/cursor-opencode-auth (do not re-clone).
- Ensure Cursor CLI is installed (agent). If not installed, install via: curl https://cursor.com/install -fsS | bash
- Ensure Cursor CLI is authenticated. If not, tell me to run: agent login
Steps:
1) Build the repo:
- npm install
- npm --workspaces run build
2) Install the OpenCode plugin (dev shim):
- Create ~/.config/opencode/plugins/cursor-opencode-auth.ts exporting CursorPlugin from:
/path/to/cursor-opencode-auth/packages/opencode-plugin-cursor/dist/index.js
3) Configure OpenCode to expose a provider named "cursor" that points at the local bridge:
- Update ~/.config/opencode/opencode.json to include:
provider.cursor.npm = "@ai-sdk/openai-compatible"
provider.cursor.options.baseURL = "http://127.0.0.1:8765/v1"
provider.cursor.options.apiKey = "unused"
- Populate provider.cursor.models by running: agent --list-models
4) Verify:
- opencode models cursor
- In OpenCode, switch model to cursor/gpt-5.2 (or any Cursor model ID) and send a test prompt.
If the provider cannot connect, use the plugin tool cursor_bridge_start and retry.
curl https://cursor.com/install -fsS | bash
agent login
agent --list-modelscd /path/to/cursor-opencode-auth
npm install
npm --workspaces run buildCreate ~/.config/opencode/plugins/cursor-opencode-auth.ts:
// Uses your local checkout (v0.2.0+) instead of a cached npm install.
export { CursorPlugin } from "/path/to/cursor-opencode-auth/packages/opencode-plugin-cursor/dist/index.js";After the plugin loads once, it will automatically create/rename a versioned plugin entry so /status can show the version (you may need to restart OpenCode once).
Important: if you previously installed the npm plugin via opencode.json (e.g. "plugin": ["opencode-plugin-cursor"]), remove it to avoid loading two versions of the plugin.
If you prefer installing from npm instead of a local checkout, pin the version in your OpenCode config (after publishing):
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-cursor@0.2.0"]
}opencode models cursor
opencode run -m cursor/gpt-5.2 "say hello"If the provider can’t connect, run cursor_bridge_start inside OpenCode (or start the bridge manually):
node /path/to/cursor-opencode-auth/packages/cursor-openai-bridge/dist/cli.jsBridge knobs (optional env vars):
Docs:
The OpenCode plugin adds tools:
Cursor CLI is a full coding agent (it reads files, calls tools, writes code), not a model. When you use cursor/<model> as an OpenCode provider, OpenCode sends a prompt to the bridge, which runs Cursor's own agent loop, then returns only the final text. This means:
Recommended: Use the CLI tools (cursor_cli_run with outputFormat: "stream-json", or cursor_cli_patch) instead of the provider for full visibility into what Cursor did. The provider approach works for simple question-answering but loses important context for coding tasks.
OpenCode's plugin API supports registering tools and event hooks, but not custom model providers. Providers must be configured via opencode.json with an AI SDK package (e.g., @ai-sdk/openai-compatible). This is why the bridge server exists as a workaround. A proper integration would require OpenCode to add provider() registration to its plugin API (see OpenCode plugin docs).
| Back | FazBrowse Home | New Git URL |