Installation¶
Threat Model Spec can be used as a Go library or as a standalone CLI tool.
Requirements¶
- Go 1.24 or later
- D2 v0.6+ (for SVG rendering)
Go Library¶
Add the library to your Go project:
Import packages as needed:
import (
"github.com/grokify/threat-model-spec/ir"
"github.com/grokify/threat-model-spec/diagram"
"github.com/grokify/threat-model-spec/stix"
"github.com/grokify/threat-model-spec/stride"
"github.com/grokify/threat-model-spec/killchain"
)
CLI Tool¶
Install the tms command-line tool:
Verify the installation:
D2 Installation¶
The --svg flag requires the D2 CLI to be installed. See d2lang.com for installation instructions.
Verify D2 installation:
Next Steps¶
- Quick Start — Create your first threat model
- Diagram Types — Learn about DFD, Attack Chain, and Sequence diagrams
- CLI Reference — Full command documentation