{"id":13432734,"url":"https://github.com/ynqa/jnv","last_synced_at":"2025-05-12T11:16:16.633Z","repository":{"id":228589338,"uuid":"773832743","full_name":"ynqa/jnv","owner":"ynqa","description":"Interactive JSON filter using jq","archived":false,"fork":false,"pushed_at":"2025-04-11T03:44:22.000Z","size":321,"stargazers_count":5542,"open_issues_count":23,"forks_count":62,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-11T11:06:43.758Z","etag":null,"topics":["autocomplete","cli","command-line","interactive","jq","json","kubernetes","prompt","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ynqa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"ynqa"}},"created_at":"2024-03-18T13:33:43.000Z","updated_at":"2025-05-09T18:47:55.000Z","dependencies_parsed_at":"2024-04-21T04:25:58.987Z","dependency_job_id":"b19fe695-8bdb-4390-9c0b-7360b2e1858c","html_url":"https://github.com/ynqa/jnv","commit_stats":null,"previous_names":["ynqa/jnv"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynqa%2Fjnv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynqa%2Fjnv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynqa%2Fjnv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynqa%2Fjnv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ynqa","download_url":"https://codeload.github.com/ynqa/jnv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253554082,"owners_count":21926612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocomplete","cli","command-line","interactive","jq","json","kubernetes","prompt","rust"],"created_at":"2024-07-31T02:01:15.882Z","updated_at":"2025-05-11T11:06:55.318Z","avatar_url":"https://github.com/ynqa.png","language":"Rust","readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"assets/jnv-dark.svg\"\u003e\n  \u003cimg alt=\"Text describing the image\" src=\"assets/jnv-light.svg\"\u003e\n\u003c/picture\u003e\n\n[![ci](https://github.com/ynqa/jnv/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ynqa/jnv/actions/workflows/ci.yml)\n\n*jnv* is designed for navigating JSON,\noffering an interactive JSON viewer and `jq` filter editor.\n\n![jnv.gif](https://github.com/ynqa/ynqa/blob/master/demo/jnv.gif)\n\nInspired by [jid](https://github.com/simeji/jid)\nand [jiq](https://github.com/fiatjaf/jiq).\n\n## Features\n\n- Interactive JSON viewer and `jq` filter editor\n  - Syntax highlighting for JSON\n  - Use [jaq](https://github.com/01mf02/jaq) to apply `jq` filter\n    - This eliminates the need for users to prepare `jq` on their own\n- Configurable features via TOML configuration\n  - Toggle hint message display\n  - Adjust UI reactivity (debounce times and animation speed)\n  - Editor appearance and behavior\n  - JSON viewer styling\n  - Adjust completion feature display and behavior\n  - Keybinds\n- Capable of accommodating various format\n  - Input: File, stdin\n  - Data: A JSON or multiple JSON structures\n    that can be deserialized with \n    [StreamDeserializer](https://docs.rs/serde_json/latest/serde_json/struct.StreamDeserializer.html),\n    such as [JSON Lines](https://jsonlines.org/)\n- Auto-completion for the filter\n  - Only supports:\n    - [Identity](https://jqlang.github.io/jq/manual/#identity)\n    - [Object Identifier-Index](https://jqlang.github.io/jq/manual/#object-identifier-index)\n    - [Array Index](https://jqlang.github.io/jq/manual/#array-index)\n- Hint message to evaluate the filter\n\n## Installation\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/jnv.svg)](https://repology.org/project/jnv/versions)\n\n### Homebrew\n\nSee [here](https://formulae.brew.sh/formula/jnv) for more info.\n\n```bash\nbrew install jnv\n```\n\nOr install via Homebrew Tap:\n\n```bash\nbrew install ynqa/tap/jnv\n```\n\n### MacPorts\n\nSee [here](https://ports.macports.org/port/jnv/) for more info.\n\n```bash\nsudo port install jnv\n```\n\n### Nix / NixOS\n\nSee [package entry on search.nixos.org](https://search.nixos.org/packages?channel=unstable\u0026query=jnv) for more info.\n\n```bash\nnix-shell -p jnv\n```\n\n### conda-forge\n\nSee [here](https://prefix.dev/channels/conda-forge/packages/jnv) for more info.\n\n```bash\npixi global install jnv\n# or\ncat data.json | pixi exec jnv\n# or\nconda install jnv\n```\n\n### Docker\n\nBuild\n(In the near future, the image will be available on something of registries)\n\n```bash\ndocker build -t jnv .\n```\n\nAnd Run\n(The following commad is just an example. Please modify the path to the file you want to mount)\n\n```bash\ndocker run -it --rm -v $(pwd)/debug.json:/jnv/debug.json jnv /jnv/debug.json\n```\n\n### Cargo\n\n```bash\ncargo install jnv\n```\n\n## Examples\n\n```bash\ncat data.json | jnv\n# or\njnv data.json\n```\n\n## Keymap\n\n| Key | Action |\n| :- | :- |\n| \u003ckbd\u003eCtrl + C\u003c/kbd\u003e | Exit |\n| \u003ckbd\u003eCtrl + Q\u003c/kbd\u003e | Copy jq filter to clipboard |\n| \u003ckbd\u003eCtrl + O\u003c/kbd\u003e | Copy JSON to clipboard |\n| \u003ckbd\u003eShift + ↑\u003c/kbd\u003e, \u003ckbd\u003eShift + ↓\u003c/kbd\u003e | Switch to another mode |\n\n### Editor mode (default)\n\n| Key | Action |\n| :- | :- |\n| \u003ckbd\u003eTab\u003c/kbd\u003e | Enter suggestion |\n| \u003ckbd\u003e←\u003c/kbd\u003e | Move cursor left |\n| \u003ckbd\u003e→\u003c/kbd\u003e | Move cursor right |\n| \u003ckbd\u003eCtrl + A\u003c/kbd\u003e | Move cursor to line start |\n| \u003ckbd\u003eCtrl + E\u003c/kbd\u003e | Move cursor to line end |\n| \u003ckbd\u003eBackspace\u003c/kbd\u003e | Delete character before cursor |\n| \u003ckbd\u003eCtrl + U\u003c/kbd\u003e | Clear entire line |\n| \u003ckbd\u003eAlt + B\u003c/kbd\u003e   | Move the cursor to the previous nearest character within set(`.`,`\\|`,`(`,`)`,`[`,`]`) |\n| \u003ckbd\u003eAlt + F\u003c/kbd\u003e   | Move the cursor to the next nearest character within set(`.`,`\\|`,`(`,`)`,`[`,`]`) |\n| \u003ckbd\u003eCtrl + W\u003c/kbd\u003e  | Erase to the previous nearest character within set(`.`,`\\|`,`(`,`)`,`[`,`]`) |\n| \u003ckbd\u003eAlt + D\u003c/kbd\u003e   | Erase to the next nearest character within set(`.`,`\\|`,`(`,`)`,`[`,`]`) |\n\n#### Suggestion in Editor (after \u003ckbd\u003eTab\u003c/kbd\u003e)\n\n| Key | Action |\n| :- | :- |\n| \u003ckbd\u003eTab\u003c/kbd\u003e, \u003ckbd\u003e↓\u003c/kbd\u003e | Select next suggestion |\n| \u003ckbd\u003e↑\u003c/kbd\u003e | Select previous suggestion |\n| Others | Return to editor |\n\n### JSON viewer mode\n\n| Key | Action |\n| :- | :- |\n| \u003ckbd\u003e↑\u003c/kbd\u003e, \u003ckbd\u003eCtrl + K\u003c/kbd\u003e | Move up |\n| \u003ckbd\u003e↓\u003c/kbd\u003e, \u003ckbd\u003eCtrl + J\u003c/kbd\u003e | Move down |\n| \u003ckbd\u003eCtrl + H\u003c/kbd\u003e | Move to last entry |\n| \u003ckbd\u003eCtrl + L\u003c/kbd\u003e | Move to first entry |\n| \u003ckbd\u003eEnter\u003c/kbd\u003e | Toggle fold |\n| \u003ckbd\u003eCtrl + P\u003c/kbd\u003e | Expand all |\n| \u003ckbd\u003eCtrl + N\u003c/kbd\u003e | Collapse all |\n\n## Usage\n\n```bash\nJSON navigator and interactive filter leveraging jq\n\nUsage: jnv [OPTIONS] [INPUT]\n\nExamples:\n- Read from a file:\n        jnv data.json\n\n- Read from standard input:\n        cat data.json | jnv\n\nArguments:\n  [INPUT]  Optional path to a JSON file. If not provided or if \"-\" is specified, reads from standard input\n\nOptions:\n  -c, --config \u003cCONFIG_FILE\u003e             Path to the configuration file.\n      --default-filter \u003cDEFAULT_FILTER\u003e  Default jq filter to apply to the input data\n  -h, --help                             Print help (see more with '--help')\n  -V, --version                          Print version\n```\n\n## Configuration\n\njnv uses a TOML format configuration file to customize various features. \nThe configuration file is loaded in the following order of priority:\n\n1. Path specified on the command line (`-c` or `--config` option)\n2. Default configuration file path\n\n### Default Configuration File Location\n\nFollowing the `dirs` crate,\nthe default configuration file location for each platform is as follows:\n\n- **Linux**: `~/.config/jnv/config.toml`\n- **macOS**: `~/Library/Application Support/jnv/config.toml`\n- **Windows**: `C:\\Users\\{Username}\\AppData\\Roaming\\jnv\\config.toml`\n\nIf the configuration file does not exist,\nit will be automatically created on first run.\n\n### Configuration Options\n\nThe following settings are available in `config.toml`:\n\n```toml\n# Whether to hide the hint message\nno_hint = false\n\n# Editor settings\n[editor]\n# Editor mode (\"Insert\" or \"Overwrite\")\nmode = \"Insert\"\n# Word break characters\nword_break_chars = [\".\", \"|\", \"(\", \")\", \"[\", \"]\"]\n\n# Theme when editor is focused\n[editor.theme_on_focus]\nprefix = \"❯❯ \"\nprefix_style = { foreground = \"blue\" }\nactive_char_style = { background = \"magenta\" }\ninactive_char_style = {}\n\n# Theme when editor is not focused\n[editor.theme_on_defocus]\nprefix = \"▼ \"\nprefix_style = { foreground = \"blue\", attributes = [\"Dim\"] }\nactive_char_style = { attributes = [\"Dim\"] }\ninactive_char_style = { attributes = [\"Dim\"] }\n\n# JSON display settings\n[json]\n# Maximum number of JSON objects to read from stream\n# max_streams = \n\n# JSON theme settings\n[json.theme]\nindent = 2\ncurly_brackets_style = { attributes = [\"Bold\"] }\nsquare_brackets_style = { attributes = [\"Bold\"] }\nkey_style = { foreground = \"cyan\" }\nstring_value_style = { foreground = \"green\" }\nnumber_value_style = {}\nboolean_value_style = {}\nnull_value_style = { foreground = \"grey\" }\n\n# Completion feature settings\n[completion]\nlines = 3\ncursor = \"❯ \"\nactive_item_style = { foreground = \"grey\", background = \"yellow\" }\ninactive_item_style = { foreground = \"grey\" }\nsearch_result_chunk_size = 100\nsearch_load_chunk_size = 50000\n\n# Keybind settings\n[keybinds]\n# Application exit key\nexit = [{ Key = { modifiers = \"CONTROL\", code = { Char = \"c\" } } }]\n# Copy query to clipboard key\ncopy_query = [{ Key = { modifiers = \"CONTROL\", code = { Char = \"q\" } } }]\n# Copy result to clipboard key\ncopy_result = [{ Key = { modifiers = \"CONTROL\", code = { Char = \"o\" } } }]\n# Mode switch keys\nswitch_mode = [\n  { Key = { code = \"Down\", modifiers = \"SHIFT\" } },\n  { Key = { code = \"Up\", modifiers = \"SHIFT\" } }\n]\n\n# Editor operation keybinds\n[keybinds.on_editor]\n# (Details omitted)\n\n# JSON viewer keybinds\n[keybinds.on_json_viewer]\n# (Details omitted)\n\n# Application reactivity settings\n[reactivity_control]\n# Delay time after query input\nquery_debounce_duration = \"600ms\"\n# Redraw delay time after window resize\nresize_debounce_duration = \"200ms\"\n# Spinner animation update interval\nspin_duration = \"300ms\"\n```\n\nFor more details on configuration, please refer to [default.toml](./default.toml)\n\n\u003e [!WARNING]\n\u003e Depending on the type of terminal and environment,\n\u003e characters and styles may not be displayed properly.\n\u003e Specific key bindings and decorative characters may not\n\u003e display or function correctly in certain terminal emulators.\n\n## Stargazers over time\n[![Stargazers over time](https://starchart.cc/ynqa/jnv.svg?variant=adaptive)](https://starchart.cc/ynqa/jnv)\n","funding_links":["https://github.com/sponsors/ynqa"],"categories":["Rust","Applications","Lovely Commands","Text Processing","cli","rust","\u003ca name=\"data-management-json\"\u003e\u003c/a\u003eData management - JSON/YAML/etc."],"sub_categories":["System tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynqa%2Fjnv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fynqa%2Fjnv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynqa%2Fjnv/lists"}