Command Palette

Search for a command to run...

Назад к скиллам
скилл № 86273

marimo

Guide for creating and working with marimo notebooks, the reactive Python notebook that stores as pure .py files. This skill should be used when creating…

БесплатноБез исполняемых скриптов
maragudkот maragudk★ 30 звёзд на GitHub

Установить marimo в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

marimo

Overview

marimo is an open-source reactive Python notebook that reinvents notebooks as reproducible, interactive, and shareable Python programs. Unlike traditional Jupyter notebooks, marimo notebooks:

  • Store as pure .py files (Git-friendly, no JSON)
  • Execute reactively (like a spreadsheet)
  • Run as scripts or deploy as web apps
  • Prevent bugs through automatic dependency tracking

Installation

uv add marimo                         # In a uv project (or: pip install marimo)
uv add "marimo[recommended]"          # With extras (SQL cells, AI, plotting helpers)
uv add "marimo[sql]"                  # With SQL support

uvx marimo edit --sandbox notebook.py # Standalone notebook, no project needed
marimo tutorial intro                 # Start tutorial

CLI Commands

# Edit
marimo edit                           # Home page: browse and create notebooks
marimo edit notebook.py               # Edit existing (or create)
marimo edit --watch notebook.py       # Reload when the file changes on disk
marimo edit --sandbox notebook.py     # Isolated env from PEP 723 inline deps (uv or pixi)

# Run as app
marimo run notebook.py                # Read-only app
marimo run notebook.py --watch        # Auto-reload on changes

# Run as script
python notebook.py

# Create
marimo new                            # Empty notebook
marimo new "analyze sales data"       # Generate from a prompt with AI

# Lint and format
marimo check notebook.py              # Report issues (multiple definitions, cycles, ...)
marimo check --fix notebook.py        # Fix what is fixable, in place

# Convert to marimo (.ipynb, .md with python fences, py:percent scripts)
marimo convert notebook.ipynb -o notebook.py

# Export
marimo export html notebook.py -o output.html
marimo export html-wasm notebook.py -o out/ --mode run  # Browser-executable (Pyodide)
marimo export ipynb notebook.py -o notebook.ipynb
marimo export md notebook.py -o notebook.md
marimo export script notebook.py -o script.py           # Flat Python script
marimo export pdf notebook.py -o notebook.pdf

Key Concepts

Reactivity

Running a cell automatically runs all cells that depend on it. Execution order is determined by variable dependencies (DAG), not cell position.

Cell Rules

  1. Each global variable must be defined in exactly one cell
  2. Variables prefixed with an underscore (_tmp) are local to their cell
  3. Mutations like list.append() aren't tracked; reassign instead
  4. If mutating is needed, do it in the same cell as the declaration
  5. No cycles between cells, and no import *

File Format

Notebooks are pure Python files with marimo decorators. Each cell is a function whose parameters are the variables it reads and whose return tuple is the variables it defines. Start the file with a PEP 723 script block listing its dependencies (marimo edit --sandbox writes one automatically) so uv run notebook.py and --sandbox resolve them:

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "marimo",
#     "polars>=1.0",
# ]
# ///

import marimo

__generated_with = "0.25.2"
app = marimo.App(width="medium")

with app.setup:
    # Setup cell: runs first; its names are usable by top-level functions
    import marimo as mo
    import polars as pl


@app.function
def clean(df: pl.DataFrame) -> pl.DataFrame:
    # Top-level function: importable with `from notebook import clean`
    return df.drop_nulls()


@app.cell(hide_code=True)
def _():
    mo.md(r"""
    # My Notebook
    """)
    return


@app.cell
def _():
    df = clean(pl.read_csv("data.csv"))
    return (df,)


@app.cell
def _(df):
    df.describe()
    return


if __name__ == "__main__":
    app.run()

A setup cell and @app.function are optional; a plain notebook imports marimo as mo in a regular @app.cell and returns (mo,). A cell that defines nothing ends with a bare return. The last expression in a cell is its output.

@app.function only works when the cell defines exactly one function that refers only to setup-cell names or other top-level definitions; @app.class_definition is the equivalent for classes. See references/app.md and references/cell.md.

Working on Notebooks as an Agent

  • Editing the .py file directly is fine: keep the format above, keep cell parameters and return tuples in sync with the variables each cell reads and defines, and run marimo check (or uvx marimo check) afterwards to catch multiple definitions, cycles, and formatting issues.
  • If the user has the notebook open, they should run marimo edit --watch notebook.py so the editor picks up your changes.
  • marimo pair connects an agent to a running notebook session to create, edit, and run cells live and read their outputs. Run marimo pair --help for the workflow. In that mode, edit through the pair API only, not the file.

API Reference

Detailed documentation for each API is available in the references/ directory. Consult th

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/app.md
  • references/caching.md
  • references/cell.md
  • references/cli-args.md
  • references/control-flow.md
  • references/diagrams.md
  • references/html.md
  • references/inputs.md
  • references/layouts.md
  • references/markdown.md
  • references/media.md
  • references/outputs.md
  • references/plotting.md
  • references/query-params.md
  • references/sql.md
  • references/state.md
  • references/status.md
  • references/watch.md

FAQ

Что делает скилл marimo?

Guide for creating and working with marimo notebooks, the reactive Python notebook that stores as pure .py files. This skill should be used when creating, editing, running, or deploying marimo notebooks.

Как установить скилл marimo?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл marimo запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить marimo с