use Symfony\Component\Console\Application; $app = new Application('My Console Application', '1.0.0'); $app->run();
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class MyCommand extends Command { protected function configure() { $this->setName('mycommand') ->setDescription('My command description'); } protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln('Hello, world!'); } } $app->add(new MyCommand());Package Library: The Symfony Console Component.