1d3a412c4d
* docs: comprehensive docs site refactoring - Replace 856-line manifest auto-generation with direct VitePress docs - Restructure from flat 4-section layout to 10-section information architecture (Getting Started, Architecture, Guides, SDKs, Components, Kubernetes, API, CLI, Examples, Community) - Establish single source of truth: docs/ owns user-facing content, READMEs are slim pointers - Remove incomplete Chinese i18n (30-40% coverage), keep English only - Add VitePress features: custom containers, code groups, edit links, footer, dark mode - Simplify build: just `vitepress build`, no docs:sync or docs:spec preprocessing - Add documentation rules to AGENTS.md and CLAUDE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: simplify CLAUDE.md to point at AGENTS.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve 38 broken links, stale paths, and content issues across docs - Fix 16 broken inbound links to moved docs pages (README, CONTRIBUTING, SECURITY, ROADMAP, GOVERNANCE, server/configuration, kubernetes/) - Move sandbox.kill() inside async-with block in quick start and README - Update execd paths from /opt/opensandbox/bin/ to /opt/opensandbox/ - Fix wrong batchsandbox-template GitHub raw URL - Remove references to deleted RELEASE_NOTE_TEMPLATE and removed scripts - Add missing cd context to server, egress, and MCP command snippets - Add missing OSEP-0012 (multi-tenancy) and OSEP-0013 to index - Fix timeout described as mandatory (it is optional) - Replace duplicated contributing/code-of-conduct with GitHub pointers - Fix broken Chinese doc references in SDK README_zh files - Remove dead Chinese docs link from README Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: align README links with versioned docs * docs: address remaining review comments * docs: clarify README ownership for components * docs: fix remaining navigation and example comments * docs: refine documentation ownership rules * docs: remove obsolete spec doc generator --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
title, description
| title | description |
|---|---|
| Codex CLI | Use the official @openai/codex npm package to call OpenAI/Codex-like models in OpenSandbox. |
Codex/OpenAI CLI Example
Use the official @openai/codex npm package to call OpenAI/Codex-like models in OpenSandbox.
Start OpenSandbox server [local]
Pre-pull the code-interpreter image (includes Node.js):
docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-interpreter:v1.1.0
# use docker hub
# docker pull opensandbox/code-interpreter:v1.1.0
Start the local OpenSandbox server, logs will be visible in the terminal:
uv pip install opensandbox-server
opensandbox-server init-config ~/.sandbox.toml --example docker
opensandbox-server
Create and Access the Codex Sandbox
# Install OpenSandbox package
uv pip install opensandbox
# Run the example (requires SANDBOX_DOMAIN / SANDBOX_API_KEY / OPENAI_API_KEY)
uv run python examples/codex-cli/main.py
The script installs the Codex CLI (npm install -g @openai/codex@latest) at runtime (Node.js is already in the code-interpreter image), then executes a simple request codex exec "Compute 1+1 and return JSON with keys result and reasoning." --skip-git-repo-check. Auth is passed via OPENAI_API_KEY; you can override endpoint/model with OPENAI_BASE_URL / OPENAI_MODEL.
Environment Variables
| Variable | Default | Description |
|---|---|---|
SANDBOX_DOMAIN |
localhost:8080 |
Sandbox service address |
SANDBOX_API_KEY |
(optional for local) | API key if your server requires authentication |
SANDBOX_IMAGE |
sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-interpreter:v1.1.0 |
Sandbox image to use |
OPENAI_API_KEY |
(required) | Your OpenAI API key |
OPENAI_BASE_URL |
https://api.openai.com/v1 |
OpenAI API endpoint |
OPENAI_MODEL |
gpt-4o-mini |
Model to use |
References
- @openai/codex - Official OpenAI Codex CLI
- Source code on GitHub