codex-multi-auth 2.19.1 → 2.21.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 (79) 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.js +2 -0
  20. package/dist/lib/constants.d.ts +2 -0
  21. package/dist/lib/constants.js +2 -0
  22. package/dist/lib/context-budget/model-context-windows.d.ts +1 -1
  23. package/dist/lib/context-budget/model-context-windows.js +4 -0
  24. package/dist/lib/context-budget-response.js +8 -8
  25. package/dist/lib/context-overflow.js +10 -10
  26. package/dist/lib/luna-reserve.d.ts +26 -0
  27. package/dist/lib/luna-reserve.js +68 -0
  28. package/dist/lib/oauth-success.html +125 -125
  29. package/dist/lib/policy/runtime-policy.js +14 -0
  30. package/dist/lib/prompts/codex-host-bridge.js +138 -138
  31. package/dist/lib/prompts/codex.js +79 -79
  32. package/dist/lib/request/helpers/model-map.d.ts +1 -1
  33. package/dist/lib/request/helpers/model-map.js +12 -0
  34. package/dist/lib/request/response-outcome.d.ts +1 -1
  35. package/dist/lib/request/response-outcome.js +4 -1
  36. package/dist/lib/runtime/account-status.js +2 -1
  37. package/dist/lib/runtime/luna-reserve-usage.d.ts +9 -0
  38. package/dist/lib/runtime/luna-reserve-usage.js +68 -0
  39. package/dist/lib/runtime/model-discovery-status.d.ts +6 -2
  40. package/dist/lib/runtime/model-discovery-status.js +13 -5
  41. package/dist/lib/runtime/reset-credit-routing.js +4 -1
  42. package/dist/lib/runtime/rotation-server-types.d.ts +2 -0
  43. package/dist/lib/runtime/runtime-observability.d.ts +2 -0
  44. package/dist/lib/runtime/runtime-observability.js +1 -0
  45. package/dist/lib/runtime-rotation-proxy.js +200 -32
  46. package/dist/lib/usage/pricing.d.ts +1 -1
  47. package/dist/lib/usage/pricing.js +4 -0
  48. package/dist/lib/usage/usage-extraction.d.ts +2 -0
  49. package/dist/lib/usage/usage-extraction.js +25 -1
  50. package/dist/lib/utils.d.ts +1 -1
  51. package/dist/lib/utils.js +1 -1
  52. package/node_modules/@codex-ai/plugin/dist/index.d.ts +2 -2
  53. package/node_modules/@codex-ai/plugin/dist/index.js +2 -2
  54. package/node_modules/@codex-ai/plugin/dist/tool.d.ts +42 -42
  55. package/node_modules/@codex-ai/plugin/dist/tool.js +29 -29
  56. package/node_modules/@codex-ai/plugin/package.json +9 -9
  57. package/node_modules/@codex-ai/sdk/dist/index.d.ts +4 -4
  58. package/node_modules/@codex-ai/sdk/dist/index.js +2 -2
  59. package/node_modules/@codex-ai/sdk/package.json +8 -8
  60. package/package.json +207 -207
  61. package/scripts/codex-app-launcher.js +653 -653
  62. package/scripts/codex-app-router.js +374 -373
  63. package/scripts/codex-bin-resolver.js +332 -332
  64. package/scripts/codex-multi-auth.js +65 -65
  65. package/scripts/codex-routing.js +62 -62
  66. package/scripts/codex.js +7006 -7005
  67. package/scripts/install-codex-auth-utils.js +213 -213
  68. package/scripts/mcodex.js +367 -367
  69. package/scripts/postinstall.js +114 -114
  70. package/scripts/preuninstall.js +265 -265
  71. package/skills/codex-auth-setup/SKILL.md +73 -73
  72. package/vendor/codex-ai-plugin/dist/index.d.ts +2 -2
  73. package/vendor/codex-ai-plugin/dist/index.js +2 -2
  74. package/vendor/codex-ai-plugin/dist/tool.d.ts +42 -42
  75. package/vendor/codex-ai-plugin/dist/tool.js +29 -29
  76. package/vendor/codex-ai-plugin/package.json +9 -9
  77. package/vendor/codex-ai-sdk/dist/index.d.ts +4 -4
  78. package/vendor/codex-ai-sdk/dist/index.js +2 -2
  79. package/vendor/codex-ai-sdk/package.json +8 -8
