Skip to content

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 ​

Install ​

Run the following command in a terminal:

bash
npm install -g @openai/codex

Verify the installation ​

bash
codex --version

A version number confirms that installation succeeded.

Command 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 --version

Uninstall Codex when it is no longer needed:

bash
npm uninstall -g @openai/codex

Next step ​

Continue to configure the Codex CLI model provider with the local ~/.codex/config.toml file.

LAYSO AI API 文档