Advertising sustains the DA. Ads are hidden for members. Join today

Drush commands

Last updated on
30 January 2022

The "drush" command is very useful for accessing and manipulating your website's settings and data from the command line. While discussion of how to use drush is out of the scope of this documentation, you can go to https://www.drush.org/ to learn how to install and use drush on your website.

Useful drush commands can be found in core drush, but many more Rules-specific commands are provided by both the Rules module and by the Rules Essentials module. All of these are listed below.

Core drush commands

drush config:status --prefix=rules --format=list
Lists all Rules components and Reaction Rules.
drush config:status --prefix=rules.reaction --format=list
Lists just the Reaction Rules.
drush config:status --prefix=rules.component --format=list
Lists just the Rules components.
drush config:get rules.reaction.machine_name > rules.reaction.machine_name.yml
This will export your reaction rule that has the machine name "machine_name".
drush watchdog:show --type=rules
Shows all Drupal log entries generated by the Rules module.

Rules drush commands

The Rules module provides some new drush commands that are specific to Rules:

You can find these on your site with drush --filter=rules
drush rules:list
List all the active and inactive reaction rules for your site in tabular form.
drush rules:enable
Enable a reaction rule on your site.
drush rules:disable
Disable a reaction rule on your site.
drush rules:delete
Delete a rule on your site.
drush rules:export
Export a rule in YAML format.
drush rules:events
Show a list of Rules events.
drush rules:conditions
Show a list of Rules conditions.
drush rules:actions
Show a list of Rules actions.
drush rules:expressions
Show a list of Rules expressions.

Typed Data API drush commands

The Typed Data API module also provides some new drush commands that useful when using Rules. You can find these with drush --filter=typed-data

drush typed-data:contexts
Show a list of available global contexts variables.
drush typed-data:datafilters
Show a list of available data filters for placeholder replacements.
drush typed-data:datatypes
Show a list of available TypedData data types.
drush typed-data:formwidgets
Show a list of available TypedData form widgets.
drush typed-data:entities
Show a list of site entity types.

Help improve this page

Page status: No known problems

You can: