Connect the CLI
Run a sandbox from the shell with the Hermitbox CLI.
Run any command in a fresh sandbox from your shell, or keep a sandbox and work in it step by step. If the CLI isn’t installed yet, run the one-command installer.
To use a Hermitbox installed elsewhere from another Linux machine (x86_64 or aarch64, which npm
calls x64 and arm64), install only the CLI, from npm:
npm install -g @hermitbox/cliQuickstart
hermitbox run -- echo hellohermitbox run creates a sandbox, runs the command in it, prints hello and deletes the sandbox.
On the machine where you installed Hermitbox, the CLI uses the saved credentials by itself. From
another machine, set HERMITBOX_API_URL and HERMITBOX_API_KEY.
Sleep and wake with state kept
A sandbox you keep holds its files while it sleeps. Create one, write a file in its data directory, put it to sleep, wake it and read the file back:
id=$(hermitbox sandbox create | jq -r .id)
hermitbox sandbox exec "$id" -- sh -c 'echo "saved before sleep" > notes.txt'
hermitbox sandbox sleep "$id"
hermitbox sandbox wake "$id"
hermitbox sandbox exec "$id" -- cat notes.txt
hermitbox sandbox rm "$id"Output includes:
saved before sleepSee the CLI reference and host boundaries.
$curl -fsSL https://hbx.sh | shInstall Hermitbox and set it up for me