The msb CLI lets you create, manage, and interact with sandboxes from the terminal. It auto-detects TTY and interactivity, so no -it flags are needed. If your terminal is interactive, msb acts accordingly.
Install
curl -fsSL https://get.microsandbox.dev | sh
microsandbox requires Linux with KVM enabled, or macOS with Apple Silicon (M-series chip). Both use hardware virtualization.
Quick reference
# Run a one-off command (ephemeral, auto-removed)
msb run python:3.11 -- python -c "print('Hello!')"
# Interactive shell (auto-detects TTY)
msb run alpine:latest -- sh
# Create a persistent sandbox
msb run --name devbox ubuntu:22.04 -- bash
# Resume later
msb start devbox
msb shell devbox
# Execute in a running sandbox
msb exec devbox -- ls -la /app
# Manage
msb ls # List all sandboxes
msb ps # Running sandboxes only
msb inspect devbox # Detailed info
msb stop devbox # Graceful shutdown
msb rm devbox # Remove stopped sandbox
# Images
msb pull python:3.11 # Pre-pull to cache
# Volumes
msb volume create data --size 10G
msb volume ls
msb volume rm data
Unnamed sandboxes (no --name flag) are ephemeral. They’re automatically removed when the command finishes. Named sandboxes persist and can be stopped, restarted, and inspected later.
Global options
| Flag | Description |
|---|
--tree | Display the complete command tree with descriptions |
--error | Show only errors |
--warn | Show warnings and errors |
--info | Show info, warnings, and errors |
--debug | Show debug output |
--trace | Show all output including trace |
Command tree
Use --tree as an alternative to --help to see every command, subcommand, and flag at once:
You can scope it to a specific subcommand:
msb image --tree # Show only image commands
msb volume --tree # Show only volume commands
msb run --tree # Show all flags for run
For detailed command reference, see Sandbox Commands, Volume Commands, and Image Commands.