The --json flag is a global option on the top-level nrfutil command. Place it immediately after nrfutil, before the device command and its subcommand:
nrfutil --json device <subcommand> [OPTIONS]
Because --json is defined on nrfutil rather than on device, it applies to all nRF Util commands—not only device subcommands. The same flag works with other commands, such as nrfutil search or nrfutil sdk-manager.
Related global output flags include --json-pretty for formatted JSON output and --skip-overhead to output only the data payload from info messages. For details about the JSON message format, see Managing command output for scripting.