CLI Reference¶
The tms (Threat Model Spec) CLI provides commands for generating and validating threat model diagrams.
Installation¶
Commands¶
| Command | Description |
|---|---|
generate |
Generate D2 diagram or STIX 2.1 from JSON |
validate |
Validate a threat model JSON file |
version |
Print version information |
completion |
Generate shell completion scripts |
Quick Reference¶
# Generate D2 diagram
tms generate model.json -o diagram.d2
# Generate D2 and render to SVG
tms generate model.json -o diagram.d2 --svg
# Export to STIX 2.1
tms generate model.json --stix -o model.stix.json
# Validate a model
tms validate model.json
# Strict validation
tms validate model.json --strict
# Print version
tms version
Global Options¶
Shell Completion¶
Generate completion scripts for your shell:
Exit Codes¶
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (validation failed, file not found, etc.) |