Graphviz (dot)
$ dot Foundation Low RiskGraphviz (dot) turns structural .dot graph descriptions into hierarchical, force-directed, or radial diagrams in SVG, PNG, PDF, or JSON layout coordinates (-Tjson). Fast C execution, stdin/stdout streaming, and universal OS package availability make it a rock-solid agent diagram backend.
brew install graphviz dot operates synchronously on .dot files or stdin in milliseconds and supports -Tjson layout inspection directly.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
Usage: dot [-Vv?] [-(GNEA)name=val] [-(KTlso)<val>] <dot files>
(additional options for neato) [-x] [-n<v>]
(additional options for fdp) [-L(gO)] [-L(nUCT)<val>]
(additional options for config) [-cv]
-V - Print version and exit
-v[n] - Enable verbose mode at level 1, or set to the level 'n' if provided
-Gname=val - Set graph attribute 'name' to 'val'
-Nname=val - Set node attribute 'name' to 'val'
-Ename=val - Set edge attribute 'name' to 'val'
-Aname=val - Set attribute 'name' to 'val' for graph, node, and edge
-Tv - Set output format to 'v'
-Kv - Set layout engine to 'v' (overrides default based on command name)
-lv - Use external library 'v'
-ofile - Write output to 'file'
-O - Automatically generate an output filename based on the input filename with a .'format' appended. (Causes all -ofile options to be ignored.)
-P - Internally generate a graph of the current plugins.
-q[l] - Set level of message suppression (=1)
-s[v] - Scale input by 'v' (=72)
-y - Invert y coordinate in output
-n[v] - No layout mode 'v' (=1)
-x - Reduce graph
-Lg - Don't use grid
-LO - Use old attractive force
-Ln<i> - Set number of iterations to i
-LU<i> - Set unscaled factor to i
-LC<v> - Set overlap expansion factor to v
-LT[*]<v> - Set temperature (temperature factor) to v
-c - Configure plugins (Writes $prefix/lib/graphviz/config
with available plugin information. Needs write privilege.)
-? - Print usage and exit FCRS-1.0 6-Dimension Breakdown
Pure stdin/stdout Unix filter with -Tjson coordinate output and clear syntax errors on stderr.
dot -Tjsonoutputs structured node/edge layout JSON- Non-interactive execution with deterministic exit codes
Offline C layout tool with zero auth or network side effects (note image= attributes can read local paths if untrusted inputs are rendered).
- No credentials or remote calls
- Pure file/pipe transformation
Prepackaged in virtually every OS package manager (brew, apt, dnf, choco, winget).
- Ubiquitous OS package availability
Unbeatable for dependency graphs, ASTs, and call graphs, though default styling looks dated compared to D2 or Mermaid.
- Multiple layout engines (
dot,neato,fdp,circo,sfdp)
Mature project hosted on GitLab (graphviz/graphviz) under EPL-1.0.
- Stable maintenance with regular bugfix releases
Comprehensive technical docs on graphviz.org, though dense and Unix-manpage-oriented.
- Official docs at graphviz.org/doc/info/command.html
Security, Auth & Guardrails
No credentials required; pure offline C executable.
Free open-source software (EPL-1.0).
# Graphviz Agent Rules - Use `-Tsvg` for crisp diagrams or `-Tjson` to inspect layout geometry without writing files. - Always write rendered outputs to an explicit `-o` path instead of clobbering inputs. - Pass `-Kneato` or `-Ksfdp` for large undirected graphs where hierarchical `dot` layout is too slow.
Agent-Ready Command Recipes
Safe Read-Only Queries
dot -Tjson graph.dot
Validates .dot syntax and outputs computed node/edge coordinates as JSON to stdout.
dot -V
Prints installed Graphviz version information.
Controlled Writes & Previews
dot -Tsvg graph.dot -o dist/graph.svg
Compiles graph.dot into a clean SVG file at dist/graph.svg.
Strengths for Agents
- + Millisecond native execution with zero browser or JVM dependencies.
- +
-Tjsonexports exact computed layout coordinates and validates.dotsyntax. - + Available natively in almost every Linux/macOS/Windows package manager.
Caveats & Pitfalls
- ! Default visual styling is utilitarian compared to modern tools like D2 or Excalidraw.
- ! Large dense graphs with default
dothierarchical layout can become slow unless switching tosfdp.