Show HN: Jqview, a simple native GUI for inspecting JSON with jq

fiatjaf | 208 points

You can get something fairly similar with fzf, using the --preview trick from [1]:

    echo '' | fzf --print-query --preview "cat *.json | jq {q}"
https://paweldu.dev/posts/fzf-live-repl/
heinrichhartman | 4 years ago

This uses https://github.com/itchyny/gojq which is a pure Go re-implementation of jq. Can be used as a cli tool or as a library. Didn't know about this, very cool that it exists!

donio | 4 years ago

I made a VSCode extension for jq[0], so I really like when people see the power of jq.

I should probably update it with a couple of life improvements now that I think about it.

[0]: https://github.com/ldd/vscode-jq

ldd | 4 years ago

I too was falling into the trap of jq, but then I discovered gron, and it turned my world upside down. Long live gron!

enriquto | 4 years ago

If you're on macOS, I can't recommend this app enough:

https://apps.apple.com/us/app/json-editor/id567740330?mt=12

jq and the like are great, but when you're trying to understand something... NSTableView is often times easier to fall back to, haha.

Klonoar | 4 years ago

I started using `jq` for my API project and I have to say it makes JSON munging much nicer on the command line. I think it'd be really cool in order to have a `jq` based redirection service, where you can paste in the URL of the API you want and a query parameter of the `jq` query you want to create.

Something like:

https://jq.io/https://myapi.com/endpoint?jqparams=$PARAMS

So like bash via HTTP :)

yingw787 | 4 years ago

Related tools for those working with JSON:

- jo: convert shell ouput to JSON

- jiq: interactive jq, useful when building complex jq queries

atmosx | 4 years ago

This is pretty tangential, but it’s interesting to me that the examples use Mises, Hayek, and Menger. These are three famous economists that of which Menger is a shared ancestor in the other two’s academic-advisor-genealogy. In academic advisor genealogy being a direct descendant of one academic advisor just means that you had them as an advisor, thus since an advisor has multiple Ph.D. students It creates a family tree like structure. Anyways, I only learned this, because my Dad is actually an academic advisor descendant of Mises and Menger. Anyways if there is any Ph.D.s lurking here on hacker news in a mathematical field you might be able to find your own advisor genealogy here: https://www.genealogy.math.ndsu.nodak.edu/id.php?id=200008

johnsonjo | 4 years ago

Happy to see a few Austrian school economists in the example data!

jteppinette | 4 years ago

jq seemed super useful when I first found it, but ultimately it was always easier to write a few lines of python to do what I needed

easytiger | 4 years ago

This doesn't seem to work that well. If you type invalid syntax, like '.[' then the window suddenly resizes to accomodate the error message, but not all of the text boxes resize.

jiq is probably a better tool.

nickodell | 4 years ago

Your hat tip to the famous Austrian economists in your examples, and the "fiat" part of your username are enough to indicate to me that we could be good friends ;-)

freedomben | 4 years ago

Nice project! Though as others already said, you can use fzf very effectively to get a GUI-like experience for such tools.

If you're not a fan of jq for its syntax, check out jql[1]. It too helps you to transform json files, but does so with a consistent, lispy syntax.

[1]:https://github.com/cube2222/jql

cube2222 | 4 years ago

You mean?

    cat json | jq | less
I checked the code, it's concatenating the output with newlines. Not necessary at all.
kissgyorgy | 4 years ago

Wasn't able to run this yet.

For browsing a JSON file I can also recommend jsonfui. I've been using it for many years now and I'm actually surprised it doesn't have more stars on GitHub.

https://github.com/AdrianSchneider/jsonfui

fphilipe | 4 years ago

I like https://github.com/akavel/up as this works on the command line and helps building fast pipes not only with jq, but also with every other text wrangling tool. But I wish it would be a little bit more polished.

rmetzler | 4 years ago

I wish jq had a different name. I don't know its functions and (JSONPath's?) syntax well, so I'm frequently trying to use it in a hurry and digging through jQuery search results to find what I need.

OJFord | 4 years ago

I built a small tool named jl to convert JSON to lines of text.

https://github.com/ajbruin/jl

ajbruin | 4 years ago

Nice tool, and nice choice of example names!

cylon13 | 4 years ago

fantastic work! installed.

parentheses | 4 years ago