cursor-agent-bridge 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -30
- package/dist/cli.mjs +4 -1
- package/dist/index.mjs +1 -1
- package/dist/{server-DBFhIonT.mjs → server-BtOiVsUV.mjs} +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
OpenAI-compatible HTTP bridge for the Cursor Agent CLI.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Responses API
|
|
5
|
+
Use it when you want Codex or another OpenAI-style client to call your local
|
|
6
|
+
Cursor Agent CLI through `http://127.0.0.1:4646/v1`. The bridge supports the
|
|
7
|
+
Responses API that Codex custom providers use, plus Chat Completions for simpler
|
|
8
8
|
clients.
|
|
9
9
|
|
|
10
10
|
## Requirements
|
|
@@ -23,12 +23,19 @@ agent --list-models
|
|
|
23
23
|
|
|
24
24
|
## Install
|
|
25
25
|
|
|
26
|
-
Install the package globally, then confirm the
|
|
27
|
-
`PATH`:
|
|
26
|
+
Install the package globally, then confirm the CLI is on your `PATH`:
|
|
28
27
|
|
|
29
28
|
```bash
|
|
30
29
|
pnpm add -g cursor-agent-bridge
|
|
31
|
-
|
|
30
|
+
cab --version
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The package installs two commands. `cab` is the short alias; the full
|
|
34
|
+
`cursor-agent-bridge` command stays available for scripts and existing setups.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cab serve
|
|
38
|
+
cab config switch cursor
|
|
32
39
|
```
|
|
33
40
|
|
|
34
41
|
For local development:
|
|
@@ -36,7 +43,7 @@ For local development:
|
|
|
36
43
|
```bash
|
|
37
44
|
pnpm install
|
|
38
45
|
pnpm build
|
|
39
|
-
|
|
46
|
+
node dist/cli.mjs serve
|
|
40
47
|
```
|
|
41
48
|
|
|
42
49
|
## Upgrade
|
|
@@ -44,20 +51,20 @@ pnpm exec cursor-agent-bridge serve
|
|
|
44
51
|
Check for updates:
|
|
45
52
|
|
|
46
53
|
```bash
|
|
47
|
-
|
|
54
|
+
cab upgrade --check
|
|
48
55
|
```
|
|
49
56
|
|
|
50
57
|
Install the latest published version:
|
|
51
58
|
|
|
52
59
|
```bash
|
|
53
|
-
|
|
60
|
+
cab upgrade
|
|
54
61
|
```
|
|
55
62
|
|
|
56
63
|
Options:
|
|
57
64
|
|
|
58
65
|
```bash
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
cab upgrade --target 0.1.3
|
|
67
|
+
cab upgrade --manager npm
|
|
61
68
|
```
|
|
62
69
|
|
|
63
70
|
`--check` compares your installed version with npm and exits `1` when a newer
|
|
@@ -68,7 +75,7 @@ If you use the optional macOS LaunchAgent, reinstall it after upgrading so the
|
|
|
68
75
|
service picks up the new binary:
|
|
69
76
|
|
|
70
77
|
```bash
|
|
71
|
-
|
|
78
|
+
cab launch-agent install
|
|
72
79
|
```
|
|
73
80
|
|
|
74
81
|
For local development from this repository, use `git pull`, `pnpm install`, and
|
|
@@ -79,7 +86,7 @@ For local development from this repository, use `git pull`, `pnpm install`, and
|
|
|
79
86
|
Run the bridge in the foreground:
|
|
80
87
|
|
|
81
88
|
```bash
|
|
82
|
-
|
|
89
|
+
cab serve --host 127.0.0.1 --port 4646
|
|
83
90
|
```
|
|
84
91
|
|
|
85
92
|
Configuration:
|
|
@@ -106,37 +113,37 @@ processes. On macOS, you can install the optional LaunchAgent to start the
|
|
|
106
113
|
bridge at login and restart it after crashes:
|
|
107
114
|
|
|
108
115
|
```bash
|
|
109
|
-
|
|
116
|
+
cab launch-agent install
|
|
110
117
|
```
|
|
111
118
|
|
|
112
119
|
Manage the service:
|
|
113
120
|
|
|
114
121
|
```bash
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
cab launch-agent status
|
|
123
|
+
cab launch-agent uninstall
|
|
117
124
|
```
|
|
118
125
|
|
|
119
126
|
The LaunchAgent listens on `127.0.0.1:4646` by default. Skip it if you prefer to
|
|
120
|
-
run `
|
|
127
|
+
run `cab serve` yourself before starting Codex.
|
|
121
128
|
|
|
122
129
|
## Codex Config
|
|
123
130
|
|
|
124
131
|
For Codex CLI profile usage, create or update `~/.codex/cursor.config.toml`:
|
|
125
132
|
|
|
126
133
|
```bash
|
|
127
|
-
|
|
134
|
+
cab config write
|
|
128
135
|
```
|
|
129
136
|
|
|
130
137
|
Preview the generated profile without writing a file:
|
|
131
138
|
|
|
132
139
|
```bash
|
|
133
|
-
|
|
140
|
+
cab config print
|
|
134
141
|
```
|
|
135
142
|
|
|
136
143
|
Validate an existing profile:
|
|
137
144
|
|
|
138
145
|
```bash
|
|
139
|
-
|
|
146
|
+
cab config check
|
|
140
147
|
```
|
|
141
148
|
|
|
142
149
|
The generated profile looks like this:
|
|
@@ -162,22 +169,23 @@ Use `/model` in Codex to pick a Cursor model. The model catalog comes from
|
|
|
162
169
|
|
|
163
170
|
## Codex IDE Switching
|
|
164
171
|
|
|
165
|
-
The Codex IDE extension reads the user-level `~/.codex/config.toml`. Switch
|
|
172
|
+
The Codex IDE extension reads the user-level `~/.codex/config.toml`. Switch
|
|
173
|
+
that file when you want the IDE to use Cursor Agent Bridge:
|
|
166
174
|
|
|
167
175
|
```bash
|
|
168
|
-
|
|
176
|
+
cab config switch cursor
|
|
169
177
|
```
|
|
170
178
|
|
|
171
179
|
Switch back to Codex's default provider:
|
|
172
180
|
|
|
173
181
|
```bash
|
|
174
|
-
|
|
182
|
+
cab config switch openai
|
|
175
183
|
```
|
|
176
184
|
|
|
177
185
|
Check the active provider:
|
|
178
186
|
|
|
179
187
|
```bash
|
|
180
|
-
|
|
188
|
+
cab config switch status
|
|
181
189
|
```
|
|
182
190
|
|
|
183
191
|
The switch command backs up the previous `~/.codex/config.toml` to
|
|
@@ -185,7 +193,7 @@ The switch command backs up the previous `~/.codex/config.toml` to
|
|
|
185
193
|
that backup with:
|
|
186
194
|
|
|
187
195
|
```bash
|
|
188
|
-
|
|
196
|
+
cab config switch restore
|
|
189
197
|
```
|
|
190
198
|
|
|
191
199
|
Reload the Codex IDE window or start a new session after switching. Codex does
|
|
@@ -196,14 +204,14 @@ not reliably hot-reload provider changes while a session is running.
|
|
|
196
204
|
Run a full preflight before starting Codex:
|
|
197
205
|
|
|
198
206
|
```bash
|
|
199
|
-
|
|
207
|
+
cab doctor
|
|
200
208
|
```
|
|
201
209
|
|
|
202
210
|
List available Cursor models without starting the HTTP server:
|
|
203
211
|
|
|
204
212
|
```bash
|
|
205
|
-
|
|
206
|
-
|
|
213
|
+
cab models
|
|
214
|
+
cab models --json
|
|
207
215
|
```
|
|
208
216
|
|
|
209
217
|
If `config write` finds a different `model_provider`, pass `--force` to switch
|
|
@@ -219,8 +227,8 @@ POST /v1/chat/completions
|
|
|
219
227
|
```
|
|
220
228
|
|
|
221
229
|
`GET /v1/models` returns an OpenAI-style model list by default. When Codex calls
|
|
222
|
-
the same endpoint
|
|
223
|
-
|
|
230
|
+
the same endpoint, the bridge returns the catalog shape Codex expects for the
|
|
231
|
+
model selector.
|
|
224
232
|
|
|
225
233
|
Model lists are cached briefly so the bridge does not spawn
|
|
226
234
|
`agent --list-models` for every request. Pass `refresh=1` to force a refresh.
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as CursorRunner, n as engines, r as version, s as toOpenAIModelList, t as startServer } from "./server-
|
|
2
|
+
import { i as CursorRunner, n as engines, r as version, s as toOpenAIModelList, t as startServer } from "./server-BtOiVsUV.mjs";
|
|
3
3
|
import { execFile, execFileSync, spawn } from "node:child_process";
|
|
4
4
|
import { copyFile, mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
5
5
|
import { homedir } from "node:os";
|
|
@@ -825,6 +825,9 @@ Usage:
|
|
|
825
825
|
cursor-agent-bridge launch-agent status
|
|
826
826
|
cursor-agent-bridge upgrade [--check] [--target latest] [--manager auto|npm|pnpm]
|
|
827
827
|
|
|
828
|
+
Alias:
|
|
829
|
+
cab is the short alias for cursor-agent-bridge
|
|
830
|
+
|
|
828
831
|
Environment:
|
|
829
832
|
HOST Listen host, default 127.0.0.1
|
|
830
833
|
PORT Listen port, default 4646
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as parseAgentModelList, c as messagesToPrompt, i as CursorRunner, l as normalizeModel, o as toCodexModelCatalog, s as toOpenAIModelList, t as startServer, u as responsesToMessages } from "./server-
|
|
1
|
+
import { a as parseAgentModelList, c as messagesToPrompt, i as CursorRunner, l as normalizeModel, o as toCodexModelCatalog, s as toOpenAIModelList, t as startServer, u as responsesToMessages } from "./server-BtOiVsUV.mjs";
|
|
2
2
|
export { CursorRunner, messagesToPrompt, normalizeModel, parseAgentModelList, responsesToMessages, startServer, toCodexModelCatalog, toOpenAIModelList };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursor-agent-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Responses-compatible API bridge for Cursor Agent CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/xwartz/cursor-agent-bridge#readme",
|
|
14
14
|
"bin": {
|
|
15
|
-
"cursor-agent-bridge": "./dist/cli.mjs"
|
|
15
|
+
"cursor-agent-bridge": "./dist/cli.mjs",
|
|
16
|
+
"cab": "./dist/cli.mjs"
|
|
16
17
|
},
|
|
17
18
|
"exports": {
|
|
18
19
|
".": {
|