Generate a module.


drupal generate:module  [options]

Available options



The Module name


The machine name (lowercase and underscore only)


The path of the module


Module description


Core version


Module package


Add a .module file


Define module as feature using the given Features bundle name


Add a composer.json file


Module dependencies separated by commas (i.e. context, panels)


Generate a test class


Generate theme template


Generate a module specifying the module name, machine name, the path, its description, drupal core and the package name. In this example the composer file, the unit test and twig template are generated too

drupal generate:module  \
  --module="modulename"  \
  --machine-name="modulename"  \
  --module-path="/modules/custom"  \
  --description="My Awesome Module"  \
  --core="8.x"  \
  --package="Custom"  \
  --module-file  \
  --composer  \
  --test  \