cli: implement structured output version 4