The msb CLI brings the familiar feel of package managers to sandbox development. Think of it like npm or cargo, but for sandboxes! Create a Sandboxfile, define your environments, and manage your sandboxes with simple commands.
Warning
microsandbox is beta software and not ready for production use.
msb initThis creates a Sandboxfile in the current directory, which serves as the configuration manifest for your sandbox environments.
msb add app \
--image python \
--cpus 1 \
--memory 1024 \
--start 'python -c "print(\"hello\")"'The command above registers a new sandbox named app in your Sandboxfile, configured to use the python image.
You should now have a Sandboxfile containing a sandbox named app:
cat Sandboxfile# Sandbox configurations
sandboxes:
app:
image: python
memory: 1024
cpus: 1
scripts:
start: python -c "print(\"hello\")"Tip
Run msb <subcommand> --help to see all the options available for a subcommand.
For example, msb add --help.
msb run --sandbox appor
msb r appor
msr appThis executes the default start script of your sandbox. For more control, you can directly specify which script to run — msr app~start.
When running project sandboxes, all file changes and installations made inside the sandbox are automatically persisted to the ./menv directory. This means you can stop and restart your sandbox any time without losing your work. Your development environment will be exactly as you left it.
For experimentation or one-off tasks, temporary sandboxes provide a clean environment that leaves no trace:
msb exe --image pythonor
msb x pythonor
msx pythonTemporary sandboxes are perfect for isolating programs you get from the internet. Once you exit the sandbox, all changes are completely discarded.
The msb install command sets up a sandbox as a system-wide executable. It installs a slim launcher program that allows you to start your sandbox from anywhere in your system with a simple command.
msb install --image alpineor
msb i alpineor
msi alpineAfter installation, you can start your sandbox by simply typing its name in any terminal:
alpineThis makes frequently used sandboxes incredibly convenient to access — no need to navigate to specific directories or remember complex commands. Just type the sandbox name and it launches immediately with all your configured settings.
Tip
You can give your sandbox a descriptive, easy-to-remember name during installation:
msi alpine:20250108 slim-linuxThis allows you to create multiple instances of the same sandbox image with different names and configurations. For example:
msi python python-data-science- A Python environment for data analysismsi python python-web- A Python environment for web development
Installed sandboxes maintain their state between sessions, so you can pick up exactly where you left off each time you launch them.