You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add codexHomePath to CodexAccount and include it in coding/initialization so accounts can reference a local Codex home. Extend AccountStore with codexHomesDirectory and codexHomeURL(for:) to compute stable per-account home directories. Add makeAuthJSON(...) and persistAuthFile(...) in CodexAPIService to generate a normalized auth.json (pretty/sorted JSON with ISO8601 last_refresh) and write it to the account's codexHomePath (attempts to set 0o600 permissions). Update token refresh result to populate codexHomePath and codexAuthJSON.
Update AccountsViewModel to normalize loaded accounts (parse token claims for canonical email/accountId), assign codexHomePath, generate/persist auth JSON on load, deduplicate duplicate accounts preferring healthy/recent validations, and always operate on normalized/canonical accounts when merging or importing. Minor fixes: expose storeDirectory as non-private and persist accounts after setup. These changes ensure local auth files are maintained and account identities are normalized/deduplicated on load.
**Startup:**`viewModel.setup()` → `AccountStore.load()` → normalize each account into its isolated Codex home → start auto-refresh timer + token keep-alive
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The Codex CLI has two rate limits: a rolling 5-hour window and a weekly window.
8
8
9
9
Codex Accounts shows the lowest remaining percentage across all your accounts directly in the menu bar. Click the icon to open a popover with a card for each account. Each card has both usage meters with time-to-reset countdowns, credit balance if your plan has one, and the plan type.
10
10
11
-
The app watches `~/.codex/auth.json`. When you run `codex auth` to switch accounts, it picks up the new account automatically. Tokens are refreshed proactively in the background and again on-demand if a request returns unauthorized.
11
+
The app imports Codex CLI logins, then keeps each account in its own isolated Codex home under `~/Library/Application Support/CodexAccounts/CodexHomes/`. Tokens are refreshed proactively in the background and again on-demand if a request returns unauthorized.
12
12
13
13
## Requirements
14
14
@@ -89,20 +89,19 @@ Output is written to `dist/`.
89
89
90
90
## Adding accounts
91
91
92
-
The app detects your current account from `~/.codex/auth.json` on launch. To add another, click "Add Account" in the popover, then in a terminal run:
92
+
The app detects your current account from `~/.codex/auth.json` on launch. To add another, click "Add Account" in the popover, then sign in through the isolated Codex login window.
The app watches the auth file and adds the new account automatically.
98
+
The app watches the import auth file, adds the account automatically, then copies it into that account's dedicated Codex home.
100
99
101
100
## Privacy
102
101
103
102
The only network requests are to `chatgpt.com/backend-api/wham/usage` to fetch usage numbers and `auth.openai.com/oauth/token` to refresh tokens when they expire. No analytics, no telemetry.
104
103
105
-
Account data (including tokens) is stored locally in `~/Library/Application Support/CodexAccounts/accounts.json`. Nothing else leaves your machine.
104
+
Account data (including tokens) is stored locally in `~/Library/Application Support/CodexAccounts/accounts.json` and each account's isolated `auth.json` under `~/Library/Application Support/CodexAccounts/CodexHomes/`. Nothing else leaves your machine.
0 commit comments