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

# Install Codex CLI

> Set up OpenAI's Codex CLI on your machine before wiring in the Yellow.pro MCP server.

> [!WARNING]
>
> Before installing an AI CLI, make sure you've completed Yellow\.pro's account setup first — connecting your wallet, creating a sub-account, and completing verification. See **[Agent Onboarding](https://docs.yellow.pro/mcp/getting-started.md)** for the full walkthrough. The steps below assume your Yellow\.pro account is already set up and you're ready to pair an AI agent to it.

If `codex --version` already works in your terminal, skip ahead to [Installation](https://docs.yellow.pro/mcp/installation.md) and use `yellow-pro setup codex`. Otherwise, follow the steps below first.

## Watch the walkthrough

Prefer to follow along on video? This six-minute walkthrough covers Codex CLI onboarding.

[Codex CLI Onboarding](https://www.youtube.com/embed/usw0oxnsAl4)

## Step by step

**1. Install**

Install Codex CLI globally via npm:

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

Alternative install methods:

```bash theme={null} theme={null}
# macOS (Homebrew)
brew install --cask codex
```

```bash theme={null} theme={null}
# Windows
winget install OpenAI.Codex
```

**2. Verify**

Open a **new** terminal window (a window that was already open won't see an updated `PATH`), then run:

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

> [!WARNING]
>
> If you see `command not found: codex`, npm's global bin directory likely isn't on your `PATH`. Check where npm installs global packages with `npm config get prefix`, then add `<that path>/bin` to your `PATH` (e.g. in `~/.zshrc`) and open a fresh terminal window.

**3. Log in**

Run:

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

This opens a browser-based sign-in flow using your ChatGPT account. Check that it worked with:

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

> [!NOTE]
>
> For headless machines without a browser, use `codex login --device-auth` instead. To authenticate with an API key rather than a ChatGPT account, use `codex login --with-api-key` or set the `CODEX_API_KEY` environment variable.

Next: continue to [Installation](https://docs.yellow.pro/mcp/installation.md) and run `yellow-pro setup codex` to register the Yellow\.pro MCP server with Codex CLI.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.