News for hackers. Stuff that matters.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by heinrichhartman on Friday June 05, 2020 @05:11PM (#23434018)
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/
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by ryannevius on Saturday June 06, 2020 @04:15AM (#23437578)
A little slow with large json datasets, but a major game changer. Thank you for sharing!
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by KitDuncan on Saturday June 06, 2020 @06:15AM (#23438103)
fzf is so amazing. it basically replaced filemanagers completely for me.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by donio on Friday June 05, 2020 @09:09PM (#23435893)
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!
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by ldd on Friday June 05, 2020 @06:15PM (#23434645)
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

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by prepend on Friday June 05, 2020 @07:03PM (#23434990)
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.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by ldd on Friday June 05, 2020 @10:49PM (#23436383)
Great feature request. I've been there.

I'll look into it for sure!

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by originalvichy on Saturday June 06, 2020 @05:55PM (#23442571)
If this hasn’t been said:

Is there a way to instantly find out what filter to use when you click on a certain row? Kind of like doing exploratory jq on VSCode so you can quickly move it to the shell?

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by ldd on Saturday June 06, 2020 @06:14PM (#23442721)
So, I don't really understand. but! Suppose you have a JSON file like this:

  [
    {
      "a": 1,
      "b": 2
    },
    {
      "a": 5,
      "b": 6
    },
  ]
what exactly do you want to do with it?
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by originalvichy on Monday June 08, 2020 @06:06AM (#23455219)
If I was to click on the part that saus ’”b”:2’, could you show me the jq query I could use to get just that part of the json file?

Kind of similar to how some Git extensions show who has the last commit on a certain line of code when you click/place cursor on a line

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by ldd on Tuesday June 09, 2020 @03:00PM (#23469609)
Gotcha. I'd honestly also would want this, but I don't see an easy way of implementing it.

It sort of makes me wonder how xpath queries work and what algorithms are used.

At face value, for certain JSON files, it is probably possible to do quickly, like in my example above, but the devil is always in the details...

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by enriquto on Saturday June 06, 2020 @01:06AM (#23436966)
I too was falling into the trap of jq, but then I discovered gron, and it turned my world upside down. Long live gron!
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by mehrdadn on Saturday June 06, 2020 @04:09AM (#23437560)
gron looks pretty cool, but it doesn't really seem like a substitute for jq? jq does all sorts of transformations.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by enriquto on Saturday June 06, 2020 @04:46AM (#23437672)
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.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by mtmail on Friday June 05, 2020 @05:45PM (#23434383)
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by Klonoar on Friday June 05, 2020 @07:43PM (#23435269)
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.

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by zoba on Friday June 05, 2020 @08:05PM (#23435416)
jq is nice because it can handle massive json files. Do you know if this app handles hundreds of mb files?
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by Klonoar on Friday June 05, 2020 @11:06PM (#23436458)
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.

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by yingw787 on Friday June 05, 2020 @05:03PM (#23433935)
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 :)

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by PufPufPuf on Friday June 05, 2020 @05:40PM (#23434333)
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by yingw787 on Friday June 05, 2020 @06:58PM (#23434948)
Oh cool! Kinda wish you had url params vs. having to curl with request data (kinda like https://cors-anywhere.herokuapp.com/), but wayyy better than nothing!
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by parentheses on Friday June 05, 2020 @05:07PM (#23433973)
are you saying you want to use a json object as input to a query?

Retool does this btw. I work there because the product is SICK!

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by yingw787 on Friday June 05, 2020 @05:15PM (#23434062)
I think `jq`'s syntax is a bit different than bare JSON (I do basic stuff like `echo $CHANNELS_RESPONSE | jq -r ".public_identifier"`), I think it'd be like running a bash script as an input to a query :)

Also not sure whether to start repping TinyDev (my project) but I can pass in an arbitrary read-only SQL query via HTTP to create a materialized view from table(s). HTTP + local procedures is like a very simple RPC :)

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by atmosx on Friday June 05, 2020 @05:13PM (#23434039)
Related tools for those working with JSON:

- jo: convert shell ouput to JSON

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

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by soheilpro on Friday June 05, 2020 @07:36PM (#23435230)
Also, catj - Displays JSON files in a flat, concise format.

https://github.com/soheilpro/catj

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by kasabali on Saturday June 06, 2020 @02:05PM (#23441069)
This is my favorite json viewer gui: https://github.com/ashwin/json-viewer

it's a single file python/tk script, requires no installation and no dependencies other than standard python

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by adictator on Friday June 05, 2020 @05:25PM (#23434169)
jid as well
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by namibj on Friday June 05, 2020 @05:37PM (#23434302)
Please explain what that's for.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by lioeters on Friday June 05, 2020 @06:10PM (#23434612)
Json Incremental Digger - https://github.com/simeji/jid

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

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by johnsonjo on Sunday June 07, 2020 @04:55AM (#23445878)
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
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by jteppinette on Friday June 05, 2020 @07:27PM (#23435176)
Happy to see a few Austrian school economists in the example data!
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by easytiger on Saturday June 06, 2020 @03:17AM (#23437417)
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
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by nickodell on Saturday June 06, 2020 @12:44AM (#23436890)
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.

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by fiatjaf on Saturday June 06, 2020 @05:23PM (#23442344)
Indeed. That is fault of my inexistent experience making "native" UIs -- or maybe the Fyne GUI framework wasn't smart enough.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by freedomben on Friday June 05, 2020 @08:44PM (#23435717)
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 ;-)
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by cube2222 on Saturday June 06, 2020 @03:13AM (#23437406)
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

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by kissgyorgy on Friday June 05, 2020 @05:26PM (#23434184)
You mean?

    cat json | jq | less
I checked the code, it's concatenating the output with newlines. Not necessary at all.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by snidane on Friday June 05, 2020 @05:33PM (#23434257)
If you want to preserve colors:

    jq . -C | less -R
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by atombender on Saturday June 06, 2020 @01:18PM (#23440710)
No, that's not what it does.

To be fair, the readme doesn't explain it well. This is a GUI app that allows you to see the jq results in real time. Here [1] is a video.

[1] https://gfycat.com/oddtartbrahmanbull

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by salmo on Friday June 05, 2020 @05:30PM (#23434232)
Yay, useless use of cat. I think you mean

  jq . < json | less
Sorry for being pedantic. Moving on.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by mason55 on Friday June 05, 2020 @05:36PM (#23434291)
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.

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by hombre_fatal on Friday June 05, 2020 @08:14PM (#23435498)
Agreed. Keeping the source on the far left (whether cat or curl) just makes things easiest to follow.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by amake on Friday June 05, 2020 @10:08PM (#23436189)
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`)

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by vially on Friday June 05, 2020 @05:36PM (#23434292)
The input redirection pipe is not necessary either:

  jq . json | less
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by mthoms on Friday June 05, 2020 @09:32PM (#23436003)
It's not useless if it makes it much more readable :)
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by nicwolff on Friday June 05, 2020 @05:38PM (#23434309)
I think you mean

    < json jq . | less
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by tlrobinson on Saturday June 06, 2020 @01:51AM (#23437135)
Congrats on saving two characters?
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by fphilipe on Friday June 05, 2020 @06:12PM (#23434625)
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

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by rmetzler on Saturday June 06, 2020 @02:09AM (#23437189)
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.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by OJFord on Friday June 05, 2020 @08:07PM (#23435430)
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.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by shmoogy on Friday June 05, 2020 @08:47PM (#23435743)
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

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by dastx on Saturday June 06, 2020 @04:35AM (#23437635)
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.
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by OJFord on Saturday June 06, 2020 @04:04AM (#23437543)
I use DDG exclusively and yes of course I add -jquery after kicking myself for forgetting.

Plenty of results still slip through, and it seems some people abbreviate jQuery to jq anyway.

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by ajbruin on Saturday June 06, 2020 @01:59AM (#23437159)
I built a small tool named jl to convert JSON to lines of text.

https://github.com/ajbruin/jl

Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by cylon13 on Friday June 05, 2020 @07:30PM (#23435193)
Nice tool, and nice choice of example names!
Re:Show HN: Jqview, a simple native GUI for inspecting JSON ... by parentheses on Friday June 05, 2020 @05:04PM (#23433938)
fantastic work! installed.