Skip to main content
The hx CLI covers the sandbox workflows in this section: profile setup, sandbox creation, network policies, volume management, process execution, file transfer, terminals, snapshots, image builds, and port exposure. Use the CLI when you want a shell-first workflow or need to script sandbox operations outside the SDKs. For the underlying API concepts, see Creating sandboxes, Network policies, Volumes, Sandbox lifecycle, Sandbox processes, Local filesystem, Base images, Custom images, and Sandbox terminal. For Mac creation, desktop sharing, and persistent disk commands, see macOS sandboxes (Beta). macOS is enabled for teams on request. For GPU image builds and creation, use hx 0.1.25 or later and follow GPU sandboxes. Contact us to enable GPU access for your team.

Install

See Install for macOS, Linux, Windows, and direct-download instructions.

Configure Profiles

Login with your account
Login with and save credentials to a profile:
List saved profiles and run a command with a specific profile:
The CLI uses the default profile unless you pass --profile. hx configure prompts for an API key if --api-key is omitted and stores profiles in ~/.hx_config/config.

Open The Dashboard

Launch the interactive dashboard:
hx dash requires an interactive terminal. Running hx without a subcommand shows help; it does not open the dashboard automatically.

Manage Volumes

Create, list, inspect, and delete persistent volumes:
Attach a volume at sandbox launch:
See Managing Volumes and Mounting Volumes for API-level rules.

Manage Secrets

Store encrypted values and pass them to sandbox processes as environment variables. Values are read from a file or stdin, encrypted locally, and never shown again:
Group secrets in a vault and pass them all by name. --secret is merged over the vault and wins on a clash. --entry sets or replaces a variable and --remove drops one. A secret a vault uses can’t be deleted until the vault stops using it:
Read fields from 1Password when a process starts, signing in with a service account token stored as an op_token secret. --1password-field is repeatable and takes ENV=item/[section/]field:
See Secrets for delivery rules and limits, and 1Password for references and errors.

Fill Credentials Into Browser Sessions

Store each part of a website login as a secret with allowed origins, group them in a vault, and fill them into a browser session’s login form:
To fill from 1Password, attach the op_token secret and name the allowed origins with the fill. The nth --1password-ref (item/[section/]field) fills the nth --selector:
See Credential fill for outcomes, allowed origins, one-time codes and tab choice.

Create Sandboxes

Launch from an image:
Launch from a snapshot:

Manage Outbound Network Access

Set a network policy when creating a sandbox:
Update a running sandbox or restore the default outbound policy:
Each --allow-out or --deny-out flag may be repeated. Network updates apply to new connections; established connections may continue until they close. See Network Policies for rule precedence, target formats, and domain behavior.

Build and list images

Building from a local Docker image requires local Docker. With --remote, the CLI uploads a Dockerfile build context and builds it remotely without local Docker.
Build a Firecracker image from a local Docker image:
List available images:
hx vm image wait supports --wait-timeout and --poll-interval when you want to control how long the CLI waits and how often it polls build status.
GPU images require --remote --enable-gpu-builds. Use hx vm image wait to wait for GPU publication as well as build completion. See Custom images for build methods and readiness.

Create GPU sandboxes

Use --region us and a GPU-ready image built by your team. --memory sets system RAM; GPU memory is determined by the GPU type. --disk defaults to 12 GiB for GPU sandboxes and must be at least 12 GiB. Follow the GPU guide for the complete build, create, run, and stop sequence.

Inspect, Stop, And Expose Sandboxes

List and inspect sandboxes:
Stop a sandbox:
Expose or remove an exposed sandbox port:
hx vm expose currently accepts exactly one --port value. Use <port>:auth or <port>:public when you want to override the default auth mode from --auth.
Sandbox workflows are grouped under the hx vm namespace (for example hx vm create, hx vm process, hx vm connect, and hx vm volumes).

Run Commands

Run a one-shot command inside a sandbox:

Manage Long-Running Processes

Start a background process:
Inspect, wait for, and stream a process:
Send input or terminate a process:

Work With Files

Copy files and directories between your machine and a sandbox:
Read a file directly from a sandbox:
The <sandbox-id>:/path shorthand is only supported by hx vm cp. hx vm read expects the sandbox ID and path as separate arguments.

Open An Interactive Terminal

Open a terminal in a selected sandbox:
Open a terminal in a specific sandbox:
Override the default command or set a working directory:
By default, hx vm connect starts /bin/bash -i -l.

Create And Restore Snapshots

Create a memory snapshot from a running sandbox:
List snapshots:
Restore from a snapshot:

JSON Output

Most commands support --json for scripting: