codex-multi-auth 2.19.0 → 2.20.0

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.
Files changed (107) hide show
  1. package/.codex-plugin/plugin.json +9 -9
  2. package/LICENSE +21 -21
  3. package/README.md +149 -148
  4. package/assets/codex-multi-auth-icon.svg +39 -39
  5. package/assets/readme-hero.svg +31 -31
  6. package/config/README.md +31 -31
  7. package/config/codex-legacy.json +1021 -1021
  8. package/config/codex-modern.json +347 -347
  9. package/config/minimal-codex.json +15 -15
  10. package/dist/index.js +1 -1
  11. package/dist/lib/accounts/rate-limits.js +5 -0
  12. package/dist/lib/accounts.js +5 -4
  13. package/dist/lib/auth/account-access.js +2 -2
  14. package/dist/lib/codex-cli/version.d.ts +22 -0
  15. package/dist/lib/codex-cli/version.js +78 -0
  16. package/dist/lib/codex-manager/commands/limits.d.ts +2 -0
  17. package/dist/lib/codex-manager/commands/limits.js +31 -0
  18. package/dist/lib/codex-manager/commands/status.js +1 -1
  19. package/dist/lib/codex-manager/dashboard-settings-data.js +2 -0
  20. package/dist/lib/codex-manager/formatters/subscription-status.d.ts +2 -2
  21. package/dist/lib/codex-manager/formatters/text-style.js +4 -1
  22. package/dist/lib/codex-manager/settings-hub/dashboard.d.ts +1 -1
  23. package/dist/lib/codex-manager/settings-hub/dashboard.js +4 -0
  24. package/dist/lib/codex-manager/settings-panels.d.ts +1 -0
  25. package/dist/lib/codex-manager/settings-panels.js +1 -0
  26. package/dist/lib/codex-manager/theme-settings-panel.d.ts +2 -1
  27. package/dist/lib/codex-manager/theme-settings-panel.js +39 -0
  28. package/dist/lib/codex-manager.js +2 -0
  29. package/dist/lib/constants.d.ts +2 -0
  30. package/dist/lib/constants.js +2 -0
  31. package/dist/lib/context-budget/model-context-windows.d.ts +1 -1
  32. package/dist/lib/context-budget/model-context-windows.js +4 -0
  33. package/dist/lib/context-budget-response.js +8 -8
  34. package/dist/lib/context-overflow.js +10 -10
  35. package/dist/lib/dashboard-settings.d.ts +2 -0
  36. package/dist/lib/dashboard-settings.js +18 -0
  37. package/dist/lib/luna-reserve.d.ts +26 -0
  38. package/dist/lib/luna-reserve.js +68 -0
  39. package/dist/lib/model-route-policy.d.ts +5 -5
  40. package/dist/lib/oauth-success.html +125 -125
  41. package/dist/lib/policy/runtime-policy.js +14 -0
  42. package/dist/lib/prompts/codex-host-bridge.js +138 -138
  43. package/dist/lib/prompts/codex.js +79 -79
  44. package/dist/lib/quota-readiness.d.ts +2 -2
  45. package/dist/lib/request/helpers/model-map.d.ts +1 -1
  46. package/dist/lib/request/helpers/model-map.js +12 -0
  47. package/dist/lib/request/response-outcome.d.ts +1 -1
  48. package/dist/lib/request/response-outcome.js +4 -1
  49. package/dist/lib/request/url-rewriting.js +3 -1
  50. package/dist/lib/runtime/account-model-catalog.d.ts +5 -5
  51. package/dist/lib/runtime/account-reset-credits.d.ts +2 -2
  52. package/dist/lib/runtime/account-status.js +2 -1
  53. package/dist/lib/runtime/luna-reserve-usage.d.ts +9 -0
  54. package/dist/lib/runtime/luna-reserve-usage.js +68 -0
  55. package/dist/lib/runtime/model-discovery-status.d.ts +11 -7
  56. package/dist/lib/runtime/model-discovery-status.js +13 -5
  57. package/dist/lib/runtime/reset-credit-routing.js +4 -1
  58. package/dist/lib/runtime/reset-credits.d.ts +7 -7
  59. package/dist/lib/runtime/resume-picker.js +1 -1
  60. package/dist/lib/runtime/rotation-server-types.d.ts +2 -0
  61. package/dist/lib/runtime/runtime-observability.d.ts +2 -0
  62. package/dist/lib/runtime/runtime-observability.js +1 -0
  63. package/dist/lib/runtime/workspace-model-scopes.d.ts +3 -3
  64. package/dist/lib/runtime-rotation-proxy.js +200 -32
  65. package/dist/lib/schemas.d.ts +65 -65
  66. package/dist/lib/ui/index.d.ts +1 -1
  67. package/dist/lib/ui/index.js +1 -1
  68. package/dist/lib/ui/runtime.d.ts +3 -1
  69. package/dist/lib/ui/runtime.js +11 -1
  70. package/dist/lib/ui/theme.d.ts +20 -1
  71. package/dist/lib/ui/theme.js +154 -30
  72. package/dist/lib/ui/ui-copy.d.ts +3 -2
  73. package/dist/lib/ui/ui-copy.js +3 -2
  74. package/dist/lib/usage/pricing.d.ts +1 -1
  75. package/dist/lib/usage/pricing.js +4 -0
  76. package/dist/lib/usage/usage-extraction.d.ts +2 -0
  77. package/dist/lib/usage/usage-extraction.js +25 -1
  78. package/dist/lib/utils.d.ts +1 -1
  79. package/dist/lib/utils.js +1 -1
  80. package/node_modules/@codex-ai/plugin/dist/index.d.ts +2 -2
  81. package/node_modules/@codex-ai/plugin/dist/index.js +2 -2
  82. package/node_modules/@codex-ai/plugin/dist/tool.d.ts +42 -42
  83. package/node_modules/@codex-ai/plugin/dist/tool.js +29 -29
  84. package/node_modules/@codex-ai/plugin/package.json +9 -9
  85. package/node_modules/@codex-ai/sdk/dist/index.d.ts +4 -4
  86. package/node_modules/@codex-ai/sdk/dist/index.js +2 -2
  87. package/node_modules/@codex-ai/sdk/package.json +8 -8
  88. package/package.json +207 -206
  89. package/scripts/codex-app-launcher.js +653 -653
  90. package/scripts/codex-app-router.js +374 -373
  91. package/scripts/codex-bin-resolver.js +332 -332
  92. package/scripts/codex-multi-auth.js +65 -65
  93. package/scripts/codex-routing.js +62 -62
  94. package/scripts/codex.js +7006 -7005
  95. package/scripts/install-codex-auth-utils.js +213 -213
  96. package/scripts/mcodex.js +367 -367
  97. package/scripts/postinstall.js +114 -114
  98. package/scripts/preuninstall.js +265 -265
  99. package/skills/codex-auth-setup/SKILL.md +73 -73
  100. package/vendor/codex-ai-plugin/dist/index.d.ts +2 -2
  101. package/vendor/codex-ai-plugin/dist/index.js +2 -2
  102. package/vendor/codex-ai-plugin/dist/tool.d.ts +42 -42
  103. package/vendor/codex-ai-plugin/dist/tool.js +29 -29
  104. package/vendor/codex-ai-plugin/package.json +9 -9
  105. package/vendor/codex-ai-sdk/dist/index.d.ts +4 -4
  106. package/vendor/codex-ai-sdk/dist/index.js +2 -2
  107. package/vendor/codex-ai-sdk/package.json +8 -8
@@ -1,9 +1,9 @@
1
- {
2
- "name": "codex-multi-auth",
3
- "version": "2.19.0",
4
- "description": "Install and operate codex-multi-auth for the official @openai/codex CLI with multi-account OAuth rotation, switching, health checks, and recovery tools.",
5
- "interface": {
6
- "composerIcon": "./assets/codex-multi-auth-icon.svg"
7
- },
8
- "skills": "./skills/"
9
- }
1
+ {
2
+ "name": "codex-multi-auth",
3
+ "version": "2.20.0",
4
+ "description": "Install and operate codex-multi-auth for the official @openai/codex CLI with multi-account OAuth rotation, switching, health checks, and recovery tools.",
5
+ "interface": {
6
+ "composerIcon": "./assets/codex-multi-auth-icon.svg"
7
+ },
8
+ "skills": "./skills/"
9
+ }
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 ndycode
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ndycode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,148 +1,149 @@
1
- # codex-multi-auth
2
-
3
- [![npm version](https://img.shields.io/npm/v/codex-multi-auth.svg)](https://www.npmjs.com/package/codex-multi-auth)
4
- [![npm downloads](https://img.shields.io/npm/dw/codex-multi-auth.svg)](https://www.npmjs.com/package/codex-multi-auth)
5
- [![CI](https://github.com/ndycode/codex-multi-auth/actions/workflows/ci.yml/badge.svg)](https://github.com/ndycode/codex-multi-auth/actions/workflows/ci.yml)
6
- [![MIT license](https://img.shields.io/npm/l/codex-multi-auth.svg)](LICENSE)
7
-
8
- <img width="1270" height="729" alt="codex-multi-auth terminal dashboard for Codex CLI multi-account OAuth account status" src="https://github.com/user-attachments/assets/0cecb77e-a6d3-432a-ba48-3577db0c7093" />
9
-
10
- `codex-multi-auth` is a multi-account OAuth manager for the official `@openai/codex` CLI. It keeps a named pool of ChatGPT sign-ins on your machine, lets you switch the active account, and — when you run Codex through its optional wrapper — rotates accounts across live requests through a loopback-only proxy. It never installs or shadows a `codex` binary; the official OpenAI install keeps owning that command.
11
-
12
- Use it when one Codex account is not enough: you hit rate limits or quota windows, you split work across organizations and workspaces, you want per-project account pools, or you run unattended agents that need JSON diagnostics and safe repair commands instead of one opaque auth file.
13
-
14
- Using OpenCode rather than the Codex CLI? The sibling project [`oc-codex-multi-auth`](https://github.com/ndycode/oc-codex-multi-auth) is the plugin that manages the same kind of account pool there.
15
-
16
- ## What it does
17
-
18
- - **Account pool** — OAuth login for multiple ChatGPT accounts, stored locally under `~/.codex/multi-auth` (files `0600`, directories `0700`), with per-project pools under `projects/<project-key>/`.
19
- - **Switching and selection** — pin an account, pick the forecast-best one, or let health- and quota-aware hybrid selection rotate for you.
20
- - **Runtime rotation** — a default-on, loopback-only proxy that forwards Responses API and model-discovery traffic through the best available account during wrapper-launched Codex sessions.
21
- - **Diagnostics and repair** — status, live health checks, quota forecasts, JSON reports, and `fix`/`doctor`/`verify` commands that recover stale or damaged local state.
22
- - **Local governance** — file-backed usage ledger, budget guards, account tags/weights/pause/drain policies, routing profiles, and an optional loopback bridge with bearer tokens for local OpenAI-compatible clients.
23
- - **Desktop routing (optional)** — a reversible bind of the packaged Codex app plus user-level launcher helpers; official app binaries are never patched.
24
-
25
- ## The four binaries
26
-
27
- | Binary | Role |
28
- | --- | --- |
29
- | `codex-multi-auth` | The account manager. Runs all 31 management subcommands locally (`login`, `status`, `switch`, `forecast`, `rotation`, `fix`, ...). The `auth` prefix is optional: `codex-multi-auth login` ≡ `codex-multi-auth auth login`. |
30
- | `codex-multi-auth-codex` | Opt-in wrapper. Handles `auth ...` locally and forwards every other command to the official Codex CLI, enabling the rotation proxy for request-bearing commands. |
31
- | `mcodex` | Convenience launcher over the wrapper, with optional `--monitor` and `--tmux` modes. No account logic of its own. |
32
- | `codex-multi-auth-app-launcher` | User-level OS launcher routing helper (Windows shortcut, macOS wrapper app, Linux `.desktop`). |
33
-
34
- ## Install
35
-
36
- Requirements: Node.js >= 18.17, and the official Codex CLI on `PATH` (`npm i -g @openai/codex`, Homebrew, or a release binary).
37
-
38
- ```bash
39
- npm i -g codex-multi-auth
40
- ```
41
-
42
- > [!NOTE]
43
- > The legacy scoped prerelease `@ndycode/codex-multi-auth` is migration-only. Install `codex-multi-auth` for all new setups; see [docs/upgrade.md](docs/upgrade.md) to migrate.
44
-
45
- ## Quick start (5 minutes)
46
-
47
- ```bash
48
- # 1. Sign in a ChatGPT account (browser OAuth, loopback callback on localhost:1455)
49
- codex-multi-auth login
50
-
51
- # 2. Repeat login to add more accounts, then inspect the pool
52
- codex-multi-auth status
53
-
54
- # 3. Probe account health and preview which account would serve next
55
- codex-multi-auth check
56
- codex-multi-auth forecast --live
57
- ```
58
-
59
- Headless or remote shell? Use `codex-multi-auth login --device-auth` — no callback port needed. Blocked browser? See [alternate login paths](docs/getting-started.md#log-in).
60
-
61
- Run Codex through the wrapper so requests rotate across the pool:
62
-
63
- ```bash
64
- codex-multi-auth-codex # interactive TUI, rotation on by default
65
- codex-multi-auth-codex exec "summarize this repo"
66
- mcodex # same wrapper, shorter name
67
- ```
68
-
69
- ## Command map
70
-
71
- `codex-multi-auth` ships 31 subcommands. The full surface — every flag, hotkey, and JSON mode — is in [docs/reference/commands.md](docs/reference/commands.md).
72
-
73
- | Group | Commands | Purpose |
74
- | --- | --- | --- |
75
- | Accounts | `login`, `list`, `status`, `switch <i>`, `unpin`, `workspace` | sign in, inspect the pool, pin or switch the active account, pick workspaces |
76
- | Selection | `forecast`, `best`, `why-selected`, `check`, `limits`, `models` | preview, explain, and probe which account serves the next request |
77
- | Runtime | `rotation status` `enable` `disable` `bind-app` `unbind-app` `reset-runtime` `reset-rate-limits` | inspect and control live rotation and the app bind |
78
- | Repair | `fix`, `doctor`, `report`, `verify`, `verify-flagged`, `uninstall` | diagnose and repair storage, flagged accounts, and install residue; machine-readable health report |
79
- | Governance | `usage`, `budget`, `account`, `monitor`, `history`, `resets` | usage ledger, budget limits, tags/weights/pause/drain, snapshots |
80
- | Local clients | `bridge`, `integrations` | bearer tokens and client snippets for the loopback bridge |
81
- | Config | `config explain` `template`, `init-config`, `debug bundle`, `features` | effective-config report, config templates, sanitized debug bundle |
82
-
83
- Everyday examples:
84
-
85
- ```bash
86
- codex-multi-auth switch 2 # pin account #2
87
- codex-multi-auth report --live --json # full machine-readable health report
88
- codex-multi-auth fix --live --model gpt-6.1-sol # live repair probes with a chosen model
89
- codex-multi-auth doctor --fix # diagnose and apply the safest fixes
90
- codex-multi-auth usage --since 24h --by model # local usage ledger summary
91
- codex-multi-auth rotation status # is live rotation enabled?
92
- ```
93
-
94
- ## Runtime rotation, in one paragraph
95
-
96
- With rotation on (the default), request-bearing wrapper commands — `exec`, `review`, `resume`, `fork`, `app`, and the bare TUI — route through a local proxy that picks the healthiest account per request, refreshes tokens as needed, and fails over across the pool on rate limits within a bounded retry budget. The proxy listens on loopback only, authenticates its own clients with a per-process token, forwards only Responses API, model-discovery, image, and thread-goal calls, and never writes account emails or tokens to client headers or logs. Plain `codex` is never touched: rotation exists only inside `codex-multi-auth-codex`/`mcodex` sessions, or inside the packaged desktop app after an opt-in, reversible bind. Turn it off with `codex-multi-auth rotation disable` or `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0`.
97
-
98
- ## Where state lives
99
-
100
- | What | Path |
101
- | --- | --- |
102
- | Accounts, settings, quota cache, usage ledger, policies, observability | `~/.codex/multi-auth/` |
103
- | Per-project account pools | `~/.codex/multi-auth/projects/<project-key>/` |
104
- | Official Codex state (kept by the official install) | `~/.codex/` |
105
- | Override the multi-auth root | `CODEX_MULTI_AUTH_DIR=<path>` |
106
-
107
- Full path map: [docs/reference/storage-paths.md](docs/reference/storage-paths.md).
108
-
109
- ## Troubleshooting in 60 seconds
110
-
111
- ```bash
112
- codex-multi-auth doctor --fix
113
- codex-multi-auth check
114
- codex-multi-auth forecast --live
115
- ```
116
-
117
- Common symptoms — wrong active account, OAuth callback port `1455` already bound, Windows/WSL port contention, `EBUSY`/`EPERM` on Windows — are covered in [docs/troubleshooting.md](docs/troubleshooting.md).
118
-
119
- ## Documentation
120
-
121
- | Doc | What it covers |
122
- | --- | --- |
123
- | [docs/index.md](docs/index.md) | Product overview — what it does at runtime and who needs it |
124
- | [docs/README.md](docs/README.md) | Full documentation portal and sitemap |
125
- | [docs/getting-started.md](docs/getting-started.md) | Install, first login, day-1 commands |
126
- | [docs/features.md](docs/features.md) | Feature tour |
127
- | [docs/architecture.md](docs/architecture.md) | Components, request flow, trust boundaries |
128
- | [docs/configuration.md](docs/configuration.md) | Settings and environment overrides |
129
- | [docs/reference/commands.md](docs/reference/commands.md) | Every command, flag, and hotkey |
130
- | [docs/reference/public-api.md](docs/reference/public-api.md) | Public API stability tiers and semver contract |
131
- | [docs/troubleshooting.md](docs/troubleshooting.md) | Recovery playbooks |
132
- | [docs/faq.md](docs/faq.md) | Common questions |
133
- | [docs/upgrade.md](docs/upgrade.md) | Version and legacy-package migration |
134
- | [docs/privacy.md](docs/privacy.md) | Data handling and local storage behavior |
135
- | [config/README.md](config/README.md) | Modern vs. legacy catalog templates |
136
- | [CHANGELOG.md](CHANGELOG.md) | Release history (short version) |
137
-
138
- ## Release notes
139
-
140
- - Current stable: [v2.19.0](docs/releases/v2.19.0.md) — `npm i -g codex-multi-auth`
141
- - Earlier stable lines: [v2.6.0](docs/releases/v2.6.0.md), [v2.5.0](docs/releases/v2.5.0.md)
142
- - Full release archive: [docs/README.md#release-history](docs/README.md#release-history)
143
-
144
- ## Terms and license
145
-
146
- `codex-multi-auth` uses OAuth account credentials and is intended for personal development use. It is an independent open-source project, not an official OpenAI product; you are responsible for your own usage and policy compliance, and for production or commercial workloads you should use the OpenAI Platform API. "ChatGPT", "Codex", and "OpenAI" are trademarks of OpenAI.
147
-
148
- MIT license — see [LICENSE](LICENSE).
1
+ # codex-multi-auth
2
+
3
+ [![npm version](https://img.shields.io/npm/v/codex-multi-auth.svg)](https://www.npmjs.com/package/codex-multi-auth)
4
+ [![npm downloads](https://img.shields.io/npm/dw/codex-multi-auth.svg)](https://www.npmjs.com/package/codex-multi-auth)
5
+ [![CI](https://github.com/ndycode/codex-multi-auth/actions/workflows/ci.yml/badge.svg)](https://github.com/ndycode/codex-multi-auth/actions/workflows/ci.yml)
6
+ [![MIT license](https://img.shields.io/npm/l/codex-multi-auth.svg)](LICENSE)
7
+
8
+ <img width="1270" height="729" alt="codex-multi-auth terminal dashboard for Codex CLI multi-account OAuth account status" src="https://github.com/user-attachments/assets/0cecb77e-a6d3-432a-ba48-3577db0c7093" />
9
+
10
+ `codex-multi-auth` is a multi-account OAuth manager for the official `@openai/codex` CLI. It keeps a named pool of ChatGPT sign-ins on your machine, lets you switch the active account, and — when you run Codex through its optional wrapper — rotates accounts across live requests through a loopback-only proxy. It never installs or shadows a `codex` binary; the official OpenAI install keeps owning that command.
11
+
12
+ Use it when one Codex account is not enough: you hit rate limits or quota windows, you split work across organizations and workspaces, you want per-project account pools, or you run unattended agents that need JSON diagnostics and safe repair commands instead of one opaque auth file.
13
+
14
+ Using OpenCode rather than the Codex CLI? The sibling project [`oc-codex-multi-auth`](https://github.com/ndycode/oc-codex-multi-auth) is the plugin that manages the same kind of account pool there.
15
+
16
+ ## What it does
17
+
18
+ - **Account pool** — OAuth login for multiple ChatGPT accounts, stored locally under `~/.codex/multi-auth` (files `0600`, directories `0700`), with per-project pools under `projects/<project-key>/`.
19
+ - **Switching and selection** — pin an account, pick the forecast-best one, or let health- and quota-aware hybrid selection rotate for you.
20
+ - **Runtime rotation** — a default-on, loopback-only proxy that forwards Responses API and model-discovery traffic through the best available account during wrapper-launched Codex sessions.
21
+ - **Diagnostics and repair** — status, live health checks, quota forecasts, JSON reports, and `fix`/`doctor`/`verify` commands that recover stale or damaged local state.
22
+ - **Luna Reserve fallback** — treats `gpt-reserve` as a separately metered Luna allowance, automatically falls back after a genuine Luna quota 429, and exposes the Reserve percentage through `limits --json --refresh`.
23
+ - **Local governance** — file-backed usage ledger, budget guards, account tags/weights/pause/drain policies, routing profiles, and an optional loopback bridge with bearer tokens for local OpenAI-compatible clients.
24
+ - **Desktop routing (optional)** — a reversible bind of the packaged Codex app plus user-level launcher helpers; official app binaries are never patched.
25
+
26
+ ## The four binaries
27
+
28
+ | Binary | Role |
29
+ | --- | --- |
30
+ | `codex-multi-auth` | The account manager. Runs all 31 management subcommands locally (`login`, `status`, `switch`, `forecast`, `rotation`, `fix`, ...). The `auth` prefix is optional: `codex-multi-auth login` ≡ `codex-multi-auth auth login`. |
31
+ | `codex-multi-auth-codex` | Opt-in wrapper. Handles `auth ...` locally and forwards every other command to the official Codex CLI, enabling the rotation proxy for request-bearing commands. |
32
+ | `mcodex` | Convenience launcher over the wrapper, with optional `--monitor` and `--tmux` modes. No account logic of its own. |
33
+ | `codex-multi-auth-app-launcher` | User-level OS launcher routing helper (Windows shortcut, macOS wrapper app, Linux `.desktop`). |
34
+
35
+ ## Install
36
+
37
+ Requirements: Node.js >= 22.19, and the official Codex CLI on `PATH` (`npm i -g @openai/codex`, Homebrew, or a release binary).
38
+
39
+ ```bash
40
+ npm i -g codex-multi-auth
41
+ ```
42
+
43
+ > [!NOTE]
44
+ > The legacy scoped prerelease `@ndycode/codex-multi-auth` is migration-only. Install `codex-multi-auth` for all new setups; see [docs/upgrade.md](docs/upgrade.md) to migrate.
45
+
46
+ ## Quick start (5 minutes)
47
+
48
+ ```bash
49
+ # 1. Sign in a ChatGPT account (browser OAuth, loopback callback on localhost:1455)
50
+ codex-multi-auth login
51
+
52
+ # 2. Repeat login to add more accounts, then inspect the pool
53
+ codex-multi-auth status
54
+
55
+ # 3. Probe account health and preview which account would serve next
56
+ codex-multi-auth check
57
+ codex-multi-auth forecast --live
58
+ ```
59
+
60
+ Headless or remote shell? Use `codex-multi-auth login --device-auth` — no callback port needed. Blocked browser? See [alternate login paths](docs/getting-started.md#log-in).
61
+
62
+ Run Codex through the wrapper so requests rotate across the pool:
63
+
64
+ ```bash
65
+ codex-multi-auth-codex # interactive TUI, rotation on by default
66
+ codex-multi-auth-codex exec "summarize this repo"
67
+ mcodex # same wrapper, shorter name
68
+ ```
69
+
70
+ ## Command map
71
+
72
+ `codex-multi-auth` ships 31 subcommands. The full surface — every flag, hotkey, and JSON mode — is in [docs/reference/commands.md](docs/reference/commands.md).
73
+
74
+ | Group | Commands | Purpose |
75
+ | --- | --- | --- |
76
+ | Accounts | `login`, `list`, `status`, `switch <i>`, `unpin`, `workspace` | sign in, inspect the pool, pin or switch the active account, pick workspaces |
77
+ | Selection | `forecast`, `best`, `why-selected`, `check`, `limits`, `models` | preview, explain, and probe which account serves the next request |
78
+ | Runtime | `rotation status` `enable` `disable` `bind-app` `unbind-app` `reset-runtime` `reset-rate-limits` | inspect and control live rotation and the app bind |
79
+ | Repair | `fix`, `doctor`, `report`, `verify`, `verify-flagged`, `uninstall` | diagnose and repair storage, flagged accounts, and install residue; machine-readable health report |
80
+ | Governance | `usage`, `budget`, `account`, `monitor`, `history`, `resets` | usage ledger, budget limits, tags/weights/pause/drain, snapshots |
81
+ | Local clients | `bridge`, `integrations` | bearer tokens and client snippets for the loopback bridge |
82
+ | Config | `config explain` `template`, `init-config`, `debug bundle`, `features` | effective-config report, config templates, sanitized debug bundle |
83
+
84
+ Everyday examples:
85
+
86
+ ```bash
87
+ codex-multi-auth switch 2 # pin account #2
88
+ codex-multi-auth report --live --json # full machine-readable health report
89
+ codex-multi-auth fix --live --model gpt-6.1-sol # live repair probes with a chosen model
90
+ codex-multi-auth doctor --fix # diagnose and apply the safest fixes
91
+ codex-multi-auth usage --since 24h --by model # local usage ledger summary
92
+ codex-multi-auth rotation status # is live rotation enabled?
93
+ ```
94
+
95
+ ## Runtime rotation, in one paragraph
96
+
97
+ With rotation on (the default), request-bearing wrapper commands — `exec`, `review`, `resume`, `fork`, `app`, and the bare TUI — route through a local proxy that picks the healthiest account per request, refreshes tokens as needed, and fails over across the pool on rate limits within a bounded retry budget. The proxy listens on loopback only, authenticates its own clients with a per-process token, forwards only Responses API, model-discovery, image, and thread-goal calls, and never writes account emails or tokens to client headers or logs. Plain `codex` is never touched: rotation exists only inside `codex-multi-auth-codex`/`mcodex` sessions, or inside the packaged desktop app after an opt-in, reversible bind. Turn it off with `codex-multi-auth rotation disable` or `CODEX_MULTI_AUTH_RUNTIME_ROTATION_PROXY=0`.
98
+
99
+ ## Where state lives
100
+
101
+ | What | Path |
102
+ | --- | --- |
103
+ | Accounts, settings, quota cache, usage ledger, policies, observability | `~/.codex/multi-auth/` |
104
+ | Per-project account pools | `~/.codex/multi-auth/projects/<project-key>/` |
105
+ | Official Codex state (kept by the official install) | `~/.codex/` |
106
+ | Override the multi-auth root | `CODEX_MULTI_AUTH_DIR=<path>` |
107
+
108
+ Full path map: [docs/reference/storage-paths.md](docs/reference/storage-paths.md).
109
+
110
+ ## Troubleshooting in 60 seconds
111
+
112
+ ```bash
113
+ codex-multi-auth doctor --fix
114
+ codex-multi-auth check
115
+ codex-multi-auth forecast --live
116
+ ```
117
+
118
+ Common symptoms — wrong active account, OAuth callback port `1455` already bound, Windows/WSL port contention, `EBUSY`/`EPERM` on Windows — are covered in [docs/troubleshooting.md](docs/troubleshooting.md).
119
+
120
+ ## Documentation
121
+
122
+ | Doc | What it covers |
123
+ | --- | --- |
124
+ | [docs/index.md](docs/index.md) | Product overview — what it does at runtime and who needs it |
125
+ | [docs/README.md](docs/README.md) | Full documentation portal and sitemap |
126
+ | [docs/getting-started.md](docs/getting-started.md) | Install, first login, day-1 commands |
127
+ | [docs/features.md](docs/features.md) | Feature tour |
128
+ | [docs/architecture.md](docs/architecture.md) | Components, request flow, trust boundaries |
129
+ | [docs/configuration.md](docs/configuration.md) | Settings and environment overrides |
130
+ | [docs/reference/commands.md](docs/reference/commands.md) | Every command, flag, and hotkey |
131
+ | [docs/reference/public-api.md](docs/reference/public-api.md) | Public API stability tiers and semver contract |
132
+ | [docs/troubleshooting.md](docs/troubleshooting.md) | Recovery playbooks |
133
+ | [docs/faq.md](docs/faq.md) | Common questions |
134
+ | [docs/upgrade.md](docs/upgrade.md) | Version and legacy-package migration |
135
+ | [docs/privacy.md](docs/privacy.md) | Data handling and local storage behavior |
136
+ | [config/README.md](config/README.md) | Modern vs. legacy catalog templates |
137
+ | [CHANGELOG.md](CHANGELOG.md) | Release history (short version) |
138
+
139
+ ## Release notes
140
+
141
+ - Current stable: [v2.20.0](docs/releases/v2.20.0.md) — `npm i -g codex-multi-auth`
142
+ - Earlier stable lines: [v2.6.0](docs/releases/v2.6.0.md), [v2.5.0](docs/releases/v2.5.0.md)
143
+ - Full release archive: [docs/README.md#release-history](docs/README.md#release-history)
144
+
145
+ ## Terms and license
146
+
147
+ `codex-multi-auth` uses OAuth account credentials and is intended for personal development use. It is an independent open-source project, not an official OpenAI product; you are responsible for your own usage and policy compliance, and for production or commercial workloads you should use the OpenAI Platform API. "ChatGPT", "Codex", and "OpenAI" are trademarks of OpenAI.
148
+
149
+ MIT license — see [LICENSE](LICENSE).
@@ -1,39 +1,39 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
- <defs>
3
- <linearGradient id="bg" x1="72" y1="44" x2="440" y2="468" gradientUnits="userSpaceOnUse">
4
- <stop offset="0" stop-color="#111827"/>
5
- <stop offset="1" stop-color="#020617"/>
6
- </linearGradient>
7
- <linearGradient id="card" x1="138" y1="152" x2="366" y2="352" gradientUnits="userSpaceOnUse">
8
- <stop offset="0" stop-color="#f8fafc"/>
9
- <stop offset="1" stop-color="#cbd5e1"/>
10
- </linearGradient>
11
- <linearGradient id="accent" x1="164" y1="184" x2="344" y2="332" gradientUnits="userSpaceOnUse">
12
- <stop offset="0" stop-color="#38bdf8"/>
13
- <stop offset="1" stop-color="#22c55e"/>
14
- </linearGradient>
15
- <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
16
- <feDropShadow dx="0" dy="18" stdDeviation="16" flood-color="#000000" flood-opacity="0.34"/>
17
- </filter>
18
- </defs>
19
- <rect width="512" height="512" rx="112" fill="url(#bg)"/>
20
- <circle cx="256" cy="256" r="176" fill="none" stroke="#1e293b" stroke-width="24"/>
21
- <path d="M376 138a176 176 0 0 1 54 116" fill="none" stroke="#38bdf8" stroke-linecap="round" stroke-width="24"/>
22
- <path d="M136 374a176 176 0 0 1-54-116" fill="none" stroke="#22c55e" stroke-linecap="round" stroke-width="24"/>
23
- <path d="M424 232l20 33 19-34" fill="none" stroke="#38bdf8" stroke-linecap="round" stroke-linejoin="round" stroke-width="18"/>
24
- <path d="M88 280l-20-33-19 34" fill="none" stroke="#22c55e" stroke-linecap="round" stroke-linejoin="round" stroke-width="18"/>
25
- <g filter="url(#shadow)">
26
- <rect x="142" y="158" width="228" height="170" rx="34" fill="#334155" opacity="0.9"/>
27
- <rect x="124" y="184" width="228" height="170" rx="34" fill="#475569"/>
28
- <rect x="104" y="210" width="228" height="170" rx="34" fill="url(#card)"/>
29
- </g>
30
- <circle cx="172" cy="278" r="36" fill="url(#accent)"/>
31
- <path d="M130 342c12-31 35-47 70-47s58 16 70 47" fill="none" stroke="#0f172a" stroke-linecap="round" stroke-width="22"/>
32
- <rect x="210" y="254" width="82" height="18" rx="9" fill="#0f172a" opacity="0.9"/>
33
- <rect x="210" y="290" width="58" height="18" rx="9" fill="#0f172a" opacity="0.56"/>
34
- <g transform="translate(302 318)">
35
- <rect x="0" y="0" width="104" height="74" rx="20" fill="#020617" stroke="#38bdf8" stroke-width="10"/>
36
- <path d="M28 26l16 12-16 12" fill="none" stroke="#e2e8f0" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/>
37
- <path d="M56 52h26" fill="none" stroke="#22c55e" stroke-linecap="round" stroke-width="10"/>
38
- </g>
39
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
+ <defs>
3
+ <linearGradient id="bg" x1="72" y1="44" x2="440" y2="468" gradientUnits="userSpaceOnUse">
4
+ <stop offset="0" stop-color="#111827"/>
5
+ <stop offset="1" stop-color="#020617"/>
6
+ </linearGradient>
7
+ <linearGradient id="card" x1="138" y1="152" x2="366" y2="352" gradientUnits="userSpaceOnUse">
8
+ <stop offset="0" stop-color="#f8fafc"/>
9
+ <stop offset="1" stop-color="#cbd5e1"/>
10
+ </linearGradient>
11
+ <linearGradient id="accent" x1="164" y1="184" x2="344" y2="332" gradientUnits="userSpaceOnUse">
12
+ <stop offset="0" stop-color="#38bdf8"/>
13
+ <stop offset="1" stop-color="#22c55e"/>
14
+ </linearGradient>
15
+ <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
16
+ <feDropShadow dx="0" dy="18" stdDeviation="16" flood-color="#000000" flood-opacity="0.34"/>
17
+ </filter>
18
+ </defs>
19
+ <rect width="512" height="512" rx="112" fill="url(#bg)"/>
20
+ <circle cx="256" cy="256" r="176" fill="none" stroke="#1e293b" stroke-width="24"/>
21
+ <path d="M376 138a176 176 0 0 1 54 116" fill="none" stroke="#38bdf8" stroke-linecap="round" stroke-width="24"/>
22
+ <path d="M136 374a176 176 0 0 1-54-116" fill="none" stroke="#22c55e" stroke-linecap="round" stroke-width="24"/>
23
+ <path d="M424 232l20 33 19-34" fill="none" stroke="#38bdf8" stroke-linecap="round" stroke-linejoin="round" stroke-width="18"/>
24
+ <path d="M88 280l-20-33-19 34" fill="none" stroke="#22c55e" stroke-linecap="round" stroke-linejoin="round" stroke-width="18"/>
25
+ <g filter="url(#shadow)">
26
+ <rect x="142" y="158" width="228" height="170" rx="34" fill="#334155" opacity="0.9"/>
27
+ <rect x="124" y="184" width="228" height="170" rx="34" fill="#475569"/>
28
+ <rect x="104" y="210" width="228" height="170" rx="34" fill="url(#card)"/>
29
+ </g>
30
+ <circle cx="172" cy="278" r="36" fill="url(#accent)"/>
31
+ <path d="M130 342c12-31 35-47 70-47s58 16 70 47" fill="none" stroke="#0f172a" stroke-linecap="round" stroke-width="22"/>
32
+ <rect x="210" y="254" width="82" height="18" rx="9" fill="#0f172a" opacity="0.9"/>
33
+ <rect x="210" y="290" width="58" height="18" rx="9" fill="#0f172a" opacity="0.56"/>
34
+ <g transform="translate(302 318)">
35
+ <rect x="0" y="0" width="104" height="74" rx="20" fill="#020617" stroke="#38bdf8" stroke-width="10"/>
36
+ <path d="M28 26l16 12-16 12" fill="none" stroke="#e2e8f0" stroke-linecap="round" stroke-linejoin="round" stroke-width="10"/>
37
+ <path d="M56 52h26" fill="none" stroke="#22c55e" stroke-linecap="round" stroke-width="10"/>
38
+ </g>
39
+ </svg>
@@ -1,31 +1,31 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="300" viewBox="0 0 1200 300" role="img" aria-label="Codex Multi-Auth OAuth">
2
- <defs>
3
- <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
4
- <stop offset="0%" stop-color="#0f172a" />
5
- <stop offset="100%" stop-color="#1f2937" />
6
- </linearGradient>
7
- <linearGradient id="accent" x1="0" y1="0" x2="1" y2="0">
8
- <stop offset="0%" stop-color="#38bdf8" />
9
- <stop offset="100%" stop-color="#22d3ee" />
10
- </linearGradient>
11
- </defs>
12
- <rect width="1200" height="300" rx="28" fill="url(#bg)" />
13
- <g opacity="0.12">
14
- <circle cx="1020" cy="70" r="120" fill="#38bdf8" />
15
- <circle cx="150" cy="260" r="140" fill="#22d3ee" />
16
- </g>
17
- <g fill="none" stroke="url(#accent)" stroke-width="8" stroke-linecap="round" stroke-linejoin="round">
18
- <path d="M160 95 L100 150 L160 205" />
19
- <path d="M280 95 L340 150 L280 205" />
20
- <path d="M205 80 L235 220" />
21
- </g>
22
- <text x="420" y="120" fill="#e2e8f0" font-size="42" font-family="'IBM Plex Sans','Segoe UI',Arial,sans-serif" font-weight="600">
23
- Codex Multi-Auth OAuth
24
- </text>
25
- <text x="420" y="170" fill="#cbd5f5" font-size="24" font-family="'IBM Plex Sans','Segoe UI',Arial,sans-serif">
26
- ChatGPT Plus/Pro auth for GPT-5.2 and Codex models
27
- </text>
28
- <text x="420" y="220" fill="#7dd3fc" font-size="18" font-family="'IBM Plex Sans','Segoe UI',Arial,sans-serif">
29
- One-command install, modern variants, full tool support
30
- </text>
31
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="300" viewBox="0 0 1200 300" role="img" aria-label="Codex Multi-Auth OAuth">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0%" stop-color="#0f172a" />
5
+ <stop offset="100%" stop-color="#1f2937" />
6
+ </linearGradient>
7
+ <linearGradient id="accent" x1="0" y1="0" x2="1" y2="0">
8
+ <stop offset="0%" stop-color="#38bdf8" />
9
+ <stop offset="100%" stop-color="#22d3ee" />
10
+ </linearGradient>
11
+ </defs>
12
+ <rect width="1200" height="300" rx="28" fill="url(#bg)" />
13
+ <g opacity="0.12">
14
+ <circle cx="1020" cy="70" r="120" fill="#38bdf8" />
15
+ <circle cx="150" cy="260" r="140" fill="#22d3ee" />
16
+ </g>
17
+ <g fill="none" stroke="url(#accent)" stroke-width="8" stroke-linecap="round" stroke-linejoin="round">
18
+ <path d="M160 95 L100 150 L160 205" />
19
+ <path d="M280 95 L340 150 L280 205" />
20
+ <path d="M205 80 L235 220" />
21
+ </g>
22
+ <text x="420" y="120" fill="#e2e8f0" font-size="42" font-family="'IBM Plex Sans','Segoe UI',Arial,sans-serif" font-weight="600">
23
+ Codex Multi-Auth OAuth
24
+ </text>
25
+ <text x="420" y="170" fill="#cbd5f5" font-size="24" font-family="'IBM Plex Sans','Segoe UI',Arial,sans-serif">
26
+ ChatGPT Plus/Pro auth for GPT-5.2 and Codex models
27
+ </text>
28
+ <text x="420" y="220" fill="#7dd3fc" font-size="18" font-family="'IBM Plex Sans','Segoe UI',Arial,sans-serif">
29
+ One-command install, modern variants, full tool support
30
+ </text>
31
+ </svg>
package/config/README.md CHANGED
@@ -1,31 +1,31 @@
1
- # Config Templates
2
-
3
- These files are optional model/provider templates for host/plugin configurations that still load `codex-multi-auth` directly. The normal account-manager workflow uses `codex-multi-auth ...` and does not require these templates.
4
-
5
- ## Primary (Codex-named)
6
-
7
- | File | Purpose |
8
- | --- | --- |
9
- | [`codex-modern.json`](./codex-modern.json) | Modern variant-based template |
10
- | [`codex-legacy.json`](./codex-legacy.json) | Legacy explicit-model template |
11
- | [`minimal-codex.json`](./minimal-codex.json) | Minimal debug template |
12
-
13
- ## Notes
14
-
15
- - These templates are optional for the OAuth account manager flow and the runtime rotation proxy.
16
- - Core account-manager commands use `codex-multi-auth login`.
17
-
18
- ## Defaults Included
19
-
20
- - Current documented OpenAI/Codex model families: GPT-6.1 Sol (`gpt-6.1-sol`, the default), GPT-6 Astra (`gpt-6-astra`), GPT-6 Sol (`gpt-6-sol`) and GPT-6 Luna (`gpt-6-luna`), then `gpt-5.6-sol`/`terra`/`luna`. Retired models (`gpt-5.5`/`gpt-5.5-pro`, `gpt-5.4*`, `gpt-5.3-codex` and older, plus the leaked `gpt-6-astra-aeon` slug) were removed from the picker; their ids still resolve to a replacement, see `docs/configuration.md`
21
- - The GPT-6 entries carry `limit.context: 272000`, the `context_window` in the upstream Codex catalog. The GPT-5.6 entries still carry the pre-cut `372000` and were left alone here; change them only alongside a deliberate review, since the value feeds a picker rather than the context budget guard (which refuses to estimate either family)
22
- - The Daybreak cyber models resolve at the code level but are deliberately absent from these templates, matching their hidden visibility in the upstream Codex picker
23
- - `store: false`
24
- - `include: ["reasoning.encrypted_content"]`
25
- - Sensible fallback behavior for unsupported model entitlements
26
-
27
- ## Related Docs
28
-
29
- - [`../docs/configuration.md`](../docs/configuration.md)
30
- - [`../docs/getting-started.md`](../docs/getting-started.md)
31
- - [`../docs/reference/settings.md`](../docs/reference/settings.md)
1
+ # Config Templates
2
+
3
+ These files are optional model/provider templates for host/plugin configurations that still load `codex-multi-auth` directly. The normal account-manager workflow uses `codex-multi-auth ...` and does not require these templates.
4
+
5
+ ## Primary (Codex-named)
6
+
7
+ | File | Purpose |
8
+ | --- | --- |
9
+ | [`codex-modern.json`](./codex-modern.json) | Modern variant-based template |
10
+ | [`codex-legacy.json`](./codex-legacy.json) | Legacy explicit-model template |
11
+ | [`minimal-codex.json`](./minimal-codex.json) | Minimal debug template |
12
+
13
+ ## Notes
14
+
15
+ - These templates are optional for the OAuth account manager flow and the runtime rotation proxy.
16
+ - Core account-manager commands use `codex-multi-auth login`.
17
+
18
+ ## Defaults Included
19
+
20
+ - Current documented OpenAI/Codex model families: GPT-6.1 Sol (`gpt-6.1-sol`, the default), GPT-6 Astra (`gpt-6-astra`), GPT-6 Sol (`gpt-6-sol`) and GPT-6 Luna (`gpt-6-luna`), then `gpt-5.6-sol`/`terra`/`luna`. Retired models (`gpt-5.5`/`gpt-5.5-pro`, `gpt-5.4*`, `gpt-5.3-codex` and older, plus the leaked `gpt-6-astra-aeon` slug) were removed from the picker; their ids still resolve to a replacement, see `docs/configuration.md`
21
+ - The GPT-6 entries carry `limit.context: 272000`, the `context_window` in the upstream Codex catalog. The GPT-5.6 entries still carry the pre-cut `372000` and were left alone here; change them only alongside a deliberate review, since the value feeds a picker rather than the context budget guard (which refuses to estimate either family)
22
+ - The Daybreak cyber models resolve at the code level but are deliberately absent from these templates, matching their hidden visibility in the upstream Codex picker
23
+ - `store: false`
24
+ - `include: ["reasoning.encrypted_content"]`
25
+ - Sensible fallback behavior for unsupported model entitlements
26
+
27
+ ## Related Docs
28
+
29
+ - [`../docs/configuration.md`](../docs/configuration.md)
30
+ - [`../docs/getting-started.md`](../docs/getting-started.md)
31
+ - [`../docs/reference/settings.md`](../docs/reference/settings.md)