JSON encoding working for command-line pipes