Jqp – A TUI playground for exploring jq
github.com
github.com
echo '' | fzf --preview 'jq {q} < filename.json'
This approach can be generalized to other tools, to some extent: https://github.com/pawelduda/fzf-live-repl
In this case, the empty string is provided as input because we're not interested in selecting options. You can then type your jq filter in fzf's query box and the command will run against filename.json in the preview pane on every kepress (the {q} is your currently typed query).
I sometimes use jiq for this purpose, but I don't like that it tries to evaluate the query as you type, pressing enter exits the interactive session, and that you can't see the source and output at the same time. Jid has similar issues.
Jqp seems to solve all of these problems, plus it has syntax highlighting. I'm going to use this tool all the time.
I often write some pretty complex jq queries. Once a query starts getting complex, I like to spread it over multiple lines for better readability. It would be cool if Jqp would let me insert newlines by pressing Shift+Enter.
Keep ‘em coming.
Still really great as-is, will definitely use it.
This really makes me want TUIs for many other clis.
I figured from the README that TUI probably stands for Text User Interface as it seems to support keystrokes in a way that an editor like Vi or Emacs work in a terminal (yeah I hadn't of it either, but I guess it is a retro acronym from GUI which is more well known)