Scripts2026年5月26日·1 分钟阅读

jnv — Interactive JSON Filter Using jq in Your Terminal

A terminal-based interactive JSON viewer and filter that lets you explore and query JSON data with live jq expression evaluation and instant feedback.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
jnv Overview
直接安装命令
npx -y tokrepo@latest install 9a3eb191-5940-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

jnv is an interactive terminal tool that combines a JSON viewer with a live jq filter editor. As you type jq expressions, jnv immediately shows the filtered results, making it far easier to build complex queries than running jq repeatedly from the command line.

What jnv Does

  • Displays JSON data in a navigable, syntax-highlighted tree view
  • Provides a live jq expression editor with instant result preview
  • Supports piped input from any command (curl, kubectl, docker, etc.)
  • Handles large JSON files efficiently with streaming and lazy rendering
  • Offers autocompletion hints for jq expressions based on the data structure

Architecture Overview

jnv is a single Rust binary that reads JSON from stdin or a file, parses it into an internal tree structure, and renders a split-pane TUI. The top pane shows the jq filter input with autocomplete suggestions. The bottom pane displays either the full JSON tree or the filtered output. As the user types, jnv compiles and runs the jq expression against the data in real time using the jaq library (a Rust reimplementation of jq). The TUI is built with ratatui for cross-platform terminal rendering.

Self-Hosting & Configuration

  • Install via Homebrew, Cargo, Nix, or download a prebuilt binary from GitHub Releases
  • No configuration files needed — works out of the box
  • Set the EDITOR environment variable to open the current filter in your preferred editor
  • Adjust terminal colors through standard TERM and color scheme settings
  • Pass --max-depth to limit initial tree expansion for deeply nested JSON

Key Features

  • Real-time jq evaluation with sub-second feedback even on megabyte-sized JSON
  • Full jq syntax support including pipes, array slicing, object construction, and builtins
  • Autocomplete suggestions derived from actual keys in the loaded JSON
  • Keyboard-driven navigation with vim-style bindings for the tree view
  • Copy filtered output to clipboard or pipe it to another command

Comparison with Similar Tools

  • jq — the standard CLI JSON processor, but non-interactive; jnv wraps jq with live feedback
  • fx — interactive JSON viewer with JavaScript expressions; jnv uses the more widely known jq syntax
  • gron — flattens JSON for grep; jnv preserves structure and supports full jq queries
  • jless — read-only JSON viewer; jnv adds filtering and expression building
  • yq — YAML/JSON processor; jnv focuses on interactive exploration rather than scripted transforms

FAQ

Q: Does jnv require jq to be installed? A: No. jnv bundles its own jq implementation (jaq) written in Rust. No external jq binary is needed.

Q: Can jnv handle very large JSON files? A: Yes. It streams input and uses lazy rendering, handling files of tens of megabytes without issues. Extremely large files (100MB+) may have slower initial load times.

Q: Does jnv support YAML or other formats? A: jnv is JSON-only. For YAML, convert to JSON first with a tool like yq before piping to jnv.

Q: Can I save my jq filter for reuse? A: You can copy the final expression from the filter bar. jnv also maintains a session history you can scroll through with arrow keys.

Sources

讨论

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

相关资产