Skip to main content
marimo provides multiple execution modes depending on your use case: interactive editing, read-only apps, or standalone scripts.

Execution Modes

marimo has three primary modes:

Edit Mode

Edit mode is the interactive development environment for creating and modifying notebooks.

Basic Usage

Configuration Options

Auto-reload when the file changes externally:
Useful when editing the .py file in another editor while viewing in marimo.
Start the server without opening a browser:

Session Management

Run Mode

Run mode serves notebooks as read-only web applications - perfect for sharing dashboards and reports.

Basic Usage

Configuration Options

Passing Arguments to Notebooks

Pass command-line arguments to your notebook:
Access these in your notebook:
Arguments are automatically parsed into a dictionary. Use --arg-name value format.
When running multiple notebooks or a directory, marimo creates a gallery view:
Users can browse and switch between notebooks in the web interface.

Script Mode

Run notebooks as standalone Python scripts - no web server required.

Running as a Script

Or make it executable:

Script Behavior

  • Executes all cells in dependency order
  • Outputs printed to terminal
  • No web interface
  • Exits when complete
notebook.py

Sandbox Mode

Run notebooks in isolated virtual environments with automatic dependency management.

Single-File Sandbox

Requires uv to be installed. marimo will automatically create an isolated environment with the dependencies declared in the notebook’s script metadata.

Multi-File Sandbox

When running a directory with --sandbox, each notebook gets its own isolated environment:
Multi-file sandbox mode requires the pyzmq package. Install with:

Authentication

Token-Based Authentication

Always use authentication when exposing marimo to untrusted networks.

CORS and Origins

Allow specific origins for CORS:

Development Mode

Enable debug logging and auto-reload:

Global Options

These options work with any marimo command:

Environment Variables

Skip Update Check

Custom Configuration

Performance Tips

Use --skip-update-check to skip version checking:
Set shorter TTL for automatic session cleanup:
Install watchdog for more efficient file watching:

Checking Notebooks

Lint and format notebooks before running:

Next Steps

Sharing Notebooks

Export and deploy your notebooks

Package Management

Manage dependencies automatically