GitHub - Javaec/Codex-Windows

Tip

🧭 Windows-first Codex repack + launch pipeline with a Node.js orchestration core and a thin PowerShell entrypoint.


🎯 What This Project Is

Codex-Windows repacks and runs Codex Desktop on Windows with a deterministic pipeline:

  • 🧩 Extract app.asar from Codex.dmg
  • πŸ› οΈ Apply Windows runtime patches (PATH/env/process guards/CLI resolution)
  • πŸ”½ Inject reliable chat auto-scroll on thread switch
  • 🧹 Sanitize workspace registry + maintain git capability cache
  • πŸ§ͺ Validate native modules (better-sqlite3, node-pty)
  • πŸ“¦ Build portable output or single-file EXE

🧼 Automatic Cleanup Policy (mtime-based)

At pipeline start, stale data in %USERPROFILE%\.codex (or %CODEX_HOME%) is cleaned by last modified time:

Target Rule
log/ files older than 7 days
sessions/ files older than 10 days
worktrees/ roots older than 5 days (based on latest mtime inside tree)

Note

βœ… Old chats/sessions are kept if they were modified recently.


πŸ—οΈ Pipeline Architecture

run.cmd / build.cmd
  -> scripts/run.ps1
    -> scripts/node/run.js
      -> scripts/ts/run.ts

Important

build.cmd runs build mode with -NoLaunch by default (build only, no auto-start).


🧰 Requirements

  • πŸͺŸ Windows 10/11
  • 🟒 Node.js
  • πŸ€– Codex CLI: npm i -g @openai/codex
  • πŸ—œοΈ 7-Zip (7z) for DMG extraction and single EXE packaging

Note

  • Python / Visual Studio Build Tools are not required for default flow.
  • scripts/ts/* = source, scripts/node/* = compiled runtime artifacts.

⚑ Quick Start

  1. Install Codex CLI:
  1. Direct run:
run.cmd -DmgPath .\Codex.dmg
  1. Portable build (no auto-launch):
build.cmd -DmgPath .\Codex.dmg

πŸ–₯️ Command Cheat Sheet

Scenario Command
▢️ Direct run run.cmd
⏸️ Direct run without launch run.cmd -NoLaunch
πŸ“¦ Portable build (default no launch) build.cmd -DmgPath .\Codex.dmg
🧷 Portable build + single EXE build.cmd -DmgPath .\Codex.dmg -SingleExe
🧠 Node runner (run mode) node .\scripts\node\run.js run -DmgPath .\Codex.dmg
πŸ› οΈ Node runner (build mode) node .\scripts\node\run.js build -DmgPath .\Codex.dmg -NoLaunch

πŸŽ›οΈ Useful Options

Option Meaning
-WorkDir .\work custom work directory
-DistDir .\dist custom output directory
-Reuse reuse reusable pipeline artifacts
-NoLaunch skip application launch
-CodexCliPath <path> explicit codex.exe path
-SingleExe build self-extracting EXE
-DevProfile use isolated dev profile
-ProfileName <name> named profile isolation
-StrictContract strict environment contract checks

Branding overrides:

  • 🎨 CODEX_ICON_PATH - custom .ico
  • 🧱 CODEX_RCEDIT_PATH - custom rcedit.exe

πŸ“ Output Layout

dist\Codex-win32-x64\Codex.exe
dist\Codex-win32-x64\Launch-Codex.cmd
dist\Codex-win32-x64-single.exe   (when -SingleExe is used)

⚠️ Disclaimer

  • This is not an official OpenAI project.
  • Do not redistribute OpenAI binaries or Codex.dmg.