TL;DR: It would be cool if all CLI apps supported JSON output, but in the meantime we can use jc
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.
Hope you enjoy the instance!
Follow the wormhole through a path of communities !webdev@programming.dev
And there is also Nushell and similar projects. Nushell has a concept with the same purpose as jc where you can install Nushell frontend functions for familiar commands such that the frontends parse output into a structured format, and you also get Nushell auto-completions as part of the package. Some of those frontends are included by default.
As an example if you run
ps
you get output as a Nushell table where you can select columns, filter rows, etc. Or you can run^ps
to bypass the Nushell frontend and get the old output format.Of course the trade-off is that Nushell wants to be your whole shell while jc drops into an existing shell.