7 ms·
Jless – a command-line JSON viewer (written in Rust)
- raesene9 5y agoI've started using jless for interacting with things like the Kubelet API, it makes browsing through the response a lot easier when I don't know exactly what I'm looking for.
- harel 5y agoThis looks cool but HomeBrew for linux is a no go for me. Multiple system level package managers is asking for trouble.
- AzzieElbab 5y agoUse cargo? It is user level
- harel 5y agoYes, I can and will, but the point was "why homebrew for linux?". Later I read the author was just not familiar with the Linux ecosystem which pretty much answered my question.
- CodeIsTheEnd 5y ago(Author here) Homebrew support was added entirely with macOS in mind, but Homebrew for Linux uses the same repository of formulas as Homebrew for macOS [1], so you get Linux support for free. I included Homebrew for Linux because it's an option, but I don't want it to be the only option. I guess I should explicitly say in the documentation that help would be appreciated in adding support for other package managers. I definitely want jless available through the most standard avenues. [1]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/jless.rb https://github.com/Homebrew/homebrew-core/blob/master/Formul...
- harel 5y agoHi Author :-) Please note that I am VERY much appreciating the application and effort, and this was not meant as criticism. I saw you mentioned you're not a Linux person which is cool - I get why the brew is there. It's just that I never really understood why there even IS a homebrew for linux. I'm pretty sure you'll find yourself with multo-distro repository presence soon enough since your app is useful indeed.
- zeppelin101 5y agoI don't always use applications posted on HackerNews, but when I do, they're ones written in Rust.
- hericium 5y agoThere was a Show HN by the author recently with an 80+ comments discussion: "Show HN: Jless, a command-line JSON viewer"[1] [1] https://news.ycombinator.com/item?id=30273940 https://news.ycombinator.com/item?id=30273940
- syrusakbary 5y agoFunnily enough I also submitted the same two days ago (I didn’t saw the original show HN) https://news.ycombinator.com/item?id=30435576 https://news.ycombinator.com/item?id=30435576
- Shadonototra 5y agoBuuuut, this one doesn't have the "written in Rust" in the title
- ludovicianul 5y agoExactly. I've submitted something written in Java, while something similar (and far inferior in features) written in Rust drew lot more attention
- CodeIsTheEnd 5y agoAuthor here! When I originally submitted it, it didn't get a lot of traction (it got on the front-page via the second chance pool a couple days later), and I definitely regretted not including "written in Rust" in the title. I'm acutely aware of HN's love of Rust, and the subsequent grumbling about always bringing it up that something is written in Rust, so I left it out with the false illusion that not mentioning it would make it more "pure" or something. But I was also pretty confident that I made something useful, and, in hindsight, I don't think I should have preemptively felt bad about using some "cheap" form of marketing to get people to see it. I have really conflicting thoughts about marketing and self-promotion from my experience trying to show people my other project, plaintextsports.com [1] (live sports scores in plain text with no ads or trackers so it loads instantly! I think the HN crowd would love it!). There's a weird line between marketing and advertising and self-promotion, where one is "ok", but the other is frowned upon. It's also a tale as old as time that the better marketed but technically inferior product wins out. (AC vs DC initially, Betamax vs VHS!) How much of success is being brazen enough to ignore those norms and shamelessly promote something? Should it be considered shameful to promote it in the first place? In this case, being written in Rust is definitely a feature, as least when comparing tools! fx [2], a similar tool that made the front-page a couple months ago runs using Node, and I'm sure jless can handle bigger files and uses less memory (though admittedly I haven't actually verified this). [1]: https://plaintextsports.com https://plaintextsports.com [2]: https://news.ycombinator.com/item?id=29861043 https://news.ycombinator.com/item?id=29861043
- leecommamichael 5y agoRust, by the way
- seanw444 5y agoIt seems like the new meta to get HN points. "New software project (WRITTEN IN RUST) (COPS CALLED) (GONE WRONG)"
- semitones 5y agoIt's not meaningless though. With all the checks and balances that the rust compiler enforces, you have a higher likelihood of having a correct and less buggy program.
- DoctorOW 5y agoIn this context, "correct" and "less buggy" are referring specifically to memory safety issues which garbage collection can also solve. Sure, theoretically the C++ JS Engine that powers Postman could maybe have a memory issue when loading up JSON. Until that actually happens, switching to this for a subset of the tasks Postman (or the Chrome dev tools) accomplishes is a waste of time.
- maximilianroos 5y agoAnd community engagement compounds — people like contributing to rust projects, so we can trust the project will continue to grow, so we'll use it, so more people will contribute, etc etc. This holds even if the original reason they enjoyed contributing isn't a good reason!
- sockpuppet69 5y ago
- 8n4vidtmkvmk 5y agoI use jq but it's not interactive like this
- semitones 5y agoI love it!
- f1refly 5y agoLook, I don't have a need for this application, but from the presentation of supported platforms: > Linux > Homebrew > Arch Linux > pacman -U jless First, if you have to revert to homebrew as a package manager on gnu/linux you might as well tell the user to just use cargo directly, that way users only have to install the rust toolchain as opposed to the rust toolchain plus an alien package manger. The typical way would be to make cargo compile the thing, place in in ~/.local somewhere and add that path to PATH. Second, "pacman -U ARG" installs from a file or from a URI. jless is neither. You have to properly package it before pacman will install from a file, which means you have to write a PKGBUILD file with some metadata and build instructions (about 20 lines) and call makepkg, which will then produce the package (a .tar.xz file if I'm not mistaken). I suggest you first test the instructions you put on your website.
- CodeIsTheEnd 5y agoSorry! Someone already filed an issue about this [1], but I haven't had time to investigate exactly what is appropriate to put there. I don't use Linux, nor have I ever released and distributed open-source software before, so I'm just kinda guessing here -- other people have added the project to various package managers, not me. Installing via Linux Homebrew is simply listed as an option because it's available as a Homebrew formula. And the option to install via cargo is also noted. [1]: https://github.com/PaulJuliusMartinez/jless/issues/46 https://github.com/PaulJuliusMartinez/jless/issues/46
- boudin 5y agoAs mentioned in this issue you should not give an install command since it's in the AUR. You can just mention it's available in the AUR and provide a link to the package instead: https://aur.archlinux.org/packages/jless https://aur.archlinux.org/packages/jless
- akvadrako 5y agoI find linuxbrew to be a welcome option since it's one of the most generic methods available. It works on most distros and for most languages, instead of being tied to, say, rust or arch.
- nurbel 5y agoGreat tool thanks! I'll try to catch the livestream ! One thing that would be great to smoothen my use-case is a better resize support. I generally have a bunch of terminals on a screen, and switch to full screen when needed. Currently, the drawing region does not update.
- cloverr20 5y agoThe ability to expand and collapse keys and moving around the sibling keys is great, the help was at the place where I expected it to be, ":h". I love this!
- ivanhoe 5y agoI usually just pipe jq output to less, but this is way nicer, thank you!
- nooyurrsdey 5y agoNice job! Looks useful
- dmos62 5y agoHm, ctrl-d and ctrl-u don't work for me, for some reason (keybinds for scrolling in screen-halves), and scrolling and moving of cursor causes jittering, which is distracting. I'm using lxterm. Nice tool otherwise!
- CodeIsTheEnd 5y agoOops, sorry, I haven't actually made a new release with those commands yet. I'll need to have better discipline maintaining a separate `latest` branch for the website...
- phonebucket 5y agoThis does look like a useful tool. Especially since `jq | less` is a very common pattern for me. Apologies if this might take things a little off-topic. But I can recall seeing "written in Rust" in the titles of quite a few HN posts. Is there any relevance to this? From my perspective, the utility of a given project/product could (or even should) be judged independently of the programming language that it was implemented in.
- tslater2006 5y agoAs someone that has recently started learning Rust, I am certainly interested in looking at source for bigger projects than I've made. Getting a feel for patterns and examples of how to do certain things. If your interest in jless is about its utility, you are right, language doesn't matter. If your interest in jless is looking at its code, I think language is relevant. And personally seeing it in the title let's me know without clicking that I might want to check out it's code later.
- scandox 5y agoI think there's a legitimate interest in the popularity and adoption of Rust because a lot of people are curious to see if it will really stick. So I for one find it interesting and it affects my sense of how it will play out.
- ziml77 5y agoVery true. The choice of a language isn't just driven by how appealing it is to oneself, but also how appealing it is to the broader population of developers. If you use a language that no one wants to work with then you're going to have a tough time getting people to want to contribute. You also end up limited on the third-party libraries that are available if you pick a language that isn't popular.
- aynawn 5y agoAnother contender is gron which does the same. It's written in golang instead of rust. https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron <pre>$ cat test.json | gron</pre>
- markstos 5y agoI have used Gron-- it's very useful and easy to learn and use.
- gav 5y agoI might be weird, but I find gron invaluable for figuring out what I need to pass to jq. gron log.json | grep https # see a json.log.entries[334].request.url jq -r '.log.entries[] | .request.url' log.json
- rmetzler 5y agoExactly what I use gron for and my feature request would be to be able to do this from jless with one key. Currently it seems like jless doesn't even allow to select and copy it (on MacOS' terminal app).
- xanathar 5y agoFeature suggestion: pressing some hotkey exits and prints the path that could be used in jq to select the node that was selected when the hotkey was pressed. I'm sure it has a lot of corner cases as a feature, but that would be super-useful as companion tool to jq.
- rmetzler 5y agoThis is something I often use gron for. And having something like this as output from jless was my feature request the last time I saw this tool on HN. I see it's added now, but it's not possible to select and copy. I'm also not sure about the keys, h or ? doesn't bring up any help text.
- sockpuppet69 5y ago