AI tools

Install OpenAI Codex CLI

OpenAI's Codex coding agent in your terminal, using your ChatGPT plan or an API key.

  1. Install it
    Terminal
    npm install -g @openai/codex

    Needs Node.js 22 or newer.

  2. Start it in your project and sign in
    Terminal
    cd ~/projects/my-app
    codex

    Choose Sign in with ChatGPT, or use an OpenAI API key.

Check it worked

  1. Check the version
    Terminal
    codex --version
Undo it
  1. Uninstall it
    Terminal
    npm uninstall -g @openai/codex
  1. Install it
    Terminal · Ubuntu / Debian
    npm install -g @openai/codex

    Needs Node.js 22 or newer.

  2. Start it in your project and sign in
    Terminal · Ubuntu / Debian
    cd ~/projects/my-app
    codex

    Choose Sign in with ChatGPT, or use an OpenAI API key.

Check it worked

  1. Check the version
    Terminal · Ubuntu / Debian
    codex --version
Undo it
  1. Uninstall it
    Terminal · Ubuntu / Debian
    npm uninstall -g @openai/codex
  1. Install it
    PowerShell
    npm install -g @openai/codex

    Needs Node.js 22 or newer. On Windows it works best inside WSL.

  2. Start it in your project and sign in
    PowerShell
    cd ~\projects\my-app
    codex

    Choose Sign in with ChatGPT, or use an OpenAI API key.

Check it worked

  1. Check the version
    PowerShell
    codex --version
Undo it
  1. Uninstall it
    PowerShell
    npm uninstall -g @openai/codex