Skip to content

jless - Command-Line JSON Viewer Cheatsheet

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

PlatformCommand
Cargo (all platforms)cargo install jless
macOS (Homebrew)brew install jless
Arch Linuxsudo pacman -S jless
Nixnix-env -iA nixpkgs.jless
Binarydownload from the GitHub Releases page
Verifyjless --version

Opening Data

CommandDescription
jless data.jsonOpen a JSON file
`cat data.jsonjless`
`curl -s URLjless`
jless --yaml config.yamlOpen a YAML file
jless --mode line data.jsonStart in line mode (raw-ish view)
jless --helpFull option list

Movement

KeyAction
j / kDown / up
h / lCollapse / expand (or move to parent/child)
g / GGo to top / bottom
Ctrl+f / Ctrl+bPage down / up
Ctrl+d / Ctrl+uHalf page down / up
J / KMove to next/previous sibling
EnterToggle expand/collapse on current node

Folding & Views

KeyAction
SpaceCollapse / expand the current node
cCollapse all siblings
eExpand all children recursively
EExpand everything
CDeep-collapse
Tab (mode)Toggle between data mode and line mode
%Jump to the matching bracket
KeyAction
/patternSearch forward
?patternSearch backward
n / NNext / previous match
*Search for the current key
Search is regexPatterns support regular expressions

Working with Paths & Values

KeyAction
y then yYank (copy) the value under the cursor
y then pYank the path to the current node (e.g. .users[0].name)
y then vYank the value
y then kYank 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

jless vs Other JSON Tools

Aspectjlessjqfx
ModeInteractive viewerQuery/transformInteractive + JS
Editing/transformNo (read-only)YesYes
Folding tree UIYesNoYes
Path yankYesN/AYes
Best forExploring/inspectingScripting transformsExplore + transform

jless is read-only by design — for filtering and transforming, pipe through jq first, then explore the result in jless.

Resources