Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Use the models on your Cursor subscription from OpenCode and [OpenChamber](https

### Sign in with Cursor, not an API key

`opencode auth login --provider cursor` opens a PKCE browser flow. Tokens land in `~/.local/share/opencode/auth.json` and refresh automatically. In OpenChamber, if no OAuth button appears, the plugin still prints a login URL — open it, then reload.
OpenCode opens a PKCE browser flow and owns the resulting credentials. In V1, `opencode auth login --provider cursor` starts the flow directly.

### Use the models your account actually has

Expand All @@ -42,25 +42,23 @@ npm install -g @openchamber/opencode-cursor

### 2. Register it in OpenCode

Add (or merge) this into `~/.config/opencode/opencode.json`:
For OpenCode V2, add (or merge) this into `~/.config/opencode/opencode.json`:

```jsonc
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@openchamber/opencode-cursor"],
"provider": {
"plugins": ["@openchamber/opencode-cursor"],
"providers": {
"cursor": { "name": "Cursor" }
}
}
```

### 3. Sign in with Cursor

```bash
opencode auth login --provider cursor
```
Connect the Cursor integration from OpenCode. A browser window opens; approve access. You do not need a Cursor API key.

A browser window opens. Approve access. You do not need a Cursor API key.
For OpenCode V1, keep using the root package with `"plugin"` / `"provider"` and run `opencode auth login --provider cursor`.

### 4. Run a Cursor model

Expand All @@ -83,9 +81,9 @@ npm install -g .

| Step | What happens |
| --- | --- |
| `opencode auth login --provider cursor` | Starts PKCE browser OAuth |
| Connect Cursor in V2, or `opencode auth login --provider cursor` in V1 | Starts PKCE browser OAuth |
| You approve in the browser | Cursor returns access + refresh tokens |
| Plugin stores credentials | `~/.local/share/opencode/auth.json` |
| OpenCode stores credentials | Host-owned credential storage |
| Access expires | Plugin refreshes silently; permanent 4xx → re-login |

**Browser OAuth is the only supported path.** You do not need a Cursor API key.
Expand All @@ -110,10 +108,12 @@ Model listings map Cursor’s variant catalog into OpenCode-native choices (`Opu

## Requirements

- [OpenCode](https://opencode.ai)
- [OpenCode](https://opencode.ai) V2 (`./server`, selected automatically) or V1 (root export)
- Active Cursor subscription
- Bun (plugin runtime) · Node.js ≥ 18 (HTTP/2 bridge)

The V2 entrypoint discovers the live model catalog after login and reloads it without restarting OpenCode. If Cursor discovery is temporarily unavailable, it retains the authorization bootstrap model (or the last discovered catalog) until the next login or token refresh.

## Development

```bash
Expand Down
203 changes: 186 additions & 17 deletions bun.lock

Large diffs are not rendered by default.

Loading