setName('My Super Command') // Optional ->setVersion('1.0.0') // Optional ->setCode(function (OutputInterface $output, #[Argument] string $foo = 'The directory', #[Option] string $bar = ''): int { // output arguments and options return 0; }) ->run();