Skip to content

lucasepe/jt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jt — Pretty Print JSON as a Tree

A clean, readable JSON tree viewer for the command line.

jt prints JSON data in a compact, human-friendly tree format - perfect for debugging APIs, inspecting payloads, or exploring large documents without drowning in raw JSON.

Features

  • Pretty-print JSON as a structured tree
  • Optional alphabetical key sorting
  • Optional Custom root title
  • Line wrapping with minimum width enforcement
  • Read from stdin or from a file

Usage

jt [flags] [file]

If no file is provided, jt reads from stdin (pipe or -).

Examples

Pipe JSON from stdin

cat api-response.json | jt

Read JSON from a file

jt api-response.json

Read JSON explicitly from stdin via -

curl https://api.example.com/data | jt -

Sort keys and wrap lines to 80 chars

jt -s -w 80 data.json

Support

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!

Donate with PayPal

How To Install

Using the install.sh script (macOS & linux)

Simply run the following command in your terminal:

curl -sL https://raw.githubusercontent.com/lucasepe/jt/main/install.sh | bash

This 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 jt binary into any directory that is part of your PATH.

If you have Go installed

You can also install jt using:

go install github.com/lucasepe/jt@latest

Make sure your $GOPATH/bin is in your PATH to run jt from anywhere.