Querying and inspecting complex, nested JSON payloads is a daily necessity for DevOps engineers, software developers, and system administrators. While the industry-standard jq utility is exceptionally powerful, writing intricate filter expressions on large payloads often devolves into tedious trial and error. You run a query, pipe it to a pager, encounter a syntax error or unexpected output, tweak the expression, and execute it again. jnv solves this friction by providing an interactive command-line JSON navigator. Built with a fast, modern terminal user interface (TUI), jnv pairs real-time autocomplete with an interactive jq filter input, previewing output and syntax validity with every keystroke.
What Is jnv and Why Use It?
jnv is an open-source terminal application written in Rust. It functions as an interactive query workbench for JSON data, embedding the jq query language directly into a responsive, split-view interface.
Key architectural advantages of using jnv include:
- Interactive Query Evaluation: Real-time rendering displays filter results as you type, eliminating the traditional write-run-refine loop.
- Intelligent Autocompletion: Pressing
Tabauto-completes object keys, array indices, and built-in jq functions based on the active JSON structure. - Syntax and Error Validation: Immediate visual feedback pinpoints jq syntax errors before committing or piping output to other commands.
- High Performance: Leveraging Rust’s memory efficiency, jnv effortlessly navigates multi-megabyte JSON payloads without terminal lag.
Installing jnv on Linux
You can install jnv across Linux distributions using Cargo, Homebrew, or standalone pre-compiled release binaries.
Method 1: Installing via Cargo
If you have Rust and Cargo configured on your machine, install jnv from crates.io:
cargo install jnv
Method 2: Downloading Pre-Built Binaries from GitHub
For systems without Rust installed, download the official pre-compiled release binary directly:
JNV_VERSION=$(curl -s "https://api.github.com/repos/ynqa/jnv/releases/latest" | grep -Po '"tag_name": "\K[^"]*')
curl -Lo jnv.tar.gz "https://github.com/ynqa/jnv/releases/download/${JNV_VERSION}/jnv-${JNV_VERSION}-x86_64-unknown-linux-musl.tar.gz"
tar -xzf jnv.tar.gz
sudo mv jnv /usr/local/bin/
rm jnv.tar.gz
Verify that the binary is operational:
jnv --version
Navigating and Filtering JSON Payloads with jnv
jnv accepts input either by passing a file path directly or through standard shell pipes (stdin).
Opening a JSON File Directly
jnv data.json
Piping Data from curl or API Endpoints
Inspect real-time API responses directly from your terminal:
curl -s "https://api.github.com/repos/torvalds/linux/releases" | jnv
The jnv interface presents two primary panels:
- Input Line (Top): Enter your jq query (e.g.,
.[] | {id, name: .tag_name}). As you type, suggested keys appear above the cursor. - Preview Pane (Bottom): Displays the colourised, pretty-printed JSON resulting from your query in real time.
Keyboard Shortcuts and Navigation
Tab: Autocomplete the suggested JSON key or jq function.Up / Down Arrows(orCtrl+P / Ctrl+N): Scroll through the JSON output preview pane.Page Up / Page Down: Jump through long payloads by page blocks.Enter: Confirm and print the final filtered output directly tostdoutupon exiting.Ctrl+CorEsc: Exit jnv without printing.
Piping jnv Output into Downstream Scripts
One of jnv’s greatest operational strengths is that pressing Enter outputs the evaluated result directly to standard output. This allows you to construct complex pipelines interactively before handing data off to other Unix utilities:
# Interactively refine your filter, then save the output to disk
curl -s https://api.example.com/telemetry | jnv > clean_metrics.json
# Interactively extract an array and pipe directly into xargs or awk
cat server_config.json | jnv | jq -r '.[].ip_address' | xargs -n1 ping -c 1
Integrating jnv into your everyday Linux toolset removes the guesswork from crafting complex jq filters, delivering real-time clarity and accelerated terminal data exploration.