Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Expected flow:
4. Return to the terminal when the browser step completes.
5. Confirm the account appears in the saved account list.

On a brand-new install (no `openai-codex-accounts.json` yet), `codex auth login` opens a first-run setup screen before OAuth. Use it to restore from backups, import accounts from a companion app pool, run doctor/check paths, open settings and Codex CLI sync, or skip straight to login. All actions reuse the existing backup browser, import, doctor, and settings flows. Upgrade note: no npm scripts changed, so existing automation remains compatible.

If interactive `codex auth login` starts with zero saved accounts and recoverable named backups in your `backups/` directory, the login flow will prompt you to restore before opening OAuth. Confirm to launch the existing restore manager; skip to proceed with a fresh login. The prompt is suppressed in non-interactive/fallback flows and after same-session `fresh` or `reset` actions.

Verify the new account:
Expand Down Expand Up @@ -82,6 +84,8 @@ Use the restore path when you already have named backup files and want to recove

The restore manager shows each backup name, account count, freshness, and whether the restore would exceed the account limit before it lets you apply anything.

If you already have an OpenCode account pool on the same machine, use the recovery import option from the login dashboard to preview and import those saved accounts before creating new OAuth sessions. The detector checks the standard OpenCode account file and honors `CODEX_OPENCODE_POOL_PATH` when you need to point at a specific file.

---

## Sync And Settings
Expand Down
4 changes: 4 additions & 0 deletions lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export type LoginMode =
| "check"
| "deep-check"
| "verify-flagged"
| "import-opencode"
| "restore-backup"
| "cancel";

Expand Down Expand Up @@ -248,6 +249,9 @@ async function promptLoginModeFallback(
) {
return { mode: "restore-backup" };
}
if (normalized === "i" || normalized === "import-opencode") {
return { mode: "import-opencode" };
}
if (normalized === "q" || normalized === "quit")
return { mode: "cancel" };
console.log(UI_COPY.fallback.invalidModePrompt);
Expand Down
Loading