Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
47c2d0a
fix(auth): define reset and delete safety flows
ndycode Mar 15, 2026
541ef0a
feat(auth): add backup restore manager
ndycode Mar 15, 2026
1d7ed86
feat(auth): prompt for recovery on startup
ndycode Mar 15, 2026
bf80247
feat(sync): add sync center and status surface
ndycode Mar 15, 2026
37bdb34
fix(auth): clean startup recovery prompt branch
ndycode Mar 16, 2026
8a76984
feat(settings): productize stable and advanced controls
ndycode Mar 15, 2026
c52e84f
fix(auth): drop recovery fallback from settings slice
ndycode Mar 16, 2026
8a51928
docs(auth): align front-door flows with shipped workflows
ndycode Mar 15, 2026
587117d
feat(sync): add result history and last-result log
ndycode Mar 15, 2026
4655386
fix(sync): bound sync history recovery reads
ndycode Mar 16, 2026
638349e
feat(auth): add backup browser and rotating restore support
ndycode Mar 15, 2026
7a867a4
feat(auth): add restore preview
ndycode Mar 15, 2026
a9a0fb9
feat(auth): add restore preview
ndycode Mar 15, 2026
e80f021
fix(restore): reuse previewed backup state
ndycode Mar 17, 2026
687ca03
fix(restore): honor previewed assessments
ndycode Mar 18, 2026
f2c3a5b
test(restore): tighten preview restore coverage
ndycode Mar 18, 2026
c61f8bf
fix(auth): bind restore preview to live storage state
ndycode Mar 18, 2026
ddca70d
feat(auth): add backup restore manager
ndycode Mar 15, 2026
137bed5
feat(auth): prompt for recovery on startup
ndycode Mar 15, 2026
5103a94
fix(auth): clean startup recovery prompt branch
ndycode Mar 16, 2026
1ba1f68
feat(auth): snapshot before destructive actions
ndycode Mar 15, 2026
29659e0
fix(storage): snapshot exact pre-mutation state
ndycode Mar 16, 2026
4ad0133
fix(storage): lock destructive snapshots with clears
ndycode Mar 17, 2026
a048cb2
fix(storage): harden auto snapshot destructive flows
ndycode Mar 18, 2026
34a3fd3
fix(storage): require snapshots before destructive auth changes
ndycode Mar 18, 2026
d169dca
test(storage): pin win32 snapshot retry coverage
ndycode Mar 18, 2026
f1a21b0
fix(storage): fail closed on import snapshots
ndycode Mar 18, 2026
34c483c
fix(storage): preserve active rotation artifacts
ndycode Mar 18, 2026
89922ec
fix(storage): pin transaction storage path
ndycode Mar 18, 2026
b39a5a3
test(storage): harden restore and retry regressions
ndycode Mar 18, 2026
432ab73
fix(storage): retry reset marker writes
ndycode Mar 18, 2026
dedece6
fix(storage): avoid dangling import snapshots
ndycode Mar 18, 2026
93a6463
fix(storage): harden named backup scans and snapshots
ndycode Mar 18, 2026
641ec1f
fix(storage): preserve replace-only restore skip counts
ndycode Mar 18, 2026
c5c84a8
fix(auth): define reset and delete safety flows
ndycode Mar 15, 2026
10d4617
feat(auth): add backup restore manager
ndycode Mar 15, 2026
6f12f45
feat(auth): prompt for recovery on startup
ndycode Mar 15, 2026
595870f
fix(auth): clean startup recovery prompt branch
ndycode Mar 16, 2026
f3962fc
feat(auth): add restore preview
ndycode Mar 15, 2026
bb43cc2
fix(storage): snapshot exact pre-mutation state
ndycode Mar 16, 2026
cc002c2
feat(sync): add manual rollback
ndycode Mar 15, 2026
20aff55
Fix rollback checkpoint selection
ndycode Mar 16, 2026
48c9ba7
fix(sync): harden rollback checkpoint recovery
ndycode Mar 16, 2026
78587d4
fix(sync): redact rollback save failures
ndycode Mar 17, 2026
7c3a21d
fix(sync): scope rollback selection and snapshots
ndycode Mar 18, 2026
d853ad8
fix(sync): record rollback restore state
ndycode Mar 18, 2026
4bd4949
fix(sync): preserve pending run ordering
ndycode Mar 18, 2026
355ac29
fix(sync): fail closed on rollback history read
ndycode Mar 18, 2026
bfd4ea0
fix(sync): restack rollback branch on preview stack
ndycode Mar 18, 2026
c5de884
chore(storage): remove unused rollback helpers
ndycode Mar 18, 2026
4f60292
test(sync): cover newer manual run without rollback checkpoint
ndycode Mar 18, 2026
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
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Codex CLI-first multi-account OAuth manager for the official `@openai/codex` CLI
- Canonical `codex auth ...` workflow for account login, switching, checks, and diagnostics
- Multi-account OAuth pool with health-aware selection and automatic failover
- Project-scoped account storage under `~/.codex/multi-auth/projects/<project-key>/...`
- Interactive dashboard for account actions and settings
- Experimental settings tab for staged sync, backup, and refresh-guard controls
- Interactive dashboard for login, restore, switching, sync preview, and settings
- Productized settings split across `Everyday Settings`, `Codex CLI Sync`, `Experimental`, and `Advanced & Operator`
- Forecast, report, fix, and doctor commands for operational safety
- Flagged account verification and restore flow
- Session affinity and live account sync controls
Expand Down Expand Up @@ -50,6 +50,7 @@ Codex CLI-first multi-account OAuth manager for the official `@openai/codex` CLI
### Option A: Standard install

