a little forest of marimo clients
moku is a development playground for building marimo clients entirely on the host protocol. The code is experimental and not for production use. Examples:
- Notebook — a notebook editor with interactive outputs.
- Minimap — a linear view of cell dependencies.
- Graph explainer — a view of cell dependencies and execution.
The clients share connections, notebook state, editing, and output rendering through the packages.
A plugin can be as small as a live cell count:
import { Plugin } from "@moku/plugin";
import { useAtomValue } from "@effect/atom-react";
export default Plugin.define({
id: "cell-count",
effect: (ctx) =>
ctx.view.add({
id: "count",
title: "Cell count",
render: ({ notebook }) => {
const count = useAtomValue(
notebook.state,
(state) => Object.keys(state.value.cells).length,
);
return <p>{count} cells</p>;
},
}),
});For a complete example, Basic lets you pick, edit, and run one cell alongside its output.
Requires Bun, Git, uv, and the pnpm version used by the selected marimo checkout.
bun setup
bun devOpen the authenticated link printed in the terminal.
Choose Add host in the launcher and enter the host API URL and its bearer token. Moku reads the catalog and opens notebooks directly from the browser. A bare origin uses /api/marimo/v1. You can also supply the full API URL for a host mounted under a path.
To connect at startup, pass a launch URL fragment to bun dev --open. URL-encode each value, including any special characters in the token.
bun dev --open '/#host=https%3A%2F%2Fnotebooks.example%2Fapi%2Fmarimo%2Fv1&token=HOST_TOKEN'The same fragment works on the URL of a statically served Moku build. Moku clears the fragment and keeps the direct connection in page memory. Reopen the link or add the host again after reloading.
The host API must share the launcher's origin or allow its cross-origin requests, including bearer authentication. Stock marimo 0.26.0 restricts its host catalog to loopback and does not enable CORS on that endpoint. Use Moku's local discovery for a stock server running on another port. Interactive outputs on a direct connection require the host's experimental comm operation.
bun run check
bun run knip
bun run test
bun run test:coverage # coverage/index.htmlAdd a view with @moku/plugin and register it in main.tsx.
Licensed under the Apache License 2.0.