Skip to content

Running a remote notebook in app mode with uvx run marimo run opens a notebooks in the edit mode #6723

@undeMalum

Description

@undeMalum

Describe the bug

Every time I run a remotedly hosted notebook with uvx run marimo run --sandbox https://some/url.com and opt for a secure docker container, the notebook gets opened not in the app mode, but in the edit mode.

The issue doesn't appear when I opt to not create a container.

When starting a contenerized marimo notebook, the edit option pops up for "Running command":

Running command: docker run --rm -d -p 8080:8080 -e MARIMO_MANAGE_SCRIPT_METADATA=true -e MARIMO_IN_SECURE_ENVIRONMENT=true -w /app ghcr.io/astral-sh/uv:0.4.21-python3.12-bookworm uvx marimo edit --sandbox --no-token -p 8080 --host 0.0.0.0 https://some/url.com

The same thing happens for "Running in a sandbox":

Running in a sandbox: uv run --isolated --no-project --compile-bytecode --with-requirements /tmp/tmpmn7xi_r8.txt --refresh marimo edit --no-token -p 8080 --host 0.0.0.0 https://some/url.com


To give an illustration, display weather demo, produces the following in the CLI:

> uvx run marimo run --sandbox https://github.com/marimo-team/youtube-material/blob/main/examples/display-demo.py
? `uvx run marimo run --sandbox https://github.com/marimo-team/youtube-material/blob/main/examples/display-demo.py` invokes the `run` package. Did you mean `uvx marimo run --sandbox https://github.com/marimo-team/youtube-material/blob/main/✔ `uvx run marimo run --sandbox https://github.com/marimo-team/youtube-material/blob/main/examples/display-demo.py` invokes the `run` package. Did you mean `uvx marimo run --sandbox https://github.com/marimo-team/youtube-material/blob/main/examples/display-demo.py`? · yes
This notebook is hosted on a remote server.
Would you like to run it in a secure docker container? [Y/n]:
Starting containerized marimo notebook
Running command: docker run --rm -d -p 8080:8080 -e MARIMO_MANAGE_SCRIPT_METADATA=true -e MARIMO_IN_SECURE_ENVIRONMENT=true -w /app ghcr.io/astral-sh/uv:0.4.21-python3.12-bookworm uvx marimo edit --sandbox --no-token -p 8080 --host 0.0.0.0 https://github.com/marimo-team/youtube-material/blob/main/examples/display-demo.py
Container ID: 438ea56cc84ab17c03de1e71c4583f4ff7ddb54c9e34ba24fd739c751fd9458d
URL: http://0.0.0.0:8080
Installed 24 packages in 224ms
Running in a sandbox: uv run --isolated --no-project --compile-bytecode --with-requirements /tmp/tmp8kf80jwf.txt --python >=3.13 marimo edit --no-token -p 8080 --host 0.0.0.0 https://github.com/marimo-team/youtube-material/blob/main/examples/display-demo.py
Installed 56 packages in 239ms
Bytecode compiled 2448 files in 1.47s

But marimo opens in the edit mode:

Image

Will you submit a PR?

  • Yes

Environment

{
  "marimo": "0.16.5",
  "editable": false,
  "location": "C:/Users/Mateusz/AppData/Local/uv/cache/archive-v0/3yrHfVdHOD4a6fFIbPiEg/Lib/site-packages/marimo",
  "OS": "Windows",
  "OS Version": "11",
  "Processor": "AMD64 Family 25 Model 80 Stepping 0, AuthenticAMD",
  "Python Version": "3.11.6",
  "Locale": "en_US",
  "Binaries": {
    "Browser": "141.0.7390.55",
    "Node": "v24.8.0"
  },
  "Dependencies": {
    "click": "8.3.0",
    "docutils": "0.22.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.9",
    "narwhals": "2.7.0",
    "packaging": "25.0",
    "psutil": "7.1.0",
    "pygments": "2.19.2",
    "pymdown-extensions": "10.16.1",
    "pyyaml": "6.0.3",
    "starlette": "0.48.0",
    "tomlkit": "0.13.3",
    "typing-extensions": "4.15.0",
    "uvicorn": "0.35.0",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {
    "loro": "1.8.1"
  },
  "Experimental Flags": {}
}

Code to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions