setName('addon:install') ->addArgument('addon', Option::VALUE_REQUIRED) ->addOption('step', 's', Option::VALUE_REQUIRED) ->setDescription('the addon install command'); } protected function execute(Input $input, Output $output) { $instance = CoreAddonInstallService::instance($input->getArgument('addon')); $step = $input->getOption('step'); try { $instance->$step(); $output->writeln("Command executed successfully"); } catch ( Exception $e ) { $output->writeln("Command failed " . $e->getMessage()); } } }