Using jqp for interactive queries with jq

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 skipReasons 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.

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #json #command-line.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.