The device command can record operations into a batch file and run them later with device batch-execute.
See that page for the batch file syntax, the list of subcommands that support batch recording, and shell examples.
When you use the --json flag, the batch options interact with the JSON message stream in the following way:
--append-batch- Writes the operation to the batch file and does not perform it on a device. nRF Util writes the operation JSON only to the batch file, not to the standard output. With--json, the command does not print any message to the standard output. Without--json, it prints a single confirmation line.--generate- Prints the JSON definition of the operation as aninfomessage and does not perform it on a device. To output only the operation definition, add the--skip-overheadflag. If you use--generatetogether with--append-batch, the command only prints the definition and does not write to the batch file.batch-execute- Runs the batch on the selected devices. By using--json, the command reports each operation in the batch as a task, using thetask_begin,task_progress, andtask_endmessages.
The JSON format of batch files and operation definitions is not stable and can change between versions of the device command.
The semantic versioning guarantees for the JSON message stream do not apply to it.
For example, the following command prints only the JSON definition of an erase operation:
nrfutil --json device erase --all --generate --skip-overhead