Bazel projects can get large and their dependencies can become seemingly intractable.
bazelvis
allows you to visualise the dependency graph like a filesystem which you can navigate recursively.
I got the original idea from one of my favorite Vim features, which is being able to open directories and traverse them, returning to the parent if needed. Turns out this UI pattern is quite suitable for any type of acyclic graph.
Here is a simple C++ project from the Bazel tutorials page, which has the following dependency graph.
We can run bazelvis
on the main target via:
bazelvis //main:hello-world
And there you have it!
Just run ./build.sh
and move the generated Go binary under ./bin/bazelvis
to your PATH
.
Then you can run bazelvis //some:target
in any Bazel workspace.
k
(or up-arrow): move cursor upj
: (or down-arrow): move cursor down- [TODO]
ctrl-f
: move down a page - [TODO]
ctrl-b
: move up a page