web/src/app/craft/README.md
</a>
Onyx Craft is an AI coding agent that creates web applications, documents, presentations, and more using your company's indexed knowledge. Users describe what they want in natural language, and the agent builds artifacts in an isolated sandbox environment with access to documents from connected sources like Linear, Slack, Google Drive, Confluence, and more.
For detailed documentation, visit our docs.
You can install Onyx Craft using our quickstart script:
curl -fsSL https://raw.githubusercontent.com/onyx-dot-app/onyx/main/deployment/docker_compose/install.sh > install.sh \
&& chmod +x install.sh \
&& ./install.sh --include-craft
This will:
ENABLE_CRAFT=true and SANDBOX_BACKEND=docker in the .env fileIMAGE_TAG to the Craft-enabled backend image (Node.js + opencode CLI baked in)docker-compose.craft.yml overlay so api_server / background can talk to the Docker socketonyx_craft_sandbox bridge network used to isolate sandbox containersRe-run the installer with --include-craft on top of an existing deployment — it patches the .env, pulls down the craft overlay, and recreates the relevant containers. Setting ENABLE_CRAFT=true by hand without re-running the installer leaves the Docker socket unmounted and sandboxes will fail to provision.
/craft/v1 — A sandbox is pre-provisioned in the backgroundCraft supports two sandbox backends controlled by SANDBOX_BACKEND:
Self-Hosted
SANDBOX_BASE_PATH (default: /tmp/onyx-sandboxes)Cloud (Production)
sandbox — Runs OpenCode agent and Next.js preview serverfile-sync — Sidecar for S3 file synchronizationSessions go through these states:
| State | Description |
|---|---|
| Provisioning | Sandbox being created when user visits /craft |
| Ready | Sandbox ready, waiting for first message |
| Running | Active session with agent processing |
| Idle | No recent activity |
| Sleeping | Idle timeout reached, pod terminated (K8s only), snapshot saved |
| Restored | User returns, snapshot loaded, session continues |
Each session gets an isolated workspace:
$SANDBOX_ROOT/
├── files/ # Symlink to user's knowledge files
└── sessions/
└── {session_id}/
├── outputs/web/ # Next.js application
├── .venv/ # Python environment
├── .opencode/skills/ # Agent skills
├── attachments/ # User uploads
├── AGENTS.md # Agent instructions
└── opencode.json # LLM configuration
Idle sandboxes are cleaned up by a Celery background task:
SANDBOX_IDLE_TIMEOUT_SECONDS (default: 1 hour)Key configuration categories (see source for full reference):
ENABLE_CRAFT, SANDBOX_BACKEND (local vs kubernetes)Frontend
Backend
Agent
Sandbox Environment
See the main CONTRIBUTING.md for guidelines.
For Craft-specific development:
ENABLE_CRAFT=true in your environment/templates/outputs and /templates/venv/tmp/onyx-sandboxesMIT — see LICENSE