Skip to main content

CLI Reference 💻

The sandforge command-line utility provides terminal commands to start secure hypervisor control servers and run transient sandboxed tasks.


🛠️ CLI Global Options

Usage:
sandforge [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
run Run a transient command in an isolated sandbox
server Run the API control plane server

Flags:
-h, --help help for sandforge

🚀 1. sandforge run

Launches an isolated virtual guest VM, executes the specified command, streams stdout/stderr outputs, and terminates the guest environment upon exit.

sandforge run [flags] <cmd> [args...]

Flags

Long FlagShort FlagDescriptionDefault
--cpu <n>-cNumber of virtual CPU cores2
--mem <mb>-mMemory size in Megabytes2048
--dir <path>-dHost workspace directory to mount into guest.
--network <mode>-nNetwork mode: offline or fetchoffline
--timeout <secs>-tMaximum execution timeout in seconds300
--mock(None)Use in-memory Mock backend instead of real hypervisorfalse
--help-hDisplay detailed subcommand help

Examples

Run offline Python script inside local directory (using short flags)

./sandforge run -c 2 -m 2048 -d . python3 main.py

Run with network access and custom timeout (using POSIX flags)

./sandforge run --network fetch --timeout 600 go build ./...

Test using the in-memory Mock backend

./sandforge run --mock -- echo "Hello from sandbox"

🛰️ 2. sandforge server

Launches the background Control Plane daemon, serving the REST HTTP API and managing the active hypervisor instances.

sandforge server [flags]

Flags

Long FlagShort FlagDescriptionDefault
--addr <address>-aTCP address for the API server to listen on:8080
--help-hDisplay detailed subcommand help

Example

./sandforge server -a :8080