```bash
npm i -g @openai/codex
npm i -g codex-multi-auth
```

Expand All @@ -74,16 +75,18 @@ codex auth status

### Step-by-step

1. Install global package:
1. Install global packages:
- `npm i -g @openai/codex`
- `npm i -g codex-multi-auth`
2. Run first login flow with `codex auth login`
3. Validate state with `codex auth status` and `codex auth check`
3. Validate state with `codex auth list` and `codex auth check`
4. Confirm routing with `codex auth forecast --live`

### Verification

```bash
codex auth status
codex auth list
codex auth check
```

Expand All @@ -95,7 +98,7 @@ codex auth check

```bash
codex auth login
codex auth status
codex auth list
codex auth check
codex auth forecast --live
```
Expand All @@ -109,6 +112,12 @@ codex auth fix --dry-run
codex auth doctor --fix
```

Interactive dashboard paths:

- restore named backups: `codex auth login` -> `Restore From Backup`
- preview Codex CLI sync: `codex auth login` -> `Settings` -> `Codex CLI Sync`
- adjust stable dashboard preferences: `codex auth login` -> `Settings` -> `Everyday Settings`

---

## Command Toolkit
Expand Down Expand Up @@ -234,6 +243,7 @@ codex auth login
- `codex auth` unrecognized: run `where codex`, then follow `docs/troubleshooting.md` for routing fallback commands
- Switch succeeds but wrong account appears active: run `codex auth switch <index>`, then restart session
- OAuth callback on port `1455` fails: free the port and re-run `codex auth login`
- Interactive login skipped restore and went straight to OAuth: place named backups in `~/.codex/multi-auth/backups/`, then rerun `codex auth login` in a normal TTY
- `missing field id_token` / `token_expired` / `refresh_token_reused`: re-login affected account

</details>
Expand Down
12 changes: 6 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Public documentation for `codex-multi-auth`.

| Document | Focus |
| --- | --- |
| [index.md](index.md) | Daily-use landing page for common `codex auth ...` workflows |
| [getting-started.md](getting-started.md) | Install, first login, and first health check |
| [index.md](index.md) | Daily-use landing page for login, restore, sync, and diagnostics workflows |
| [getting-started.md](getting-started.md) | Install, first login, startup restore prompt, and first health check |
| [faq.md](faq.md) | Short answers to common adoption questions |
| [architecture.md](architecture.md) | Public system overview of the wrapper, storage, and optional plugin runtime |
| [features.md](features.md) | User-facing capability map |
| [features.md](features.md) | User-facing capability map, including backup restore, sync center, and settings split |
| [configuration.md](configuration.md) | Stable defaults, precedence, and environment overrides |
| [troubleshooting.md](troubleshooting.md) | Recovery playbooks for install, login, switching, and stale state |
| [troubleshooting.md](troubleshooting.md) | Recovery playbooks for install, login, restore, sync, and stale state |
Comment on lines +20 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

document the rollback flow in the portal index.

docs/README.md:20-26 and docs/README.md:43-44 widen the restore/sync wording, but they still do not mention the new manual rollback workflow from this pr. that leaves the docs landing page out of sync with the changed cli surface and gives users no obvious path to the rollback docs or upgrade notes. please add rollback wording here and point to the matching reference/upgrade pages.

as per coding guidelines, "docs/**: keep README, SECURITY, and docs consistent with actual CLI flags and workflows. whenever behavior changes, require updated upgrade notes and mention new npm scripts."

Also applies to: 43-44

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/README.md` around lines 20 - 26, The docs README lacks mention of the
new manual rollback workflow; update the portal landing copy in README.md (the
index list entries such as getting-started.md, restore/sync entries) to add a
short "rollback" entry that describes the manual rollback flow, add a link to
the rollback reference page and the upgrade notes, and mention the new npm
script/CLI flag that implements the rollback (ensure the text references the
rollback docs and upgrade notes files and the CLI flag/script name used by the
PR).

| [privacy.md](privacy.md) | Data handling and local storage behavior |
| [upgrade.md](upgrade.md) | Migration from legacy package and path history |
| [releases/v1.1.10.md](releases/v1.1.10.md) | Stable release notes |
Expand All @@ -40,8 +40,8 @@ Public documentation for `codex-multi-auth`.

| Document | Focus |
| --- | --- |
| [reference/commands.md](reference/commands.md) | Commands, flags, and hotkeys |
| [reference/settings.md](reference/settings.md) | Dashboard and runtime settings |
| [reference/commands.md](reference/commands.md) | Commands, flags, hotkeys, and interactive entry points |
| [reference/settings.md](reference/settings.md) | Everyday settings, sync center, and advanced operator controls |
| [reference/storage-paths.md](reference/storage-paths.md) | Canonical and compatibility storage paths |
| [reference/public-api.md](reference/public-api.md) | Public API stability and semver contract |
| [reference/error-contracts.md](reference/error-contracts.md) | CLI, JSON, and helper error semantics |
Expand Down
5 changes: 5 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ User-facing capability map for `codex-multi-auth`.
| Capability | What it gives you | Primary entry |
| --- | --- | --- |
| Multi-account dashboard login | Add and manage multiple OAuth identities from one terminal flow | `codex auth login` |
| Startup recovery prompt | Offer restore before OAuth when recoverable named backups are found and no active accounts exist | `codex auth login` |
| Backup restore manager | Review named backups, merge with dedupe, and skip invalid or over-limit restores | `codex auth login` -> `Restore From Backup` |
| Account dedupe and identity normalization | Avoid duplicate saved account rows | login flow |
| Explicit active-account switching | Pick the current account by index instead of relying on hidden state | `codex auth switch <index>` |
| Fast and deep health checks | See whether the current pool is usable before a coding session | `codex auth check` |
Expand All @@ -32,6 +34,7 @@ User-facing capability map for `codex-multi-auth`.
| --- | --- | --- |
| Safe repair workflow | Detects and repairs known local storage inconsistencies | `codex auth fix` |
| Diagnostics with optional repair | One command to inspect and optionally fix common failures | `codex auth doctor` |
| JSON diagnostics pack | Machine-readable state for support, bug reports, and deeper inspection | `codex auth report --live --json` |
| Backup and WAL recovery | Safer persistence when local writes are interrupted or partially applied | storage runtime |

---
Expand All @@ -53,6 +56,8 @@ User-facing capability map for `codex-multi-auth`.
| --- | --- |
| Quick switch and search hotkeys | Faster navigation in the dashboard |
| Account action hotkeys | Per-account set, refresh, toggle, and delete shortcuts |
| Productized settings split | Keeps `Everyday Settings` separate from `Advanced & Operator` controls |
| Preview-first sync center | Shows one-way Codex CLI sync results and rollback context before apply |
Comment on lines +59 to +60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

call out rollback as an operator action here.

docs/features.md:59-60 only mentions rollback context before apply, but the shipped flow in lib/codex-manager/settings-hub.ts:2822-2827 can also roll back the last manual apply. please name rollback explicitly in the capability map so the docs match the actual sync-center workflow.

As per coding guidelines, "docs/**: keep README, SECURITY, and docs consistent with actual CLI flags and workflows. whenever behavior changes, require updated upgrade notes and mention new npm scripts."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/features.md` around lines 59 - 60, Update the "Preview-first sync
center" capability line in docs/features.md to explicitly call out "operator
rollback" (e.g., "Shows one-way Codex CLI sync results, operator rollback of
last manual apply, and rollback context before apply") so the docs match the
rollback behavior implemented in the settings hub rollback code path in
settings-hub.ts (the roll-back-last-manual-apply logic around the ~2822–2827
area); also add a short upgrade note in the docs explaining the new rollback
capability and mention any new npm scripts or CLI flags required by the workflow
change to satisfy the docs/** guidelines.

| In-dashboard settings hub | Runtime and display tuning without editing files directly |
| Browser-first OAuth with manual fallback | Works in normal and constrained terminal environments |

Expand Down
25 changes: 25 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.

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:

```bash
Expand All @@ -70,6 +72,29 @@ codex auth forecast --live

---

## Restore Or Start Fresh

Use the restore path when you already have named backup files and want to recover account state before creating new OAuth sessions.

- Automatic path: run `codex auth login`, then confirm the startup restore prompt when it appears
- Manual path: run `codex auth login`, then choose `Restore From Backup`
- Backup location: `~/.codex/multi-auth/backups/<name>.json`

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.

---

## Sync And Settings

The settings flow is split into two productized sections:

- `Everyday Settings` for list appearance, details line, results and refresh behavior, and colors
- `Advanced & Operator` for `Codex CLI Sync`, `Experimental`, and backend tuning

Use `Codex CLI Sync` when you want to preview one-way sync from official Codex CLI account files before applying it. The sync screen shows source and target paths, preview summary, destination-only preservation, and backup rollback paths before apply.

---

## Day-1 Command Pack

```bash
Expand Down
10 changes: 9 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# codex-multi-auth Docs

Daily-use guide for the `codex auth ...` workflow.
Daily-use guide for the `codex auth ...` workflow, including restore, sync, and diagnostics.

---

Expand All @@ -12,6 +12,8 @@ codex auth list
codex auth check
```

If login detects recoverable named backups before OAuth, confirm the prompt to open `Restore From Backup` first.

If you are choosing an account for the next session:

```bash
Expand Down Expand Up @@ -39,6 +41,12 @@ codex auth report --live --json
codex auth doctor --fix
```

Interactive workflows that ship in the dashboard:

- backup restore: `codex auth login` -> `Restore From Backup`
- sync preview and apply: `codex auth login` -> `Settings` -> `Codex CLI Sync`
- settings split: `codex auth login` -> `Settings` -> `Everyday Settings` or `Advanced & Operator`

---

## Canonical Policy
Expand Down
24 changes: 18 additions & 6 deletions docs/reference/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ Compatibility aliases are supported:

| Command | Description |
| --- | --- |
| `codex auth login` | Open interactive auth dashboard |
| `codex auth login` | Open interactive auth dashboard, including login, restore, settings, and diagnostics entry points |
| `codex auth list` | List saved accounts and active account |
| `codex auth status` | Print short runtime/account summary |
| `codex auth switch <index>` | Set active account by index |
| `codex auth check` | Run quick account health check |
| `codex auth features` | Print implemented feature summary |
| `codex auth restore-backup` | Open the backup restore picker directly |

---

