Kagex/Guides
CLI DocsObservability & API · 5 min read

sandboxctl & sandboxd Complete CLI Reference for Developers

Fast lookup reference covering every host daemon and sandbox lifecycle command across macOS, Linux, and Windows.

Control CLI
sandboxctl (28+ subcommands)
Host daemon
sandboxd (serve, install, doctor, token, setup-wsl)
Dry-run GC
sandboxctl gc --dry-run
Daily developer commands cheat sheet
sandboxd doctor && sandboxctl doctor
sandboxctl ps                                   # List running/paused VMs
sandboxctl shell "$ID"                          # Interactive guest bash session
sandboxctl exec "$ID" -- go test ./...          # One-off command execution
sandboxctl logs "$ID" && sandboxctl grep "$ID" FAIL
sandboxctl artifacts && sandboxctl undo art_...

Key Engineering Points · OpenAPI, Go/Python SDKs & WAL Storage

All 10 key points →
  • 1sandboxd serves a versioned REST/JSON + SSE API contracted cleanly in docs/openapi.yaml and live at GET /v1/openapi.yaml.
  • 2Public Go SDK in pkg/client requires zero cgo and handles automatic platform discovery across macOS, Linux, and Windows.
  • 3Python integration requires zero third-party pip packages — stdlib http.client + socket AF_UNIX / TCP streams SSE cleanly (docs/examples/python-harness/harness.py).
  • 4Asynchronous executions via wait=false stream chunked stdout, stderr, and final exit payloads over GET /v1/executions/{exec_id}/stream.
  • 5Oversized command logs stay searchable directly via GET /v1/executions/{exec_id}/grep without overflowing LLM token windows.
  • 6Persistence uses pure-Go SQLite (modernc.org/sqlite) in WAL mode with 1 writer and an 8-reader connection pool.

Safe Lifecycle & Backup Recovery Commands

From creating sandboxes to rolling back applied patches, every destructive action requires confirmation or creates logged recovery trails. sandboxd uninstall preserves data unless --purge is explicitly confirmed.

Cross-OS Parity

All subcommands work consistently across macOS Terminal, Linux bash, and Windows PowerShell (sandboxctl.exe / sandboxd.exe).

Inspect this architecture live in 3D

Step through MCP ingress, Ghost Secrets, CoW blades, and run sandboxctl commands interactively in your browser.

Frequently Asked Questions

Run sandboxctl shell <sbx_id> — supported across macOS, Linux, and Windows.