Run the Codex desktop app on Windows using the official macOS installer.
A Windows runner that extracts the Codex DMG (macOS installer), rebuilds native modules for Windows, and runs—or packages—the full Electron app. No official Windows build exists; this project bridges the gap so you can use Codex on Windows with a single script or a portable .exe.
- One-time setup: Download the latest Codex DMG from the official website (or Codex releases) and place it in the root directory of Codex-Windows (e.g.
Codex.dmg). - No manual patching: The script extracts the app, swaps macOS-only native modules for Windows builds (better-sqlite3, node-pty), and launches Codex.
- Single-folder app: Build a fully self-contained
Codex-win32-x64folder withCodex.exe, bundled Codex CLI, and a Desktop shortcut. - Truly portable: Move the entire folder anywhere (USB, another PC). No
run.ps1or Node.js required after building.
- This repo does not ship OpenAI/Codex binaries. You supply the DMG and (for the first run) have the Codex CLI available (e.g.
npm i -g @openai/codex). The portable build bundles the CLI into the output folder.
- Runtime: Node.js (for the build script)
- Packaging: Electron (version read from the app’s
package.json) - Native modules: better-sqlite3, node-pty (prebuilds or Visual Studio Build Tools for rebuild)
- Script: PowerShell (
run.ps1), 7-Zip (auto-installed viawingetif missing)
Codex-Windows/
Codex.dmg # Place the DMG you download from the official website here
image.png # Preview image
run.cmd # Shortcut: run.cmd [options]
scripts/
run.ps1 # Main script: extract, patch, run or build exe
Generated output (extracted app, native builds, and the portable Codex-win32-x64 folder) is created locally and is not part of the repo.
- Windows 10 or 11
- Node.js (for running the script)
- 7-Zip — if not installed, the script will try
wingetor download a portable copy - Codex CLI (for first run or if not building portable):
npm i -g @openai/codex
- Download the latest Codex DMG from the official website and place it in the root directory of Codex-Windows (e.g. name it
Codex.dmg). - To use a different path or filename:
.\scripts\run.ps1 -DmgPath .\path\to\YourCodex.dmg
# From repo root
.\scripts\run.ps1Or with the shortcut:
run.cmdThe script will extract the DMG, prepare the app, auto-detect codex.exe, and launch Codex.
Build a self-contained app and a Desktop shortcut:
.\scripts\run.ps1 -BuildExe- A Codex-win32-x64 folder is created (with
Codex.exeand resources). A Desktop shortcut is also created—double-click it to launch. - To move the app: move the entire
Codex-win32-x64folder, then create a new shortcut toCodex.exeif needed.
Do not move only
Codex.exe. It needs the surrounding DLLs,resources/, andlocales/folders.
Build without launching:
.\scripts\run.ps1 -BuildExe -NoLaunch| Goal | Command / Action |
|---|---|
| Run once | .\scripts\run.ps1 or run.cmd |
| Build portable | .\scripts\run.ps1 -BuildExe |
| Custom DMG | .\scripts\run.ps1 -DmgPath .\path\to\Codex.dmg |
| Reuse existing | .\scripts\run.ps1 -BuildExe -Reuse (skips re-extract) |
| Custom work dir | .\scripts\run.ps1 -WorkDir .\mywork |
- This is not an official OpenAI project.
- Do not redistribute the Codex DMG or OpenAI binaries; use your own installer.
- Native modules: If compilation fails (e.g. no Visual Studio), the script tries prebuilt binaries. If none are available for your Electron version, install Visual Studio Build Tools and run again.
Creator: @dhruvtwt_
