Implementation:AI Builder Club Skills cbx sh
| Knowledge Sources | |
|---|---|
| Domains | Cloud_Infrastructure, Agent_Engineering |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
Concrete tool for managing isolated cloud dev boxes per agent via crabbox + Daytona, provided by the crabbox-setup skill.
Description
The cbx.sh script is a front-door wrapper around crabbox + Daytona that handles the provider's limitations: 60-second exec cap (backgrounds setup.sh + polls for STACK READY), no auto-stop (explicit down required), no cp (file pull via base64), and lease ID resolution (so down+up never targets the wrong box). It sources .env for secret forwarding and provides subcommands: up (lease box + run setup.sh + wait for READY), logs, tunnel (SSH tunnel for local browser), pw (run playwright-cli in the box), get (pull file off box), and down.
Usage
Use this when loops run concurrently — one laptop cannot host N full stacks (fixed ports, one Docker daemon, one DB). Each agent gets its own isolated stack + in-box browser via crabbox, so parallel verification never collides. The verifier_setup_skill references this for crabbox run mode.
Code Reference
Source Location
- Repository: AI Builder Club Skills
- File: skills/crabbox-setup/assets/cbx.sh
Signature
# Subcommands:
cbx.sh up <name> # Lease box + run setup.sh (bg+poll) → STACK READY
cbx.sh logs <name> # Tail the setup log on the box
cbx.sh tunnel <name> & # SSH tunnel: localhost → box (local browser)
cbx.sh pw <name> -- <args> # Run playwright-cli IN the box
cbx.sh get <name> <remote> <local> # Pull a file off the box (base64)
cbx.sh down <name> # Release the box (Daytona has NO auto-stop)
# Key config (EDIT section):
PROVIDER=daytona
APP_PORT=3000
TUNNEL_PORTS="3000:localhost:3000"
READY_MARKER="STACK READY"
Import
# Run from the project root (needs .env for secrets):
bash cbx.sh up myagent
bash cbx.sh pw myagent -- --screenshot http://localhost:3000
bash cbx.sh down myagent
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | str | Yes | Box slug name (e.g. myagent)
|
| PROVIDER | str | Config | Cloud provider (default: daytona)
|
| APP_PORT | int | Config | Dev server port on the box (default: 3000) |
| TUNNEL_PORTS | str | Config | SSH -L specs for tunnel (e.g. "3000:localhost:3000")
|
| .env | file | Yes | Secrets forwarded to the box |
Outputs
| Name | Type | Description |
|---|---|---|
| .cbx-{name}.id | file | Canonical lease ID (cbx_hex), used by all subsequent commands |
| STACK READY | stdout marker | Emitted by setup.sh when stack is fully up on the box |
| Box filesystem | remote | Full dev stack running in isolated cloud box |
Usage Examples
Full Box Lifecycle
# 1. Lease a box and bring up the stack
bash cbx.sh up agent1
# ▸ leasing box…
# ▸ waiting for the box to be ready…
# ▸ starting setup.sh on the box (backgrounded)…
# ▸ waiting for STACK READY (first run pulls images — a few min)…
# ✓ STACK READY — app on the box at localhost:3000
# 2. Run Playwright in the box (for verification)
bash cbx.sh pw agent1 -- --screenshot http://localhost:3000 evidence.png
# 3. Pull evidence off the box
bash cbx.sh get agent1 /tmp/evidence.png ./evidence.png
# 4. Tunnel for local browser access
bash cbx.sh tunnel agent1 &
# ▸ tunneling -L 3000:localhost:3000 → open http://localhost:3000
# 5. Release the box (Daytona has NO auto-stop!)
bash cbx.sh down agent1