
Show HN: Jqview, a simple native GUI for inspecting JSON with jq - fiatjaf
https://github.com/fiatjaf/jqview
======
heinrichhartman
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/](https://paweldu.dev/posts/fzf-live-
repl/)

~~~
ryannevius
A little slow with large json datasets, but a major game changer. Thank you
for sharing!

------
donio
This uses [https://github.com/itchyny/gojq](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!

------
ldd
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](https://github.com/ldd/vscode-jq)

~~~
prepend
Thanks for your plugin. I wish it had up arrow history. I keep a separate text
log with commands and it would be nice if the plugin tracked them. Especially
given the high numbers of jq syntax errors.

~~~
ldd
Great feature request. I've been there.

I'll look into it for sure!

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

~~~
mehrdadn
gron looks pretty cool, but it doesn't really seem like a substitute for jq?
jq does all sorts of transformations.

~~~
enriquto
yep, gron simply rewrites json into a sane format that can be then transformed
by the standard tools (grep, cut, sed, awk, ...). In practice, I use gron
mostly to print json data in a human readable and editable format.

------
mtmail
[https://github.com/jcsalterego/jqq/](https://github.com/jcsalterego/jqq/) is
similar, written in Ruby by HN user
[https://news.ycombinator.com/user?id=jcsalterego](https://news.ycombinator.com/user?id=jcsalterego)

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

[https://apps.apple.com/us/app/json-
editor/id567740330?mt=12](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.

~~~
zoba
jq is nice because it can handle massive json files. Do you know if this app
handles hundreds of mb files?

~~~
Klonoar
It likely works about as fine as NSJSONSerialization does, which is to say:
I've had no issues, although the "validating" does sometimes lag and that can
be annoying.

If someone else uses it I'd be interested in their thoughts.

------
yingw787
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](https://jq.io/https://myapi.com/endpoint?jqparams=$PARAMS)

So like bash via HTTP :)

~~~
PufPufPuf
That exists:
[https://github.com/captn3m0/jqaas](https://github.com/captn3m0/jqaas)

~~~
yingw787
Oh cool! Kinda wish you had url params vs. having to curl with request data
(kinda like [https://cors-anywhere.herokuapp.com/](https://cors-
anywhere.herokuapp.com/)), but wayyy better than nothing!

------
atmosx
Related tools for those working with JSON:

\- jo: convert shell ouput to JSON

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

~~~
adictator
jid as well

~~~
namibj
Please explain what that's for.

~~~
lioeters
Json Incremental Digger -
[https://github.com/simeji/jid](https://github.com/simeji/jid)

"..drill down JSON interactively by using filtering queries like jq"

------
johnsonjo
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](https://www.genealogy.math.ndsu.nodak.edu/id.php?id=200008)

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

------
easytiger
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

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

~~~
fiatjaf
Indeed. That is fault of my inexistent experience making "native" UIs -- or
maybe the Fyne GUI framework wasn't smart enough.

------
freedomben
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 ;-)

------
cube2222
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](https://github.com/cube2222/jql)

------
kissgyorgy
You mean?

    
    
        cat json | jq | less
    

I checked the code, it's concatenating the output with newlines. Not necessary
at all.

~~~
salmo
Yay, useless use of cat. I think you mean

    
    
      jq . < json | less
    

Sorry for being pedantic. Moving on.

~~~
mason55
Yes, you can re-write it without using cat, but many people (including me)
think it's clearer to read from left-to-right. Plus the mixing of sending the
file through stdin and then using a pipe always makes my brain pause.

I just personally find that using cat as the first part of the pipeline makes
everything easier.

Plus, if you're going to argue against useless use of cat, there's also no
reason to send the file in through stdin. jq can read the file directly.

~~~
hombre_fatal
Agreed. Keeping the source on the far left (whether cat or curl) just makes
things easiest to follow.

~~~
amake
You can put `<json` on the left no problem.

(But it makes the pipeline harder to edit so actually I have no problem with
`cat JSON`)

------
fphilipe
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](https://github.com/AdrianSchneider/jsonfui)

------
rmetzler
I like [https://github.com/akavel/up](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.

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

~~~
shmoogy
You should be able to add -jquery to your query to remove it as a term. Or do
"jq" most of the time it works to clear your results

Also duckduckgo can be better than google sometimes

~~~
dastx
DDG is terrible with this. I've had so many jq searches with the -jquery, and
yet, I still many jquery results. It's super annoying.

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

[https://github.com/ajbruin/jl](https://github.com/ajbruin/jl)

------
cylon13
Nice tool, and nice choice of example names!

------
parentheses
fantastic work! installed.

