Quick tip: Download and enable a module with one Drush command

Us developers tend to be efficiency driven - constantly on the search for productivity gains that allow us to work faster.

Drush makes easy work of downloading and enabling new modules or themes with the pm-download and pm-enable commands.

To download a new module or theme from drupal.org, simply run the following command:

  1. drush dl module_name

dl is an alias for pm-download

And when that has finished downloading, run:

  1. drush en module_name

en is an alias for pm-enable

But there is an even easier way. Rather than running both commands, you can simply run the pm-enable (en) command and skip the pm-download (dl) command entirely. If the module/theme has not been downloaded yet, Drush will automatically download it.

  1. drush en module_name -y

For example, to download and enable the diff module, run:

  1. drush en diff -y

Adding -y to the command skips the prompts asking you confirm that you want to download and enable the module. More time saving!

After you run the command, you will see the following returned:

Drush enable output

That is a 50% time saving! Every productivity optimisation like this, however small, makes a difference.

Get your free Drush Cheatsheet

Drush is awesome - and every awesome thing requires a cheatsheet!

Get your Drush cheatsheet


Conquer Drupal 8 Module Development

Don't struggle to conquer Drupal 8 module development. Action packed lessons where you will work along building your own real world modules.

20% launch discount available now!

Find out more


Add new comment