codex-multi-auth 1.3.2 → 2.0.1
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 +40 -26
- package/config/README.md +4 -4
- package/config/codex-legacy.json +571 -646
- package/config/codex-modern.json +258 -274
- package/config/minimal-codex.json +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -14
- package/dist/index.js.map +1 -1
- package/dist/lib/auto-update-checker.d.ts +23 -1
- package/dist/lib/auto-update-checker.d.ts.map +1 -1
- package/dist/lib/auto-update-checker.js +481 -8
- package/dist/lib/auto-update-checker.js.map +1 -1
- package/dist/lib/cli.d.ts +5 -0
- package/dist/lib/cli.d.ts.map +1 -1
- package/dist/lib/cli.js.map +1 -1
- package/dist/lib/codex-manager/commands/best.js +1 -1
- package/dist/lib/codex-manager/commands/best.js.map +1 -1
- package/dist/lib/codex-manager/commands/forecast.js +3 -3
- package/dist/lib/codex-manager/commands/forecast.js.map +1 -1
- package/dist/lib/codex-manager/commands/report.js +3 -3
- package/dist/lib/codex-manager/commands/report.js.map +1 -1
- package/dist/lib/codex-manager/commands/rotation.d.ts +26 -0
- package/dist/lib/codex-manager/commands/rotation.d.ts.map +1 -0
- package/dist/lib/codex-manager/commands/rotation.js +313 -0
- package/dist/lib/codex-manager/commands/rotation.js.map +1 -0
- package/dist/lib/codex-manager/commands/status.d.ts +6 -0
- package/dist/lib/codex-manager/commands/status.d.ts.map +1 -1
- package/dist/lib/codex-manager/commands/status.js +64 -10
- package/dist/lib/codex-manager/commands/status.js.map +1 -1
- package/dist/lib/codex-manager/forecast-report-commands.js +4 -4
- package/dist/lib/codex-manager/forecast-report-commands.js.map +1 -1
- package/dist/lib/codex-manager/help.d.ts.map +1 -1
- package/dist/lib/codex-manager/help.js +3 -2
- package/dist/lib/codex-manager/help.js.map +1 -1
- package/dist/lib/codex-manager/rate-limit-markers.d.ts +2 -0
- package/dist/lib/codex-manager/rate-limit-markers.d.ts.map +1 -0
- package/dist/lib/codex-manager/rate-limit-markers.js +4 -0
- package/dist/lib/codex-manager/rate-limit-markers.js.map +1 -0
- package/dist/lib/codex-manager/repair-commands.js +3 -3
- package/dist/lib/codex-manager/repair-commands.js.map +1 -1
- package/dist/lib/codex-manager.d.ts.map +1 -1
- package/dist/lib/codex-manager.js +115 -87
- package/dist/lib/codex-manager.js.map +1 -1
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +9 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/constants.d.ts +2 -0
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +2 -0
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/fs-retry.d.ts +7 -0
- package/dist/lib/fs-retry.d.ts.map +1 -0
- package/dist/lib/fs-retry.js +35 -0
- package/dist/lib/fs-retry.js.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +1 -0
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/prompts/codex.d.ts +1 -1
- package/dist/lib/prompts/codex.d.ts.map +1 -1
- package/dist/lib/prompts/codex.js +3 -3
- package/dist/lib/prompts/codex.js.map +1 -1
- package/dist/lib/quota-probe.js +1 -1
- package/dist/lib/quota-probe.js.map +1 -1
- package/dist/lib/quota-readiness.d.ts +16 -0
- package/dist/lib/quota-readiness.d.ts.map +1 -0
- package/dist/lib/quota-readiness.js +82 -0
- package/dist/lib/quota-readiness.js.map +1 -0
- package/dist/lib/request/fetch-helpers.d.ts.map +1 -1
- package/dist/lib/request/fetch-helpers.js +19 -8
- package/dist/lib/request/fetch-helpers.js.map +1 -1
- package/dist/lib/request/helpers/model-map.d.ts +2 -1
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
- package/dist/lib/request/helpers/model-map.js +52 -60
- package/dist/lib/request/helpers/model-map.js.map +1 -1
- package/dist/lib/request/request-transformer.d.ts +2 -2
- package/dist/lib/request/request-transformer.js +4 -3
- package/dist/lib/request/request-transformer.js.map +1 -1
- package/dist/lib/runtime/app-bind.d.ts +74 -0
- package/dist/lib/runtime/app-bind.d.ts.map +1 -0
- package/dist/lib/runtime/app-bind.js +620 -0
- package/dist/lib/runtime/app-bind.js.map +1 -0
- package/dist/lib/runtime/config-toml.d.ts +10 -0
- package/dist/lib/runtime/config-toml.d.ts.map +1 -0
- package/dist/lib/runtime/config-toml.js +128 -0
- package/dist/lib/runtime/config-toml.js.map +1 -0
- package/dist/lib/runtime/login-menu-accounts.d.ts +5 -0
- package/dist/lib/runtime/login-menu-accounts.d.ts.map +1 -1
- package/dist/lib/runtime/login-menu-accounts.js +7 -2
- package/dist/lib/runtime/login-menu-accounts.js.map +1 -1
- package/dist/lib/runtime/quota-probe.js +1 -1
- package/dist/lib/runtime/quota-probe.js.map +1 -1
- package/dist/lib/runtime/runtime-current-account.d.ts +52 -0
- package/dist/lib/runtime/runtime-current-account.d.ts.map +1 -0
- package/dist/lib/runtime/runtime-current-account.js +252 -0
- package/dist/lib/runtime/runtime-current-account.js.map +1 -0
- package/dist/lib/runtime/runtime-observability.d.ts +5 -0
- package/dist/lib/runtime/runtime-observability.d.ts.map +1 -1
- package/dist/lib/runtime/runtime-observability.js +5 -0
- package/dist/lib/runtime/runtime-observability.js.map +1 -1
- package/dist/lib/runtime-constants.d.ts +3 -0
- package/dist/lib/runtime-constants.d.ts.map +1 -0
- package/dist/lib/runtime-constants.js +3 -0
- package/dist/lib/runtime-constants.js.map +1 -0
- package/dist/lib/runtime-rotation-proxy.d.ts +36 -0
- package/dist/lib/runtime-rotation-proxy.d.ts.map +1 -0
- package/dist/lib/runtime-rotation-proxy.js +828 -0
- package/dist/lib/runtime-rotation-proxy.js.map +1 -0
- package/dist/lib/schemas.d.ts +1 -0
- package/dist/lib/schemas.d.ts.map +1 -1
- package/dist/lib/schemas.js +1 -0
- package/dist/lib/schemas.js.map +1 -1
- package/dist/lib/ui/auth-menu.d.ts +6 -1
- package/dist/lib/ui/auth-menu.d.ts.map +1 -1
- package/dist/lib/ui/auth-menu.js +22 -2
- package/dist/lib/ui/auth-menu.js.map +1 -1
- package/package.json +13 -11
- package/scripts/bench-format/codex-host.mjs +142 -73
- package/scripts/bench-format/models.mjs +23 -24
- package/scripts/benchmark-edit-formats.mjs +9 -7
- package/scripts/check-pack-budget-lib.js +49 -6
- package/scripts/codex-app-launcher.js +653 -0
- package/scripts/codex-app-router.js +322 -0
- package/scripts/codex-multi-auth.js +3 -1
- package/scripts/codex-routing.js +6 -0
- package/scripts/codex.js +2428 -445
- package/scripts/postinstall.js +343 -0
package/README.md
CHANGED
|
@@ -3,28 +3,32 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/codex-multi-auth)
|
|
4
4
|
[](https://www.npmjs.com/package/codex-multi-auth)
|
|
5
5
|
|
|
6
|
-
Codex CLI-first multi-account OAuth manager for the official Codex CLI
|
|
6
|
+
Codex CLI-first multi-account OAuth manager for the official Codex CLI. The installed `codex` wrapper handles `codex auth ...` locally, forwards normal Codex commands to the official runtime, and can optionally route live Responses traffic through a localhost account-rotation proxy.
|
|
7
7
|
|
|
8
8
|
<img width="1270" height="729" alt="2026-02-28 12_54_58-prompt txt - Notepads" src="https://github.com/user-attachments/assets/0cecb77e-a6d3-432a-ba48-3577db0c7093" />
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
> [!NOTE]
|
|
12
13
|
> Legacy scoped prerelease package `@ndycode/codex-multi-auth` is migration-only.
|
|
13
14
|
> Use `codex-multi-auth` for all new installs.
|
|
14
15
|
|
|
15
16
|
## What You Get
|
|
16
17
|
|
|
17
|
-
- Canonical `codex auth ...` workflow for account login, switching, checks, and diagnostics
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
18
|
+
- Canonical `codex auth ...` workflow for account login, switching, checks, and diagnostics
|
|
19
|
+
- Official Codex CLI forwarding for all non-auth commands
|
|
20
|
+
- Multi-account OAuth pool with health-aware selection and automatic failover
|
|
21
|
+
- Project-scoped account storage under `~/.codex/multi-auth/projects/<project-key>/...`
|
|
22
|
+
- Interactive dashboard for account actions and settings
|
|
23
|
+
- Experimental settings tab for staged sync, backup, and refresh-guard controls
|
|
24
|
+
- Forecast, report, fix, and doctor commands for operational safety
|
|
25
|
+
- Runtime counters, budget/cooldown state, and multi-auth probe visibility in `codex auth status` / `codex auth report`
|
|
26
|
+
- Default-on runtime Responses proxy for live account rotation inside forwarded Codex CLI/app sessions
|
|
27
|
+
- Reversible packaged Codex app bind and user-level launcher routing helpers
|
|
28
|
+
- Flagged account verification and restore flow
|
|
29
|
+
- Session affinity and live account sync controls
|
|
30
|
+
- Proactive refresh and preemptive quota deferral controls
|
|
31
|
+
- Codex-oriented request/prompt compatibility with strict runtime handling
|
|
28
32
|
- Stable docs set for install, config, troubleshooting, and upgrade paths
|
|
29
33
|
|
|
30
34
|
---
|
|
@@ -35,7 +39,7 @@ Codex CLI-first multi-account OAuth manager for the official Codex CLI, includin
|
|
|
35
39
|
> [!CAUTION]
|
|
36
40
|
> This project uses OAuth account credentials and is intended for personal development use.
|
|
37
41
|
>
|
|
38
|
-
> By using this
|
|
42
|
+
> By using this package, you acknowledge:
|
|
39
43
|
> - This is an independent open-source project, not an official OpenAI product
|
|
40
44
|
> - You are responsible for your own usage and policy compliance
|
|
41
45
|
> - For production/commercial workloads, use the OpenAI Platform API
|
|
@@ -165,9 +169,10 @@ If browser launch is blocked, use the alternate login paths in [docs/getting-sta
|
|
|
165
169
|
|
|
166
170
|
| Command | What it answers |
|
|
167
171
|
| --- | --- |
|
|
168
|
-
| `codex auth report --live --json` | How do I get the full machine-readable health report? |
|
|
169
|
-
| `codex auth fix --live --model gpt-5-codex` | How do I run live repair probes with a chosen model? |
|
|
170
|
-
| `codex auth why-selected --json` | Which account does the selector pick now, and why? |
|
|
172
|
+
| `codex auth report --live --json` | How do I get the full machine-readable health report? |
|
|
173
|
+
| `codex auth fix --live --model gpt-5.3-codex` | How do I run live repair probes with a chosen model? |
|
|
174
|
+
| `codex auth why-selected --json` | Which account does the selector pick now, and why? |
|
|
175
|
+
| `codex auth rotation status` | Is live runtime account rotation enabled for forwarded Codex sessions? |
|
|
171
176
|
|
|
172
177
|
### Reliability behavior
|
|
173
178
|
|
|
@@ -211,9 +216,11 @@ If browser launch is blocked, use the alternate login paths in [docs/getting-sta
|
|
|
211
216
|
| Accounts | `~/.codex/multi-auth/openai-codex-accounts.json` |
|
|
212
217
|
| Flagged accounts | `~/.codex/multi-auth/openai-codex-flagged-accounts.json` |
|
|
213
218
|
| Quota cache | `~/.codex/multi-auth/quota-cache.json` |
|
|
214
|
-
| Runtime observability | `~/.codex/multi-auth/runtime-observability.json` |
|
|
215
|
-
|
|
|
216
|
-
|
|
|
219
|
+
| Runtime observability | `~/.codex/multi-auth/runtime-observability.json` |
|
|
220
|
+
| Runtime app helper status | `~/.codex/multi-auth/runtime-rotation-app-helper.json` |
|
|
221
|
+
| Persistent app bind state/logs | `~/.codex/multi-auth/app-bind/` |
|
|
222
|
+
| Logs | `~/.codex/multi-auth/logs/codex-plugin/` |
|
|
223
|
+
| Per-project accounts | `~/.codex/multi-auth/projects/<project-key>/openai-codex-accounts.json` |
|
|
217
224
|
|
|
218
225
|
Override root with `CODEX_MULTI_AUTH_DIR=<path>`.
|
|
219
226
|
|
|
@@ -230,9 +237,14 @@ Selected runtime/environment overrides:
|
|
|
230
237
|
| Variable | Effect |
|
|
231
238
|
| --- | --- |
|
|
232
239
|
| `CODEX_MULTI_AUTH_DIR` | Override settings/accounts root |
|
|
233
|
-
| `CODEX_MULTI_AUTH_CONFIG_PATH` | Alternate config file path |
|
|
234
|
-
| `CODEX_MODE=0/1` | Disable/enable Codex mode |
|
|
235
|
-
| `
|
|
240
|
+
| `CODEX_MULTI_AUTH_CONFIG_PATH` | Alternate config file path |
|
|
241
|
+
| `CODEX_MODE=0/1` | Disable/enable Codex mode |
|
|
242
|
+
| `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0/1` | Opt out/in of live Responses proxy rotation for forwarded Codex CLI/app sessions |
|
|
243
|
+
| `CODEX_MULTI_AUTH_APP_ROTATION_IDLE_MS=<ms>` | Override automatic Codex app helper idle shutdown |
|
|
244
|
+
| `CODEX_MULTI_AUTH_APP_BIND_INSTALL=0/1` | Opt out/in of packaged Codex app bind self-heal during install/update or rotation enable |
|
|
245
|
+
| `CODEX_MULTI_AUTH_APP_LAUNCHER_INSTALL=0/1` | Opt out/in of routing supported app shortcuts during install/update or rotation enable |
|
|
246
|
+
| `CODEX_MULTI_AUTH_AUTO_UPDATE=0/1` | Opt out/in of best-effort global package auto-update checks |
|
|
247
|
+
| `CODEX_TUI_V2=0/1` | Disable/enable TUI v2 |
|
|
236
248
|
| `CODEX_TUI_COLOR_PROFILE=truecolor|ansi256|ansi16` | TUI color profile |
|
|
237
249
|
| `CODEX_TUI_GLYPHS=ascii|unicode|auto` | TUI glyph style |
|
|
238
250
|
| `CODEX_AUTH_BACKGROUND_RESPONSES=0/1` | Opt in/out of stateful Responses `background: true` compatibility |
|
|
@@ -247,7 +259,9 @@ codex auth check
|
|
|
247
259
|
codex auth forecast --live
|
|
248
260
|
```
|
|
249
261
|
|
|
250
|
-
Responses background mode stays opt-in. Enable `backgroundResponses` in settings or `CODEX_AUTH_BACKGROUND_RESPONSES=1` only for callers that intentionally send `background: true`, because those requests switch from stateless `store=false` routing to stateful `store=true`. See [docs/upgrade.md](docs/upgrade.md) for rollout guidance.
|
|
262
|
+
Responses background mode stays opt-in. Enable `backgroundResponses` in settings or `CODEX_AUTH_BACKGROUND_RESPONSES=1` only for callers that intentionally send `background: true`, because those requests switch from stateless `store=false` routing to stateful `store=true`. See [docs/upgrade.md](docs/upgrade.md) for rollout guidance.
|
|
263
|
+
|
|
264
|
+
Runtime rotation is enabled by default for request-bearing wrapper-launched Codex sessions. Global install/update self-heals supported packaged Codex app binds and user-level launcher routing when possible, while `codex auth rotation enable` remains the explicit repair command. `codex auth rotation disable` turns the setting off and removes the persistent app bind. Set `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0`, `CODEX_MULTI_AUTH_APP_BIND_INSTALL=0`, `CODEX_MULTI_AUTH_APP_LAUNCHER_INSTALL=0`, or `CODEX_MULTI_AUTH_AUTO_UPDATE=0` to opt out of the matching default behavior.
|
|
251
265
|
|
|
252
266
|
---
|
|
253
267
|
|
|
@@ -333,9 +347,9 @@ codex auth doctor --json
|
|
|
333
347
|
|
|
334
348
|
## Release Notes
|
|
335
349
|
|
|
336
|
-
- Current stable: [docs/releases/
|
|
337
|
-
- Previous stable: [docs/releases/v1.3.
|
|
338
|
-
- Earlier stable: [docs/releases/v1.3.
|
|
350
|
+
- Current stable: [docs/releases/v2.0.1.md](docs/releases/v2.0.1.md)
|
|
351
|
+
- Previous stable: [docs/releases/v1.3.2.md](docs/releases/v1.3.2.md)
|
|
352
|
+
- Earlier stable: [docs/releases/v1.3.1.md](docs/releases/v1.3.1.md)
|
|
339
353
|
- Full release archive: [docs/README.md#release-history](docs/README.md#release-history)
|
|
340
354
|
- Archived prerelease: [docs/releases/v0.1.0-beta.0.md](docs/releases/v0.1.0-beta.0.md)
|
|
341
355
|
|
package/config/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Config Templates
|
|
2
2
|
|
|
3
|
-
These files are
|
|
3
|
+
These files are optional model/provider templates for host/plugin configurations that still load `codex-multi-auth` directly. The normal wrapper workflow uses `codex auth ...` and does not require these templates.
|
|
4
4
|
|
|
5
5
|
## Primary (Codex-named)
|
|
6
6
|
|
|
@@ -12,12 +12,12 @@ These files are example model/provider templates for `codex-multi-auth`.
|
|
|
12
12
|
|
|
13
13
|
## Notes
|
|
14
14
|
|
|
15
|
-
- These templates are optional for the OAuth account manager flow.
|
|
16
|
-
- Core auth commands use `codex auth login`.
|
|
15
|
+
- These templates are optional for the OAuth account manager flow and the runtime rotation proxy.
|
|
16
|
+
- Core auth commands use `codex auth login`.
|
|
17
17
|
|
|
18
18
|
## Defaults Included
|
|
19
19
|
|
|
20
|
-
-
|
|
20
|
+
- Current documented OpenAI/Codex model families (`gpt-5.5`, `gpt-5.4`, and `gpt-5.3-codex`)
|
|
21
21
|
- `store: false`
|
|
22
22
|
- `include: ["reasoning.encrypted_content"]`
|
|
23
23
|
- Sensible fallback behavior for unsupported model entitlements
|