1
Check Node version
- Node.js >= 18
2
Install Codex CLI
3
Set environment variables
zsh (default)
zsh (default)
bash
bash
4
Start Codex
enters the interactive interface and follows the prompts to define your model and session configuration.
- Option 1 (Full Access): Codex can directly execute commands or modify files in the /root directory without confirming each time. Highest efficiency.
- Option 2 (Ask for Approval): Every time you change a file or execute a command, you will be asked for confirmation first, which is more secure and suitable for operations on production machines or key directories.
5
Get started
- /init: Create AGENTS.md in the current directory and place Codex instructions and configuration templates for easy reuse.
- /status: View the current session configuration (model, token consumption, etc.).
- /approvals: Set which operations require manual confirmation and which can be automatically executed (corresponding to the “approval mode” above).
- /model: Select model and inference strength (e.g. GPT-4/GPT-5, fast or deep mode).
~/.codex/config.tomlAdd in: