Run as a scriptΒΆ

You can run marimo notebooks as scripts at the command line, just like any other Python script. For example,

python my_marimo_notebook.py

Running a notebook as a script is useful when your notebook has side-effects, like writing to disk. Print statements and other console outputs will show up in your terminal.

You can pass arguments to your notebook at the command-line: see the docs page on CLI args to learn more.

Producing notebook outputs

To run as a script while also producing HTML of the noteobok outputs, use

marimo export html notebook.py -o notebook.html