OpenAI Codex CLI inside an aicodebox container. One image, five ways in: interactive shell, one-shot exec, OpenAI-compatible endpoint, MCP server, Telegram bot, and a cron scheduler. You talk to codexbox; codexbox talks to codex; codex talks to OpenAI — or your ChatGPT subscription.
- ✓License: WTFPL
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
- !Install pipes a remote script into a shell (curl | sh)
claude mcp add docker-codexbox -- uvx docker-codexbox{
"mcpServers": {
"docker-codexbox": {
"command": "uvx",
"args": ["docker-codexbox"],
"env": {
"OPENAI_API_KEY": "<openai_api_key>",
"CODEXBOX_API_MODE_TOKEN": "<codexbox_api_mode_token>",
"CODEXBOX_TELEGRAM_MODE_TOKEN": "<codexbox_telegram_mode_token>",
"CODEXBOX_MCP_MODE_TOKEN": "<codexbox_mcp_mode_token>"
}
}
}
}OPENAI_API_KEYCODEXBOX_API_MODE_TOKENCODEXBOX_TELEGRAM_MODE_TOKENCODEXBOX_MCP_MODE_TOKENMCP Servers overview
# docker-codexbox [](https://github.com/psyb0t/docker-codexbox/actions/workflows/pipeline.yml) [](https://github.com/psyb0t/docker-codexbox/releases) [](LICENSE) [](https://hub.docker.com/r/psyb0t/codexbox) [OpenAI Codex CLI](https://github.com/openai/codex) inside an [aicodebox](https://github.com/psyb0t/docker-aicodebox) container. Minimal and toolchain-loaded images, five ways in: interactive shell, one-shot exec, OpenAI-compatible endpoint, MCP server, Telegram bot, and a cron scheduler that fires codex on whatever schedule you want. You talk to codexbox. codexbox talks to codex. codex talks to OpenAI — or your ChatGPT subscription. Nobody cares about the middle. ## Table of Contents - [Quick start](#quick-start) - [Using the `codexbox` wrapper](#using-the-codexbox-wrapper) - [Image variants](#image-variants) - [Modes](#modes) - [API mode](docs/modes/api.md) - [Telegram mode](docs/modes/telegram.md) - [Cron mode](docs/modes/cron.md) - [MCP mode](docs/modes/mcp.md) - [Configuration](#configuration) - [Auth](#auth) - [Agent integrations](#agent-integrations) - [Development](#development) - [Tests](#tests) - [License](#license) ## Quick start Docker installed and running is the only prerequisite. ### One-liner install The installer pulls the selected image, creates the persistent Codex and SSH directories, downloads the wrapper, and installs `codexbox` on your `PATH`. ```bash # minimal image — default curl -fsSL https://raw.githubusercontent.com/psyb0t/docker-codexbox/master/install.sh | bash # full image — every development tool pre-installed export CODEXBOX_FULL=1 && curl -fsSL https://raw.githubusercontent.com/psyb0t/docker-codexbox/master/install.sh | bash # custom command name curl -fsSL https://raw.githubusercontent.com/psyb0t/docker-codexbox/master/install.sh | bash -s -- codex ``` Installing with `CODEXBOX_FULL=1` bakes `latest-full` into the wrapper, so the choice persists; you do not need to export it again. `CODEXBOX_FULL` must be set for `bash`, not merely for `curl`, hence the `export … &&` form above. ### Local checkout From a checkout of this repository, build the matching image and install the local wrapper without pulling a published codexbox image: ```bash make install # minimal image make install-full # full image # install only the local wrapper; do not build or pull make install-wrapper CODEXBOX_FULL=1 make install-wrapper # full image ``` These targets set `CODEXBOX_SRC_LOCAL=true`. `make install` and `make install-full` build their image first; `make install-wrapper` only installs the local `wrapper.sh` against the selected existing image. It fails if that image is absent instead of falling back to `docker pull`. ## Using the `codexbox` wrapper The wrapper mounts the current directory as the workspace, persists `~/.codex` (so login survives container recreation), forwards auth and configured environment variables, and manages a per-directory container. ```bash export OPENAI_API_KEY=sk-... # or use a subscription: `codexbox login --device-auth` codexbox # interactive TUI — continues the last session for THIS dir codexbox --no-continue # same, but starts a brand-new session instead codexbox exec "fix the failing test in ./app" # one-shot codex exec, output to your terminal echo "summarize README.md" | codexbox exec - # prompt via stdin codexbox login --device-auth # ChatGPT-subscription OAuth login (persists in ~/.codex) codexbox login status # which auth mode is active codexbox --version # passthrough to `codex --version` codexbox stop # stop this dir's running container(s) codexbox clear-session # drop codex's saved sessions (keeps auth + config) ``` The wrapper forwards `"$@"` straight to the image, so any `codex` subcommand works (`codexbox mcp ...`, `codexbox doctor`, etc.). The sandbox-bypass flag is injected inside the container — you never pass it yourself. The bare interactive TUI defaults to **continuing the most recent session for the directory you're in** (same idea as claudebox's default) — codex's own `resume --last` cwd-scopes the lookup and starts a fresh session automatically when there's nothing to resume, so this is safe on a brand-new workspace too. Pass `--no-continue` to force a fresh session instead. ### Manual Docker use Use raw Docker only when you intentionally do not want the wrapper, such as a one-shot run or a long-running API service. The [Modes](#modes) section has the relevant commands and configuration. ## Image variants - `psyb0t/codexbox:latest` is the default minimal image: Codex, Node.js, Python, `uv`, Docker, Git, `jq`, and `curl`. - `psyb0t/codexbox:latest-full` starts from the immutable `aicodebox:v0.15.0-full` base, then adds Codexbox's adapter, entrypoint, auth, and config. `CODEXBOX_FULL` is binary: unset or `0` selects minimal; `1` selects full. Any other value fails. The installer writes the resolved image into the installed wrapper, so the choice persists without exporting the variable on every run. A runtime `CODEXBOX_FULL=0` or `CODEXBOX_FULL=1` temporarily forces a variant; `CODEXBOX_IMAGE` remains the highest-priority explicit override. The full image adds: - Go 1.26.7 with gopls, Delve, golangci-lint, staticcheck, gofumpt, and test/code-generation helpers - Python 3.14.7 with pytest, Black, Flake8, mypy, Pyright, Poetry, Pipenv, and common HTTP/parsing libraries - JavaScript and TypeScript linting, formatting, process, framework, API-test, static-server, Lighthouse, and Storybook CLIs - GitHub CLI, Terraform, kubectl, and Helm - Build tools, CMake, ClangFormat, Valgrind, GDB, strace, and ltrace - PostgreSQL, MySQL, SQLite, and Redis clients - Vim, Nano, tmux, htop, archive tools, network diagnostics, ripgrep, fd, bat, eza, shellcheck, and shfmt The full variant is pinned to the released Aicodebox full manifest. Aicodebox owns the shared toolchain pins, locks, and supply-chain checks. Codexbox adds only its agent package and startup layer. **Licensing note:** the minimal image is clean — just Apache-2.0 Codex on top of the aicodebox base. The full image additionally bundles HashiCorp Terraform, which is BUSL-1.1 (source-available, non-compete), not OSI-approved open source. If that matters to your use case, stick to the minimal image or review the [BUSL-1.1 terms](https://github.com/hashicorp/terraform/blob/main/LICENSE) yourself before using `latest-full`. Full breakdown in [THIRD_PARTY.md](THIRD_PARTY.md). ### Wrapper environment variables Set these on the host before running `codexbox`: | Var | Default | What it does | |-----|---------|---------------| | `OPENAI_API_KEY` | — | API-key auth (seeded into `~/.codex/auth.json` on boot). Not needed for subscription login. | | `OPENAI_BASE_URL` | — | Point codex at an OpenAI-compatible endpoint | | `CODEXBOX_IMAGE` | installed image | Override the image the wrapper runs | | `CODEXBOX_FULL` | installed choice (`0` initially) | `0` forces minimal; `1` forces full | | `CODEXBOX_DATA_DIR` | `~/.codex` | Host dir mounted as `CODEX_HOME` (auth + config + sessions) | | `CODEXBOX_SSH_DIR` | `~/.ssh/codexbox` | SSH key dir mounted into the container (for git over SSH) | | `CODEXBOX_MAX_MEM` | `10g` | Per-container memory limit | | `CODEXBOX_CONTAINER_NAME` | derived from `$PWD` | Override the per-workspace container name | | `CODEXBOX_ENV_*` | — | Forward arbitrary env into the container (prefix stripped: `CODEXBOX_ENV_FOO=bar` → `FOO=bar`) | | `CODEXBOX_MOUNT_*` | — | Mount extra host dirs (`/host:/container` syntax, or a bare path for same-path-both-sides) | `CODEXBOX_MODE_CRON=1` + `CODEXBOX_MODE_CRON_FILE=/path/cron.yaml codexbox` starts the cron scheduler as a long-running background container instead. **Prefer no host install?** Everything the wrapper does is plain `docker run`; see [Manual Docker use](#manual-docker-use) and [Modes](#modes). ## Modes **Foreground modes** (API / Telegram / Cron) are mutually exclusive — except `CODEXBOX_TELEGRAM_MODE=1` + `CODEXBOX_CRON_MODE=1`, which run together (cron in-thread inside telegram). API wins if set alongside anything else. **MCP mode** (`CODEXBOX_MCP_MODE=1`) is independent — it coexists with whatever foreground mode is running. In API mode it's mounted at `/mcp` on the API port; in other modes it runs as a sidecar uvicorn on its own port. Each mode has its own page with full setup, env vars, and examples. ### [API Mode →](docs/modes/api.md) Long-lived FastAPI server on `:8080`. Agent runs (sync, async with run-id polling, cancellable), workspace file upload/download/list/delete with traversal checking, and an OpenAI-compatible `chat/completions` endpoint with streaming and client-executed tool calling. Codex's native `--output-schema` backs `jsonSchema`, so schema-conforming output needs no retries. ```yaml environment: - CODEXBOX_API_MODE=1 - CODEXBOX_API_MODE_TOKEN=your-secret - CODEXBOX_AVAILABLE_MODELS=gpt-5.1-codex,gpt-5.1-codex-mini ``` ### [Telegram Mode →](docs/modes/telegram.md) Talk to codex from Telegram. Per-chat isolated workspaces, allowed-chats and per-chat allowed-users gating, file ingestion, `[SEND_FILE: path]` to get files back, and per-chat `/model`, `/effort`, `/system_prompt`, `/append_system_prompt` overrides that persist across restarts. ```yaml environment: - CODEXBOX_TELEGRAM_MODE=1 - CODEXBOX_TELEGRAM_MODE_TOKEN=123456:ABC ``` ### [Cron Mode →](docs/modes/cron.md) YAML-defined scheduled jobs on 6-field croniter schedules. Per-run history dirs with `meta.json`
What people ask about docker-codexbox
What is psyb0t/docker-codexbox?
+
psyb0t/docker-codexbox is mcp servers for the Claude AI ecosystem. OpenAI Codex CLI inside an aicodebox container. One image, five ways in: interactive shell, one-shot exec, OpenAI-compatible endpoint, MCP server, Telegram bot, and a cron scheduler. You talk to codexbox; codexbox talks to codex; codex talks to OpenAI — or your ChatGPT subscription. It has 0 GitHub stars and its last recorded update is dated 2026-09-13.
How do I install docker-codexbox?
+
You can install docker-codexbox by cloning the repository (https://github.com/psyb0t/docker-codexbox) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is psyb0t/docker-codexbox safe to use?
+
Our security agent has analyzed psyb0t/docker-codexbox and assigned a Trust Score of 77/100 (tier: Trusted). See the full breakdown of passed checks and flags on this page.
Who maintains psyb0t/docker-codexbox?
+
psyb0t/docker-codexbox is maintained by psyb0t. The last recorded GitHub activity is dated 2026-09-13, with 0 open issues.
Are there alternatives to docker-codexbox?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy docker-codexbox to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/psyb0t-docker-codexbox)<a href="https://claudewave.com/repo/psyb0t-docker-codexbox"><img src="https://claudewave.com/api/badge/psyb0t-docker-codexbox" alt="Featured on ClaudeWave: psyb0t/docker-codexbox" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
The fastest path to AI-powered full stack observability, even for lean teams.