Skip to content

Latest commit

 

History

History
174 lines (116 loc) · 3.82 KB

File metadata and controls

174 lines (116 loc) · 3.82 KB

  PROJECTS  B E T A

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.

Create a Sandbox Project

msb init

This creates a Sandboxfile in the current directory, which serves as the configuration manifest for your sandbox environments.

Add a Sandbox to the Project

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.

Running a Sandbox

Run a Sandbox Defined in Your Project
msb run --sandbox app

or

msb r app

or

msr app

This 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.

Run an Temporary Sandbox

For experimentation or one-off tasks, temporary sandboxes provide a clean environment that leaves no trace:

msb exe --image python

or

msb x python

or

msx python

Temporary sandboxes are perfect for isolating programs you get from the internet. Once you exit the sandbox, all changes are completely discarded.

Installing Sandboxes

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 alpine

or

msb i alpine

or

msi alpine

After installation, you can start your sandbox by simply typing its name in any terminal:

alpine

This 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-linux

This 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 analysis
  • msi 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.