Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What I really want is all the shell commands to have an object (e.g. json) output mode. Then all my "glue" between tools becomes less bespoke and more standardized, e.g. jq. Instead of analyzing output to build weird grep and awk statements, I would just need to remember a couple of jq patterns, take a quick look at the output, and use one of my patterns to extract the data to stream to the next command.



I want it to work in all the shells, which is why I want the functionality inside the tools themselves.


Sending you thoughts and prayers, then. Although, I am not very confident it's within God's capabilities.


Take a look at Marcel, https://marceltheshell.org.

It passes Python values instead of json, but otherwise works as you described.


https://github.com/kellyjonbrazil/jc - "CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts."


Thank you for the link. It still would be great built in functionality for the tools themselves.


Sounds nice. But I think we all know how that would go (insert xkcd on competing standards)


I have a recurring nightmare where web developers create a one world government where they enforce a law requiring all data be converted to JSON before transmission. Existing network protocols are replaced with JSON-compatible versions, and specialized JSON parsing ASICs become a necessity in network devices. The nightmare ends with the collapse of civilization.


Didn't that happen with XML and web services? We survived that one.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: