wndr

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 3 Imported by: 0

README

wndr


License Release CI Go Reference

wndr (wander) allows you explore tree-based file formats as an interactive TUI tree. This supports JSON, YAML, and TOML files.

example

It can also be used to compare two or more tree-based formats in an interactive TUI or output the diff to another file.

example

Installation

Can be installed using Go 1.23+ via:

go install github.com/crosleyzack/wndr@latest

It can also be installed as a nix flake using

nix build

which will write the binary to ./result/bin/wndr

Examples

wndr can take in data by providing a data file:

wndr -f foo.toml

or by passing it as the first argument:

wndr "{\"foo\": \"bar\"}"

or finally via stdin:

cat bar.yml | wndr -x 1

Configuration

wndr will search for a configuration toml file at:

  1. $WNDR_CONFIG
  2. $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"]

Tree View in your TUI

wndr tree view can be embedded in your own application by:

  1. Convert your data to a map[string]any type. Examples exist in the pkg/format package for JSON, YAML, and TOML.
  2. Call pkg/nodes.New to convert your map[string]any to a *nodes.Node tree.
  3. Call pkg/modules/tree.New with the *nodes.Node tree as well as your desired pkg/modules/tree.TreeFormat, pkg/keys.KeyMap, and pkg/styles.Style to create the tree view bubbletea tree module.
  4. Create a new bubbletea program with the tree module, or add the tree module to your existing bubbletea program.

Documentation

Overview

Command wndr explores a tree data file with a TUI graphical interface.

It takes in a tree data file (JSON, YAML, or TOML) either via the -f flag, as the first argument, or piped through stdin, and produces a navigable tree to view and explore the data. See github.com/crosleyzack/wndr/cmds for the command definitions and the main entry point.

Directories

Path Synopsis
Package cmds defines the command-line interface commands for wndr.
Package cmds defines the command-line interface commands for wndr.
pkg
diff
Package diff compares two or more tree-based data structures and produces a single tree describing where they differ.
Package diff compares two or more tree-based data structures and produces a single tree describing where they differ.
format
Package format provides utilities for converting between JSON, YAML, TOML, and plain-text representations of data.
Package format provides utilities for converting between JSON, YAML, TOML, and plain-text representations of data.
keys
Package keys defines the key bindings and keymaps used by the wndr TUI.
Package keys defines the key bindings and keymaps used by the wndr TUI.
modules/tree
Package tree implements the bubbletea model for rendering a tree view.
Package tree implements the bubbletea model for rendering a tree view.
nodes
Package nodes defines the tree data structure used to represent and traverse hierarchical data in wndr.
Package nodes defines the tree data structure used to represent and traverse hierarchical data in wndr.
omap
Package omap provides OMap, an ordered map that keeps its keys sorted.
Package omap provides OMap, an ordered map that keeps its keys sorted.
styles
Package styles provides lipgloss-based styling for the wndr user interface.
Package styles provides lipgloss-based styling for the wndr user interface.
tui
Package tui implements the terminal user interface for wndr.
Package tui implements the terminal user interface for wndr.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL