This project repackages the upstream macOS Codex desktop app so it can run on Linux. It does not scrape the DMG directly by default. Instead it reads the upstream Sparkle appcast feed, downloads the versioned macOS ZIP, inspects the bundled Electron version, rebuilds the native Node modules for Linux, and drops the result into a Linux Electron runtime.
The current upstream app exposes a machine-readable release feed at https://persistent.oaistatic.com/codex-app-prod/appcast.xml. That feed points to versioned macOS ZIP artifacts such as Codex-darwin-arm64-26.305.950.zip, which are simpler to automate against than the generic Codex.dmg URL.
The builder rebuilds the upstream app.asar after applying a small Linux-specific patch set and swaps native artifacts at paths that are already indexed by app.asar. The unpacked helper binaries such as node-pty's spawn-helper still stay in app.asar.unpacked.
- Linux
- Node.js and
npm unzippython3makeg++codexonPATHat runtime, orCODEX_APP_SYSTEM_CODEX=/path/to/codexrgonPATHat runtime, orCODEX_APP_SYSTEM_RG=/path/to/rg
Install the project dependencies:
npm installInspect the latest upstream release:
npm run release-infoBuild the latest Linux package into out/:
npm run repackageSmoke-test the packaged app launch path:
npm run smoke-testExtract the bundled automation templates and related automation UI text into a repo directory:
npm run extract-automation-examples -- --version 26.305.950Install the current build as a desktop app for the current user:
npm run install-desktop -- --version 26.305.950Build a specific upstream release:
npm run repackage -- --version 26.305.950Build from a local upstream ZIP:
npm run repackage -- --zip /path/to/Codex-darwin-arm64-26.305.950.zipReplace an existing output directory:
npm run repackage -- --forceSmoke-test a specific build output:
npm run smoke-test -- --version 26.305.950The build output contains:
start.sh: Linux launch scriptserve-webview.mjs: local static server for the extracted renderer assetscontent/webview/: renderer assets extracted fromapp.asarresources/codex: wrapper that resolves a LinuxcodexCLIresources/rg: wrapper that resolves Linuxrgcodex-linux-manifest.json: captured upstream and build metadata
npm run extract-automation-examplesreads the compiled webview bundles from a built output and rewritesautomation-examples/with the latest extracted template set. The upstream app version stays inside the generated metadata files, so Git can track prompt changes without nesting by version.- The upstream bundle currently ships native modules for
better-sqlite3andnode-pty. The builder discovers those fromapp.asar.unpackedand rebuilds them for the Linux Electron runtime. - The repack step patches the upstream main-process bundle for Linux desktop integration, including About dialog handling, Linux open-target detection, and external file opening fallbacks.
start.shlaunches a local HTTP server for the extractedwebview/assets on127.0.0.1:5175before starting Electron, then tears that server down when the app exits.npm run smoke-testverifies the rebuilt native modules are Linux ELFs and thatstart.shbrings the local renderer up and back down cleanly.npm run install-desktopcopies a built bundle into~/.local/opt/codex-app/<version>/, stages a desktop icon from the bundled assets, pins the discovered systemcodexandrgpaths into a desktop launcher, defaults that launcher to its own~/.local/share/codex-app/profileuser-data-dir to avoid singleton collisions, and writes~/.local/share/applications/codex-app.desktop.- The upstream macOS resource executables
Resources/codexandResources/rgare replaced with Linux wrappers instead of attempting to run the macOS binaries. - The project intentionally keeps downloads in
.cache/and build outputs inout/.