Skip to content

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.

refactor: change to `marimo export thumbnail` (#8149)

Myles Scolnickfab2af0cf522
diff --git a/marimo/_cli/cli.py b/marimo/_cli/cli.py
index 0e26741b5f..6ce7cae30b 100644
--- a/marimo/_cli/cli.py
+++ b/marimo/_cli/cli.py
@@ -27,7 +27,6 @@ from marimo._cli.print import red
from marimo._cli.run_docker import (
prompt_run_in_docker_container,
)
-from marimo._cli.tools.commands import tools
from marimo._cli.upgrade import check_for_updates, print_latest_version
from marimo._cli.utils import (
check_app_correctness,
@@ -1481,4 +1480,3 @@ main.command()(convert)
main.add_command(export)
main.add_command(config)
main.add_command(development)
-main.add_command(tools)
diff --git a/marimo/_cli/export/commands.py b/marimo/_cli/export/commands.py
index 7bf95ba001..5d119e4a76 100644
--- a/marimo/_cli/export/commands.py
+++ b/marimo/_cli/export/commands.py
@@ -10,6 +10,7 @@ import click
from marimo._cli.export.cloudflare import create_cloudflare_files
from marimo._cli.parse_args import parse_args
from marimo._cli.print import echo, green
+from marimo._cli.tools.thumbnails import thumbnail
from marimo._cli.utils import prompt_to_overwrite
from marimo._dependencies.dependencies import DependencyManager
from marimo._dependencies.errors import ManyModulesNotFoundError
@@ -829,3 +830,4 @@ export.add_command(md)
export.add_command(ipynb)
export.add_command(pdf)
export.add_command(html_wasm)
+export.add_command(thumbnail)
diff --git a/marimo/_cli/tools/commands.py b/marimo/_cli/tools/commands.py
deleted file mode 100644
index fa33a6b97a..0000000000
--- a/marimo/_cli/tools/commands.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2026 Marimo. All rights reserved.
-from __future__ import annotations
-
-import click
-
-from marimo._cli.tools.thumbnails import thumbnails
-
-
[email protected](help="Utilities for marimo notebooks.")
-def tools() -> None:
- pass
-
-
-tools.add_command(thumbnails)
diff --git a/marimo/_cli/tools/thumbnails.py b/marimo/_cli/tools/thumbnails.py
index 9c9d782d40..a1bf7c25b7 100644
--- a/marimo/_cli/tools/thumbnails.py
+++ b/marimo/_cli/tools/thumbnails.py
@@ -36,11 +36,6 @@ _sandbox_message = (
)
[email protected](help="Generate and manage notebook thumbnails.")
-def thumbnails() -> None:
- pass
-
-
def _split_paths_and_args(
name: str, args: tuple[str, ...]
) -> tuple[list[str], tuple[str, ...]]:
@@ -420,7 +415,9 @@ async def _generate_thumbnails(
)
[email protected](help="Generate OpenGraph thumbnails for notebooks.")
+ "thumbnail", help="Generate OpenGraph thumbnails for notebooks."
+)
@click.argument(
"name",
type=click.Path(
@@ -504,7 +501,7 @@ async def _generate_thumbnails(
help="Continue processing other notebooks if one notebook fails.",
)
@click.argument("args", nargs=-1, type=click.UNPROCESSED)
-def generate(
+def thumbnail(
name: Path,
width: int,
height: int,