MakerRepo CLI – Generators
The generators subcommands let you run generators (functions decorated with @customizable) and view
or export their output. Generators take a JSON payload for parameters. You can refer to a generator by
name or module/name when there are multiple generators with the same name.
For the concept of generators and the @customizable decorator, see Generators.
All examples below assume you run commands from the repository root.
For caching, logging, and completion flags that apply to all subcommands, see:
List generators
List generators discovered from the current repository.
| Option | Description |
|---|---|
-o, --output |
Output format (default: table). Use -o json for JSON to stdout. |
View generator output
Run a generator with a JSON payload and send the result to the OCP viewer.
| Option | Description |
|---|---|
-p, --payload |
JSON payload for the generator. Use @path/to/file.json to load from a file, or - to read from stdin. Default: {}. |
--port |
OCP Viewer port (default: 3939). |
--camera |
Camera preset when loading the model (default: reset). |
--colormap |
Colormap for coloring parts (default: none). |
--versioned |
Use the versioned model for generator output (if available). When the generator returns a Result with a versioned variant, this flag shows that variant instead of the primary model. Fails if versioned is requested but not provided. |
If you omit GENERATOR, an interactive prompt lets you select one.
Examples:
# Inline JSON payload for generator parameters
mr generators view my_generator -p '{"width": 10, "height": 5}'
# Load payload from a file (e.g. params.json)
mr generators view -p @params.json
# Read payload from stdin (pipe or type JSON, then Ctrl+D)
mr generators view -p -
Export generator output
Export generator output to STEP, STL, BREP, glTF, 3MF, SVG, or DXF.
| Option | Description |
|---|---|
-p, --payload |
JSON payload ({}, @file.json, or - for stdin). Default: {}. |
-o, --output |
Output file or directory (default: current directory). |
-f, --format |
Export format (default: step, or inferred from -o). |
--versioned |
Use the versioned model for generator output (if available). Exports the versioned variant from a Result instead of the primary model when set. |
Snapshot
Capture a screenshot of the generator output.
| Option | Description |
|---|---|
-p, --payload |
JSON payload for the generator. Default: {}. |
-o, --output |
Output image file path (default: snapshot.png). |
--camera |
Camera view preset for the snapshot (default: iso). |
--colormap |
Colormap for parts (default: none). |
--versioned |
Use the versioned model for generator output (if available). Snapshots the versioned variant from a Result when set. |
Web-based UI (planned)
Today, generator commands are purely CLI-driven: you pass JSON payloads via -p and view results in the OCP viewer
or as exported files. In a future release, makerrepo-cli will add a command to run a local web server that:
- Presents a form UI for a chosen generator's parameters in your browser.
- Lets you edit parameters interactively instead of crafting JSON by hand.
- Shows a live preview of the resulting model.
- Allows you to export or snapshot the generated model directly from the web page.
This will provide a friendlier way to explore and fine-tune generators locally, while keeping the underlying behavior consistent with the CLI commands described above.