Key takeaways
- On macOS or Linux, OpenAI's installer is curl -fsSL https://chatgpt.com/codex/install.sh | sh; npm and Homebrew also work.
- After installing, run codex and choose Sign in with ChatGPT, which the README recommends for Plus, Pro, Business, Edu and Enterprise plans.
- VS Code users install the Codex extension from the Visual Studio Marketplace (openai.chatgpt).
Codex how to install, in short: the quickest route on macOS or Linux is one command: curl -fsSL https://chatgpt.com/codex/install.sh | sh. On Windows, run OpenAI's PowerShell installer. You can also use npm or Homebrew, or install the extension in VS Code. This guide for the Codex command-line tool (CLI) follows the openai/codex README on GitHub and OpenAI's Codex CLI docs, as read on November 2, 2026. We did not run the commands ourselves.
Codex comes in a few forms: the CLI that runs in your terminal, an extension for editors, a desktop app, and a cloud agent at chatgpt.com/codex. The README says you start the CLI by typing codex after installing.
Install the Codex CLI
Pick one method. They all give you the same codex command.
| Method | Command |
|---|---|
| Standalone installer, macOS or Linux | curl -fsSL https://chatgpt.com/codex/install.sh | sh |
| Standalone installer, Windows (PowerShell) | powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" |
| npm | npm install -g @openai/codex |
| Homebrew | brew install --cask codex |
The README says the installers download from releases.openai.com/codex and fall back to GitHub Releases if that is unavailable. To force GitHub Releases on macOS or Linux, run curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false sh. On Windows, set the same variable first: $env:CODEX_INSTALLER_USE_RELEASES_OPENAI_COM='false'; irm https://chatgpt.com/codex/install.ps1 | iex.
Download a binary instead
The README also points to the latest GitHub Release, where each platform has an archive:
- 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 file with the platform in its name. The README suggests renaming it to codex after you extract it, then putting it somewhere on your path.
Sign in and run Codex
Open a project folder in your terminal and run the command below. Nothing else is needed before it, and the README lists no system requirements.
codex
On first run, choose Sign in with ChatGPT. The README recommends this for Plus, Pro, Business, Edu and Enterprise plans. Using an API key instead needs extra setup, which OpenAI describes in its authentication docs. For what Codex costs on each plan, see our guide on whether Codex is free.
Then describe a task. OpenAI's example prompt is "Tell me about this project". The docs list slash commands such as /init, /status, /permissions, /model and /review, and codex exec for scripts and CI. The docs also advise making a Git checkpoint before and after a task so you can undo changes. To see how much of your allowance a session used, read how to check Codex token usage.
Install the Codex extension in your editor
OpenAI's IDE docs say VS Code and compatible editors use the Codex extension. For VS Code, install it from the Visual Studio Marketplace (extension ID openai.chatgpt). The docs link the same extension for Cursor, Windsurf and VS Code Insiders. Xcode and JetBrains IDEs have separate integrations that the docs link to.
The marketplace page is the only step OpenAI's docs give for installing it, and they do not cover Windows-specific setup for the extension. To open it in VS Code, Cursor or Windsurf, select the Codex icon. If you don't see it, run "Codex: Open Codex Sidebar" from the Command Palette. Then sign in.
If Codex doesn't work after installing
The pages we read give no step-by-step fixes, so these are checks, not official fixes.
- Confirm the install worked by opening a new terminal window and typing
codex. - If the installer download fails, try the GitHub Releases option above.
- If the VS Code extension shows no Codex icon, use the Command Palette command above.
- For Windows, OpenAI's docs link separate pages on the Windows app, the Windows sandbox and WSL (Windows Subsystem for Linux). The CLI page does not say which Windows setups are supported, so check those pages.
- OpenAI keeps a troubleshooting reference in its Codex docs. We could not open that page when reporting this guide.
Codex's code is public, which matters if you want to inspect what you install. We cover that in whether Codex is open source. To keep it current later, see how to update Codex.
Frequently asked questions
How do I download Codex?
Use the installer, npm or Homebrew commands in this guide, or download a binary archive for your platform from the latest GitHub Release of openai/codex and rename it to codex.
What is the Codex CLI?
It is OpenAI's coding agent that runs in your terminal. After installing it, you start it by typing codex in a project folder.
How do I install Codex in VS Code?
Install the Codex extension (openai.chatgpt) from the Visual Studio Marketplace, then select the Codex icon or run Codex: Open Codex Sidebar from the Command Palette.
Why is Codex not working in VS Code?
OpenAI's IDE page has no troubleshooting section. If the icon is missing, try the Codex: Open Codex Sidebar command, make sure you are signed in, and check OpenAI's troubleshooting reference.
Sources
- openai/codex READMEOpenAI (GitHub)
- Codex CLIOpenAI
- Codex IDE extensionOpenAI