Skip to content

Commit 9df51c0

Browse files
committed
Improve README clarity and conciseness
Tighten wording, remove implementation details, consolidate scattered bullet lists into inline text, and use blockquotes for callouts.
1 parent 63cb252 commit 9df51c0

1 file changed

Lines changed: 16 additions & 40 deletions

File tree

README.md

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,10 @@
44

55
It swaps only the active auth file. Your main Codex history, logs, sessions, and other state stay shared.
66

7-
## Status
8-
9-
- Public GitHub repository: ready
10-
- npm package name: selected as `codex-auth-switch`
11-
12-
For now, the supported installation path is running from this repository checkout. Package-install instructions will be added after the package is published.
13-
147
## Before You Start
158

16-
- **This tool runs as `./codex-auth-switch ...` in this repository.**
17-
- Running `pnpm install` and `pnpm build` does **not** create a global `codex-auth-switch` command.
18-
- `./codex-auth-switch` is a small wrapper that runs `node dist/index.mjs`.
9+
- **This tool runs as `./codex-auth-switch ...` from this repository's root.**
10+
- `pnpm install && pnpm build` does **not** create a global command. Always invoke via `./codex-auth-switch`.
1911

2012
## Requirements
2113

@@ -26,9 +18,9 @@ For now, the supported installation path is running from this repository checkou
2618

2719
## Important Constraints
2820

29-
- **File-backed auth only.** `cli_auth_credentials_store` must be `"file"` or `"auto"` resolving to a readable file-backed auth file. Keyring-backed auth is not supported.
21+
- **File-backed auth only.** Codex's `cli_auth_credentials_store` setting must be `"file"` (or `"auto"` resolving to a file). Keyring-backed auth is not supported.
3022
- **Email is a label.** `add <email>` stores the email as a user-provided label. It is not verified against the browser session used during `codex login`.
31-
- **Usage is best-effort.** `usage` depends on upstream behavior that is not a public stable API.
23+
- **Usage is best-effort.** The `usage` command relies on Codex's internal API, which is not a public stable interface and may change without notice.
3224

3325
## Install
3426

@@ -37,13 +29,13 @@ pnpm install
3729
pnpm build
3830
```
3931

40-
After that, run the CLI like this:
32+
Verify the build:
4133

4234
```bash
4335
./codex-auth-switch --help
4436
```
4537

46-
Windows is not supported at the moment. The CLI currently depends on POSIX process inspection and file-permission behavior.
38+
> **Note:** Windows is not supported. The CLI depends on POSIX process inspection and file-permission behavior.
4739
4840
## Quick Start
4941

@@ -81,12 +73,7 @@ yes foo@example.com 8cd075d2-c767-41da-91d4-09ff5585276d 2026-04-04 21:10
8173
bar@example.com a1b2c3d4-e5f6-7890-abcd-1234567890ef 2026-04-03 18:00 local
8274
```
8375

84-
Columns:
85-
86-
- active flag
87-
- email label
88-
- full `account_id`
89-
- `last_used_at` in local time
76+
Columns: active flag, email label, `account_id`, and `last_used_at` in local time.
9077

9178
### 3. Switch the active account
9279

@@ -102,7 +89,7 @@ Direct:
10289
./codex-auth-switch use foo@example.com
10390
```
10491

105-
This writes the selected auth to `$CODEX_HOME/auth.json`. If `CODEX_HOME` is not set, the default target is `~/.codex/auth.json`.
92+
This writes the selected auth to `$CODEX_HOME/auth.json` (default: `~/.codex/auth.json`).
10693

10794
Example output:
10895

@@ -189,15 +176,9 @@ Reads usage information.
189176
- `--all`: all saved accounts
190177
- `--json`: machine-readable output
191178

192-
`--all` continues when one account fails. If the resolved auth belongs to a different `account_id`, the command fails closed for that account.
193-
If the upstream usage payload reports a different email than the saved label, the human-readable output shows `Observed email`.
179+
`--all` continues even when individual accounts fail. If the fetched auth belongs to a different `account_id` than expected, that account is treated as an error (fail-closed).
194180

195-
Typical empty state:
196-
197-
```text
198-
No saved accounts yet.
199-
Run `./codex-auth-switch add <email>` to register your first account.
200-
```
181+
If the upstream response reports a different email than the saved label, the output shows it as `Observed email`.
201182

202183
## Where Data Is Stored
203184

@@ -210,9 +191,8 @@ Managed auth snapshots live outside the main Codex directory:
210191
<profile_id>.json
211192
```
212193

213-
- `email` is the user-facing identifier
214-
- `profileId` is the internal primary key
215-
- managed auth paths are derived from `profileId` at runtime
194+
- `email` — user-facing identifier (the label you pass to commands)
195+
- `profileId` — internal primary key; auth file paths are derived from it at runtime
216196

217197
Example `state.json`:
218198

@@ -239,13 +219,11 @@ MIT
239219

240220
- Atomic replacement of auth and state files
241221
- Lock-file based concurrency control for `add` and `use`
242-
- `0700` for directories and `0600` for auth files
222+
- `0700` for directories, `0600` for auth files
243223
- No logging of tokens or raw auth payloads
244224
- Rollback on failed switch when possible
245225

246-
Important risk:
247-
248-
- If `~/.config/codex-auth-switch/` is compromised, every saved session is exposed
226+
> **Risk:** If `~/.config/codex-auth-switch/` is compromised, every saved session is exposed.
249227
250228
Please report security issues privately as described in [`SECURITY.md`](./SECURITY.md).
251229

@@ -259,12 +237,10 @@ Exit codes:
259237
| `2` | Local state, auth, or lock failure |
260238
| `3` | External dependency failure |
261239

262-
For structured logs:
240+
Structured logs (JSON Lines on `stderr`, sensitive fields redacted):
263241

264242
```bash
265243
CODEX_AUTH_SWITCH_LOG_LEVEL=debug ./codex-auth-switch usage --all
266244
```
267245

268-
- Output format: JSON Lines on `stderr`
269-
- Levels: `error`, `warn`, `info`, `debug`
270-
- Sensitive fields are redacted
246+
Available levels: `error`, `warn`, `info`, `debug`.

0 commit comments

Comments
 (0)