Registering Commands Automatically
To make the console commands available automatically within a Drupal installation, you will need to:
Commanddirectory inside your module i.e.
src/Commandand create a
PHPfile suffixed with
MyCustomCommand.phpfor each command that you want to provide.
Make sure you class extends one of
Drupal Console provides two types of commands,
stand alone and
container aware commands.
Stand alone commands
These commands are listed and can run outside of a Drupal installation, you defined one by extending the
class MyStandAloneCommand extends Command
Container aware commands
These commands are listed and must be run against a Drupal, you defined one by extending the
class MyContainerAwareCommand extends ContainerAwareCommand