Add a node to the document. Throws if the ID already exists. Change, realisation, and gate nodes require companion relationship targets.
Library function: src/operations/addNode!addNodeOp
spm add <node-type> [options]
| Argument | Description |
|---|---|
<node-type> |
Node type to add |
| Flag | Description | Required |
|---|---|---|
--path |
SysProM document path (auto-detected if omitted) | |
--json |
output as JSON | |
--dry-run |
preview changes without saving | |
--sync |
sync to markdown directory after saving | |
--id |
Node ID (auto-generated if omitted) | |
--name |
Human-readable node name | Yes |
--description |
Node description | |
--status |
Lifecycle status | |
--context |
Decision context | |
--rationale |
Decision rationale | |
--scope |
Change scope (repeatable) | |
--selected |
Selected option ID | |
--decision |
Decision ID this change implements (required for change nodes) | |
--element |
Element ID this realisation implements (required for realisation nodes) | |
--governed-by |
Invariant or policy ID this gate enforces (required for gate nodes) | |
--option |
Option in format 'ID:description' or just 'description' (repeatable) |