The COMMAND event allows you to attach listeners before any command is executed by the console. It also allows you to modify the command, input and output before they are handed to the command.
@Event("Symfony\\Component\\Console\\Event\\ConsoleCommandEvent");
public const COMMAND = 'console.command';