codex-universal

repository·main·Indexed 21 days ago

https://github.com/openai/codex-universal

A reference implementation of the Docker image used in OpenAI Codex, designed for developers to customize and debug environments locally. It supports configuring specific language runtimes for Python, Node.js, Rust, Go, Swift, Ruby, PHP, and Java via CODEX_ENV_* environment variables, and includes pre-installed packages such as bun, bazel, erlang, and elixir.

Tokens
821
Snippets
2
Records
4
Agent score
26%

What's inside codex-universal

  1. Run codex-universal locally with custom language versions

    main

    You can run the codex-universal image and approximate the OpenAI Codex setup environment by passing CODEX_ENV_* environment variables.

    To ensure your local files are accessible within the container, the following pattern mounts your current working directory to /workspace/$(basename $(pwd)) and sets that as the working directory.

    Note: The image is built for both linux/amd64 and linux/arm64, but the repository primarily runs the linux/amd64 version. If you are on an ARM-based machine, you may need to use the --platform linux/amd64 flag for emulation.

    # See below for environment variable options.
    # This script mounts the current directory similar to how it would get cloned in.
    docker run --rm -it \
        -e CODEX_ENV_PYTHON_VERSION=3.12 \
        -e CODEX_ENV_NODE_VERSION=20 \
        -e CODEX_ENV_RUST_VERSION=1.87.0 \
        -e CODEX_ENV_GO_VERSION=1.23.8 \
        -e CODEX_ENV_SWIFT_VERSION=6.2 \
        -e CODEX_ENV_RUBY_VERSION=3.4.4 \
        -e CODEX_ENV_PHP_VERSION=8.4 \
        -v $(pwd):/workspace/$(basename $(pwd)) -w /workspace/$(basename $(pwd)) \
        ghcr.io/openai/codex-universal:latest
  2. Configure language runtimes via environment variables

    main

    The codex-universal image includes setup scripts that detect CODEX_ENV_* environment variables to install specific language versions and associated tools.

    Supported Environment Variables and Versions:

    Environment variableDescriptionSupported versionsAdditional packages
    CODEX_ENV_PYTHON_VERSIONPython version3.10, 3.11.12, 3.12, 3.13, 3.14.0pyenv, poetry, uv, ruff, black, mypy, pyright, isort
    CODEX_ENV_NODE_VERSIONNode.js version18, 20, 22corepack, yarn, pnpm, npm
    CODEX_ENV_RUST_VERSIONRust version1.83.0, 1.84.1, 1.85.1, 1.86.0, 1.87.0, 1.88.0, 1.89.0, 1.90, 1.91.1, 1.92.0, 1.93.0, 1.94.0, 1.95.0
    CODEX_ENV_GO_VERSIONGo version1.22.12, 1.23.8, 1.24.3, 1.25.1
    CODEX_ENV_SWIFT_VERSIONSwift version5.10, 6.1, 6.2
    CODEX_ENV_RUBY_VERSIONRuby version3.2.3, 3.3.8, 3.4.4
    CODEX_ENV_PHP_VERSIONPHP version8.4, 8.3, 8.2
    CODEX_ENV_JAVA_VERSIONJDK version25, 24, 23, 22, 21, 17, 11