One npm package, three auth paths
Codex CLI ships as @openai/codex. After install, codex is on your PATH. Like Claude Code, it requires a Git repository (use --skip-git-repo-check for one-off directories). Three authentication paths cover the spectrum from individual to CI.
ChatGPT OAuth via codex login — easiest if you have ChatGPT Plus/Pro. Browser flow, no API key to manage, billing rolls up under your subscription. API key in environment — OPENAI_API_KEY env var, the path for servers and CI. API key via stdin — pipe the key through echo "$KEY" | codex exec ... for jobs where you don't want the key in process listings or shell history.
After install, drop a minimum ~/.codex/config.toml and a global ~/.codex/AGENTS.md, and you're ready. codex status verifies setup.