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.
| Value | Description |
|---|---|
SVG | (default) SVG rendered via Graphviz. Crisp at any zoom level, works offline. |
PLANTUML | PlantUML 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
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.
| Flag | Default | Description |
|---|---|---|
--server / -s | off | Start the OPC UA test server after generation |
--port / -p | 26543 | TCP 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
| Flag | Default | Description |
|---|---|---|
--debounceMs | 500 | Milliseconds to wait after the last FS event |
Full generate flag reference
| Flag | Short | Default | Description |
|---|---|---|---|
--input | -i | — | Input YAML file (required) |
--generate | -g | (input prefix) | Output file prefix pattern |
--watch | -w | off | Rebuild on file change |
--server | -s | off | Start live OPC UA test server |
--port | -p | 26543 | OPC UA server port |
--createTypescriptDefinition | -t | off | Generate .mts TypeScript definitions |
--markdownImage | — | SVG | Diagram format: SVG or PLANTUML |
--debounceMs | — | 500 | Watch debounce interval (ms) |
--quiet | -q | off | Suppress warnings |
--strict | — | off | Escalate warnings to errors |
--style | — | off | Show info-level diagnostics |
--silence | — | — | Suppress specific diagnostic codes |
--show-yaml-path | — | off | Show YAML path in diagnostics |
--debug | -d | off | Extra debugging output |