StoryClaw Docs

Install Codex CLI

Install Codex CLI on macOS, Windows, or Linux and verify it, before connecting it to StoryClaw.

Codex CLI ships a standalone installer that bundles its own runtime, so Node.js is not required.

System requirements

ItemRequirementNotes
macOS12 (Monterey) or laterApple Silicon and Intel
Windows10 / 11Native support is still experimental; WSL2 is more mature
Linuxglibc-based distributions (Ubuntu 22.04+, Debian 11+, Fedora 34+)
Node.js22 or later recommendedOnly relevant for the npm install

macOS

In a terminal:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Homebrew works too:

brew install --cask codex

Windows

In PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

If your execution policy blocks the script, use "Installing with npm" below instead.

Codex reads and writes Git repositories, so installing Git for Windows is recommended — it also provides Git Bash, which avoids most path-related quirks of the native shell. Native Windows support is still experimental; if problems persist, install inside WSL2 using the Linux steps.

Linux

In a terminal:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Installing with npm

If you already run a stable Node.js setup, or the standalone installer is blocked on your machine, npm is the official fallback:

npm install -g @openai/codex

Requires Node.js 22 or later. Installing it through nvm needs no sudo and avoids permission errors:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install 22
npm install -g @openai/codex

On Windows, install Node.js directly from nodejs.org. Do not use sudo npm install -g — it causes permission and security problems.

Verify the installation

In a terminal:

codex --version

A version number means the install succeeded. If you get command not found, open a new terminal first — the installer updated PATH, and already-open sessions still use the old value.

Codex still talks to OpenAI at this point. Continue with Configure Codex CLI to point it at StoryClaw.

Troubleshooting

SymptomFix
codex: command not found right after installingOpen a new terminal. The installer updated PATH, and sessions opened earlier still use the old value.
npm install -g fails with EACCES or another permission errorFix your npm global prefix, or manage Node.js with nvm. Do not use sudo npm install -g.
node --version reports below 22Run nvm install 22 && nvm use 22, or use the standalone installer, which bundles its own runtime.
PowerShell refuses to run the install scriptInclude -ExecutionPolicy ByPass as shown above, or install with npm instead.
Download fails or hangsForce the GitHub Releases mirror: curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false sh

On this page