Expand Down Expand Up @@ -90,16 +91,26 @@ Compatibility aliases are supported:

Settings screen hotkeys are panel-specific:

- Account List View: `Enter Toggle | Number Toggle | M Sort | L Layout | S Save | Q Back (No Save)`
- Summary Line: `Enter Toggle | 1-3 Toggle | [ ] Reorder | S Save | Q Back (No Save)`
- Menu Behavior: `Enter Select | 1-3 Delay | P Pause | L AutoFetch | F Status | T TTL | S Save | Q Back (No Save)`
- Color Theme: `Enter Select | 1-2 Base | S Save | Q Back (No Save)`
- Backend Controls: `Enter Open | 1-4 Category | S Save | R Reset | Q Back (No Save)`
- List Appearance: `Enter Toggle | Number Toggle | M Sort | L Layout | S Save | Q Back (No Save)`
- Details Line: `Enter Toggle | 1-3 Toggle | [ ] Reorder | S Save | Q Back (No Save)`
- Results & Refresh: `Enter Select | 1-3 Delay | P Pause | L AutoFetch | F Status | T TTL | S Save | Q Back (No Save)`
- Colors: `Enter Select | 1-2 Base | S Save | Q Back (No Save)`
- Advanced Backend Controls: `Enter Open | 1-4 Category | S Save | R Reset | Q Back (No Save)`

---

## Workflow Packs

Interactive dashboard workflows:

- Backup restore: `codex auth login` -> `Restore From Backup`
- Startup recovery prompt: interactive `codex auth login` TTY flow only, then confirm restore when recoverable named backups are found before OAuth
- Sync preview and apply: `codex auth login` -> `Settings` -> `Codex CLI Sync`
- Stable settings path: `codex auth login` -> `Settings` -> `Everyday Settings`
- Advanced settings path: `codex auth login` -> `Settings` -> `Advanced & Operator`

---

Health and planning:

```bash
Expand All @@ -111,6 +122,7 @@ codex auth report --live --json
Repair and recovery:

```bash
codex auth restore-backup
codex auth fix --dry-run
codex auth fix --live --model gpt-5-codex
codex auth doctor --fix
Expand Down
54 changes: 47 additions & 7 deletions docs/reference/settings.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Settings Reference

Reference for dashboard and backend settings available from `codex auth login` -> `Settings`.
Reference for the settings surface available from `codex auth login` -> `Settings`.

---

Expand All @@ -19,7 +19,11 @@ When `CODEX_MULTI_AUTH_DIR` is set, this root moves accordingly.

---

## Account List View
## Everyday Settings

The shipped settings menu starts with `Everyday Settings` and keeps the stable dashboard path separate from advanced operator controls. This is the default path for most users.

### List Appearance

Controls account-row display and sorting behavior:

Expand All @@ -37,7 +41,7 @@ Controls account-row display and sorting behavior:
- `menuSortQuickSwitchVisibleRow`
- `menuLayoutMode`

## Summary Line
### Details Line

Controls detail-line fields and order:

Expand All @@ -46,7 +50,7 @@ Controls detail-line fields and order:
- `limits`
- `status`

## Menu Behavior
### Results & Refresh

Controls result-screen and fetch behavior:

Expand All @@ -56,7 +60,7 @@ Controls result-screen and fetch behavior:
- `menuShowFetchStatus`
- `menuQuotaTtlMs`

## Color Theme
### Colors

Controls display style:

Expand All @@ -66,7 +70,38 @@ Controls display style:

---

## Experimental
## Advanced and Operator Controls

The second top-level section is `Advanced & Operator`. It holds the sync workflow and backend tuning that are useful when you need to inspect or change lower-level behavior.

### Codex CLI Sync

`Codex CLI Sync` is a preview-first sync center for Codex CLI account sync.
See [upgrade notes](../upgrade.md) for sync workflow changes.

Before applying sync, it shows:

- target path
- current source path when available
- last sync result for this session
- preview summary (adds, updates, destination-only preserved accounts)
- destination-only preservation behavior
- backup and rollback context (`.bak`, `.bak.1`, `.bak.2`, `.wal`)

