buf dep graph

Print the dependency graph in DOT format


$ buf dep graph <input> [flags]


As an example, if module in directory "src/proto" depends on module "" from the BSR with commit "12345", and "" depends on module "" from the BSR with commit "67890", the following will be printed:

digraph {

"src/proto" -> "" "" -> ""


The actual output may vary between CLI versions and has no stability guarantees, however the output will always be in valid DOT format. If you'd like us to produce an alternative stable format (such as a Protobuf message that we serialize to JSON), let us know!

See to explore Graphviz and the DOT language. Installation of graphviz will vary by platform, but is easy to install using homebrew:

brew install graphviz

You can easily visualize a dependency graph using the dot tool:

buf dep graph | dot -Tpng >| graph.png && open graph.png

The first argument is the source or module to print the dependency graph for, which must be one of format [dir,git,mod,protofile,tar,zip]. This defaults to "." if no argument is specified.


Do not follow symlinks when reading sources or configuration from the local filesystem By default, symlinks are followed in this CLI, but never followed on the Buf Schema Registry

--error-format string

The format for build errors printed to stderr. Must be one of [text,json,msvs,junit,github-actions]

-h, --help

help for graph

Flags inherited from parent commands


Turn on debug logging

--log-format string

The log format [text,color,json]

--timeout duration

The duration until timing out, setting it to zero means no timeout

-v, --verbose

Turn on verbose mode

Parent Command