{"id":13587911,"url":"https://github.com/reegnz/jq-zsh-plugin","last_synced_at":"2025-04-05T16:09:47.660Z","repository":{"id":44749360,"uuid":"237034979","full_name":"reegnz/jq-zsh-plugin","owner":"reegnz","description":"jq zsh plugin","archived":false,"fork":false,"pushed_at":"2024-08-23T08:46:32.000Z","size":30,"stargazers_count":325,"open_issues_count":1,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T15:07:35.554Z","etag":null,"topics":["cli","fzf","jq","shell","zsh","zsh-plugin","zshell"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/reegnz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2020-01-29T16:53:31.000Z","updated_at":"2025-03-23T20:20:45.000Z","dependencies_parsed_at":"2023-11-23T12:28:36.517Z","dependency_job_id":"961a541a-c3ee-4a80-a703-a80c8868fade","html_url":"https://github.com/reegnz/jq-zsh-plugin","commit_stats":{"total_commits":43,"total_committers":11,"mean_commits":3.909090909090909,"dds":0.2325581395348837,"last_synced_commit":"ded47a1e51303fb2cb331288e134e18f637274a6"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reegnz%2Fjq-zsh-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reegnz%2Fjq-zsh-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reegnz%2Fjq-zsh-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reegnz%2Fjq-zsh-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reegnz","download_url":"https://codeload.github.com/reegnz/jq-zsh-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361693,"owners_count":20926643,"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":["cli","fzf","jq","shell","zsh","zsh-plugin","zshell"],"created_at":"2024-08-01T15:06:25.287Z","updated_at":"2025-04-05T16:09:47.633Z","avatar_url":"https://github.com/reegnz.png","language":"Shell","funding_links":[],"categories":["Plugins","Shell","HarmonyOS"],"sub_categories":["ZSH on Windows","Windows Manager","Zinit (née zplugin)"],"readme":"# jq zsh plugin\n\nInteractively build [jq](https://stedolan.github.io/jq/) expressions ([gojq](https://github.com/itchyny/gojq)\nis also supported).\n\nThis zsh plugin gives you jq superpowers!\n\n[Fish](https://fishshell.com/) users: you can use this friendly fork:\n[rmartine-ias/jq-fish-plugin](https://github.com/rmartine-ias/jq-fish-plugin)\n\n## Table of contents\n\n- [Demos](#demos)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Key bindings](#key-bindings)\n\n## Demos\n\n### Interactive jq query construction\n\n[![asciicast](https://asciinema.org/a/IqAqzPS0ZgeaduQ3qs1B5ZgRI.svg)](https://asciinema.org/a/IqAqzPS0ZgeaduQ3qs1B5ZgRI)\n\n### Insert jq query in the middle of a pipeline\n\n[![asciicast](https://asciinema.org/a/9Q4Va21OzD2VTbHwntmLWGvm6.svg)](https://asciinema.org/a/9Q4Va21OzD2VTbHwntmLWGvm6)\n\n## Installation\n\nBesides [jq](https://stedolan.github.io/jq/), this plugin also requires\n[fzf](https://github.com/junegunn/fzf#installation)\n([a recent version](https://github.com/reegnz/jq-zsh-plugin/issues/19)) to be installed and available on your\nPATH.\n\nThe following installation methods are proven to work:\n\n- [Oh My Zsh](#oh-my-zsh)\n- [zplug](#zplug)\n- [Antigen](#antigen)\n- [Zgen](#zgen)\n\n### [Oh My Zsh](https://ohmyz.sh)\n\n1. Clone the repository:\n\n```sh\ngit clone https://github.com/reegnz/jq-zsh-plugin.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/jq\n```\n\n2. Add the plugin to the list of plugins for Oh My Zsh to load (inside `~/.zshrc`):\n\n```sh\nplugins=(\n\t# other plugins...\n\tjq\n)\n```\n\n3. Start a new terminal session.\n\n### [zplug](https://github.com/zplug/zplug)\n\n```sh\nzplug reegnz/jq-zsh-plugin\n```\n\n### [Antigen](https://github.com/zsh-users/antigen)\n\n```sh\nantigen bundle reegnz/jq-zsh-plugin\n```\n\n### [Zgen](https://github.com/tarjoilija/zgen)\n\n```sh\nzgen load reegnz/jq-zsh-plugin\n```\n\n## Usage\n\n- type out a command that you expect to produce json on its standard output\n- press alt + j\n- start typing jq expression and watch it being evaluated in real time (like a true\n  [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop)!)\n- use up/down and hit tab to select one of the suggestions\n- or type out a jq query on your own\n- press enter, and the jq expression is appended to your initial command!\n\n## Key bindings\n\nBringing up the jq query builder for a shell command: `alt + j`\n\nDuring interactive querying, the following shortcuts can be used:\n\n| Shortcut                 | Effect                                           |\n| ------------------------ | ------------------------------------------------ |\n| `ctrl-k` or `up`         | Navigate path queries                            |\n| `ctrl-j` or `down`       | Navigate path queries                            |\n| `tab`                    | Select path query                                |\n| `ctrl-p` or `shift-up`   | Scroll up                                        |\n| `ctrl-n` or `shift-down` | Scroll down                                      |\n| `ctrl-alt-p`             | Scroll up half page                              |\n| `ctrl-alt-n`             | Scroll down half page                            |\n| `alt-up`                 | Scroll up full page                              |\n| `alt-down`               | Scroll down full page                            |\n| `ctrl-r`                 | Reload input                                     |\n| `ctrl-y`                 | Yank selected path to clipboard (GNU/Linux only) |\n\n## gojq support\n\nIf you want to use an alternative `jq` implementation, like [gojq](https://github.com/itchyny/gojq) then you\ncan override the default jq command used by the plugin. Set the following environment variable:\n\n```sh\nJQ_REPL_JQ=gojq\n```\n\n## Internals\n\nThe project consists of the following components:\n\n- a `jq.plugin.zsh` providing a\n  [user-defined zsh line-editor widget](https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html),\n  utilizing the `jq-repl` command\n- a `jq-repl` command to interactively build jq expressions, utilizing fzf for its UI\n- a `jq-paths` command to get all valid jq paths in the provided JSON document, used for suggesting paths.\n\n## Troubleshooting\n\n### MacOS: Pressing alt-j creates a `∆` symbol in iTerm2\n\nYou need to remap your alt-key to `Esc+` in iTerm2:\n\n- `Cmd + ,` to enter preferences\n- Go to Profiles\n- select your profile from the pane on the left hand side\n- go to the keys tab\n- Set Left Option (⌥ ) Key to `Esc+`\n\nSee other suggestions on stackoverflow if the above one doesn't help you:\nhttps://stackoverflow.com/q/196357/205318\n\nAnother option is to map to `ctrl+j` instead by putting this in your `.zshrc`:\n\n```sh\nbindkey `^j` jq-complete\n```\n\n### Disable expanding shell aliases\n\nThe plugin automatically expands shell aliases in a command before passing it to `jq-repl`. To disable, put\nthe following line into your `.zshrc`:\n\n```sh\nJQ_ZSH_PLUGIN_EXPAND_ALIASES=0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freegnz%2Fjq-zsh-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freegnz%2Fjq-zsh-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freegnz%2Fjq-zsh-plugin/lists"}