Workflow notes:

- refresh recomputes the read-only preview from Codex CLI source files
- apply writes the preview result into the target path
- sync is one-way, it is not a bidirectional merge
- target-only accounts are preserved rather than deleted

Validation:

- `npm run typecheck`
- `npm run build`
- `npm test`

Comment on lines +98 to +103
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

validation section includes dev commands rather than user-facing validation.

the validation subsection at lines 98-103 references npm run typecheck, npm run build, and npm test. these are developer/maintainer commands, not user-facing validation steps. the settings reference should document user-facing validation like codex auth check or codex auth forecast --live.

consider moving these to a contributor guide or replacing with user-facing commands:

📝 suggested fix
-Validation:
-
-- `npm run typecheck`
-- `npm run build`
-- `npm test`
+Validation:
+
+- `codex auth status`
+- `codex auth check`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Validation:
- `npm run typecheck`
- `npm run build`
- `npm test`
Validation:
- `codex auth status`
- `codex auth check`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reference/settings.md` around lines 98 - 103, The "Validation:"
subsection currently lists developer npm commands (`npm run typecheck`, `npm run
build`, `npm test`); replace those with user-facing validation instructions
(e.g., `codex auth check`, `codex auth forecast --live` or other CLI commands
that validate settings) and move the npm commands into a contributor/developer
guide or a new "Developer validation" section; update the "Validation:" heading
content accordingly and ensure the change is applied where the current
`Validation:` block appears so readers see user-facing checks first while
maintainers can find the npm steps in contributor docs.

### Experimental

Experimental currently hosts:

Expand All @@ -88,7 +123,11 @@ Named backup behavior:
- rejects separators, traversal (`..`), `.rotate.`, `.tmp`, and `.wal` suffixes
- fails safely on collisions instead of overwriting by default

## Backend Controls
### Advanced Backend Controls

`Advanced Backend Controls` stay available without changing the saved settings schema. They are grouped into categories so the everyday path can stay simpler for day-to-day use.

## Backend Categories

### Session & Sync

Expand Down Expand Up @@ -178,6 +217,7 @@ For most environments:

- smart sort enabled
- auto-fetch limits enabled
- storage backups enabled when you want rollback context for sync and recovery flows
- live sync enabled
- session affinity enabled
- preemptive quota deferral enabled
Expand Down
14 changes: 14 additions & 0 deletions docs/reference/storage-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Override root:
| --- | --- |
| Unified settings | `~/.codex/multi-auth/settings.json` |
| Accounts | `~/.codex/multi-auth/openai-codex-accounts.json` |
| Named backups | `~/.codex/multi-auth/backups/<name>.json` |
| Accounts backup | `~/.codex/multi-auth/openai-codex-accounts.json.bak` |
| Accounts WAL | `~/.codex/multi-auth/openai-codex-accounts.json.wal` |
| Flagged accounts | `~/.codex/multi-auth/openai-codex-flagged-accounts.json` |
Expand Down Expand Up @@ -56,6 +57,7 @@ Backup metadata:
When project-scoped behavior is enabled:

- `~/.codex/multi-auth/projects/<project-key>/openai-codex-accounts.json`
- `~/.codex/multi-auth/projects/<project-key>/backups/<name>.json`

`<project-key>` is derived as:

Expand Down Expand Up @@ -100,6 +102,17 @@ Rules:
- `.rotate.`, `.tmp`, and `.wal` names are rejected
- existing files are not overwritten unless a lower-level force path is used explicitly

Restore workflow:

1. Run `codex auth login`.
2. Open the `Recovery` section.
3. Choose `Restore From Backup`.
4. Pick a backup and confirm the merge summary before import.

Direct entrypoint:

- Run `codex auth restore-backup` to open the same picker without entering the full login dashboard first.

---

## oc-chatgpt Target Paths
Expand All @@ -115,6 +128,7 @@ Experimental sync targets the companion `oc-chatgpt-multi-auth` storage layout:
## Verification Commands

```bash
codex auth login
codex auth status
codex auth list
```
Expand Down
Loading