Option 1: Codex CLI with the official installer
Open a new PowerShell window and run:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
Run the same command later to update. Open a new terminal, change to your project folder, and run codex. Choose Sign in with ChatGPT the first time.
You can also install with npm (npm install -g @openai/codex) if you already use Node.js on Windows.
Option 2: The ChatGPT desktop app from the Microsoft Store
OpenAI ships the Windows desktop app through the Microsoft Store:
- Open the Microsoft Store listing, or
- Run this from PowerShell:
winget install --id 9PLM9XGG6VKS -s msstore
Then open the app, sign in, add a project, and choose Codex.
Native Windows or WSL2?
By default the desktop app uses the Windows-native Codex agent. Commands run in PowerShell, protected by a native Windows sandbox when you select Ask for approval below the composer. If you’d rather the agent ran in Linux, open Settings, switch the agent from Windows native to WSL, and restart the app.
OpenAI’s advice for the native agent is to keep projects on the Windows filesystem and reach them from WSL through /mnt/<drive>/.... Opening projects directly from \\wsl$\ is less reliable. Full walkthrough: Codex with WSL2.
Helpful tools to install first
Codex works best with a few developer tools already present. OpenAI’s Windows docs suggest:
winget install --id Git.Git
winget install --id OpenJS.NodeJS.LTS
winget install --id GitHub.cli
Git powers the review pane. Node.js and Python help the agent work efficiently. After installing GitHub CLI, run gh auth login to enable GitHub features.
Running Codex in full access mode means it isn’t limited to your project folder. OpenAI warns that this can lead to destructive actions and data loss. Keep the sandbox on unless you have a specific reason.