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.
List generators
List generators discovered from the current repository.
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). |
--colormap |
Colormap for coloring parts (default: none). |
If you omit GENERATOR, an interactive prompt lets you select one.
Examples:
mr generators view my_generator -p '{"width": 10, "height": 5}'
mr generators view -p @params.json
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). |
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). |
--colormap |
Colormap for parts (default: none). |
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.