Fetch actions or an MCP server with CallTool instead. Export is for UIs where all the data and behavior is self-contained in the HTML.
Exported apps run entirely in the browser. Client-side features all work: state, forms, conditionals,
Fetch actions, and client-side interactivity. CallTool actions require an MCP server and will not function in exported files.Usage
Given a Python file that defines aPrefabApp:
app.py
prefab export:
app.html to the current directory, derived from the input filename. Override the output path with --output:
PrefabApp instances, specify which one:
CDN vs Bundled
By default, the exported HTML loads the Prefab renderer from CDN (jsDelivr), pinned to your installedprefab-ui version. The file itself stays small, around 1 KB of boilerplate plus your component data, but requires a network connection to render.
For fully self-contained output with all JS and CSS inlined, pass --bundled:
Version Pinning
CDN exports are pinned to your installed version by default. On dev builds, the version defaults tolatest. You can pin to any published version explicitly:
Embedding
The exported file works as a standalone page or inside an iframe:Options
| Flag | Default | Description |
|---|---|---|
--output, -o | <input_stem>.html | Output file path |
--bundled | false | Inline all JS/CSS (no network needed) |
--cdn-version | Installed version | Pin CDN renderer to a specific version |