MiravoMiravo

Build Your own template

Create a template bundle folder, add or override asset models, and validate the layout.

Create a local template bundle when a built-in template is close but not exact, or when your topology and physics need their own files.

Technical details

One folder per template bundle

packaging-line.miravo.yaml
centrifugal-pump.asset.yaml
belt-conveyor.asset.yaml

A template bundle folder holds exactly one root .miravo.yaml entry file and any number of sibling .asset.yaml override files. A model reference resolves to a sibling model first, then to the shared built-in model.

Miravo discovers template bundles in this order: the current working directory, your personal template bundles, your namespaced personal template bundles, then the built-in templates.

Create or fork with the CLI

miravo init creates the bundle folder under ~/.miravo/templates/ (or $MIRAVO_HOME/templates/). Refer to it by name from then on.

miravo init packaging-line

Validate it before you run it.

miravo validate packaging-line

miravo models add also registers the new model in the bundle's entry template as an assignment with count: 1. Delete that assignment if you only want the file.

Built-in model references stay shared by default. To override a built-in model, copy it under its own name, for example miravo models add centrifugal-pump --in packaging-line --from centrifugal-pump, then edit the copy.

Validate the layout

Run validation after moving, renaming, or adding files.

miravo validate packaging-line

Validation fails when:

  • the folder has zero or several root .miravo.yaml files,
  • a model reference has no sibling or built-in .asset.yaml, or
  • an asset file's name does not match its model.name, as in centrifugal-pump.asset.yaml with model.name: centrifugal-pump.

After validation passes, run lint for realism warnings.

miravo lint packaging-line

Reference

Path or commandNotes
~/.miravo/templates/<bundle>/A personal template bundle folder
~/.miravo/templates/<namespace>/<bundle>/A namespaced template bundle folder
miravo init <name>Create a template bundle folder
miravo init <name> --from <src>Copy a template bundle from a built-in, a namespace, or an absolute folder
miravo models add <model> [--in <id>]Add a blank asset model file and register it in the entry template
miravo models add <model> --from <src>Copy one model from a built-in, a namespace, or an absolute file
miravo validate [<id>]Check schema, references, and file layout
miravo lint [<id>] [--strict]Check physical realism rules
MIRAVO_HOMEMoves personal template bundles, persisted state, auth, and integration targets to another base directory

Was this page useful?

Last updated on