[enh] Allow to encode printed result in json from the cli