A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
docs: --sandbox (#2136)
Myles Scolnickc20fb6de7d50
diff --git a/docs/guides/apps.md b/docs/guides/apps.mdindex a7022c4c96..f96ed549d6 100644--- a/docs/guides/apps.md+++ b/docs/guides/apps.md@@ -21,28 +21,34 @@ Usage: marimo run [OPTIONS] NAME [ARGS]...* marimo run notebook.pyOptions:- -p, --port INTEGER Port to attach to.- --host TEXT Host to attach to. [default: 127.0.0.1]- --proxy TEXT Address of reverse proxy.- --headless Don't launch a browser.- --token / --no-token Use a token for authentication. This enables session-- based authentication. A random token will be- generated if --token-password is not set.-- If --no-token is set, session-based authentication- will not be used. [default: no-token]- --token-password TEXT Use a specific token for authentication. This enables- session-based authentication. A random token will be- generated if not set.- --include-code Include notebook code in the app.- --watch Watch the file for changes and reload the app. If- watchdog is installed, it will be used to watch the- file. Otherwise, file watcher will poll the file- every 1s.- --base-url TEXT Base URL for the server. Should start with a /.- --allow-origins TEXT Allowed origins for CORS. Can be repeated.- --redirect-console-to-browser Redirect stdout and stderr to the browser console.- --help Show this message and exit.+ -p, --port INTEGER Port to attach to.+ --host TEXT Host to attach to. [default: 127.0.0.1]+ --proxy TEXT Address of reverse proxy.+ --headless Don't launch a browser.+ --token / --no-token Use a token for authentication. This enables+ session-based authentication. A random token+ will be generated if --token-password is not+ set.++ If --no-token is set, session-based+ authentication will not be used. [default:+ no-token]+ --token-password TEXT Use a specific token for authentication. This+ enables session-based authentication. A+ random token will be generated if not set.+ --include-code Include notebook code in the app.+ --watch Watch the file for changes and reload the+ app. If watchdog is installed, it will be+ used to watch the file. Otherwise, file+ watcher will poll the file every 1s.+ --base-url TEXT Base URL for the server. Should start with a+ /.+ --allow-origins TEXT Allowed origins for CORS. Can be repeated.+ --redirect-console-to-browser Redirect console logs to the browser console.+ --sandbox Run the command in an isolated virtual+ environment using 'uv run --isolated'.+ Requires `uv`.+ --help Show this message and exit.```## Layoutdiff --git a/docs/guides/editor_features/package_management.md b/docs/guides/editor_features/package_management.mdindex ba214a03ed..85771d24f6 100644--- a/docs/guides/editor_features/package_management.md+++ b/docs/guides/editor_features/package_management.md@@ -7,12 +7,12 @@ Once the module is installed, all cells that depend on the module will be rerun.```{admonition} Package Installation:class: note-We use some heuristic for guessing the package name in your registry (e.g. PyPI) from the module name. It is possible that the package name is different from the module name. If you encounter an error, please file an issue, so we can correct the heuristic.+We use some heuristic for guessing the package name in your registry (e.g. PyPI) from the module name. It is possible that the package name is different from the module name. If you encounter an error, please file an issue or help us by adding your mapping [directly to the codebase](https://github.com/marimo-team/marimo/blob/main/marimo/_runtime/packages/module_name_to_pypi_name.py).```## Auto-add inline script metadata (`uv` only)-When using [uv](https://docs.astral.sh/uv), marimo can automatically add the package name metadata to your script, per [PEP 723](https://peps.python.org/pep-0723/). This metadata is used to manage the script's dependencies and Python version.+When using [uv](https://docs.astral.sh/uv), marimo can automatically update the package name metadata in your notebook file, per [PEP 723](https://peps.python.org/pep-0723/). This metadata is used to manage the notebook's dependencies and Python version.For example, say you start marimo in a new virtual environment and spin up a new notebook. Whenever you add a new package, marimo will automatically add script metadata that looks like this:@@ -25,3 +25,14 @@ For example, say you start marimo in a new virtual environment and spin up a new# ]# ///```++## Running `marimo` in a sandbox environment (`uv` only)++If you want to run marimo in a sandbox environment, you can use the `--sandbox` flag. This will create a new virtual environment (using [uv](https://docs.astral.sh/uv)) and install any packages listed in the script metadata, per [PEP 723](https://peps.python.org/pep-0723/).+This is useful when you want to run marimo in a clean environment without affecting your global environment.++```bash+marimo edit --sandbox notebook.py+```++If there is not package metadata in the script, marimo will still prompt you to install any missing packages.