Windows-native development keeps project files and terminal commands in the same environment. OpenAI Codex CLI's standalone installer adds the codex command to PowerShell for the current Windows user.

The OpenAI standalone installer selects the native ARM64 or x64 package on 64-bit Windows. It stores the runtime in the user's profile and registers a command directory on the user's PATH. Windows 11 is OpenAI's recommended Windows platform.

Installation, authentication, and the Windows command sandbox have separate states. Codex can report a consistent installation while still lacking a login or an enabled sandbox backend; both need attention before asking it to work on a project.

Steps to install Codex CLI on Windows:

  1. Open PowerShell as your ordinary Windows user.

    The built-in Windows PowerShell is suitable. The installer writes to the current user's profile. Running it as another administrator would install into that account's profile instead.

  2. Download OpenAI's standalone installer to the temporary folder.
    $ Invoke-WebRequest -UseBasicParsing -Uri https://chatgpt.com/codex/install.ps1 -OutFile "$env:TEMP\codex-install.ps1"
  3. Check the downloaded installer's signature. Example output:
    $ Get-AuthenticodeSignature "$env:TEMP\codex-install.ps1" | Format-List Status,SignerCertificate
    Status            : Valid
    SignerCertificate : [Subject]
                          CN="OpenAI OpCo, LLC", O="OpenAI OpCo, LLC", L=San Francisco, S=California, C=US
    ##### snipped #####

    The script installs executable software and changes your user PATH. Its signature must be Valid and its certificate subject must identify OpenAI OpCo, LLC before execution. A missing, invalid, or different publisher signature is a reason to stop.

  4. Install Codex CLI for the current Windows user with the signed script. Example output:
    $ powershell -ExecutionPolicy ByPass -File "$env:TEMP\codex-install.ps1"
    ==> Installing Codex CLI
    ==> Detected platform: Windows (ARM64)
    ==> Resolved version: 0.167.2
    ==> Downloading Codex CLI
    ==> PATH updated for future PowerShell sessions.
    ==> Current PowerShell session: codex
    ==> Future PowerShell windows: open a new PowerShell window and run: codex
    Codex CLI 0.167.2 installed successfully.

    The installer selects the latest release; the version and platform lines vary. -ExecutionPolicy ByPass applies to this child PowerShell process and does not persistently change the user or machine execution policy. An optional Start Codex now? prompt can be declined while finishing installation checks.
    Related: OpenAI's downloaded-script installation method

  5. Remove the downloaded installer script.
    $ Remove-Item "$env:TEMP\codex-install.ps1"

    This removes only the temporary download; the installed runtime remains in $env:USERPROFILE\.codex\packages\standalone.

  6. Close the PowerShell window used for installation.

    A shell that was already running can retain its old PATH. If PowerShell is hosted in Windows Terminal, closing the entire terminal application avoids inheriting its old environment in another tab.

  7. Open PowerShell in a fresh session.
  8. Check which executable the fresh shell resolves for codex.
    $ Get-Command codex

    The result should be an Application named codex.exe with Source under C:\Users\<your-user>\AppData\Local\Programs\OpenAI\Codex\bin. A missing command or a different location needs attention before continuing.
    Related: How to add a folder to the PATH environment variable in Windows

  9. Confirm that the installed executable prints its version. Example output:
    $ codex --version
    codex-cli 0.167.2

    The release number changes as OpenAI publishes updates.

  10. Inspect the installation health and Windows sandbox state in the diagnostic report. Example output:
    $ codex doctor
    Codex Doctor v0.167.2 · windows-aarch64
    ##### snipped #####
          executable               C:\Users\reader\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe
      ✓ install      consistent
    ##### snipped #####
      ✗ auth         no Codex credentials were found — Run codex login or provide an API key through a supported auth env var.
    ##### snipped #####
      ✓ sandbox      restricted fs + restricted network · approval OnRequest
    ##### snipped #####
          sandbox backend          disabled
          denied-read restrictions false
      ✓ sandbox      no explicit filesystem paths to probe
    ##### snipped #####
    18 ok · 1 idle · 3 notes · 2 warn · 1 fail failed

    The executable path, working version command, and install consistent line establish the standalone installation. The shortened report uses reader as an example Windows username. This unsigned-in report returned exit status 1 because authentication failed; it also warned about Microsoft Defender exclusions and a failed WebSocket handshake. It is not an all-healthy result. Diagnostic interpretation is covered in How to run diagnostics for Codex CLI.

    The sandbox summary describes configured permissions; sandbox backend disabled means an active Windows sandbox has not been established. The installation report does not prove sandboxed command execution. OpenAI's Windows sandbox setup explains native backend selection and any administrator-approved setup. Disabling Defender or bypassing sandbox restrictions is not an installation requirement.

    Authentication is the next separate setup task before model requests.
    Related: How to start a Codex interactive session

Share this guide