Step-by-Step Guide to Installing Codex App and CLI on macOS and Windows

This article provides a comprehensive, step‑by‑step tutorial for installing the OpenAI Codex desktop App and command‑line interface on both macOS and Windows, covering official store installation, MSIX sideloading, PowerShell scripts, npm mirrors, verification steps, and common troubleshooting for Chinese network environments.

Su San Talks Tech
Su San Talks Tech
Su San Talks Tech
Step-by-Step Guide to Installing Codex App and CLI on macOS and Windows

App Installation

Download the Codex App from openai.com/codex. On macOS, open the downloaded DMG, drag the Codex icon into the Applications folder, launch it, and log in with a ChatGPT account.

On Windows the app is distributed via the Microsoft Store, which can be problematic. Three installation routes are described:

Direct Store install (simplest but may fail).

MSIX sideloading (recommended): visit https://store.rg-adguard.net/, select ProductId 9PLM9XGG6VKS, choose Retail, download the OpenAI.Codex_..._x64...msixbundle from the Microsoft CDN, verify the signature with

Get-AuthenticodeSignature .\OpenAI.Codex_*.msixbundle | Format-List

(expect Status : Valid), then install with Add-AppxPackage .\OpenAI.Codex_*.msixbundle.

Winget command (fallback): winget source update, winget search "OpenAI Codex" -s msstore, winget install --id 9PLM9XGG6VKS -s msstore.

Common Windows errors such as error code 0x80131500 or endless loading usually stem from Store connectivity; solutions include changing the system region to United States, resetting the Store with wsreset.exe, and ensuring a non‑China Microsoft account is used.

CLI Installation

Codex CLI is independent of the App. The recommended installation order is: official script first, then npm mirror if the script fails, and finally update an existing version.

macOS CLI

Method 1 – Official script (recommended): curl -fsSL https://chatgpt.com/codex/install.sh | sh, then verify with codex --version.

Method 2 – Homebrew: brew install --cask codex.

Method 3 – npm (works better on Chinese networks): Install Node.js (preferably via nvm with Node 20 LTS), then npminstall-g @openai/codex. If network errors occur, use a domestic registry:

npminstall-g @openai/codex --registry=https://registry.npmmirror.com

.

Windows CLI

Method 1 – Official PowerShell script (recommended):

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

, then verify with codex --version.

Method 2 – npm: Install Node.js LTS from nodejs.org (or use nvm-windows), then npminstall-g @openai/codex. Use the domestic registry flag if needed.

Common Windows CLI issues: "command not found" usually means the npm global bin path is not in PATH or PowerShell execution policy blocks the script. Fix by adding the bin directory to PATH or running Set-ExecutionPolicy RemoteSigned -Scope CurrentUser. Restarting the terminal or rebooting often resolves the problem.

Post‑Installation Verification

App: launch the desktop application, log in, and start a new conversation to confirm it works.

CLI: run codex or codex --version in a terminal; an interactive prompt and a version number indicate a successful install.

Common Troubleshooting

Windows Store stuck – use the MSIX sideload method.

npm install times out – switch the registry to https://registry.npmmirror.com (or set it permanently with npm config set registry https://registry.npmmirror.com).

CLI not recognized – ensure the global npm bin directory is in PATH or adjust PowerShell execution policy, then restart the terminal or reboot.

App and CLI can be installed independently; they share the same ChatGPT account but do not automatically sync conversation history.

Feature parity between macOS and Windows is largely the same; only the computer‑control experience differs slightly, with macOS offering a smoother automation workflow.

Tips for Chinese Users

Set npm registry permanently: npm config set registry https://registry.npmmirror.com (or use nrm to switch between mirrors).

Use nvm to manage Node versions, which simplifies switching between Node 20 and other versions.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CLIOpenAIWindowsInstallationmacOSnpmAppCodex
Su San Talks Tech
Written by

Su San Talks Tech

Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.