You can print information passed from nrfutil device in a machine-readable JSON format.
To do this, use the --json parameter, which will print the output directly to stdout on the command line.
The information can be used in scripts or by other applications that can parse JSON.
For example, to list all connected devices as JSON, run the following command:
nrfutil --json device list
To program devices and show progress information as JSON messages, run the following command with the correct ZIP file name:
nrfutil --json device program --traits nordicDfu --firmware <path_to_dfu_package_file>.zip