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.asarfromCodex.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
- Install Codex CLI:
- Direct run:
run.cmd -DmgPath .\Codex.dmg
- 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- customrcedit.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.