Skip to content

JSON output

Most commands accept --json: list, info, usb, test, inspect, bench, rescue, repair, capacity, format, wipe, selftest and upload -from. It is the interface SmartDisk for Mac uses.

Terminal window
smartdisk list --json # {"schema":1,"disks":[…]}
smartdisk info --json disk0 # {"schema":1,"reports":[…]}
sudo smartdisk usb --json disk4 # one event per line: step …, result
sudo smartdisk test --json disk4 -full # progress … (at most 4 per second), result
smartdisk upload --json -from report.json # {"schema":1,"id":"HA-…","state":"stored",…}
  • JSON mode never prompts: no disk picker, no upload question. Commands that write take their confirmation as -confirm <disk> instead.
  • Exit codes stay the same (3 BAD, 4 CAUTION, 130 interrupted). See Exit codes.
  • Long-running commands write newline-delimited events: step, progress, then result or error.
  • The format is versioned ("schema": 1). Fields are only ever added.

Every report in info --json (and in the results of usb and selftest) carries capture, the complete report file. See PDF and JSON reports.