jless
A command-line JSON viewer and pager — navigate, search, and explore JSON documents interactively in the terminal.
jless is an interactive, keyboard-driven JSON viewer for the terminal. Rather
than piping JSON through python -m json.tool or squinting at a wall of
minified text, jless gives you a collapsible tree view with syntax
highlighting, vim-style navigation, and a search mode — all without leaving the
terminal.
Features
- Collapsible tree view — expand and collapse objects and arrays to focus on the parts of the document you care about
- Vim-style navigation —
hjkl,gg/G,{/},Ctrl+d/Ctrl+uall work as you'd expect - Search —
/searches forward,?searches backward, through both keys and values - Multiple view modes — toggle between the default line-oriented view and a raw data view
- Copy to clipboard — yank the current node's value or path with a keypress
- Piped input — reads from stdin or a file, works naturally in shell pipelines
- YAML support — can also display YAML documents in addition to JSON
Installation
cargo install jless
Or via your system package manager:
# macOS
brew install jless
# Arch Linux
pacman -S jless
# Nix
nix-env -iA nixpkgs.jless
# Debian / Fedora
# Pre-built Linux binaries are available on the
# [releases page](https://github.com/PaulJuliusMartinez/jless/releases).Usage
# View a JSON file
jless data.json
# Pipe JSON from a command
curl -s https://api.github.com/repos/PaulJuliusMartinez/jless | jless
# View a YAML file
jless config.yaml
# Start with all nodes collapsed
jless --collapse data.jsonKeybindings
| Key | Action |
|---|---|
h / ← | Collapse the current node |
l / → | Expand the current node |
j / ↓ | Move down one line |
k / ↑ | Move up one line |
Space | Toggle collapse/expand |
i | Enter insert mode (scroll through data view) |
gg | Jump to the top |
G | Jump to the bottom |
Ctrl+d / Ctrl+u | Scroll half a page down / up |
{ / } | Jump to previous / next sibling node |
/ | Search forward |
? | Search backward |
n / N | Next / previous search match |
yy | Copy the current node's value to clipboard |
yp | Copy the path to the current node |
q | Quit |
Tips
- Collapse everything first — press
cto recursively collapse all nodes, then expand only what you need. This is the fastest way to navigate a deeply nested document. - Use with
jq— pipejqoutput intojlessfor a great exploration workflow:curl -s https://api.github.com/orgs/rust-lang/repos | jq '.[] | {name, stars: .stargazers_count}' | jless - Use the path display — the current node's full JSON path is always shown at the bottom of the screen, so you always know where you are in the document.