Generate boilerplate code for modules/plugins/services etc.
Drush asks questions so that the generated code is as polished as possible. After generating, Drush lists the files that were created.
drush generate. Pick from available generators and then run it.
drush generate drush-command-file. Generate a Drush commandfile for your module.
drush generate controller --answer=Example --answer=example. Generate a controller class and pre-fill the first two questions in the wizard.
drush generate controller -vvv --dry-run. Learn all the potential answers so you can re-run with several --answer options.
- [generator]. A generator name. Omit to pick from available Generators.
- --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Absolute path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
- Instructions on creating your own Drush Generators. (docs:generators)
- An argument or option with square brackets is optional.
- Any default value is listed at end of arg/option description.
- An ellipsis indicates that an argument accepts multiple values separated by a space.