@@ -1,265 +1,265 @@
1
- #!/usr/bin/env node
2
-
3
- // @ts-check
4
-
5
- import { readFile, writeFile, rm } from "node:fs/promises";
6
- import { resolve } from "node:path";
7
- import { fileURLToPath } from "node:url";
8
- import process from "node:process";
9
- import {
10
- isCiEnvironment,
11
- resolveInstallPaths,
12
- removePluginFromList,
13
- withFileOperationRetry,
14
- } from "./install-codex-auth-utils.js";
15
-
16
- async function loadAppBindModule() {
17
- try {
18
- return await import("../dist/lib/runtime/app-bind.js");
19
- } catch (error) {
20
- if (
21
- error &&
22
- typeof error === "object" &&
23
- "code" in error &&
24
- error.code === "ERR_MODULE_NOT_FOUND"
25
- ) {
26
- return null;
27
- }
28
- throw error;
29
- }
30
- }
31
-
32
- function defaultPreuninstallLog(message) {
33
- console.error(`codex-multi-auth: ${message}`);
34
- }
35
-
36
- /**
37
- * @param {{
38
- * unbindCodexApp?: (dryRun: boolean) => Promise<void>,
39
- * removeLauncher?: (options: { dryRun: boolean, log: (m: string) => void }) => Promise<void>,
40
- * removePluginFromConfig?: (dryRun: boolean, log: (m: string) => void) => Promise<{ bunLockState: "safe" | "uncertain" }>,
41
- * clearCache?: (dryRun: boolean, log: (m: string) => void, bunLockSafe: boolean) => Promise<void>,
42
- * log?: (message: string) => void,
43
- * env?: NodeJS.ProcessEnv,
44
- * home?: string,
45
- * dryRun?: boolean,
46
- * }} [deps]
47
- */
48
- export async function runPreuninstallCleanup(deps = {}) {
49
- const log = deps.log ?? defaultPreuninstallLog;
50
- const env = deps.env ?? process.env;
51
- const home =
52
- deps.home ??
53
- (deps.env
54
- ? env.HOME || env.USERPROFILE || ""
55
- : undefined);
56
- const dryRun = deps.dryRun ?? process.argv.includes("--dry-run");
57
-
58
- if (isCiEnvironment(env)) {
59
- return 0;
60
- }
61
-
62
- /** @type {"safe" | "uncertain"} */
63
- let bunLockState = "uncertain";
64
-
65
- // Unbind Codex app runtime rotation (reverses install-time/first-run bind)
66
- try {
67
- if (deps.unbindCodexApp) {
68
- await deps.unbindCodexApp(dryRun);
69
- } else {
70
- const appBindModule = await loadAppBindModule();
71
- if (
72
- appBindModule &&
73
- typeof appBindModule.unbindCodexAppRuntimeRotation === "function"
74
- ) {
75
- if (dryRun) {
76
- log("[dry-run] Would unbind Codex app runtime rotation");
77
- } else {
78
- await appBindModule.unbindCodexAppRuntimeRotation();
79
- }
80
- }
81
- }
82
- } catch (error) {
83
- log(
84
- `app unbind skipped: ${error instanceof Error ? error.message : String(error)}`,
85
- );
86
- }
87
-
88
- // Remove OS-level launcher (reverses install-time/first-run launcher install)
89
- try {
90
- if (deps.removeLauncher) {
91
- await deps.removeLauncher({ dryRun, log });
92
- } else {
93
- const launcherModule = await import("./codex-app-launcher.js");
94
- if (typeof launcherModule.installCodexAppLauncher === "function") {
95
- await launcherModule.installCodexAppLauncher({ remove: true, dryRun, log });
96
- }
97
- }
98
- } catch (error) {
99
- log(
100
- `launcher removal skipped: ${error instanceof Error ? error.message : String(error)}`,
101
- );
102
- }
103
-
104
- // Remove plugin entry from Codex.json and track whether we're certain that
105
- // no other plugins remain. bun.lock is shared across all Codex plugins, so
106
- // it's only safe to delete when:
107
- // - File ENOENT → safe (nothing to protect)
108
- // - Parse error / read fail → uncertain (be conservative)
109
- // - File ok, no plugins[] → uncertain (we don't know what's installed)
110
- // - File ok, plugins[]=[] → safe
111
- // - File ok, plugins[]≠[] → uncertain
112
- try {
113
- if (deps.removePluginFromConfig) {
114
- const result = await deps.removePluginFromConfig(dryRun, log);
115
- if (result && typeof result === "object" && "bunLockState" in result) {
116
- bunLockState = result.bunLockState === "safe" ? "safe" : "uncertain";
117
- }
118
- } else {
119
- const paths = resolveInstallPaths(
120
- process.platform,
121
- env,
122
- home || undefined,
123
- );
124
- try {
125
- const raw = await withFileOperationRetry(() =>
126
- readFile(paths.configPath, "utf8"),
127
- );
128
- const config = JSON.parse(raw);
129
- if (Array.isArray(config.plugins)) {
130
- const next = removePluginFromList(config.plugins);
131
- bunLockState = next.length === 0 ? "safe" : "uncertain";
132
- if (dryRun) {
133
- log(
134
- `[dry-run] Would remove codex-multi-auth from ${paths.configPath}`,
135
- );
136
- } else {
137
- config.plugins = next;
138
- await withFileOperationRetry(() =>
139
- writeFile(
140
- paths.configPath,
141
- JSON.stringify(config, null, "\t") + "\n",
142
- "utf8",
143
- ),
144
- );
145
- }
146
- } else if (dryRun) {
147
- log(
148
- `[dry-run] Would remove codex-multi-auth from ${paths.configPath}`,
149
- );
150
- }
151
- } catch (fileError) {
152
- const code =
153
- fileError &&
154
- typeof fileError === "object" &&
155
- "code" in fileError
156
- ? fileError.code
157
- : undefined;
158
- if (code === "ENOENT") {
159
- bunLockState = "safe";
160
- if (dryRun) {
161
- log(
162
- `[dry-run] Would remove codex-multi-auth from ${paths.configPath}`,
163
- );
164
- }
165
- } else {
166
- log(
167
- `config cleanup skipped: ${fileError instanceof Error ? fileError.message : String(fileError)}`,
168
- );
169
- }
170
- }
171
- }
172
- } catch (error) {
173
- log(
174
- `config cleanup skipped: ${error instanceof Error ? error.message : String(error)}`,
175
- );
176
- }
177
-
178
- const bunLockSafe = bunLockState === "safe";
179
-
180
- // Clear plugin cache dirs
181
- try {
182
- if (deps.clearCache) {
183
- await deps.clearCache(dryRun, log, bunLockSafe);
184
- } else {
185
- const paths = resolveInstallPaths(
186
- process.platform,
187
- env,
188
- home || undefined,
189
- );
190
- if (dryRun) {
191
- log(`[dry-run] Would remove ${paths.cacheNodeModules}`);
192
- if (paths.cacheLegacyNodeModules) {
193
- log(`[dry-run] Would remove ${paths.cacheLegacyNodeModules}`);
194
- }
195
- if (bunLockSafe) {
196
- log(`[dry-run] Would remove ${paths.cacheBunLock}`);
197
- } else {
198
- log(
199
- `[dry-run] Would skip ${paths.cacheBunLock} (other plugins still installed)`,
200
- );
201
- }
202
- } else {
203
- try {
204
- await withFileOperationRetry(() =>
205
- rm(paths.cacheNodeModules, { recursive: true, force: true }),
206
- );
207
- if (paths.cacheLegacyNodeModules) {
208
- await withFileOperationRetry(() =>
209
- rm(paths.cacheLegacyNodeModules, {
210
- recursive: true,
211
- force: true,
212
- }),
213
- );
214
- }
215
- if (bunLockSafe) {
216
- await withFileOperationRetry(() =>
217
- rm(paths.cacheBunLock, { force: true }),
218
- );
219
- }
220
- } catch (error) {
221
- log(
222
- `cache clear skipped: ${error instanceof Error ? error.message : String(error)}`,
223
- );
224
- }
225
- }
226
- }
227
- } catch (error) {
228
- log(
229
- `cache clear skipped: ${error instanceof Error ? error.message : String(error)}`,
230
- );
231
- }
232
-
233
- return 0;
234
- }
235
-
236
- async function main() {
237
- return runPreuninstallCleanup();
238
- }
239
-
240
- function normalizeExitCode(exitCode) {
241
- return Number.isInteger(exitCode) && exitCode >= 0 && exitCode <= 255
242
- ? exitCode
243
- : 0;
244
- }
245
-
246
- const isDirectRun = (() => {
247
- try {
248
- return resolve(process.argv[1] ?? "") === fileURLToPath(import.meta.url);
249
- } catch {
250
- return false;
251
- }
252
- })();
253
-
254
- if (isDirectRun) {
255
- main()
256
- .then((exitCode) => {
257
- process.exitCode = normalizeExitCode(exitCode);
258
- })
259
- .catch((error) => {
260
- defaultPreuninstallLog(
261
- `preuninstall cleanup skipped: ${error instanceof Error ? error.message : String(error)}`,
262
- );
263
- process.exitCode = 0;
264
- });
265
- }
1
+ #!/usr/bin/env node
2
+
3
+ // @ts-check
4
+
5
+ import { readFile, writeFile, rm } from "node:fs/promises";
6
+ import { resolve } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+ import process from "node:process";
9
+ import {
10
+ isCiEnvironment,
11
+ resolveInstallPaths,
12
+ removePluginFromList,
13
+ withFileOperationRetry,
14
+ } from "./install-codex-auth-utils.js";
15
+
16
+ async function loadAppBindModule() {
17
+ try {
18
+ return await import("../dist/lib/runtime/app-bind.js");
19
+ } catch (error) {
20
+ if (
21
+ error &&
22
+ typeof error === "object" &&
23
+ "code" in error &&
24
+ error.code === "ERR_MODULE_NOT_FOUND"
25
+ ) {
26
+ return null;
27
+ }
28
+ throw error;
29
+ }
30
+ }
31
+
32
+ function defaultPreuninstallLog(message) {
33
+ console.error(`codex-multi-auth: ${message}`);
34
+ }
35
+
36
+ /**
37
+ * @param {{
38
+ * unbindCodexApp?: (dryRun: boolean) => Promise<void>,
39
+ * removeLauncher?: (options: { dryRun: boolean, log: (m: string) => void }) => Promise<void>,
40
+ * removePluginFromConfig?: (dryRun: boolean, log: (m: string) => void) => Promise<{ bunLockState: "safe" | "uncertain" }>,
41
+ * clearCache?: (dryRun: boolean, log: (m: string) => void, bunLockSafe: boolean) => Promise<void>,
42
+ * log?: (message: string) => void,
43
+ * env?: NodeJS.ProcessEnv,
44
+ * home?: string,
45
+ * dryRun?: boolean,
46
+ * }} [deps]
47
+ */
48
+ export async function runPreuninstallCleanup(deps = {}) {
49
+ const log = deps.log ?? defaultPreuninstallLog;
50
+ const env = deps.env ?? process.env;
51
+ const home =
52
+ deps.home ??
53
+ (deps.env
54
+ ? env.HOME || env.USERPROFILE || ""
55
+ : undefined);
56
+ const dryRun = deps.dryRun ?? process.argv.includes("--dry-run");
57
+
58
+ if (isCiEnvironment(env)) {
59
+ return 0;
60
+ }
61
+
62
+ /** @type {"safe" | "uncertain"} */
63
+ let bunLockState = "uncertain";
64
+
65
+ // Unbind Codex app runtime rotation (reverses install-time/first-run bind)
66
+ try {
67
+ if (deps.unbindCodexApp) {
68
+ await deps.unbindCodexApp(dryRun);
69
+ } else {
70
+ const appBindModule = await loadAppBindModule();
71
+ if (
72
+ appBindModule &&
73
+ typeof appBindModule.unbindCodexAppRuntimeRotation === "function"
74
+ ) {
75
+ if (dryRun) {
76
+ log("[dry-run] Would unbind Codex app runtime rotation");
77
+ } else {
78
+ await appBindModule.unbindCodexAppRuntimeRotation();
79
+ }
80
+ }
81
+ }
82
+ } catch (error) {
83
+ log(
84
+ `app unbind skipped: ${error instanceof Error ? error.message : String(error)}`,
85
+ );
86
+ }
87
+
88
+ // Remove OS-level launcher (reverses install-time/first-run launcher install)
89
+ try {
90
+ if (deps.removeLauncher) {
91
+ await deps.removeLauncher({ dryRun, log });
92
+ } else {
93
+ const launcherModule = await import("./codex-app-launcher.js");
94
+ if (typeof launcherModule.installCodexAppLauncher === "function") {
95
+ await launcherModule.installCodexAppLauncher({ remove: true, dryRun, log });
96
+ }
97
+ }
98
+ } catch (error) {
99
+ log(
100
+ `launcher removal skipped: ${error instanceof Error ? error.message : String(error)}`,
101
+ );
102
+ }
103
+
104
+ // Remove plugin entry from Codex.json and track whether we're certain that
105
+ // no other plugins remain. bun.lock is shared across all Codex plugins, so
106
+ // it's only safe to delete when:
107
+ // - File ENOENT → safe (nothing to protect)
108
+ // - Parse error / read fail → uncertain (be conservative)
109
+ // - File ok, no plugins[] → uncertain (we don't know what's installed)
110
+ // - File ok, plugins[]=[] → safe
111
+ // - File ok, plugins[]≠[] → uncertain
112
+ try {
113
+ if (deps.removePluginFromConfig) {
114
+ const result = await deps.removePluginFromConfig(dryRun, log);
115
+ if (result && typeof result === "object" && "bunLockState" in result) {
116
+ bunLockState = result.bunLockState === "safe" ? "safe" : "uncertain";
117
+ }
118
+ } else {
119
+ const paths = resolveInstallPaths(
120
+ process.platform,
121
+ env,
122
+ home || undefined,
123
+ );
124
+ try {
125
+ const raw = await withFileOperationRetry(() =>
126
+ readFile(paths.configPath, "utf8"),
127
+ );
128
+ const config = JSON.parse(raw);
129
+ if (Array.isArray(config.plugins)) {
130
+ const next = removePluginFromList(config.plugins);
131
+ bunLockState = next.length === 0 ? "safe" : "uncertain";
132
+ if (dryRun) {
133
+ log(
134
+ `[dry-run] Would remove codex-multi-auth from ${paths.configPath}`,
135
+ );
136
+ } else {
137
+ config.plugins = next;
138
+ await withFileOperationRetry(() =>
139
+ writeFile(
140
+ paths.configPath,
141
+ JSON.stringify(config, null, "\t") + "\n",
142
+ "utf8",
143
+ ),
144
+ );
145
+ }
146
+ } else if (dryRun) {
147
+ log(
148
+ `[dry-run] Would remove codex-multi-auth from ${paths.configPath}`,
149
+ );
150
+ }
151
+ } catch (fileError) {
152
+ const code =
153
+ fileError &&
154
+ typeof fileError === "object" &&
155
+ "code" in fileError
156
+ ? fileError.code
157
+ : undefined;
158
+ if (code === "ENOENT") {
159
+ bunLockState = "safe";
160
+ if (dryRun) {
161
+ log(
162
+ `[dry-run] Would remove codex-multi-auth from ${paths.configPath}`,
163
+ );
164
+ }
165
+ } else {
166
+ log(
167
+ `config cleanup skipped: ${fileError instanceof Error ? fileError.message : String(fileError)}`,
168
+ );
169
+ }
170
+ }
171
+ }
172
+ } catch (error) {
173
+ log(
174
+ `config cleanup skipped: ${error instanceof Error ? error.message : String(error)}`,
175
+ );
176
+ }
177
+
178
+ const bunLockSafe = bunLockState === "safe";
179
+
180
+ // Clear plugin cache dirs
181
+ try {
182
+ if (deps.clearCache) {
183
+ await deps.clearCache(dryRun, log, bunLockSafe);
184
+ } else {
185
+ const paths = resolveInstallPaths(
186
+ process.platform,
187
+ env,
188
+ home || undefined,
189
+ );
190
+ if (dryRun) {
191
+ log(`[dry-run] Would remove ${paths.cacheNodeModules}`);
192
+ if (paths.cacheLegacyNodeModules) {
193
+ log(`[dry-run] Would remove ${paths.cacheLegacyNodeModules}`);
194
+ }
195
+ if (bunLockSafe) {
196
+ log(`[dry-run] Would remove ${paths.cacheBunLock}`);
197
+ } else {
198
+ log(
199
+ `[dry-run] Would skip ${paths.cacheBunLock} (other plugins still installed)`,
200
+ );
201
+ }
202
+ } else {
203
+ try {
204
+ await withFileOperationRetry(() =>
205
+ rm(paths.cacheNodeModules, { recursive: true, force: true }),
206
+ );
207
+ if (paths.cacheLegacyNodeModules) {
208
+ await withFileOperationRetry(() =>
209
+ rm(paths.cacheLegacyNodeModules, {
210
+ recursive: true,
211
+ force: true,
212
+ }),
213
+ );
214
+ }
215
+ if (bunLockSafe) {
216
+ await withFileOperationRetry(() =>
217
+ rm(paths.cacheBunLock, { force: true }),
218
+ );
219
+ }
220
+ } catch (error) {
221
+ log(
222
+ `cache clear skipped: ${error instanceof Error ? error.message : String(error)}`,
223
+ );
224
+ }
225
+ }
226
+ }
227
+ } catch (error) {
228
+ log(
229
+ `cache clear skipped: ${error instanceof Error ? error.message : String(error)}`,
230
+ );
231
+ }
232
+
233
+ return 0;
234
+ }
235
+
236
+ async function main() {
237
+ return runPreuninstallCleanup();
238
+ }
239
+
240
+ function normalizeExitCode(exitCode) {
241
+ return Number.isInteger(exitCode) && exitCode >= 0 && exitCode <= 255
242
+ ? exitCode
243
+ : 0;
244
+ }
245
+
246
+ const isDirectRun = (() => {
247
+ try {
248
+ return resolve(process.argv[1] ?? "") === fileURLToPath(import.meta.url);
249
+ } catch {
250
+ return false;
251
+ }
252
+ })();
253
+
254
+ if (isDirectRun) {
255
+ main()
256
+ .then((exitCode) => {
257
+ process.exitCode = normalizeExitCode(exitCode);
258
+ })
259
+ .catch((error) => {
260
+ defaultPreuninstallLog(
261
+ `preuninstall cleanup skipped: ${error instanceof Error ? error.message : String(error)}`,
262
+ );
263
+ process.exitCode = 0;
264
+ });
265
+ }
@@ -1,73 +1,73 @@
1
- ---
2
- name: codex-auth-setup
3
- description: Install or refresh codex-multi-auth for the official Codex CLI, run first login, and verify account health and routing.
4
- ---
5
-
6
- # codex-auth-setup
7
-
8
- Use this skill when the user wants to install, reinstall, upgrade, or troubleshoot `codex-multi-auth` for the official `@openai/codex` CLI.
9
-
10
- ## Install
11
-
12
- ```bash
13
- npm i -g @openai/codex
14
- npm i -g codex-multi-auth
15
- ```
16
-
17
- If the old scoped prerelease package is still installed:
18
-
19
- ```bash
20
- npm uninstall -g @ndycode/codex-multi-auth
21
- npm i -g codex-multi-auth
22
- ```
23
-
24
- ## First login
25
-
26
- ```bash
27
- codex-multi-auth login
28
- ```
29
-
30
- Default flow:
31
-
32
- 1. Open the account menu.
33
- 2. Choose the browser-first OAuth path.
34
- 3. Complete the official OAuth flow.
35
- 4. Return to the terminal and confirm the account was saved.
36
-
37
- ## Verify health and routing
38
-
39
- ```bash
40
- codex-multi-auth status
41
- codex-multi-auth list
42
- codex-multi-auth check
43
- codex-multi-auth forecast --live
44
- ```
45
-
46
- Use these next when managing multiple accounts:
47
-
48
- ```bash
49
- codex-multi-auth switch 2
50
- codex-multi-auth verify-flagged
51
- codex-multi-auth doctor --fix
52
- ```
53
-
54
- ## Alternate login paths
55
-
56
- Use these when browser launch is blocked or the shell is headless:
57
-
58
- ```bash
59
- codex-multi-auth login --manual
60
- CODEX_AUTH_NO_BROWSER=1 codex-multi-auth login
61
- ```
62
-
63
- ## Troubleshooting
64
-
65
- - Run `where codex-multi-auth` if `codex-multi-auth` is not recognized.
66
- - Free port `1455` and retry if the OAuth callback server cannot bind.
67
- - Re-run `codex-multi-auth login` if the active account is stale or the wrong account was selected.
68
- - Use `codex-multi-auth doctor --fix` followed by `codex-multi-auth check` for a fast recovery loop.
69
- - See `docs/getting-started.md`, `docs/configuration.md`, `docs/troubleshooting.md`, and `docs/reference/commands.md` for the full command and config docs.
70
-
71
- ## Usage boundaries
72
-
73
- This project is for personal development use. For production or commercial workloads, use the OpenAI Platform API.
1
+ ---
2
+ name: codex-auth-setup
3
+ description: Install or refresh codex-multi-auth for the official Codex CLI, run first login, and verify account health and routing.
4
+ ---
5
+
6
+ # codex-auth-setup
7
+
8
+ Use this skill when the user wants to install, reinstall, upgrade, or troubleshoot `codex-multi-auth` for the official `@openai/codex` CLI.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm i -g @openai/codex
14
+ npm i -g codex-multi-auth
15
+ ```
16
+
17
+ If the old scoped prerelease package is still installed:
18
+
19
+ ```bash
20
+ npm uninstall -g @ndycode/codex-multi-auth
21
+ npm i -g codex-multi-auth
22
+ ```
23
+
24
+ ## First login
25
+
26
+ ```bash
27
+ codex-multi-auth login
28
+ ```
29
+
30
+ Default flow:
31
+
32
+ 1. Open the account menu.
33
+ 2. Choose the browser-first OAuth path.
34
+ 3. Complete the official OAuth flow.
35
+ 4. Return to the terminal and confirm the account was saved.
36
+
37
+ ## Verify health and routing
38
+
39
+ ```bash
40
+ codex-multi-auth status
41
+ codex-multi-auth list
42
+ codex-multi-auth check
43
+ codex-multi-auth forecast --live
44
+ ```
45
+
46
+ Use these next when managing multiple accounts:
47
+
48
+ ```bash
49
+ codex-multi-auth switch 2
50
+ codex-multi-auth verify-flagged
51
+ codex-multi-auth doctor --fix
52
+ ```
53
+
54
+ ## Alternate login paths
55
+
56
+ Use these when browser launch is blocked or the shell is headless:
57
+
58
+ ```bash
59
+ codex-multi-auth login --manual
60
+ CODEX_AUTH_NO_BROWSER=1 codex-multi-auth login
61
+ ```
62
+
63
+ ## Troubleshooting
64
+
65
+ - Run `where codex-multi-auth` if `codex-multi-auth` is not recognized.
66
+ - Free port `1455` and retry if the OAuth callback server cannot bind.
67
+ - Re-run `codex-multi-auth login` if the active account is stale or the wrong account was selected.
68
+ - Use `codex-multi-auth doctor --fix` followed by `codex-multi-auth check` for a fast recovery loop.
69
+ - See `docs/getting-started.md`, `docs/configuration.md`, `docs/troubleshooting.md`, and `docs/reference/commands.md` for the full command and config docs.
70
+
71
+ ## Usage boundaries
72
+
73
+ This project is for personal development use. For production or commercial workloads, use the OpenAI Platform API.
@@ -1,2 +1,2 @@
1
- export type PluginInput = any;
2
- export type Plugin = any;
1
+ export type PluginInput = any;
2
+ export type Plugin = any;