Title: Hey, Hacker News! Today I&#x27;m proud to release jless, a command-line JSON viewer.<p>jless provides a JSON viewing experience similar to what you see in a browser&#x27;s network tab in the developer console, but from the comfort of your terminal, with a whole suite of vim-inspired key bindings to easily manipulate your view of the data and full-text regex search. I&#x27;m sure many of you have some piped together some combination of cat, jq and less before; hopefully jless can replace that usage (hence the name). It supports newline delimited JSON too, so it can handle any output from jq.<p>I built jless to solve a problem I kept facing while building plaintextsports.com [1][2]. For the live data I use a lot of public, but undocumented APIs, and I was constantly digging through giant JSON files to understand how the data was structured. I tried installing multiple Chrome extensions, but was dissatisfied with all of them. I piped files through jq into less a lot, and that was ok, but not great. The Preview pane in the Network tab of Chrome&#x27;s dev tools was pretty useful, and I modeled a lot of jless&#x27;s behavior and appearance off of that, but it didn&#x27;t fit well into my tmux + vim dev environment, and I couldn&#x27;t easily use it to inspect files on disk. I wanted that experience, but in my terminal (and with search support).<p>Once I had built a rudimentary version of jless a few months ago, I immediately started using it whenever I was debugging something, and my usage has only grown as I&#x27;ve added more basic functionality. I&#x27;ve finally added all the features I feel like it needs to be functional, useful, and reliable.<p>There&#x27;s definitely more features I want to add: Windows support, some way to filter data with jq filters (a la fx [3]), yanking objects to the clipboard, being able to hide keys entirely, streaming data in, so you can peek at the start of gigantic file, maybe a way to extract a schema from a file (like [4]), plenty of low-hanging fruit for performance. Support for different hierarchical data formats (YAML, TOML, XML) could be cool someday. I&#x27;m sure many people will ask for editing support, but sadly that is not something I plan on adding anytime soon.<p>I also used this project as a chance to learn Rust (code style and design comments appreciated!), which I had only dabbled with before. For a command-line utility, this felt like an obvious choice: small binaries (~3mb), instant startup, and great performance without any effort (try searching for comma in a big file!).<p>I hope you find it useful!<p>[1]: <a href="https:&#x2F;&#x2F;plaintextsports.com" rel="nofollow">https:&#x2F;&#x2F;plaintextsports.com</a>, live sports scores in plain text, no ads, no tracking, no loading<p>[2]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26310314" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26310314</a><p>[3]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29861043" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29861043</a><p>[4]: <a href="https:&#x2F;&#x2F;quicktype.io&#x2F;typescript" rel="nofollow">https:&#x2F;&#x2F;quicktype.io&#x2F;typescript</a>
Upvote: