How to Install and Use jless in Linux for Interactive Terminal JSON Viewing and Exploration

Working with large, deeply nested JSON files from API responses, database dumps, or application logs in the terminal is often challenging. Piping JSON into standard pagers like less displays walls of unformatted text, while formatting tools like jq print expanded output that quickly overwhelms the scrollback buffer. jless is an interactive command-line JSON viewer written in Rust that combines the familiar navigation of less with an expandable tree explorer, syntax highlighting, and object/array folding designed specifically for structured data.

Why jless Enhances Terminal JSON Navigation

Unlike general-purpose text pagers that treat documents as streams of raw characters, jless parses JSON into an interactive syntax tree in memory:

  • Collapsible Nodes: Expand and collapse individual arrays, objects, and nested dictionaries with a single keystroke.
  • Vim-Style Navigation: Move smoothly through keys and arrays using standard j, k, h, and l directional keys.
  • Dual Mode Viewing: Switch between Line Mode (viewing JSON as structured text) and Data Mode (focusing purely on key-value pairs).
  • Path Copying: Copy the exact JSON pointer or dot-notation path of any highlighted property directly to your clipboard.
  • Fast Regex Searching: Search for specific property names or values without expanding irrelevant sections.

Installing jless Across Linux Distributions

The jless binary is lightweight and has zero runtime dependencies.

Installing on Arch Linux and Manjaro

sudo pacman -S jless

Installing via Cargo (Any Distribution)

cargo install jless

Downloading Standalone Binaries

For Debian, Ubuntu, or Fedora systems, download pre-compiled musl binaries from GitHub releases:

# Download latest release
wget https://github.com/PaulJuliusMartinez/jless/releases/latest/download/jless-v0.9.0-x86_64-unknown-linux-gnu.zip

# Extract and install
unzip jless-v0.9.0-x86_64-unknown-linux-gnu.zip
sudo mv jless /usr/local/bin/
chmod +x /usr/local/bin/jless

Core Navigation and Interactive Keybindings

Open any JSON document directly or pipe payload data from API tools:

# Open local JSON file
jless data.json

# Pipe curl API responses into jless
curl -s https://api.github.com/users/octocat | jless

Use the following keyboard shortcuts to explore nested JSON hierarchies effortlessly:

Key Function and Behaviour
j / k or Down / Up Move selection up or down through visible keys and values.
h / l or Left / Right Collapse or expand the currently selected object or array.
Spacebar Toggle expansion state of the highlighted node.
c Collapse all sibling nodes at the current tree level.
e Expand all sibling nodes at the current tree level.
/ Search for keys or values using regular expressions.
n / N Jump to next or previous search match.
yp Copy current property path (e.g., .users[0].address.city) to clipboard.
q Exit jless.

Copying Values and JSON Pointers

Extracting nested paths from complex schemas for code integration is seamless:

  • Press yv: Copies the raw highlighted value to the system clipboard.
  • Press yk: Copies the property key name.
  • Press yp: Copies the full JavaScript-style dot-path, perfect for pasting into code or jq filters.

Adopting jless streamlines debugging microservice payloads and config files, providing immediate structural clarity without leaving the Linux terminal.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.