commandline writes json, csv