/usr/sbin/system_profiler
system_profiler reports on the hardware and software configuration of the system. It can generate plain text report or XML reports which can be opened with System Information.app, or JSON reports.