Launch a new child process, or run the command in the current process.
Optionally:
* Prevent halting script execution on error.
* Capture and return STDOUT, or full details about command execution.
* Parse JSON output if the command rendered it.
$options = array(
'return' => true, // Return 'STDOUT'; use 'all' for full object.
'parse' => 'json', // Parse captured STDOUT to JSON array.
'launch' => false, // Reuse the current process.
'exit_error' => true, // Halt script execution on error.
);
$plugins = WP_CLI::runcommand( 'plugin list --format=json', $options );