setName('{{ name }}') ->setDescription('...') ->addArgument('argument', InputArgument::OPTIONAL, 'Argument description') ->addOption('option', null, InputOption::VALUE_NONE, 'Option description') ; } protected function execute(InputInterface $input, OutputInterface $output) { $argument = $input->getArgument('argument'); if ($input->getOption('option')) { // ... } $output->writeln('Command result.'); } {% endblock class_body %} }