marimo provides multiple execution modes depending on your use case: interactive editing, read-only apps, or standalone scripts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/marimo-team/marimo/llms.txt
Use this file to discover all available pages before exploring further.
Execution Modes
marimo has three primary modes:| Mode | Command | Use Case |
|---|---|---|
| Edit | marimo edit | Interactive development with live editing |
| Run | marimo run | Share as read-only web app |
| Script | python notebook.py | Execute as standard Python script |
Edit Mode
Edit mode is the interactive development environment for creating and modifying notebooks.Basic Usage
Configuration Options
Server Configuration
Server Configuration
File Watching
File Watching
Auto-reload when the file changes externally:
Useful when editing the
.py file in another editor while viewing in marimo.Headless Mode
Headless Mode
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:Gallery Mode
When running multiple notebooks or a directory, marimo creates a gallery view:Script Mode
Run notebooks as standalone Python scripts - no web server required.Running as a Script
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:
Authentication
Token-Based Authentication
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
Fast Startup
Fast Startup
Use
--skip-update-check to skip version checking:Session Cleanup
Session Cleanup
Set shorter TTL for automatic session cleanup:
Watch Mode Optimization
Watch Mode Optimization
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