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
| Item | Requirement | Notes |
|---|---|---|
| macOS | 12 (Monterey) or later | Apple Silicon and Intel |
| Windows | 10 / 11 | Native support is still experimental; WSL2 is more mature |
| Linux | glibc-based distributions (Ubuntu 22.04+, Debian 11+, Fedora 34+) | — |
| Node.js | 22 or later recommended | Only relevant for the npm install |
macOS
In a terminal:
curl -fsSL https://chatgpt.com/codex/install.sh | shHomebrew works too:
brew install --cask codexWindows
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 | shInstalling 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/codexRequires 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/codexOn 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 --versionA 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
| Symptom | Fix |
|---|---|
codex: command not found right after installing | Open 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 error | Fix your npm global prefix, or manage Node.js with nvm. Do not use sudo npm install -g. |
node --version reports below 22 | Run nvm install 22 && nvm use 22, or use the standalone installer, which bundles its own runtime. |
| PowerShell refuses to run the install script | Include -ExecutionPolicy ByPass as shown above, or install with npm instead. |
| Download fails or hangs | Force the GitHub Releases mirror: curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false sh |