Safe workflow for adding a new codex auth ... command without expanding scope or breaking the existing CLI contract.
Add one new command path while keeping:
codex auth ...as the canonical command family- current help text and aliases aligned with docs
- JSON and human-readable output predictable
- command behavior covered by targeted tests
lib/codex-manager.tsdocs/reference/commands.mdREADME.mdwhen user-visible workflow changestest/codex-manager-cli.test.tstest/documentation.test.ts
- Add the command logic in
lib/codex-manager.tsor the current command handler module. - Keep usage text literal and copy-pasteable.
- Reuse existing storage, refresh, and quota helpers instead of adding new command-local state.
- Add or extend CLI tests in
test/codex-manager-cli.test.tsfor:- success path
- invalid input or missing args
- JSON mode if supported
- non-interactive behavior if relevant
- Update
docs/reference/commands.mdwith the command and flags. - Update
README.mdonly when the command changes the recommended user workflow. - Update
test/documentation.test.tsif new command text must stay aligned across docs and runtime usage text.
npm run lint
npm run typecheck
npm test -- test/codex-manager-cli.test.ts test/documentation.test.ts
npm run build- command name is consistent across runtime and docs
- help text matches actual flags
- no unrelated settings or storage changes were mixed in
- JSON output is stable if exposed
- tests cover failure paths, not only the happy path