Skip to main content

Advanced Generate Options

These options extend the basic generate command with TypeScript output, diagram format control, a live test server, and watch-mode tuning.


TypeScript definition generation

--createTypescriptDefinition / -t

New in v1.42.0

Generate a .mts TypeScript definition file alongside the NodeSet XML.

opcua-modeler generate -i model.yaml -t

The generated file contains typed interfaces and constants for every node in your model, with code-folding region comments for easy navigation in VS Code and other editors:

// #region MyObjectType
export interface MyObjectType {
temperature: UAVariable<number>;
pressure: UAVariable<number>;
status: UAVariable<StatusEnum>;
}
// #endregion MyObjectType

This is useful for TypeScript projects that consume the generated NodeSet — the types give you compile-time safety when constructing or reading nodes.


Diagram image format

--markdownImage <format>

New in v3.10.0

Control the image format used for diagrams embedded in the generated Markdown documentation.

ValueDescription
SVG(default) SVG rendered via Graphviz. Crisp at any zoom level, works offline.
PLANTUMLPlantUML diagram source blocks. Requires a PlantUML renderer to display.
# Default — SVG diagrams
opcua-modeler generate -i model.yaml

# PlantUML blocks instead
opcua-modeler generate -i model.yaml --markdownImage PLANTUML
Mermaid diagrams
New in v4.10.0

From v4.10.0, the generated Markdown also includes Mermaid diagram blocks for class hierarchies. These render natively in GitHub, GitLab, Docusaurus, and most modern doc tools — no plugin required.


Live OPC UA test server

--server / -s and --port / -p

Start a live OPC UA test server that serves the generated NodeSet immediately after each successful build. Combine with --watch for a fully live development loop.

# Watch + live server on default port 26543
opcua-modeler generate -i model.yaml --watch --server

# Watch + live server on a custom port
opcua-modeler generate -i model.yaml --watch --server --port 4840

The server reloads the NodeSet automatically on each rebuild. You can connect any OPC UA client (UA Expert, node-opcua, etc.) to opc.tcp://localhost:26543 to browse your model in real time as you edit the YAML.

FlagDefaultDescription
--server / -soffStart the OPC UA test server after generation
--port / -p26543TCP port for the OPC UA server

Watch mode debounce

--debounceMs <ms>

Control how long the watcher waits after the last file-system event before triggering a rebuild. Useful when your model spans many files or your editor writes in multiple bursts.

# Wait 1 second after the last change before rebuilding
opcua-modeler generate -i model.yaml --watch --debounceMs 1000
FlagDefaultDescription
--debounceMs500Milliseconds to wait after the last FS event

Full generate flag reference

FlagShortDefaultDescription
--input-iInput YAML file (required)
--generate-g(input prefix)Output file prefix pattern
--watch-woffRebuild on file change
--server-soffStart live OPC UA test server
--port-p26543OPC UA server port
--createTypescriptDefinition-toffGenerate .mts TypeScript definitions
--markdownImageSVGDiagram format: SVG or PLANTUML
--debounceMs500Watch debounce interval (ms)
--quiet-qoffSuppress warnings
--strictoffEscalate warnings to errors
--styleoffShow info-level diagnostics
--silenceSuppress specific diagnostic codes
--show-yaml-pathoffShow YAML path in diagnostics
--debug-doffExtra debugging output