()
| 103 | } |
| 104 | |
| 105 | function resolveCodexHome(): string { |
| 106 | const envPath = process.env.CODEX_HOME?.trim() |
| 107 | if (envPath && envPath.length > 0) { |
| 108 | return path.resolve(envPath) |
| 109 | } |
| 110 | return path.join(os.homedir(), ".codex") |
| 111 | } |
| 112 | |
| 113 | async function readCodexAuthFile(): Promise<CodexCliAuthFile | null> { |
| 114 | try { |