Interprocess pipeline is a difficult problem only because there is no standard encoding. Elvish has pairs of builtin commands like from-json and to-json; so if your command takes JSON and writes JSON, you can use it in a pipeline like:
... | to-json | your-command | from-json | ...
It is also trivial to wrap it into a function like: