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('my-app:my-command') ->setDescription('My command description') ->addArgument('my-argument', InputArgument::REQUIRED, 'My argument description') ->addOption('my-option', null, InputOption::VALUE_OPTIONAL, 'My option description'); } protected function execute(InputInterface $input, OutputInterface $output) { // command logic } }In the above example, the configure method is used to define the name, description, argument and option for a console command. The package library used here is `symfony/console`, which is a standalone package for building console applications in PHP. With this method, we can define the necessary configuration details for our console command, which makes it more maintainable and reusable.