Use this when adding a new codex auth ... command.
Add a command without breaking the existing CLI surface, help text, JSON mode, or dashboard/menu behavior.
lib/codex-manager.ts— command parsing and dispatchlib/codex-manager/— extracted command/controller helpers when the command grows beyond trivial sizelib/cli.ts— prompt-heavy shared CLI helpers when the command needs reusable interactive flowsdocs/reference/commands.md— command referencetest/codex-manager-cli.test.ts— CLI behavior coveragetest/documentation.test.ts— docs parity when command text/help changes
- Add the smallest possible parsing/dispatch change in
lib/codex-manager.ts. - If the command has more than one logical branch, extract a helper under
lib/codex-manager/instead of growing the main file. - Keep JSON output stable and explicit if the command already has
--json. - Update command help text and
docs/reference/commands.mdin the same change. - Add or extend
test/codex-manager-cli.test.tsfor the new path.
- Preserve canonical command shape:
codex auth <subcommand> - Do not silently change existing help text unless docs/tests are updated too
- If adding flags, update both help text and command reference
npm run typechecknpm run lint -- lib/codex-manager.ts test/codex-manager-cli.test.ts docs/reference/commands.md test/documentation.test.tsnpm run test -- test/codex-manager-cli.test.ts test/documentation.test.ts- For auth flows, never paste raw tokens/session headers in PRs, issues, or logs; redact sensitive output.
- Run the real command or
--helppath in Bash and inspect output