OpenAI Codex CLI in 2026
OAuth once, run forever. Codex CLI's interactive mode finally feels like a first-class Claude Code peer.
⚡ 3min read beginner OS · macos · linux · windows v1.3.0
Last updated May 09, 2026 · by xlrd
Prereq
- Node.js 20+
- OpenAI account with ChatGPT Pro or an API key
- A repo to test in
Steps
01. Install
bash
npm install -g @openai/codex
codex --version # 1.3.0 02. OAuth once
bash
codex login
# opens a browser, auth'd session stored in ~/.codex/auth.json If you’d rather use an API key: codex login --api-key sk-....
03. Start interactive mode
bash
cd ~/projects/your-app
codex You get a REPL with file awareness, slash commands, and streaming output.
04. Work with slash commands
bash
/model gpt-5.4 # switch model
/add src/**/*.ts # scope the repo view
/shell npm test # run a command, pipe output back
/undo # revert last edit
/exit 05. Pipe it in CI
bash
codex exec --model gpt-5.4-mini \
--task "update all imports from lodash to es-toolkit" \
--allow-write "src/**" Non-interactive mode writes a JSON summary to stdout. Easy to parse in a GH Action.
Next
- Codex in GitHub Actions
- Dual-wield with Claude Code
Feedback · anonymous
Was this helpful?