jless - Command-Line JSON Viewer Cheatsheet
jless is a fast, read-only viewer for JSON (and YAML) data in the terminal. Instead of piping raw output through less or jq and scrolling through walls of brackets, you get a syntax-highlighted, collapsible tree you can navigate with Vim-like keys, fold deeply nested structures, and search. It is purpose-built for exploring API responses, config files, and large JSON documents quickly.
Installation
| Platform | Command |
|---|
| Cargo (all platforms) | cargo install jless |
| macOS (Homebrew) | brew install jless |
| Arch Linux | sudo pacman -S jless |
| Nix | nix-env -iA nixpkgs.jless |
| Binary | download from the GitHub Releases page |
| Verify | jless --version |
Opening Data
| Command | Description |
|---|
jless data.json | Open a JSON file |
| `cat data.json | jless` |
| `curl -s URL | jless` |
jless --yaml config.yaml | Open a YAML file |
jless --mode line data.json | Start in line mode (raw-ish view) |
jless --help | Full option list |
Movement
| Key | Action |
|---|
j / k | Down / up |
h / l | Collapse / expand (or move to parent/child) |
g / G | Go to top / bottom |
Ctrl+f / Ctrl+b | Page down / up |
Ctrl+d / Ctrl+u | Half page down / up |
J / K | Move to next/previous sibling |
Enter | Toggle expand/collapse on current node |
Folding & Views
| Key | Action |
|---|
Space | Collapse / expand the current node |
c | Collapse all siblings |
e | Expand all children recursively |
E | Expand everything |
C | Deep-collapse |
Tab (mode) | Toggle between data mode and line mode |
% | Jump to the matching bracket |
Search
| Key | Action |
|---|
/pattern | Search forward |
?pattern | Search backward |
n / N | Next / previous match |
* | Search for the current key |
| Search is regex | Patterns support regular expressions |
Working with Paths & Values
| Key | Action |
|---|
y then y | Yank (copy) the value under the cursor |
y then p | Yank the path to the current node (e.g. .users[0].name) |
y then v | Yank the value |
y then k | Yank the current key |
. | Show the full path of the current node |
Yanking the path is especially handy: navigate to a field visually, then paste its jq-style path into a script.
Common Workflows
# Explore a big API response without drowning in brackets
curl -s https://api.example.com/data | jless
# Inspect a config and copy the exact path to a setting
jless config.json # navigate, then yy/yp to grab value or path
# Browse YAML the same way as JSON
jless --yaml docker-compose.yaml
# Pair with jq: filter first, then explore the result interactively
jq '.items' big.json | jless
| Aspect | jless | jq | fx |
|---|
| Mode | Interactive viewer | Query/transform | Interactive + JS |
| Editing/transform | No (read-only) | Yes | Yes |
| Folding tree UI | Yes | No | Yes |
| Path yank | Yes | N/A | Yes |
| Best for | Exploring/inspecting | Scripting transforms | Explore + transform |
jless is read-only by design — for filtering and transforming, pipe through jq first, then explore the result in jless.
Resources