# Projects

Learn how to use microsandbox's project-based development workflow for managing complex sandbox environments and persistent development setups.


# Overview

microsandbox supports project-based development similar to npm, cargo, or other package managers. This approach is perfect for:

  • Development environments that need to persist between sessions
  • Complex applications with multiple services or components
  • Team collaboration with shared sandbox configurations
  • Reproducible environments across different machines

# Project-Based Development

# Initialize a Project

Create a new microsandbox project in your current directory:

msb init

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

# Add a Sandbox to Your Project

Register a new sandbox in your project:

msb add myapp \
    --image python \
    --cpus 1 \
    --memory 1024 \
    --start 'python app.py'

This command adds a sandbox named myapp to your Sandboxfile with the specified configuration.

After adding a sandbox, your Sandboxfile will look like this:

# Sandbox configurations
sandboxes:
  myapp:
    image: python
    memory: 1024
    cpus: 1
    scripts:
      start: python app.py

# Run Your Project Sandbox

Execute your project sandbox:

msb run --sandbox myapp

or use the shorthand:

msr myapp

This executes the default start script of your sandbox. For more control, you can specify which script to run:

msr myapp~start

# Next Steps

CLI Reference
../../references/cli/#project-management