Home

stencila graph

Build, view, and export Stencila graphs

Usage

stencila graph [OPTIONS] [PATH] [OUTPUT]

Examples

# View the current workspace graph in a browser
stencila graph

# View a workspace graph in a browser
stencila graph .

# Start the graph server without opening a browser
stencila graph . --no-open --port 9010

# Export graph JSON inferred from the output extension
stencila graph . graph.json

# Export graph YAML inferred from the output extension
stencila graph report.smd graph.yaml

# Export graph YAML to stdout
stencila graph . - --to yaml

# Export a projected data flow graph as Graphviz DOT
stencila graph . graph.dot --view flow

# Export a detailed data flow graph including local symbols
stencila graph . graph.dot --view flow --detail high

# Export only the data flow connected to a matching script
stencila graph . graph.png --view flow --connected-to analysis.R

# Export the full connected component through shared inputs
stencila graph . graph.png --view flow --connected-to analysis.R --connected-mode undirected

# Export the same graph without directory/document containment clusters
stencila graph . graph.dot --view flow --containment none

# Export a projected software dependency graph as SVG using Graphviz
stencila graph . graph.svg --view deps

Arguments

NameDescription
[PATH]The workspace directory or document file to graph. Default value: ..
[OUTPUT]Output path for exporting the graph, or - for stdout.

Options

NameDescription
--toOutput format, overriding inference from the output extension.
--viewProjection preset for DOT, SVG, and PNG graph exports. Default value: auto.
--detailDetail level for projected graph exports. Default value: medium.
--containmentHow to represent containment in projected graph exports.
--structureInclude structural containment as visual clusters in projected graph exports. Possible values: true, false.
--no-structureExclude structural containment context in projected graph exports. Possible values: true, false.
--no-low-confidenceExclude low-confidence edges in projected graph exports. Possible values: true, false.
--no-collapse-citationsKeep citation marker nodes visible in projected graph exports. Possible values: true, false.
--no-c2paDo not inspect C2PA content credentials while building workspace graphs. Possible values: true, false.
--no-git-authorsDo not include Git commit authors on file-backed workspace graph nodes. Possible values: true, false.
--connected-toFilter projected graph exports to nodes connected to matching nodes.
--connected-modeHow to traverse graph edges for connected-to filtering. Default value: directed.
-a, --addressThe address to serve on. Default value: 127.0.0.1.
-p, --portThe port to serve on. Default value: 9000.
--no-openDo not open the graph view in a browser. Possible values: true, false.
--no-authDo not authenticate or authorize graph view requests. Possible values: true, false.

Possible values of --view

ValueDescription
autoChoose the first useful projection from the graph's relationships
allShow every graph node and edge without applying a focused projection
flowShow resource flow, data lineage, and provenance relationships
depsShow software imports, calls, environments, packages, and dependency use
citeShow bibliographic references, citations, and external resource links
reactShow executable document reactivity dependencies

Possible values of --connected-mode

ValueDescription
directedInclude upstream dependencies and downstream dependents of matched nodes
undirectedInclude the full undirected component containing matched nodes

Possible values of --to

ValueDescription
jsonStencila Schema Graph as JSON
yamlStencila Schema Graph as YAML
dotProjected graph as Graphviz DOT
svgProjected graph rendered to SVG by Graphviz
pngProjected graph rendered to PNG by Graphviz

Possible values of --detail

ValueDescription
lowShow only the main resource, code, output, and environment relationships
mediumShow useful data-level detail while hiding local symbol and function internals
highShow all relationships selected by the preset

Possible values of --containment

ValueDescription
noneDo not include structural containment context
clustersUse containment to group nodes visually, without rendering PartOf edges
edgesRender containment as explicit PartOf edges
bothUse both visual groups and explicit PartOf edges
© 2026 Stencila