Configs2026年7月5日·1 分钟阅读

jless — Command-Line JSON Viewer with Interactive Navigation

jless is a Rust-based terminal JSON viewer designed for reading, exploring, and searching through large JSON data with vim-like key bindings and collapsible tree navigation.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
jless Overview
先审查命令
npx -y tokrepo@latest install a308475a-784d-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

jless is a terminal-based JSON viewer that renders JSON data as a collapsible tree you can navigate, search, and explore interactively. It fills the gap between piping JSON through jq for extraction and opening files in a text editor for manual inspection.

What jless Does

  • Displays JSON as an interactive, collapsible tree in the terminal
  • Supports vim-like key bindings for navigation (j/k/h/l)
  • Provides search functionality to locate keys and values
  • Handles large JSON files efficiently with lazy rendering
  • Supports YAML input in addition to JSON

Architecture Overview

jless parses input into a tree data structure and renders visible nodes to the terminal using a TUI framework. Navigation moves a cursor through the tree without re-parsing. Collapsed subtrees skip rendering entirely, allowing large documents to remain responsive. The search function walks the tree and highlights matching nodes.

Self-Hosting & Configuration

  • Install via Homebrew, Cargo, or download prebuilt binaries for Linux and macOS
  • No configuration file is needed; jless works out of the box
  • Pass files as arguments or pipe JSON through stdin
  • Use --mode line for a flat line-based view instead of the tree
  • Supports reading from compressed files when piped through zcat or similar

Key Features

  • Collapsible tree view with expand/collapse on individual nodes
  • Vim-style key bindings including gg, G, Ctrl-d, Ctrl-u for fast navigation
  • Regex-based search with n/N to jump between matches
  • Data mode that shows raw values vs. line mode for source-level view
  • Handles deeply nested documents without performance degradation

Comparison with Similar Tools

  • jq — Powerful JSON processor for filtering and transforming, not an interactive viewer
  • fx — Interactive JSON viewer with JavaScript-based filtering, heavier runtime
  • gron — Flattens JSON to greppable lines, no tree view
  • bat — Syntax-highlighted file viewer, no JSON-specific navigation or collapse

FAQ

Q: Does jless support editing JSON? A: No. jless is read-only. Use jq or a text editor to modify JSON data.

Q: Can jless handle very large files? A: Yes. jless uses lazy rendering so only visible nodes are drawn, making it responsive even with multi-megabyte files.

Q: Does it support YAML? A: Yes. jless auto-detects YAML input and renders it as a navigable tree.

Q: How do I copy a value from jless? A: Press y to yank the value at the cursor position to the system clipboard (where supported).

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产