Using jqp
for interactive queries with jq
This post's featured URL for sharing metadata is https://www.jvt.me/img/profile.jpg.
I'm not particularly jq
-savvy, so when I have to play with it, I find it a little difficult at times.
(Yes, LLMs make the process a little less painful, as I can outsource some of the thinking to them)
Although there are online tools like the JQ Playground, y'all know my thoughts on the fact that you shouldn't use online tools, so I wanted to look for alternatives.
I'd started looking into Neovim plugins for it, and then found a cool Terminal User Interface (TUI) called jqp
which provides a local-only, interactive TUI for testing out queries with JQ.
It's a nice tool that provides a straightforward way to test a query, and see interactively what changes.
For instance, let's look at the query I wrote in Summarising the skipReason
s for Renovate data exports:
.packageData |
to_entries[] |
.key as $k |
.value[] |
.packageFile as $pf |
.deps[] |
select(.skipReason != null) |
"\(.skipReason): \($pf) \($k)/\(.packageName)@\(.currentValue)"
We can see this in jqp
in the following cast:
Note that we're hitting Enter to update the view of the data from that given query.