dev-tools 5 min read

jless - CLI JSON Viewer for Developers

jless is a Rust-based command-line JSON viewer with syntax highlighting, vim-style navigation, and collapsible tree views. Install via brew, cargo, or binary.

By
Share: X in
jless CLI JSON viewer

TL;DR: jless is a Rust CLI tool that renders JSON in a clean, syntax-highlighted, vim-style interface. Install with one command and never go back to jq+less.

TL;DR

Source and Accuracy Notes

What Is jless?

jless is a command-line JSON viewer written in Rust. It replaces the common workflow of chaining cat, jq, and less to explore JSON files with a single, focused tool. The display renders JSON without quotes around keys or trailing commas, making nested structure easier to read at a glance.

From the README:

jless is a command-line JSON viewer. Use it as a replacement for whatever combination of less, jq, cat and your editor you currently use for viewing JSON files. It is written in Rust and can be installed as a single standalone binary.

Key features from the README

  • Clean syntax highlighted display of JSON data, omitting quotes around object keys, closing delimiters, and trailing commas.
  • Expand and collapse objects and arrays to see both high- and low-level structure.
  • Vim-inspired movement commands for efficient navigation.
  • Full regex-based search.

Setup Workflow

Step 1: Install

Choose your package manager:

# macOS
brew install jless

# Linux - Homebrew
brew install jless

# Arch Linux
pacman -S jless

# Void Linux
sudo xbps-install jless

# NetBSD
pkgin install jless

# FreeBSD
pkg install jless

# From source (requires Rust toolchain)
cargo install jless

Pre-built binaries for Linux (x86_64, aarch64) and macOS (x86_64, aarch64) are available on the releases page.

Step 2: Basic Usage

# View a JSON file directly
jless largefile.json

# Pipe JSON from another command
cat data.json | jq '.users' | jless

# Or from a URL
curl -s https://api.example.com/data | jless

Step 3: Navigation Commands

jless uses vim-inspired keybindings:

| Key | Action | | --- | --- | | j / k | Move down / up | | / | Regex search | | Space | Expand current node | | Backspace | Collapse current node | | g | Go to start | | G | Go to end | | q | Quit |

Basic arrow keys and page up/down also work for those unfamiliar with vim.

Deeper Analysis

Performance on large files

jless is built in Rust using a memory-mapped file index. For large JSON files (hundreds of MB), the tool avoids loading the entire file into memory by rendering only the visible viewport. Scrolling stays smooth even on files that would choke a browser tab.

Why not just use jq?

jq is powerful for filtering and transforming JSON, but it is not a viewer. You need to know the structure beforehand or iterate with trial-and-error queries. jless lets you explore the structure first, then apply jq transformations once you know the shape of the data.

Comparison to alternatives

  • jq + less: Two tools, more friction. jless consolidates navigation and search.
  • JSON parsing in editors: Requires opening a file in an IDE. jless works in any terminal session.
  • Online JSON viewers: Require uploading data or pasting it into a website — a privacy concern for sensitive payloads.

Practical Evaluation Checklist

  • [ ] Install via brew or cargo in under 2 minutes
  • [ ] Open a JSON file over 1 MB and scroll smoothly
  • [ ] Test regex search with /your_pattern
  • [ ] Verify expand/collapse on a nested JSON object
  • [ ] Pipe output from curl or jq into jless
  • [ ] Confirm cursor moves correctly with vim-style keys

Security Notes

jless is a local-only viewer. It does not send data anywhere, make network requests, or require internet access after installation. For sensitive JSON payloads (API keys, personal data in logs), using a local CLI tool avoids the privacy risk of pasting into online JSON viewers.

FAQ

Q: How does jless handle massive JSON files? A: jless uses a memory-mapped file index, keeping memory usage low even for files several hundred MB in size.

Q: Can I use jless with jq for filtering? A: Yes — pipe jq output into jless:

cat data.json | jq '.users' | jless

Q: Does jless work on Windows? A: Windows support is planned but not yet available. Linux and macOS are fully supported.

Q: Is the source code available? A: Yes, jless is fully open source under the MIT license at github.com/PaulJuliusMartinez/jless.

Conclusion

jless solves a focused but everyday problem for developers: reading JSON in a terminal without losing your mind. The Rust implementation keeps it fast and the single-binary distribution makes installation trivial. Vim-style navigation and regex search make it genuinely pleasant to use compared to cat piped through jq with trial-and-error queries.

If you work with APIs, config files, or JSON logs, spending two minutes to install jless is worth it. The 5,400+ GitHub stars and sustained HN engagement (344 points, 84 comments) reflect a tool that does one thing extremely well.