jless
An interactive terminal JSON viewer with structural navigation, search, line modes, and collapsible values.
Why consider jless?
jless is an interactive command-line JSON viewer written in Rust that provides syntax highlighting, collapsible structures, vim-style navigation, and regex search. It offers developers an efficient alternative to traditional terminal combinations of jq and less.
Learn jless by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide5 sections
Exploring and Navigating Structured Data with jless
Introduction to jless
Working with deeply nested JSON documents in the terminal often involves awkward combinations of command-line utilities and text editors. According to the official documentation, jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data. Written in Rust, it delivers a specialized terminal environment tailored for inspecting complex payloads without requiring cumbersome manual formatting.
Developers frequently encounter unformatted API responses or complex event payloads that are difficult to parse in standard terminal pagers. In these scenarios, the tool pretty prints JSON and applies syntax highlighting when exploring external APIs or debugging request payloads. This visual distinction helps engineers quickly identify scalar values, nested structures, and object keys.
Structural Navigation and Tree Manipulation
Navigating large datasets requires the ability to switch between high-level hierarchy and granular leaf nodes. To facilitate this inspection, users can expand and collapse objects and arrays to inspect both high-level and low-level structures using vim-inspired navigation commands. Keys such as h, j, k, and l allow developers to traverse nodes, collapse sibling trees, and inspect individual properties without losing context.
To minimize visual noise during inspection, jless starts in data mode, presenting JSON without closing delimiters, trailing commas, or quotes around valid identifier keys. This streamlined presentation maximizes terminal real estate and allows engineers to focus on substantive data attributes. When standard formatting is required, pressing m switches the interface into line mode to display input as standard pretty-printed JSON.
Orientation within extensive files is maintained through flexible line markers. Specifically, jless supports both absolute and relative line numbers to assist in navigating large JSON payloads. Relative numbering helps users determine exact jump counts for vertical movement commands, while absolute numbers provide a stable reference to pretty-printed locations.
Advanced Search and Data Extraction
Finding specific attributes in extensive payloads can be tedious without robust query capabilities. To address this, the viewer supports full-text regular expression search to quickly locate data within string values or jump between matching keys. Users can search forward or backward using familiar slash patterns, and jump directly between occurrences of identical object keys across nested collections.
Extracting extracted values from the terminal into external scripts or configuration files is an essential requirement for command-line tools. Accordingly, developers can copy parts of the JSON data to their clipboard using dedicated y commands such as copying node values, unescaped strings, or object paths. This capability allows engineers to copy JavaScript-style dot paths, bracket notations, or unescaped string contents directly into their clipboard.
Stream Processing and YAML Compatibility
Command-line utilities thrive when they integrate cleanly into standard Unix pipelines. For pipeline workflows, jless can handle newline-delimited JSON, allowing users to pipe in output from jq or dense log files directly. This streaming support makes it possible to inspect log streams or paginated API results without manual pre-processing.
The utility is not restricted to JSON payloads alone. In addition to JSON, jless can also handle YAML data, either automatically by detecting the file extension, or by explicitly passing the --yaml flag. This enables teams managing Kubernetes manifests or CI/CD pipelines to navigate YAML hierarchies with identical keyboard shortcuts.
Getting Started with jless
To begin exploring JSON data, jless can read files directly, or read JSON data from standard input. The following commands demonstrate fetching remote data, inspecting a local file, or streaming piped content directly into the viewer:
$ curl https://api.github.com/repos/PaulJuliusMartinez/jless/commits -o commits.json$ jless commits.json$ cat commits.json | jlessWhen working regularly with YAML files, if you frequently view YAML data, we suggest the following alias: Setting this alias in your shell configuration simplifies daily inspection tasks:
$ alias yless="jless --yaml"For installation across different environments, binaries for various architectures are also available on GitHub. For complete source code and release history, developers can visit the official jless repository and inspect the latest release updates on GitHub Releases.
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.