2025-03-28 21:30:45 +09:00
2024-03-20 10:30:41 +09:00
2024-08-28 22:35:22 -04:00
2025-03-28 00:21:52 +09:00
2024-06-16 17:46:18 +01:00
2024-08-05 01:19:37 +09:00
2025-03-28 21:30:45 +09:00
2025-03-28 21:30:45 +09:00
2024-03-19 22:39:39 +09:00
2024-03-19 22:39:39 +09:00
2025-03-26 23:17:42 +09:00
2024-08-07 02:00:31 +09:00
2024-03-19 22:39:39 +09:00
2025-03-28 21:30:45 +09:00

Text describing the image

ci

jnv is designed for navigating JSON, offering an interactive JSON viewer and jq filter editor.

jnv.gif

Inspired by jid and jiq.

Features

  • Interactive JSON viewer and jq filter editor
    • Syntax highlighting for JSON
    • Use jaq to apply jq filter
      • This eliminates the need for users to prepare jq on their own
  • Configurable features via TOML configuration
    • Toggle hint message display
    • Adjust UI reactivity (debounce times and animation speed)
    • Editor appearance and behavior
    • JSON viewer styling
    • Adjust completion feature display and behavior
    • Keybinds
  • Capable of accommodating various format
  • Auto-completion for the filter
  • Hint message to evaluate the filter

Installation

Packaging status

Homebrew

See here for more info.

brew install jnv

Or install via Homebrew Tap:

brew install ynqa/tap/jnv

MacPorts

See here for more info.

sudo port install jnv

Nix / NixOS

See package entry on search.nixos.org for more info.

nix-shell -p jnv

conda-forge

See here for more info.

pixi global install jnv
# or
cat data.json | pixi exec jnv
# or
conda install jnv

Docker

Build (In the near future, the image will be available on something of registries)

docker build -t jnv .

And Run (The following commad is just an example. Please modify the path to the file you want to mount)

docker run -it --rm -v $(pwd)/debug.json:/jnv/debug.json jnv /jnv/debug.json

Cargo

cargo install jnv

Examples

cat data.json | jnv
# or
jnv data.json

Keymap

Key Action
Ctrl + C Exit
Ctrl + Q Copy jq filter to clipboard
Ctrl + O Copy JSON to clipboard
Shift + ↑, Shift + ↓ Switch to another mode

Editor mode (default)

Key Action
Tab Enter suggestion
Move cursor left
Move cursor right
Ctrl + A Move cursor to line start
Ctrl + E Move cursor to line end
Backspace Delete character before cursor
Ctrl + U Clear entire line
Alt + B Move the cursor to the previous nearest character within set(.,|,(,),[,])
Alt + F Move the cursor to the next nearest character within set(.,|,(,),[,])
Ctrl + W Erase to the previous nearest character within set(.,|,(,),[,])
Alt + D Erase to the next nearest character within set(.,|,(,),[,])

Suggestion in Editor (after Tab)

Key Action
Tab, Select next suggestion
Select previous suggestion
Others Return to editor

JSON viewer mode

Key Action
, Ctrl + K Move up
, Ctrl + J Move down
Ctrl + H Move to last entry
Ctrl + L Move to first entry
Enter Toggle fold
Ctrl + P Expand all
Ctrl + N Collapse all

Usage

JSON navigator and interactive filter leveraging jq

Usage: jnv [OPTIONS] [INPUT]

Examples:
- Read from a file:
        jnv data.json

- Read from standard input:
        cat data.json | jnv

Arguments:
  [INPUT]  Optional path to a JSON file. If not provided or if "-" is specified, reads from standard input

Options:
  -c, --config <CONFIG_FILE>             Path to the configuration file.
      --default-filter <DEFAULT_FILTER>  Default jq filter to apply to the input data
  -h, --help                             Print help (see more with '--help')
  -V, --version                          Print version

Stargazers over time

Stargazers over time

Description
Interactive JSON filter using jq
Readme MIT 2.3 MiB
Languages
Rust 98.3%
Dockerfile 1.7%