Install Codex CLI
Codex CLI is OpenAI's command-line coding agent. It can inspect code, edit files, and run commands directly from your terminal.
Prerequisites
- Get an API key from the LAYSO AI website ↗.
- Install Node.js ↗; Node.js 18 or later is recommended.
- Prepare a project directory for the first Codex test.
Install
Run the following command in a terminal:
bash
npm install -g @openai/codexIMAGE SLOT 01Install Codex CLI
/screenshots/codex/01-install.pngRecommended 16:9 · 1600 × 900Verify the installation
bash
codex --versionA version number confirms that installation succeeded.
IMAGE SLOT 02Verify the installation
/screenshots/codex/02-verify.pngRecommended 16:9 · 1600 × 900Command not found
Run node --version and npm --version to confirm Node.js is installed. Reopen the terminal and make sure npm's global executable directory is included in PATH.
Update and uninstall
Update to the current npm release:
bash
npm update -g @openai/codex
codex --versionUninstall Codex when it is no longer needed:
bash
npm uninstall -g @openai/codexNext step
Continue to configure the Codex CLI model provider with the local ~/.codex/config.toml file.
