Kipt

Your prompts and skills, one keystroke away.

Explore

Install Codex CLI: npm, Homebrew and standalone installers by OS

npm install codex the right way: npm install -g @openai/codex, plus the standalone installers, Homebrew and binaries by OS, then verify, update and uninstall.

By the Kipt team · Updated 26 October 2026

To install the Codex CLI with npm, run npm install -g @openai/codex, then run codex in a project folder and sign in. OpenAI also documents a standalone installer for macOS, Linux and Windows, a Homebrew cask, and prebuilt binaries on GitHub, none of which need Node.js.

This guide covers every documented install method by operating system, how to verify the install, how to update and pin versions, and how to uninstall. Facts come from OpenAI's Codex CLI page, the openai/codex README and the environment variables page, read on 26 October 2026, when the latest release on GitHub was 0.164.0 (published 23 October 2026).

Which install method should you use?

OpenAI documents five ways to get the CLI:

Method Command OS Needs Node.js
Standalone installer curl -fsSL https://chatgpt.com/codex/install.sh | sh macOS, Linux No
Standalone installer powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" Windows No
npm npm install -g @openai/codex Any with Node.js Yes
Homebrew brew install --cask codex macOS No
GitHub Release binary Download from the latest release macOS, Linux, Windows No

The Codex CLI page lists the standalone installer first. Pick npm if you already manage tools through Node.js, Homebrew if that is how you keep your Mac up to date, and a binary if you need a fixed file you can copy around.

Pick one. OpenAI's installer script warns that "Multiple managed Codex installs can be ambiguous because PATH order decides which one runs."

How do you install Codex with npm?

Run:

npm install -g @openai/codex

Use the scoped name @openai/codex, the one OpenAI documents. The package.json for that package in OpenAI's repo declares "node": ">=16" in its engines field.

To install a specific version, add it after @, as OpenAI's Windows deployment guide does:

npm install -g @openai/codex@0.164.0

If a global npm install fails on permissions, the standalone installer is an alternative: it installs into your user folder by default. On Windows, the deployment guide adds a useful warning: "Global" in npm "does not necessarily mean all Windows users."

How do you install Codex on macOS and Linux?

The standalone installer is one line:

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

Facts about it from OpenAI's docs and the installer source on GitHub:

  • It puts the visible codex command in ~/.local/bin by default. Set CODEX_INSTALL_DIR to change that.
  • It keeps its package cache under CODEX_HOME/packages/standalone, which is ~/.codex/packages/standalone by default.
  • It downloads from https://releases.openai.com/codex and falls back to GitHub Releases if a download is unavailable. Set CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false to force GitHub.
  • It verifies the download against a SHA-256 checksum before installing.
  • It accepts --release VERSION or CODEX_RELEASE to pin a version, and CODEX_NON_INTERACTIVE=1 to skip prompts in scripts.
# Unattended install, for example in a provisioning script
curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh

On a Mac with Homebrew, the cask is the alternative:

brew install --cask codex

The repo's install doc lists system requirements of macOS 12+ or Ubuntu 20.04+/Debian 10+, 4 GB of RAM minimum (8 GB recommended), and optionally Git 2.23+ for built-in PR helpers.

How do you install Codex on Windows?

Open a new PowerShell window and run:

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

That is the README's form. The Codex CLI page shows the shorter irm https://chatgpt.com/codex/install.ps1 | iex, run from a new PowerShell window. The installer puts the command in %LOCALAPPDATA%\Programs\OpenAI\Codex\bin and adds it to your User PATH, so open a new terminal afterwards. npm works on Windows too if Node.js is already installed. For a pinned version, the deployment guide downloads the script and passes -Release:

$CodexRelease = '0.164.0'
Invoke-WebRequest -UseBasicParsing -Uri 'https://chatgpt.com/codex/install.ps1' -OutFile '.\codex-install.ps1'
powershell -ExecutionPolicy Bypass -File .\codex-install.ps1 -Release $CodexRelease

Note that the repo's install doc still lists "Windows 11 via WSL2" in its requirements table, while the Codex CLI page now documents the native PowerShell installer above. If you prefer Linux tooling, install inside WSL2 with the macOS and Linux command. OpenAI's WSL page says WSL1 was supported through Codex 0.114 and is no longer supported from 0.115.

Can you install Codex from a GitHub binary?

Yes. Each GitHub Release contains many files. The README points to these for most people:

Platform File
macOS Apple Silicon codex-aarch64-apple-darwin.tar.gz
macOS Intel codex-x86_64-apple-darwin.tar.gz
Linux x86_64 codex-x86_64-unknown-linux-musl.tar.gz
Linux arm64 codex-aarch64-unknown-linux-musl.tar.gz

Each archive holds one executable with the platform in its name, so rename it to codex and put it on your PATH. Releases also include a DotSlash file named codex, which lets a team commit a lightweight pointer so everyone runs the same version. Building from source with Cargo is covered in the repo's install doc.

How do you verify the install and sign in?

Open a new terminal, then:

codex --version
codex

On Windows, OpenAI's deployment guide also runs Get-Command codex to confirm which executable resolves. The first time you run codex, choose Sign in with ChatGPT or another available method. The README notes that an API key also works but "requires additional setup."

If anything is off, run codex doctor. The CLI reference says it generates "a local diagnostic report" that checks "installation, configuration, authentication, runtime, Git, terminal, app-server, and thread inventory health." Our Codex troubleshooting guide covers common errors such as command not found.

How do you update Codex?

Update with the same method you installed with:

Installed with Update command
Standalone installer Rerun the same install.sh or install.ps1 command
npm npm install -g @openai/codex
Homebrew brew upgrade --cask codex

There is also a built-in command. The CLI reference describes codex update as: "Check for and apply a Codex CLI update when the installed release supports self-update." OpenAI's troubleshooting page notes that the ChatGPT desktop app and Codex CLI "can include different Codex versions," so a feature may reach one before the other.

How do you uninstall Codex?

OpenAI's docs don't publish a dedicated uninstall page. The commands below are taken from its installer script on GitHub, which runs them when it finds an existing npm, Bun or Homebrew install and you agree to remove it before a standalone install:

npm uninstall -g @openai/codex     # npm
brew uninstall --cask codex        # Homebrew
bun remove -g @openai/codex        # Bun

For the standalone installer, OpenAI documents no removal steps. Based on the installer's default paths (our inference, not an official procedure), delete the codex command from its install folder (~/.local/bin by default, or %LOCALAPPDATA%\Programs\OpenAI\Codex\bin on Windows), along with a codex-code-mode-host link there if one exists, and the package cache under ~/.codex/packages/standalone. On Windows, also remove that folder from your User PATH.

Be careful with the rest of ~/.codex. The environment variables page describes CODEX_HOME as "the root for Codex state, including config, auth, logs, sessions, skills, and standalone package metadata." Deleting the whole folder removes your settings, saved sign-in and chat history too, so only do it if you want a clean slate.

What should you set up after installing?

Three things make the first week smoother: a ~/.codex/config.toml with your preferred model and approval mode (see the Codex config.toml guide), an AGENTS.md in each repo, and the skills you rely on. Kipt keeps prompts and Agent Skills as Markdown in a private GitHub repo you own, and one command, npx skills add https://github.com/<you>/<repo>.git --all -g, installs every skill into Codex on a fresh machine. The Codex CLI guide covers flags, commands and your first session.

Questions

What is the npm command to install Codex?

Run npm install -g @openai/codex. The package name is scoped under @openai, so use @openai/codex exactly as OpenAI documents it. Running the same command again updates Codex to the latest version.

What is the recommended way to install the Codex CLI?

OpenAI lists the standalone installer first: curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS and Linux, or the install.ps1 script from a new PowerShell window on Windows. npm and Homebrew are documented alternatives, and GitHub Releases has prebuilt binaries.

Do I need Node.js to install Codex?

Only for the npm method. The standalone installers, Homebrew and the GitHub Release binaries don't need Node.js. The package.json for @openai/codex in OpenAI's repo declares Node.js 16 or later in its engines field.

How do I update the Codex CLI?

Use the method you installed with: rerun the standalone installer, run npm install -g @openai/codex again, or run brew upgrade --cask codex. The CLI also has a codex update command that applies an update when the installed release supports self-update.

How do I uninstall the Codex CLI?

OpenAI doesn't publish an uninstall page. Its installer script uses npm uninstall -g @openai/codex and brew uninstall --cask codex when it offers to remove an existing npm or Homebrew install. For a standalone install, our inference from the script's default paths is to delete the codex command in ~/.local/bin and the cache in ~/.codex/packages/standalone.

How do I check that Codex installed correctly?

Open a new terminal and run codex --version. On Windows, Get-Command codex shows which executable runs. If something looks wrong, codex doctor generates a diagnostic report that checks installation, configuration, authentication and more.

More in Codex

All guides

Keep your prompts and skills in one place, in your own GitHub. Install every skill with one command.

Get started

Kipt is an independent product, not affiliated with or endorsed by Anthropic, OpenAI, Cursor or GitHub. Claude, ChatGPT, Codex, Cursor and GitHub are trademarks of their owners.