ynqa/jnv
Fork: 42 Star: 4379 (更新于 2024-05-15 21:27:27)
license: MIT
Language: Rust .
interactive JSON filter using jq
最后发布版本: v0.2.2 ( 2024-04-21 19:18:04)
jnv
jnv is designed for navigating JSON,
offering an interactive JSON viewer and jq
filter editor.
Features
- Interactive JSON viewer and
jq
filter editor- Syntax highlighting for JSON
- 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
Installation
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
Cargo
Requirements
cargo install jnv
[!NOTE] jnv does not require users to install
jq
on their system, because it utilizes j9 Rust bindings.
Examples
cat data.json | jnv
Or
jnv data.json
Keymap
Key | Action |
---|---|
Ctrl + C | Exit jnv |
Tab | jq filter auto-completion |
← | Move the cursor one character to the left |
→ | Move the cursor one character to the right |
Ctrl + A | Move the cursor to the start of the filter |
Ctrl + E | Move the cursor to the end of the filter |
Backspace | Delete a character of filter at the cursor position |
Ctrl + U | Delete all characters of filter |
↑, Ctrl + K | Move the cursor one entry up in JSON viewer |
↓, Ctrl + J | Move the cursor one entry down in JSON viewer |
Ctrl + H | Move to the last entry in JSON viewer |
Ctrl + L | Move to the first entry in JSON viewer |
Enter | Toggle expand/collapse in JSON viewer |
Ctrl + P | Expand all folds in JSON viewer |
Ctrl + N | Collapse all folds in JSON viewer |
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(. ,| ,( ,) ,[ ,] ) |
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:
-e, --edit-mode <EDIT_MODE>
Specifies the edit mode for the interface.
Acceptable values are "insert" or "overwrite".
- "insert" inserts a new input at the cursor's position.
- "overwrite" mode replaces existing characters with new input at the cursor's position.
[default: insert]
-i, --indent <INDENT>
Affect the formatting of the displayed JSON,
making it more readable by adjusting the indentation level.
[default: 2]
-n, --no-hint
When this option is enabled, it prevents the display of
hints that typically guide or offer suggestions to the user.
-d, --expand-depth <EXPAND_DEPTH>
Specifies the initial depth to which JSON nodes are expanded in the visualization.
Note: Increasing this depth can significantly slow down the display for large datasets.
[default: 3]
-l, --suggestion-list-length <SUGGESTION_LIST_LENGTH>
Controls the number of suggestions displayed in the list,
aiding users in making selections more efficiently.
[default: 3]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
Stargazers over time
最近版本更新:(数据更新于 2024-04-26 22:17:28)
2024-04-21 19:18:04 v0.2.2
2024-03-29 23:47:05 v0.2.1
2024-03-25 19:23:39 v0.2.0
2024-03-24 10:49:23 v0.1.3
2024-03-21 21:47:48 v0.1.2
2024-03-20 10:05:07 v0.1.1
2024-03-19 22:06:24 v0.1.0
主题(topics):
autocomplete, cli, command-line, interactive, jq, json, kubernetes, prompt, rust
ynqa/jnv同语言 Rust最近更新仓库
2024-05-19 19:06:52 actix/actix-web
2024-05-19 09:11:47 lapce/lapce
2024-05-18 17:46:26 extrawurst/gitui
2024-05-18 09:51:52 slawlor/ractor
2024-05-17 21:48:26 tailcallhq/tailcall
2024-05-17 20:37:18 hyperium/h2