jnv is designed for navigating JSON,
offering an interactive JSON viewer and jq
filter editor.
- 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.
- This eliminates the need for users to prepare
Important
Starting from v0.3.0, the transition from libjq Rust binding j9 to jq clone jaq was made.
This change eliminated the need to manage C-related dependencies that include external tools like autoconf, thus simplifying the build process. However, please note that some filters are not yet supported by jaq. For more details, refer to GitHub issue #24.
Please continue to provide feedback regarding this transition.
- Capable of accommodating various format
- Input: File, Stdin
- Data: A JSON or multiple JSON structures that can be deserialized with StreamDeserializer, such as JSON Lines
- Auto-completion for the filter
- Only supports:
- Hint message to evaluate the filter
See here for more info.
brew install jnv
Or install via Homebrew Tap:
brew install ynqa/tap/jnv
See here for more info.
sudo port install jnv
See package entry on search.nixos.org for more info.
nix-shell -p jnv
See here for more info.
pixi global install jnv
# or
cat data.json | pixi exec jnv
# or
conda install jnv
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 install jnv
cat data.json | jnv
# or
jnv data.json
Key | Action |
---|---|
Ctrl + C | Exit |
Ctrl + Q | Copy jq filter to clipboard |
Ctrl + O | Copy JSON to clipboard |
Shift + ↑, Shift + ↓ | Switch to another mode |
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(. ,| ,( ,) ,[ ,] ) |
Key | Action |
---|---|
Tab, ↓ | Select next suggestion |
↑ | Select previous suggestion |
Others | Return to editor |
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 |
SON 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:
-e, --edit-mode <EDIT_MODE> Edit mode for the interface ('insert' or 'overwrite'). [default: insert]
-i, --indent <INDENT> Number of spaces used for indentation in the visualized data. [default: 2]
-n, --no-hint Disables the display of hints.
--max-streams <MAX_STREAMS> Maximum number of JSON streams to display
--suggestions <SUGGESTIONS> Number of autocomplete suggestions to show [default: 3]
-h, --help Print help (see more with '--help')
-V, --version Print version