This repository adapts the official macOS Codex Desktop distribution to Linux by:
- downloading the upstream
Codex.dmg - extracting
app.asar - rebuilding macOS-native modules as Linux ELF binaries
- patching Linux-incompatible Electron code paths
- packaging a portable Linux artifact and an installable Arch Linux package
The project remains an unofficial port. The technical approach works, but it is inherently coupled to upstream bundle internals and should be treated as a maintained compatibility layer, not a stable public API.
What is validated:
- the repository now builds a prebuilt native Linux release from a tagged pipeline
- release notes are generated automatically from commit history between tags
- CI runs workflow linting, shell validation, portable packaging, release-contract checks, and Arch install/launch smoke tests on GitHub Actions
- the built-in file manager works on Linux and can open both file locations and individual files
- voice input works on Linux
- the current Linux build avoids the graphical glitches that are common in other unofficial Codex Desktop Linux solutions
What is still fragile by design:
- patching happens against a minified upstream
main.js - upstream changes can break string-based patches without warning unless the guard checks catch them
- the runtime is Linux
x64only at the moment
The detailed technical audit lives in docs/REPOSITORY_AUDIT.md.
node,npm,pnpmpython37zfile- base toolchain (
build-essentialon Debian/Ubuntu,base-develon Arch)
git clone https://github.com/mazixs/codex-desktop.git
cd codex-desktop/codex-linux-build
pnpm install --frozen-lockfile
pnpm run build
./start.shTo create the same portable artifact used in releases:
pnpm run package:portableArtifacts are written to codex-linux-build/artifacts/.
To produce the Arch Linux package locally after the portable archive is ready:
./scripts/build-arch-package.sh \
--source codex-linux-build/artifacts/*.tar.gz \
--metadata codex-linux-build/artifacts/build-metadata.env \
--output-dir codex-linux-build/artifactsThe repository now uses a tag-driven release process:
git tag v1.0.0
git push origin v1.0.0After the tag is pushed:
- GitHub Actions builds the portable Linux archive
codex-desktop-native-<upstream-version>-linux-portable-x64.tar.gz - a second job turns that artifact into the installable Arch Linux package
codex-desktop-native-<upstream-version>-archlinux-x86_64.pkg.tar.zst scripts/generate-release-notes.shcollects commit subjects and bodies since the previous tag and derives platform-specific asset names frombuild-metadata.env- the workflow creates or updates the GitHub Release and uploads both packages plus checksums
The CI/CD details are documented in docs/CI_CD.md. Each tagged release now publishes both a portable Linux archive and an Arch Linux installer, both with bundled Electron.
The repository treats CI/CD as a product contract, not a best-effort build:
- Node is pinned to
24in GitHub Actions pnpmis activated only throughcorepackusing the version fromcodex-linux-build/package.json- workflow syntax is linted with
actionlint - the portable artifact must contain bundled Electron, Linux icons, packaged skill overrides, metadata, and a working launcher
- the Arch artifact must install through
pacman -U, contain the bundled runtime under/opt/codex-desktop, and survive a headless smoke launch - releases are only published after the asset contract, checksums, metadata, and release notes all validate
Repo-controlled regressions should fail with deterministic messages. External failures such as GitHub outages, upstream DMG CDN issues, or package mirror/network errors remain outside the repository's control and are treated as retriable infrastructure failures.
codex-linux-build/build toolchain, launcher, packaging logicscripts/repository-level automation such as release note generationdocs/architecture, reverse engineering notes, audit, and CI/CD documentationcodex_extracted/optional local extraction cache, ignored by git
- The upstream application is distributed for macOS, so Linux compatibility depends on reverse-engineered patch points.
- This repository does not publish an official upstream build; it automates a local adaptation.
- If upstream Electron internals, native module versions, or bundle structure change, the Linux build may need patch updates.
Repository code is provided under Apache-2.0. Upstream Codex application binaries remain subject to OpenAI's terms.
