Visualize your data, branch by branch.
A command-line tool to visualize structured data as ASCII/Unicode trees.
It works both with plain indented text and JSON input.
- Convert JSON or indented text into a clean tree view
- Multiple layout styles (right-aligned or top-down)
- Optional alphabetical sorting of JSON object keys
- Works with stdin or file inputs
- Unicode connectors for readable output
txtree [flags] [file]
If no file is provided, txtree reads from stdin.
Pipe JSON from stdin
cat api-response.json | txtreetxtree api-response.jsontxtree -i text notes.txttxtree -l 3 data.json-h Show help
(default: false)
-i Input format (auto, text, json)
↳ (default: auto)
-l Layout style:
0 = right-center
1 = right-top
2 = right-bottom
3 = top-down
(default: 0)
-s Sort keys alphabetically (JSON only)
(default: false)
Note: -s applies only when -i=json.
Sorting does not affect plain text mode.
All tools are completely free to use, with every feature fully unlocked and accessible.
If you find one or more of these tool helpful, please consider supporting its development with a donation.
Your contribution, no matter the amount, helps cover the time and effort dedicated to creating and maintaining these tools, ensuring they remain free and receive continuous improvements.
Every bit of support makes a meaningful difference and allows me to focus on building more tools that solve real-world challenges.
Thank you for your generosity and for being part of this journey!
Simply run the following command in your terminal:
curl -sL https://raw.githubusercontent.com/lucasepe/txtree/main/install.sh | bashThis script will:
- Detect your operating system and architecture
- Download the latest release binary
- Install it into /usr/local/bin (requires sudo)
- otherwise fallback to $HOME/.local/bin
- Make sure the install directory is in your PATH environment variable
Manually download the latest binaries from the releases page:
Unpack the binary into any directory that is part of your PATH.
If you have Go installed
You can also install it using:
go install github.com/lucasepe/txtree@latestMake sure your $GOPATH/bin is in your PATH to run txtree from anywhere.