> ## Documentation Index
> Fetch the complete documentation index at: https://docs.duiapi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI installation

> Install Codex CLI

Codex CLI requires Node.js and npm. After installation, run `codex` at least once to confirm Codex starts correctly.

## 1. Check Node.js

```bash theme={null}
node --version
npm --version
```

If version numbers appear, Node.js and npm are installed.

If Node.js is not installed, refer to the [Node.js installation guide](https://www.runoob.com/nodejs/nodejs-install-setup.html), then run the checks again.

## 2. Install Codex CLI

```bash theme={null}
npm install -g @openai/codex@latest
```

Check the installed version:

```bash theme={null}
codex --version
```

## 3. Initialize Codex

```bash theme={null}
codex
```

If the Codex chat UI, model information, or command hints appear, the installation succeeded.

<img src="https://mintcdn.com/duiapi/v5s4WtHrXMbWmd21/images/codex-cli-started.svg?fit=max&auto=format&n=v5s4WtHrXMbWmd21&q=85&s=f65e6db6662a7e14ee8b80d7436613b2" alt="Codex started successfully" width="980" height="520" data-path="images/codex-cli-started.svg" />
