wndr (wander) allows you explore tree-based file formats as an interactive TUI tree. This supports JSON, YAML, and TOML files.
It can also be used to compare two or more tree-based formats in an interactive TUI or output the diff to another file.
Can be installed using Go 1.23+ via:
go install github.com/crosleyzack/wndr@latestIt can also be installed as a nix flake using
nix buildwhich will write the binary to ./result/bin/wndr
wndr can take in data by providing a data file:
wndr -f foo.tomlor by passing it as the first argument:
wndr "{\"foo\": \"bar\"}"or finally via stdin:
cat bar.yml | wndr -x 1wndr will search for a configuration toml file at:
- $WNDR_CONFIG
- $XDG_CONFIG_HOME/wndr/config.toml
Configuration options include:
# format
ExpandedShape = "╰─"
ExpandableShape = "❭"
LeafShape = "└─"
SpacesPerLayer = 2
HideSummaryWhenExpanded = false
SpacesAfterKey = 4
# colors
ExpandedShapeColor = "#d99c63"
ExpandableShapeColor = "#d19359"
LeafShapeColor = "#d19359"
SelectedForegroundColor = "#fffffb"
SelectedBackgroundColor = "#63264A"
UnselectedForegroundColor = "#fffffd"
HelpColor = "#fffffe"
# keys
BottomKeys = ["bottom", "G"]
TopKeys = ["top", "g"]
DownKeys = ["down","j"]
UpKeys = ["up","k"]
CollapseToggleKeys = ["tab", "h", "l"]
CollapseAllKeys = ["<", "H"]
ExpandAllKeys = [">", "L"]
HelpKeys = ["?"]
QuitKeys = ["esc","q"]
SearchKeys = ["/"]
SubmitKeys = ["enter"]
NextKeys = ["n"]wndr tree view can be embedded in your own application by:
- Convert your data to a
map[string]anytype. Examples exist in thepkg/formatpackage for JSON, YAML, and TOML. - Call
pkg/nodes.Newto convert yourmap[string]anyto a*nodes.Nodetree. - Call
pkg/modules/tree.Newwith the*nodes.Nodetree as well as your desiredpkg/modules/tree.TreeFormat,pkg/keys.KeyMap, andpkg/styles.Styleto create the tree view bubbletea tree module. - Create a new bubbletea program with the tree module, or add the tree module to your existing bubbletea program.


