Post

Drush cheatsheet

Get version of Drupal and PHP you are running.

1
drush status

List installed modules

1
drush pm:list --status=enabled

Remove flag to get all installed modules, regardless of status

Enable Module

1
ddev drush en paragraphs 

List Themes

1
drush pm-list --type=theme

Enable Theme

1
ddev drush theme-enable bootstrap5

Set theme as default

1
2
ddev drush cset system.theme default bootstrap5 --yes
ddev drush cr
1
cd /your/drupal/site/
1
drush uli --uri example.com

Trouble Shooting

The Drush launcher could not find a local Drush in your Drupal site.

1
vendor/bin/drush uli --uri http://your-site-url

Find Drush version

1
drush --version

Update Drush

You might need to add the ^ to the beginning of the version number ie ^12.0.2 in the composer.json file.

1
composer update drush/drush

Uninstall Drupal Module

1
drush pm:uninstall module_name

Remove the Module:

1
composer remove drupal/module_name

with ddev

Uninstall the Module:

1
ddev drush pm:uninstall module_name

Remove the Module:

1
ddev composer remove drupal/module_name
This post is licensed under CC BY 4.0 by the author.