Skip to content

Instantly share code, notes, and snippets.

@P1n3appl3
Created November 10, 2022 22:12
Show Gist options
  • Save P1n3appl3/1fef03a31b6e1315538a7dbc7a552cbb to your computer and use it in GitHub Desktop.
Save P1n3appl3/1fef03a31b6e1315538a7dbc7a552cbb to your computer and use it in GitHub Desktop.
bazel graphviz terminal pretty printer
#!/bin/sh
# example usage:
# fx bazel cquery "allpaths(//build/bazel/examples/hello_rust:pkg.component, //build/bazel/examples/hello_rust:src/main.rs)" --output=graph | idot
font=mono
fgcolor=gray87 # closest to #DDDDDD which kitty's default foreground
dot -Tsvg -Nstyle=rounded -Gbgcolor=black -Ncolor=$fgcolor -Nfontcolor=$fgcolor \
-Ecolor=$fgcolor -Efontcolor=$fgcolor -Gfontname=$font -Nfontname=$font -Efontname=$font |
tee /tmp/graph.svg |
kitty +kitten icat --align left # replace with some sort of sixel image output if not using kitty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment