Skip to main content

marimo edit

Create or edit marimo notebooks in an interactive editor with a web-based interface.

Usage

Arguments

NAME - Path to the notebook file or directory to edit (optional)
  • If a file path is provided, opens that specific notebook
  • If a directory path is provided, opens a file browser for that directory
  • If omitted, opens the current working directory
  • Supports URLs for remote notebooks
  • Supports piping: cat notebook.py | marimo edit
ARGS - Arguments to pass to the notebook (after --)
  • All arguments after -- are passed to the notebook’s sys.argv

Options

Server Configuration

-p, —port PORT - Port to attach to
  • Type: Integer
  • Default: Auto-assigned
—host HOST - Host to attach to
  • Type: String
  • Default: 127.0.0.1
—proxy PROXY - Address of reverse proxy
  • Type: String
—base-url URL - Base URL for the server (should start with /)
  • Type: String
  • Default: ""

Browser & UI

—headless - Don’t launch a browser
  • Type: Flag
  • Default: False

Authentication

—token / —no-token - Use token for authentication
  • Type: Flag
  • Default: True
  • Enables session-based authentication with a random token
—token-password PASSWORD - Use a specific token for authentication
  • Type: String
  • If not set, a random token will be generated
—token-password-file FILE - Path to file containing token password, or - for stdin
  • Type: String
  • Mutually exclusive with --token-password

Security & CORS

—allow-origins ORIGIN - Allowed origins for CORS
  • Type: String (can be repeated)
  • Use * for all origins
  • Example: --allow-origins https://example.com --allow-origins https://other.com
—trusted / —untrusted - Run notebooks hosted remotely
  • If --untrusted, runs marimo in a Docker container
  • Default: Prompt if remote notebook detected

Development Features

—watch - Watch the file for changes and reload when saved in another editor
  • Type: Flag
  • Default: False
—skew-protection / —no-skew-protection - Enable skew protection middleware
  • Type: Flag
  • Default: True
  • Prevents version mismatch issues between client and server
—skip-update-check - Don’t check if a new version is available
  • Type: Flag
  • Default: False

Sandbox & Isolation

—sandbox / —no-sandbox - Run in an isolated virtual environment
  • Type: Flag
  • Dependencies tracked via PEP 723 inline metadata
  • Requires uv

Session Management

—timeout MINUTES - Global timeout to shut down server after specified minutes of no connection
  • Type: Float
—session-ttl SECONDS - Seconds to wait before closing a session on websocket disconnect
  • Type: Integer
  • If None, sessions are not automatically closed

Examples

Basic Usage

Custom Server Configuration

Authentication

Development Workflow

Remote Notebooks

Passing Arguments to Notebook

Inside app.py, access arguments via sys.argv:

Using with Reverse Proxy

CORS Configuration

Piping Input

On Unix-like systems, you can pipe notebook content: