better-opencode-openai-codex-auth 0.1.3 → 0.1.5
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
CHANGED
|
@@ -33,14 +33,7 @@ Then authenticate and run:
|
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
35
|
opencode auth login
|
|
36
|
-
opencode run "write hello world to test.txt" --model=openai/gpt-5.
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
**Legacy OpenCode** (v1.0.209 and below):
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
bunx better-opencode-openai-codex-auth@latest --legacy
|
|
43
|
-
opencode run "write hello world to test.txt" --model=openai/gpt-5.2-medium
|
|
36
|
+
opencode run "write hello world to test.txt" --model=openai/gpt-5.4 --variant=medium
|
|
44
37
|
```
|
|
45
38
|
|
|
46
39
|
**Uninstall:**
|
|
@@ -80,19 +73,14 @@ bunx better-opencode-openai-codex-auth@dev
|
|
|
80
73
|
|
|
81
74
|
- **gpt-5.3** (none/low/medium/high/xhigh)
|
|
82
75
|
- **gpt-5.3-codex** (low/medium/high/xhigh)
|
|
83
|
-
- **gpt-5.
|
|
84
|
-
- **gpt-5.
|
|
85
|
-
- **gpt-5.1-codex-max** (low/medium/high/xhigh)
|
|
86
|
-
- **gpt-5.1-codex** (low/medium/high)
|
|
87
|
-
- **gpt-5.1-codex-mini** (medium/high)
|
|
88
|
-
- **gpt-5.1** (none/low/medium/high)
|
|
76
|
+
- **gpt-5.4** (none/low/medium/high/xhigh)
|
|
77
|
+
- **gpt-5.4-pro** (medium/high/xhigh)
|
|
89
78
|
|
|
90
79
|
---
|
|
91
80
|
|
|
92
81
|
## Configuration
|
|
93
82
|
|
|
94
83
|
- **Modern** (OpenCode v1.0.210+): `config/opencode-modern.json`
|
|
95
|
-
- **Legacy** (OpenCode v1.0.209 and below): `config/opencode-legacy.json`
|
|
96
84
|
|
|
97
85
|
Minimal configs don't work with GPT-5.x; use the full configs above.
|
|
98
86
|
|
|
@@ -101,8 +89,8 @@ Minimal configs don't work with GPT-5.x; use the full configs above.
|
|
|
101
89
|
## Features
|
|
102
90
|
|
|
103
91
|
- ChatGPT Plus/Pro OAuth (same flow as official Codex CLI)
|
|
104
|
-
-
|
|
105
|
-
- Variant system support (v1.0.210+)
|
|
92
|
+
- 18 model presets across GPT-5.4 and GPT-5.3 families
|
|
93
|
+
- Variant system support (v1.0.210+)
|
|
106
94
|
- Multimodal input for all models
|
|
107
95
|
- Usage-aware errors with automatic token refresh
|
|
108
96
|
- Multi-account pool with round-robin or sticky selection (`~/.opencode/openai-codex-accounts.json`)
|
package/config/README.md
CHANGED
|
@@ -7,6 +7,8 @@ This directory contains the opencode configuration template for the OpenAI Codex
|
|
|
7
7
|
**`opencode-modern.json`** — the only config. Requires opencode v1.0.210+ (variants system).
|
|
8
8
|
The installer (`bunx better-opencode-openai-codex-auth@latest`) writes this to `~/.config/opencode/opencode.jsonc` automatically.
|
|
9
9
|
|
|
10
|
+
The shipped template pins the plugin as `better-opencode-openai-codex-auth@latest` so fresh installs always resolve the latest published npm tarball.
|
|
11
|
+
|
|
10
12
|
## Available Models
|
|
11
13
|
|
|
12
14
|
| Model | Variants | Notes |
|
|
@@ -15,13 +17,6 @@ The installer (`bunx better-opencode-openai-codex-auth@latest`) writes this to `
|
|
|
15
17
|
| `gpt-5.4-pro` | medium / high / xhigh | Pro tier (no none/low) |
|
|
16
18
|
| `gpt-5.3-codex` | low / medium / high / xhigh | Newest Codex family |
|
|
17
19
|
| `gpt-5.3` | none / low / medium / high / xhigh | GPT-5.3 general |
|
|
18
|
-
| `gpt-5.2` | none / low / medium / high / xhigh | |
|
|
19
|
-
| `gpt-5.2-codex` | low / medium / high / xhigh | |
|
|
20
|
-
| `gpt-5.1-codex-max` | low / medium / high / xhigh | |
|
|
21
|
-
| `gpt-5.1-codex` | low / medium / high | |
|
|
22
|
-
| `gpt-5.1-codex-mini` | medium / high | |
|
|
23
|
-
| `gpt-5.1` | none / low / medium / high | |
|
|
24
|
-
|
|
25
20
|
## Manual install
|
|
26
21
|
|
|
27
22
|
```bash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://opencode.ai/config.json",
|
|
3
3
|
"plugin": [
|
|
4
|
-
"better-opencode-openai-codex-auth"
|
|
4
|
+
"better-opencode-openai-codex-auth@latest"
|
|
5
5
|
],
|
|
6
6
|
"provider": {
|
|
7
7
|
"openai": {
|
|
@@ -151,194 +151,6 @@
|
|
|
151
151
|
"textVerbosity": "medium"
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
},
|
|
155
|
-
"gpt-5.2": {
|
|
156
|
-
"name": "GPT 5.2 (OAuth)",
|
|
157
|
-
"limit": {
|
|
158
|
-
"context": 272000,
|
|
159
|
-
"output": 128000
|
|
160
|
-
},
|
|
161
|
-
"modalities": {
|
|
162
|
-
"input": ["text", "image"],
|
|
163
|
-
"output": ["text"]
|
|
164
|
-
},
|
|
165
|
-
"variants": {
|
|
166
|
-
"none": {
|
|
167
|
-
"reasoningEffort": "none",
|
|
168
|
-
"reasoningSummary": "auto",
|
|
169
|
-
"textVerbosity": "medium"
|
|
170
|
-
},
|
|
171
|
-
"low": {
|
|
172
|
-
"reasoningEffort": "low",
|
|
173
|
-
"reasoningSummary": "auto",
|
|
174
|
-
"textVerbosity": "medium"
|
|
175
|
-
},
|
|
176
|
-
"medium": {
|
|
177
|
-
"reasoningEffort": "medium",
|
|
178
|
-
"reasoningSummary": "auto",
|
|
179
|
-
"textVerbosity": "medium"
|
|
180
|
-
},
|
|
181
|
-
"high": {
|
|
182
|
-
"reasoningEffort": "high",
|
|
183
|
-
"reasoningSummary": "detailed",
|
|
184
|
-
"textVerbosity": "medium"
|
|
185
|
-
},
|
|
186
|
-
"xhigh": {
|
|
187
|
-
"reasoningEffort": "xhigh",
|
|
188
|
-
"reasoningSummary": "detailed",
|
|
189
|
-
"textVerbosity": "medium"
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
"gpt-5.2-codex": {
|
|
194
|
-
"name": "GPT 5.2 Codex (OAuth)",
|
|
195
|
-
"limit": {
|
|
196
|
-
"context": 272000,
|
|
197
|
-
"output": 128000
|
|
198
|
-
},
|
|
199
|
-
"modalities": {
|
|
200
|
-
"input": ["text", "image"],
|
|
201
|
-
"output": ["text"]
|
|
202
|
-
},
|
|
203
|
-
"variants": {
|
|
204
|
-
"low": {
|
|
205
|
-
"reasoningEffort": "low",
|
|
206
|
-
"reasoningSummary": "auto",
|
|
207
|
-
"textVerbosity": "medium"
|
|
208
|
-
},
|
|
209
|
-
"medium": {
|
|
210
|
-
"reasoningEffort": "medium",
|
|
211
|
-
"reasoningSummary": "auto",
|
|
212
|
-
"textVerbosity": "medium"
|
|
213
|
-
},
|
|
214
|
-
"high": {
|
|
215
|
-
"reasoningEffort": "high",
|
|
216
|
-
"reasoningSummary": "detailed",
|
|
217
|
-
"textVerbosity": "medium"
|
|
218
|
-
},
|
|
219
|
-
"xhigh": {
|
|
220
|
-
"reasoningEffort": "xhigh",
|
|
221
|
-
"reasoningSummary": "detailed",
|
|
222
|
-
"textVerbosity": "medium"
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
"gpt-5.1-codex-max": {
|
|
227
|
-
"name": "GPT 5.1 Codex Max (OAuth)",
|
|
228
|
-
"limit": {
|
|
229
|
-
"context": 272000,
|
|
230
|
-
"output": 128000
|
|
231
|
-
},
|
|
232
|
-
"modalities": {
|
|
233
|
-
"input": ["text", "image"],
|
|
234
|
-
"output": ["text"]
|
|
235
|
-
},
|
|
236
|
-
"variants": {
|
|
237
|
-
"low": {
|
|
238
|
-
"reasoningEffort": "low",
|
|
239
|
-
"reasoningSummary": "detailed",
|
|
240
|
-
"textVerbosity": "medium"
|
|
241
|
-
},
|
|
242
|
-
"medium": {
|
|
243
|
-
"reasoningEffort": "medium",
|
|
244
|
-
"reasoningSummary": "detailed",
|
|
245
|
-
"textVerbosity": "medium"
|
|
246
|
-
},
|
|
247
|
-
"high": {
|
|
248
|
-
"reasoningEffort": "high",
|
|
249
|
-
"reasoningSummary": "detailed",
|
|
250
|
-
"textVerbosity": "medium"
|
|
251
|
-
},
|
|
252
|
-
"xhigh": {
|
|
253
|
-
"reasoningEffort": "xhigh",
|
|
254
|
-
"reasoningSummary": "detailed",
|
|
255
|
-
"textVerbosity": "medium"
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
"gpt-5.1-codex": {
|
|
260
|
-
"name": "GPT 5.1 Codex (OAuth)",
|
|
261
|
-
"limit": {
|
|
262
|
-
"context": 272000,
|
|
263
|
-
"output": 128000
|
|
264
|
-
},
|
|
265
|
-
"modalities": {
|
|
266
|
-
"input": ["text", "image"],
|
|
267
|
-
"output": ["text"]
|
|
268
|
-
},
|
|
269
|
-
"variants": {
|
|
270
|
-
"low": {
|
|
271
|
-
"reasoningEffort": "low",
|
|
272
|
-
"reasoningSummary": "auto",
|
|
273
|
-
"textVerbosity": "medium"
|
|
274
|
-
},
|
|
275
|
-
"medium": {
|
|
276
|
-
"reasoningEffort": "medium",
|
|
277
|
-
"reasoningSummary": "auto",
|
|
278
|
-
"textVerbosity": "medium"
|
|
279
|
-
},
|
|
280
|
-
"high": {
|
|
281
|
-
"reasoningEffort": "high",
|
|
282
|
-
"reasoningSummary": "detailed",
|
|
283
|
-
"textVerbosity": "medium"
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
"gpt-5.1-codex-mini": {
|
|
288
|
-
"name": "GPT 5.1 Codex Mini (OAuth)",
|
|
289
|
-
"limit": {
|
|
290
|
-
"context": 272000,
|
|
291
|
-
"output": 128000
|
|
292
|
-
},
|
|
293
|
-
"modalities": {
|
|
294
|
-
"input": ["text", "image"],
|
|
295
|
-
"output": ["text"]
|
|
296
|
-
},
|
|
297
|
-
"variants": {
|
|
298
|
-
"medium": {
|
|
299
|
-
"reasoningEffort": "medium",
|
|
300
|
-
"reasoningSummary": "auto",
|
|
301
|
-
"textVerbosity": "medium"
|
|
302
|
-
},
|
|
303
|
-
"high": {
|
|
304
|
-
"reasoningEffort": "high",
|
|
305
|
-
"reasoningSummary": "detailed",
|
|
306
|
-
"textVerbosity": "medium"
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
"gpt-5.1": {
|
|
311
|
-
"name": "GPT 5.1 (OAuth)",
|
|
312
|
-
"limit": {
|
|
313
|
-
"context": 272000,
|
|
314
|
-
"output": 128000
|
|
315
|
-
},
|
|
316
|
-
"modalities": {
|
|
317
|
-
"input": ["text", "image"],
|
|
318
|
-
"output": ["text"]
|
|
319
|
-
},
|
|
320
|
-
"variants": {
|
|
321
|
-
"none": {
|
|
322
|
-
"reasoningEffort": "none",
|
|
323
|
-
"reasoningSummary": "auto",
|
|
324
|
-
"textVerbosity": "medium"
|
|
325
|
-
},
|
|
326
|
-
"low": {
|
|
327
|
-
"reasoningEffort": "low",
|
|
328
|
-
"reasoningSummary": "auto",
|
|
329
|
-
"textVerbosity": "low"
|
|
330
|
-
},
|
|
331
|
-
"medium": {
|
|
332
|
-
"reasoningEffort": "medium",
|
|
333
|
-
"reasoningSummary": "auto",
|
|
334
|
-
"textVerbosity": "medium"
|
|
335
|
-
},
|
|
336
|
-
"high": {
|
|
337
|
-
"reasoningEffort": "high",
|
|
338
|
-
"reasoningSummary": "detailed",
|
|
339
|
-
"textVerbosity": "high"
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
154
|
}
|
|
343
155
|
}
|
|
344
156
|
}
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** Plugin identifier for logging and error messages */
|
|
6
6
|
export declare const PLUGIN_NAME = "openai-codex-plugin";
|
|
7
7
|
/** Plugin version — keep in sync with package.json */
|
|
8
|
-
export declare const PLUGIN_VERSION = "0.1.
|
|
8
|
+
export declare const PLUGIN_VERSION = "0.1.5";
|
|
9
9
|
/** Base URL for ChatGPT backend API */
|
|
10
10
|
export declare const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
11
11
|
/** Dummy API key used for OpenAI SDK (actual auth via OAuth) */
|
package/dist/lib/constants.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/** Plugin identifier for logging and error messages */
|
|
6
6
|
export const PLUGIN_NAME = "openai-codex-plugin";
|
|
7
7
|
/** Plugin version — keep in sync with package.json */
|
|
8
|
-
export const PLUGIN_VERSION = "0.1.
|
|
8
|
+
export const PLUGIN_VERSION = "0.1.5";
|
|
9
9
|
/** Base URL for ChatGPT backend API */
|
|
10
10
|
export const CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
11
11
|
/** Dummy API key used for OpenAI SDK (actual auth via OAuth) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-opencode-openai-codex-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "OpenAI ChatGPT (Codex backend) OAuth auth plugin for opencode - use your ChatGPT Plus/Pro subscription instead of API credits",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,6 +8,7 @@ import { homedir } from "node:os";
|
|
|
8
8
|
import { parse, modify, applyEdits, printParseErrorCode } from "jsonc-parser";
|
|
9
9
|
|
|
10
10
|
const PLUGIN_NAME = "better-opencode-openai-codex-auth";
|
|
11
|
+
const PLUGIN_REF = `${PLUGIN_NAME}@latest`;
|
|
11
12
|
const args = new Set(process.argv.slice(2));
|
|
12
13
|
|
|
13
14
|
if (args.has("--help") || args.has("-h")) {
|
|
@@ -51,6 +52,15 @@ const pluginAccountsPath = join(homedir(), ".opencode", "openai-codex-accounts.j
|
|
|
51
52
|
const pluginLogDir = join(homedir(), ".opencode", "logs", "codex-plugin");
|
|
52
53
|
const opencodeCacheDir = join(homedir(), ".opencode", "cache");
|
|
53
54
|
|
|
55
|
+
const LEGACY_MANAGED_MODEL_IDS = [
|
|
56
|
+
"gpt-5.2",
|
|
57
|
+
"gpt-5.2-codex",
|
|
58
|
+
"gpt-5.1-codex-max",
|
|
59
|
+
"gpt-5.1-codex",
|
|
60
|
+
"gpt-5.1-codex-mini",
|
|
61
|
+
"gpt-5.1",
|
|
62
|
+
];
|
|
63
|
+
|
|
54
64
|
function log(message) {
|
|
55
65
|
console.log(message);
|
|
56
66
|
}
|
|
@@ -61,7 +71,7 @@ function normalizePluginList(list) {
|
|
|
61
71
|
if (typeof entry !== "string") return true;
|
|
62
72
|
return entry !== PLUGIN_NAME && !entry.startsWith(`${PLUGIN_NAME}@`);
|
|
63
73
|
});
|
|
64
|
-
return [...filtered,
|
|
74
|
+
return [...filtered, PLUGIN_REF];
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
function removePluginEntries(list) {
|
|
@@ -98,12 +108,15 @@ function mergeOpenAIConfig(existingOpenAI, templateOpenAI) {
|
|
|
98
108
|
template.models && typeof template.models === "object"
|
|
99
109
|
? template.models
|
|
100
110
|
: {};
|
|
111
|
+
const prunedExistingModels = Object.fromEntries(
|
|
112
|
+
Object.entries(existingModels).filter(([key]) => !LEGACY_MANAGED_MODEL_IDS.includes(key)),
|
|
113
|
+
);
|
|
101
114
|
|
|
102
115
|
return {
|
|
103
116
|
...existing,
|
|
104
117
|
...template,
|
|
105
118
|
options: { ...existingOptions, ...templateOptions },
|
|
106
|
-
models: { ...
|
|
119
|
+
models: { ...prunedExistingModels, ...templateModels },
|
|
107
120
|
};
|
|
108
121
|
}
|
|
109
122
|
|
|
@@ -111,7 +124,10 @@ async function getKnownModelIds() {
|
|
|
111
124
|
const modernTemplate = await readJson(
|
|
112
125
|
join(repoRoot, "config", "opencode-modern.json"),
|
|
113
126
|
);
|
|
114
|
-
return new Set(
|
|
127
|
+
return new Set([
|
|
128
|
+
...Object.keys(modernTemplate?.provider?.openai?.models || {}),
|
|
129
|
+
...LEGACY_MANAGED_MODEL_IDS,
|
|
130
|
+
]);
|
|
115
131
|
}
|
|
116
132
|
|
|
117
133
|
function formatJson(obj) {
|
|
@@ -354,7 +370,7 @@ async function main() {
|
|
|
354
370
|
}
|
|
355
371
|
|
|
356
372
|
const template = await readJson(templatePath);
|
|
357
|
-
template.plugin = [
|
|
373
|
+
template.plugin = [PLUGIN_REF];
|
|
358
374
|
|
|
359
375
|
let nextConfig = template;
|
|
360
376
|
let nextContent = null;
|