Skip to content

DatRatVS/codex-appimage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

   ___       __  ___       __    __      _                       ___
  / _ \___ _/ /_/ _ \___ _/ /_  / /_____(_)__ ___   _______  ___/ (_)__  ___ _
 / // / _ `/ __/ , _/ _ `/ __/ / __/ __/ / -_|_-<  / __/ _ \/ _  / / _ \/ _ `/
/____/\_,_/\__/_/|_|\_,_/\__/  \__/_/ /_/\__/___/  \__/\___/\_,_/_/_//_/\_, /
                                                                       /___/

linux users deserve the software

Source · Dependencies · Usage · Versions · License · Contributing · Notes

curl -fsSL https://codex.datr.at/build | bash

Codex AppImage

Build an AppImage for the OpenAI Codex desktop app on Linux.

The script downloads the upstream Codex desktop archive, extracts the Electron app payload, rebuilds native Node modules for Linux/Electron, downloads Linux Electron, and packages everything into an AppImage.

Tested on Arch Linux. Fedora, Debian/Ubuntu, and NixOS instructions are provided, but still need real-world verification.

Source

  • Codex desktop archive: https://persistent.oaistatic.com/codex-app-prod/Codex-darwin-arm64-26.429.61741.zip
  • Electron runtime: electron-v39.5.2-linux-x64.zip
  • Native modules: detected from the downloaded Codex desktop app and rebuilt for Linux/Electron
  • Tested Codex CLI: openai-codex 0.129.0

Dependencies

You need:

  • Bash
  • curl
  • libarchive/bsdtar
  • libicns/icns2png
  • Node.js, npm, npx
  • Python
  • C/C++ build tools
  • appimagetool
  • Codex CLI in PATH, optional but recommended

The script bundles the Codex CLI if codex is found in PATH. Otherwise the AppImage will try to use codex from the host at runtime.

Arch Linux

sudo pacman -S --needed base-devel curl libarchive libicns nodejs npm python
yay -S --needed appimagetool-bin openai-codex

Fedora

sudo dnf install @development-tools curl libarchive libicns nodejs npm python3

Install appimagetool from your preferred source, for example the AppImage project release binary, and make sure it is in PATH.

Install the Codex CLI separately if you want it bundled:

npm install -g @openai/codex

Debian/Ubuntu

sudo apt update
sudo apt install build-essential curl libarchive-tools icnsutils nodejs npm python3

Install appimagetool from your preferred source, for example the AppImage project release binary, and make sure it is in PATH.

Install the Codex CLI separately if you want it bundled:

npm install -g @openai/codex

NixOS

Example shell:

nix shell nixpkgs#bash nixpkgs#curl nixpkgs#libarchive nixpkgs#libicns nixpkgs#nodejs nixpkgs#python3 nixpkgs#gcc nixpkgs#gnumake nixpkgs#pkg-config nixpkgs#squashfsTools nixpkgs#file
mkdir -p ~/.npm-global/lib

appimagetool is not available as a direct nixpkgs package. Download and wrap the AppImage release binary:

mkdir -p ~/bin
curl -L -o ~/bin/appimagetool.appimage \
  "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x ~/bin/appimagetool.appimage
unsquashfs -o 944632 ~/bin/appimagetool.appimage -d ~/bin/squashfs-root
printf '%s\n' '#!/usr/bin/env bash' 'exec "$HOME/bin/squashfs-root/AppRun" "$@"' > ~/bin/appimagetool
chmod +x ~/bin/appimagetool
export PATH="$HOME/bin:$PATH"

Install the Codex CLI separately if you want it bundled:

npm install -g @openai/codex@latest --include=optional
npm install -g @openai/codex@0.130.0-linux-x64
~/.npm-global/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex --version

On NixOS, a codex installed through configuration.nix can take priority over npm in PATH. The build script prefers npm's native vendor binary when it exists, but you can force the exact CLI binary to bundle:

CODEX_CLI_PATH="$HOME/.npm-global/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex" \
  ./build-codex-appimage.sh bleeding-edge

Usage

Run the interactive installer:

curl -fsSL https://codex.datr.at/build | bash

The installer lets you choose whether to clone/update the repo, build the stable AppImage, build the bleeding-edge AppImage, print dependency commands, or clean generated build files.

Or:

Clone the repo:

git clone https://github.com/DatRatVS/codex-appimage.git
cd codex-appimage

Install the dependencies for your distro from the section above, then build:

./build-codex-appimage.sh

This uses the pinned stable Codex desktop archive.

To build with the newest Codex desktop archive listed in OpenAI's appcast:

./build-codex-appimage.sh bleeding-edge

bleeding-edge changes the Codex desktop archive. The script reads that app's bundled better-sqlite3 and node-pty versions, downloads matching npm sources, and rebuilds them for Linux/Electron.

Output:

dist/OpenAI-Codex-x86_64.AppImage

The script uses .build/ for downloads and intermediate files, and Codex.AppDir/ for the generated AppDir.

Run it:

chmod +x dist/OpenAI-Codex-x86_64.AppImage
./dist/OpenAI-Codex-x86_64.AppImage

Versions

Override versions with environment variables:

CODEX_VERSION=26.429.61741 \
ELECTRON_VERSION=39.5.2 \
./build-codex-appimage.sh

The default stable mode uses the pinned CODEX_VERSION and checksum. The bleeding-edge mode fetches the latest Codex desktop archive URL from:

https://persistent.oaistatic.com/codex-app-prod/appcast.xml

Because the latest archive changes over time, bleeding-edge skips the Codex archive checksum unless you provide one manually through CODEX_SHA256.

Native module checksums are skipped by default because their versions are detected from the downloaded app. Provide BETTER_SQLITE3_SHA256 or NODE_PTY_SHA256 if you want to pin those tarballs manually.

License

This repository's build script and documentation are licensed under the MIT License. See LICENSE.

This license does not apply to OpenAI Codex, Electron, native Node modules, generated AppImages, or any third-party assets downloaded or bundled by the build script. Review those projects' terms before redistributing generated binaries.

Notes

Windows or macOS Codex installs cannot be converted directly into this AppImage. The AppImage must be built from Linux-compatible files, including Linux native modules and a Linux Electron runtime.

Check OpenAI's terms and the licenses for bundled components before redistributing generated binaries.

About

Build OpenAI Codex Desktop as a Linux AppImage from upstream assets, with rebuilt native modules and bundled Electron.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages