diff --git a/12.x/search/search_index.json b/12.x/search/search_index.json
index 99d8e955fb..da55fcee7a 100644
--- a/12.x/search/search_index.json
+++ b/12.x/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"
Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands and generators. Similarly, it runs update.php, executes SQL queries, runs content migrations, and misc utilities like cron or cache rebuild. Drush can be extended by 3rd party commandfiles.
"},{"location":"#resources","title":"Resources","text":" - Installing and Upgrading
- Commands and Generators
- API Documentation
- Drush packages available via Composer
- A list of modules that include Drush integration
- Drush expects all participants to abide by the Drupal Code of Conduct.
- Drush 8 is no longer recommended, but here are its docs.
"},{"location":"#support","title":"Support","text":" - Post support requests to Drupal Answers. Tag question with drush.
- Report bugs and request features in the GitHub Drush Issue Queue.
- Use pull requests (PRs) to contribute to Drush. Guidelines.
"},{"location":"#faq","title":"FAQ","text":""},{"location":"#what-does-drush-stand-for","title":"What does Drush stand for?","text":"A: The Drupal Shell.
"},{"location":"#how-do-i-pronounce-drush","title":"How do I pronounce Drush?","text":"Some people pronounce the dru with a long 'u' like Drupal. Fidelity points go to them, but they are in the minority. Most pronounce Drush so that it rhymes with hush, rush, flush, etc. This is the preferred pronunciation.
"},{"location":"#credits","title":"Credits","text":" - Maintained by Moshe Weitzman with much help from the folks listed at https://github.com/orgs/drush-ops/people.
- Originally developed by Arto Bendiken for Drupal 4.7.
- Redesigned by Franz Heinzmann in May 2007 for Drupal 5.
- Thanks to JetBrains for supporting this project and open source software.
"},{"location":"bootstrap/","title":"The Drush Bootstrap Process","text":"When preparing to run a command, Drush works by bootstrapping the Drupal environment in very much the same way that is done during a normal page request from the web server, so most Drush commands run in the context of a fully-initialized website.
For efficiency and convenience, some Drush commands can work without first bootstrapping a Drupal site, or by only partially bootstrapping a site. This is faster than a full bootstrap. It is also a matter of convenience, because some commands are useful even when you don't have a working Drupal site.
Commands may specify their bootstrap level with via an attribute or an annotation. Commands supplied by Drupal modules are always full
.
PHP8 AttributeAnnotation use Drush\\Attributes as CLI;\n\n#[CLI\\Bootstrap(level: DrupalBootLevels::NONE)]\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
/**\n * @bootstrap none\n*/\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
Prior to bootstrapping, Drush goes through the preflight process, where the following things occur:
Preflight
- Commandline arguments are parsed.
- Configuration files are read.
- The site-alias included on the commandline is loaded if present.
- The local selected site is determined, if any.
- Dependency injection is done.
- Global commandfiles are loaded. Commandfiles that ship with modules are loaded later, during
bootstrap @full
. - The command is dispatched via the Symfony Console component.
Bootstrapping is done from a Symfony Console command hook. The different bootstrap levels are described below.
"},{"location":"bootstrap/#none","title":"none","text":"Only run Drush preflight, without considering Drupal at all. Any code that operates on the Drush installation, and not specifically any Drupal directory, should bootstrap to this phase.
"},{"location":"bootstrap/#root","title":"root","text":"Set up and test for a valid Drupal root, either through the --root options, or evaluated based on the current working directory. Any code that interacts with an entire Drupal installation, and not a specific site on the Drupal installation should use this bootstrap phase.
"},{"location":"bootstrap/#site","title":"site","text":"Set up a Drupal site directory and the correct environment variables to allow Drupal to find the configuration file. If no site is specified with the --uri options, Drush will assume the site is 'default', which mimics Drupal's behaviour. Note that it is necessary to specify a full URI, e.g. --uri=http://example.com, in order for certain Drush commands and Drupal modules to behave correctly. See the Drush configuration for more information. Any code that needs to modify or interact with a specific Drupal site's settings.php file should bootstrap to this phase.
"},{"location":"bootstrap/#configuration","title":"configuration","text":"Load the settings from the Drupal sites directory. This phase is analogous to the DRUPAL_BOOTSTRAP_CONFIGURATION bootstrap phase in Drupal itself, and this is also the first step where Drupal specific code is included. This phase is commonly used for code that interacts with the Drupal install API, as both install.php and update.php start at this phase.
"},{"location":"bootstrap/#database","title":"database","text":"Connect to the Drupal database using the database credentials loaded during the previous bootstrap phase. This phase is analogous to the DRUPAL_BOOTSTRAP_DATABASE bootstrap phase in Drupal. Any code that needs to interact with the Drupal database API needs to be bootstrapped to at least this phase.
"},{"location":"bootstrap/#full","title":"full","text":"Fully initialize Drupal. This is analogous to the DRUPAL_BOOTSTRAP_FULL bootstrap phase in Drupal. Any code that interacts with the general Drupal API should be bootstrapped to this phase.
"},{"location":"bootstrap/#max","title":"max","text":"This is not an actual bootstrap phase. Commands that use the \"max\" bootstrap level will cause Drush to bootstrap as far as possible, and then run the command regardless of the bootstrap phase that was reached. This is useful for Drush commands that work without a bootstrapped site, but that provide additional information or capabilities in the presence of a bootstrapped site. For example, drush status
will show progressively more information the farther the site bootstraps.
"},{"location":"commands/","title":"Creating Custom Commands","text":"Tip
- Drush 12 expects commandfiles to use a create() method to inject Drupal and Drush dependencies. Prior versions used a drush.services.yml file which is now deprecated and will be removed in Drush 13.
- Drush 12 expects all commandfiles in the
<module-name>/Drush/<Commands|Generators>
directory. The Drush
subdirectory is a new requirement.
Creating a new Drush command is easy. Follow the steps below.
- Run
drush generate drush:command-file
. - Drush will prompt for the machine name of the module that should \"own\" the file. The module selected must already exist and be enabled. Use
drush generate module
to create a new module. - Drush will then report that it created a commandfile. Edit as needed.
- Use the classes for the core Drush commands at /src/Commands as inspiration and documentation.
- See the dependency injection docs for interfaces you can implement to gain access to Drush config, Drupal site aliases, etc. Also note the create() method for injecting Drupal or Drush dependencies.
- Write PHPUnit tests based on Drush Test Traits.
"},{"location":"commands/#attributes-or-annotations","title":"Attributes or Annotations","text":"The following are both valid ways to declare a command:
PHP8 AttributesAnnotations use Drush\\Attributes as CLI;\n\n/**\n * Retrieve and display xkcd cartoons (attribute variant).\n */\n#[CLI\\Command(name: 'xkcd:fetch-attributes', aliases: ['xkcd-attributes'])]\n#[CLI\\Argument(name: 'search', description: 'Optional argument to retrieve the cartoons matching an index, keyword, or \"random\".')]\n#[CLI\\Option(name: 'image-viewer', description: 'Command to use to view images (e.g. xv, firefox).', suggestedValues: ['open', 'xv', 'firefox'])]\n#[CLI\\Option(name: 'google-custom-search-api-key', description: 'Google Custom Search API Key')]\n#[CLI\\Usage(name: 'drush xkcd', description: 'Retrieve and display the latest cartoon')]\n#[CLI\\Usage(name: 'drush xkcd sandwich', description: 'Retrieve and display cartoons about sandwiches.')]\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
/**\n * @command xkcd:fetch\n * @param $search Optional argument to retrieve the cartoons matching an index number, keyword, or \"random\".\n * @option image-viewer Command to use to view images (e.g. xv, firefox).\n * @option google-custom-search-api-key Google Custom Search API Key.\n * @usage drush xkcd\n * Retrieve and display the latest cartoon.\n * @usage drush xkcd sandwich\n * Retrieve and display cartoons about sandwiches.\n * @aliases xkcd\n*/\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
- A commandfile that will only be used on PHP8+ should use PHP Attributes instead of Annotations.
- See Attributes provided by Drush core. Custom code can add additional attributes.
"},{"location":"commands/#altering-command-info","title":"Altering Command Info","text":"Drush command info (annotations/attributes) can be altered from other modules. This is done by creating and registering command info alterers. Alterers are classes that are able to intercept and manipulate an existing command annotation.
In the module that wants to alter a command info, add a class that:
- The generator class namespace, relative to base namespace, should be
Drupal\\<module-name>\\Drush\\CommandInfoAlterers
and the class file should be located under the src/Drush/CommandInfoAlterers
directory. - The filename must have a name like FooCommandInfoAlterer.php. The prefix
Foo
can be whatever string you want. The file must end in CommandInfoAlterer.php
. - The class must implement the
\\Consolidation\\AnnotatedCommand\\CommandInfoAltererInterface
. - Implement the alteration logic in the
alterCommandInfo()
method. - Along with the alter code, it's strongly recommended to log a debug message explaining what exactly was altered. This makes things easier on others who may need to debug the interaction of the alter code with other modules. Also it's a good practice to inject the the logger in the class constructor.
For an example, see WootCommandInfoAlterer provided by the testing 'woot' module.
"},{"location":"commands/#symfony-console-commands","title":"Symfony Console Commands","text":"Drush lists and runs Symfony Console commands, in addition to more typical annotated commands. See this test and this commandfile.
"},{"location":"commands/#auto-discovered-commands-psr4","title":"Auto-discovered commands (PSR4)","text":"Such commands are auto-discovered by their class PSR4 namespace and class/file name suffix. Drush will auto-discover commands if:
Auto-discovered commandfiles should declare their Drush version compatibility via a conflict
directive. For example, a Composer-managed site-wide command that works with both Drush 11 and Drush 12 might contain something similar to the following in its composer.json file:
\"conflict\": {\n\"drush/drush\": \"<11.0\",\n}\n
Using require
in place of conflict
is not recommended. Symlinked packages
While it is good practice to make your custom commands into a Composer package, please beware that symlinked packages (by using the composer repository type Path) will not be discovered by Drush. When in development, it is recommended to specify your package's path in your drush.yml
to have quick access to your commands.
"},{"location":"commands/#site-wide-commands","title":"Site-wide Commands","text":"Commandfiles that are installed in a Drupal site and are not bundled inside a Drupal module are called site-wide commandfiles. Site-wide commands may either be added directly to the Drupal site's repository (e.g. for site-specific policy files), or via composer require
. See the examples/Commands folder for examples. In general, it's preferable to use modules to carry your Drush commands.
Here are some examples of valid commandfile names and namespaces:
- Simple
- Filename: $PROJECT_ROOT/drush/Commands/ExampleCommands.php
- Namespace: Drush\\Commands
- Nested in a subdirectory committed to the site's repository
- Filename: $PROJECT_ROOT/drush/Commands/example/ExampleCommands.php
- Namespace: Drush\\Commands\\example
- Nested in a subdirectory installed via a Composer package
- Filename: $PROJECT_ROOT/drush/Commands/contrib/dev_modules/ExampleCommands.php
- Namespace: Drush\\Commands\\dev_modules
Note: Make sure you do not include src
in the path to your command. Your command may not be discovered and have additional problems.
If a commandfile is added via a Composer package, then it may declare any dependencies that it may need in its composer.json file. Site-wide commandfiles that are committed directly to a site's repository only have access to the dependencies already available in the site.
A site-wide commandfile should have tests that run with each (major) version of Drush that is supported. You may model your test suite after the example drush extension project.
"},{"location":"commands/#global-commands-discovered-by-configuration","title":"Global commands discovered by configuration","text":"Deprecation
Configuration discovery has been deprecated and will be removed in a future version of Drush. It is recommended that you avoid global Drush commands, and favor site-wide or PSR4 discovered commandfiles instead. If you really need commands that are not part of any Drupal site, consider making a stand-alone script or custom .phar instead. See ahoy, Robo and g1a/starter as potential starting points.
Global commandfiles discoverable by configuration are not supported by default; in order to enable them, you must configure your drush.yml
configuration file to add an include
search location.
For example:
drush:\npaths:\ninclude:\n- '${env.home}/.drush/commands'\n
With this configuration in place, global commands may be placed as described in the Site-Wide Drush Commands section above. Global commandfiles may not declare any dependencies of their own; they may only use those dependencies already available via the autoloader. Tip
- The filename must be have a name like Commands/ExampleCommands.php
- The prefix
Example
can be whatever string you want. - The file must end in
Commands.php
- The directory above
Commands
must be one of: - A Folder listed in the 'include' option. Include may be provided via config or via CLI.
- ../drush, /drush or /sites/all/drush. These paths are relative to Drupal root.
"},{"location":"config-exporting/","title":"Exporting and Importing Configuration","text":"Drush provides commands to export, pull, and import Drupal configuration files.
"},{"location":"config-exporting/#simple-value-changes","title":"Simple - value changes","text":"It is not necessary to alter configuration values to make simple value changes to configuration variables, as this may be done by the configuration override system.
The configuration override system allows you to change configuration values for a given instance of a site (e.g. the development server) by setting configuration variables in the site's settings.php file. For example, to change the name of a local development site:
$config['system.site']['name'] = 'Local Install of Awesome Widgets, Inc.';\n
Note that the configuration override system is a Drupal feature, not a Drush feature. It should be the preferred method for changing configuration values on a per-environment basis; however, it does not work for some things, such as enabling and disabling modules."},{"location":"config-exporting/#advanced-variation-by-environment","title":"Advanced - variation by environment","text":" - Drupal supports excluding development modules from enabling on higher environments.
- See Config Split module for more advanced needs.
"},{"location":"cron/","title":"Running Drupal cron tasks from Drush","text":"Drupal cron tasks are often set up to be run via a wget/curl call to cron.php; this same task can also be accomplished via the cron command, which circumvents the need to provide a web server interface to cron.
"},{"location":"cron/#quick-start","title":"Quick start","text":"If you just want to get started quickly, here is a crontab entry that will run cron once every hour at ten minutes after the hour:
10 * * * * cd [DOCROOT] && /usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COLUMNS=72 ../vendor/bin/drush --uri=your.drupalsite.org --quiet maint:status && /vendor/bin/drush --uri=your.drupalsite.org --quiet cron\n
You should set up crontab to run your cron tasks as the same user that runs the web server; for example, if you run your web server as the user www-data:
sudo crontab -u www-data -e\n
You might need to edit the crontab entry shown above slightly for your particular setup; for example, if you have installed Drush to some directory other than /usr/local/drush, then you will need to adjust the path to drush appropriately. We'll break down the meaning of each section of the crontab entry in the documentation that continues below.
"},{"location":"cron/#setting-the-schedule","title":"Setting the schedule","text":"See man 5 crontab
for information on how to format the information in a crontab entry. In the example above, the schedule for the crontab is set by the string 10 * * * *
. These fields are the minute, hour, day of month, month and day of week; *
means essentially 'all values', so 10 * * * *
will run any time the minute == 10 (once every hour).
"},{"location":"cron/#setting-the-path","title":"Setting the PATH","text":"We use /usr/bin/env to run Drush so that we can set up some necessary environment variables that Drush needs to execute. By default, cron will run each command with an empty PATH, which would not work well with Drush. To find out what your PATH needs to be, just type:
echo $PATH\n
Take the value that is output and place it into your crontab entry in the place of the one shown above. You can remove any entry that is known to not be of interest to Drush (e.g. /usr/games), or is only useful in a graphic environment (e.g. /usr/X11/bin).
"},{"location":"cron/#setting-columns","title":"Setting COLUMNS","text":"When running Drush in a terminal, the number of columns will be automatically determined by Drush by way of the tput command, which queries the active terminal to determine what the width of the screen is. When running Drush from cron, there will not be any terminal set, and the call to tput will produce an error message. Spurious error messages are undesirable, as cron is often configured to send email whenever any output is produced, so it is important to make an effort to insure that successful runs of cron complete with no output.
In some cases, Drush is smart enough to recognize that there is no terminal -- if the terminal value is empty or \"dumb\", for example. However, there are some \"non-terminal\" values that Drush does not recognize, such as \"unknown.\" If you manually set COLUMNS
, then Drush will respect your setting and will not attempt to call tput.
"},{"location":"cron/#using-quiet","title":"Using --quiet","text":"By default, Drush will print a success message when the run of cron is completed. The --quiet flag will suppress these and other progress messages, again avoiding an unnecessary email message.
"},{"location":"cron/#specifying-the-drupal-site-to-run","title":"Specifying the Drupal site to run","text":"There are many ways to tell Drush which Drupal site to select for the active command, and any may be used here. The example uses cd [DOCROOT]
, but you could also use the --root and --uri flags.
"},{"location":"cron/#avoiding-maintenance-mode","title":"Avoiding Maintenance mode","text":"The call to maint:status checks to see if the site is in maintenance mode. If yes, cron will not run and the command returns a failure. It is not safe to run cron while the site is in maintenance. See https://drupal.slack.com/archives/C45SW3FLM/p1675287662331809.
"},{"location":"dependency-injection/","title":"Dependency Injection","text":"Drush command files obtain references to the resources they need through a technique called dependency injection. When using this programing paradigm, a class by convention will never use the new
operator to instantiate dependencies. Instead, it will store the other objects it needs in class variables, and provide a way for other code to assign an object to that variable.
"},{"location":"dependency-injection/#types-of-injection","title":"Types of Injection","text":"There are two ways that a class can receive its dependencies. One is called \u201cconstructor injection\u201d, and the other is called \u201csetter injection\u201d.
Example of constructor injection:
public function __construct(DependencyType $service)\n {\n $this->service = $service;\n }\n
Example of setter injection:
public function setService(DependencyType $service)\n {\n $this->service = $service;\n }\n
The code that is responsible for providing the dependencies a class needs is usually an object called the dependency injection container."},{"location":"dependency-injection/#create-method","title":"create() method","text":" 11.6+
Tip
Drush 11 and prior required dependency injection via a drush.services.yml file. This approach is deprecated in Drush 12 and will be removed in Drush 13.
Drush command files can inject services by adding a create() method to the commandfile. See creating commands for instructions on how to use the Drupal Code Generator to create a simple command file starter. A create() method and a constructor will look something like this:
class WootStaticFactoryCommands extends DrushCommands\n{\n protected $configFactory;\n\n protected function __construct($configFactory)\n {\n $this->configFactory = $configFactory;\n }\n\n public static function create(ContainerInterface $container, DrushContainer $drush): self\n {\n return new static($container->get('config.factory'));\n }\n
See the Drupal Documentation for details on how to inject Drupal services into your command file. Drush's approach mimics Drupal's blocks, forms, and controllers. Note that if you do not need to pull any services from the Drush container, then you may omit the second parameter to the create()
method.
"},{"location":"dependency-injection/#createearly-method","title":"createEarly() method","text":" 12.0+ Drush commands that need to be instantiated prior to bootstrap may do so by utilizing the createEarly()
static factory. This method looks and functions exacty like the create()
static factory, except it is only passed the Drush container. The Drupal container is not available to command handlers that use createEarly()
.
Note also that Drush commands packaged with Drupal modules are not discovered until after Drupal bootstraps, and therefore cannot use createEarly()
. This mechanism is only usable by PSR-4 discovered commands packaged with Composer projects that are not Drupal modules.
"},{"location":"dependency-injection/#inflection","title":"Inflection","text":"Tip
Inflection is deprecated in Drush 12; use create()
or createEarly()
instead. Some classes are no longer available for inflection in Drush 12, and more (or potentially all) may be removed in Drush 13.
Drush will also inject dependencies that it provides using a technique called inflection. Inflection is a kind of dependency injection that works by way of a set of provided inflection interfaces, one for each available service. Each of these interfaces will define one or more setter methods (usually only one); these will automatically be called by Drush when the commandfile object is instantiated. The command only needs to implement this method and save the provided object in a class field. There is usually a corresponding trait that may be included via a use
statement to fulfill this requirement.
For example:
<?php\nnamespace Drupal\\my_module\\Commands;\n\nuse Drush\\Commands\\DrushCommands;\nuse Consolidation\\OutputFormatters\\StructuredData\\ListDataFromKeys;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareInterface;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareTrait;\n\nclass MyModuleCommands extends DrushCommands implements SiteAliasManagerAwareInterface\n{\n use SiteAliasManagerAwareTrait;\n\n /**\n * Prints the current alias name and info.\n */\n #[CLI\\Command(name: 'mymodule:myAlias')]\n public function myAlias(): ListDataFromKeys \n {\n $selfAlias = $this->siteAliasManager()->getSelf();\n $this->logger()->success(\u2018The current alias is {name}\u2019, [\u2018name\u2019 => $selfAlias]);\n return new ListDataFromKeys($aliasRecord->export());\n }\n}\n
All Drush command files extend DrushCommands. DrushCommands implements ConfigAwareInterface, IOAwareInterface, LoggerAwareInterface, which gives access to $this->getConfig()
, $this->logger()
and other ways to do input and output. See the IO documentation for more information.
Any additional services that are desired must be injected by implementing the appropriate inflection interface.
Additional Interfaces:
- SiteAliasManagerAwareInterface: The site alias manager allows alias records to be obtained.
- CustomEventAwareInterface: Allows command files to define and fire custom events that other command files can hook.
Note that although the autoloader and Drush dependency injection container is available and may be injected into your command file if needed, this should be avoided. Favor using services that can be injected from Drupal or Drush. Some of the objects in the container are not part of the Drush public API, and may not maintain compatibility in minor and patch releases.
"},{"location":"deploycommand/","title":"Deploy","text":" 10.3+
The deploy command standardizes how Drupal deployments work. The intent is your deployment script updates the codebase for the target site and then this command performs the following:
drush updatedb --no-cache-clear\ndrush cache:rebuild\ndrush config:import\ndrush cache:rebuild\ndrush deploy:hook\n
"},{"location":"deploycommand/#authoring-update-functions","title":"Authoring update functions","text":"Below are the 3 types of update functions run by this command, in order. Choose the most appropriate for your need.
Function Drupal API Purpose HOOK_update_n() Not allowed Low level changes. HOOK_post_update_NAME() Allowed Runs before config is imported. HOOK_deploy_NAME() Allowed Runs after config is imported."},{"location":"deploycommand/#configuration","title":"Configuration","text":"If you need to customize this command, you should use Drush configuration for the subcommands listed above (e.g. updatedb, config:import, etc.).
"},{"location":"generators/","title":"Overview","text":"Tip
Drush 11 and prior required generators to define a drush.services.yml file. This is no longer used with Drush 12+ generators. See create() method for injecting dependencies.
Generators jump start your coding by building all the boring boilerplate code for you. After running the generate command, you have a guide for where to insert your custom logic.
Drush's generators reuse classes provided by the excellent Drupal Code Generator project. See its Commands directory for inspiration.
"},{"location":"generators/#writing-custom-generators","title":"Writing Custom Generators","text":"Drupal modules may supply their own Generators, just like they can supply Commands.
See Woot module, which Drush uses for testing. Specifically,
- Write a class similar to ExampleGenerator. Implement your custom logic in the generate() method. Typically this class is placed under the src/Drush/Generators directory.
- Add a .twig file to the same directory. This template specifies what gets output from the generator.
"},{"location":"generators/#auto-discovered-generators-psr4","title":"Auto-discovered Generators (PSR4)","text":"Generators that don't ship inside Drupal modules are called global generators. For example see CustomDrushGenerator. In general, it is better to use modules to carry your generators. If you still prefer using a global generator, please note:
- The generator class should be PSR4 auto-loadable.
- The generator class namespace, relative to base namespace, should be
Drush\\Generators
. For instance, if a Drush generator provider third party library maps this PSR4 autoload entry: \"autoload\": {\n\"psr-4\": {\n\"My\\\\Custom\\\\Library\\\\\": \"src\"\n}\n}\n
then the Drush global generator class namespace should be My\\Custom\\Library\\Drush\\Generators
and the class file should be located under the src/Drush/Generators
directory. - The filename must have a name like FooGenerator.php. The prefix
Foo
can be whatever string you want. The file must end in Generator.php
.
"},{"location":"generators/#site-wide-generators","title":"Site-wide Generators","text":"Sitewide generators (as opposed to auto-discovered PSR4) have a namespace that starts with \\Drush\\Generators
, the directory above Generators must be one of: 1. A Folder listed in the --include option. include may be provided via config or via CLI. 1. ../drush
, /drush
or /sites/all/drush
. These paths are relative to Drupal root.
"},{"location":"hooks/","title":"Hooks","text":""},{"location":"hooks/#core-hooks","title":"Core Hooks","text":"All commandfiles may implement methods that are called by Drush at various times in the request cycle. To implement one, add a #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: 'pm:install')]
(for example) to the top of your method. The class constants for hooks are located in HookManager.
- Documentation about available hooks.
- To see how core commands implement a hook, you can search the Drush source code.
"},{"location":"hooks/#custom-hooks","title":"Custom Hooks","text":"Drush commands can define custom events that other command files can hook. You can find examples in CacheCommands and SanitizeCommands
First, the command must implement CustomEventAwareInterface and use CustomEventAwareTrait, as described in the dependency injection documentation.
Then, the command may ask the provided hook manager to return a list of handlers with a certain attribute. In the example below, the my-event
label is used:
/**\n * This command uses a custom event 'my-event' to collect data. Note that\n * the event handlers will not be found unless the hook manager is\n * injected into this command handler object via `setHookManager()`\n * (defined in CustomEventAwareTrait).\n */\n #[CLI\\Command(name: 'example:command')] \n public function exampleCommand()\n {\n $myEventHandlers = $this->getCustomEventHandlers('my-event');\n $result = [];\n foreach ($myEventHandlers as $handler) {\n $result[] = $handler();\n }\n sort($result);\n return implode(',', $result);\n }\n
Other commandfiles may provide implementations via a PHP8 Attribute or an Annotation.
PHP8 AttributesAnnotations /**\n * #[CLI\\Hook(type: HookManager::ON_EVENT, target: 'my-event')]\n */\npublic function hookOne()\n{\n return 'one';\n}\n
/**\n * @hook on-event my-event\n */\npublic function hookOne()\n{\n return 'one';\n}\n
"},{"location":"install/","title":"Install","text":"Tip
Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency.
See the Drush 8 or Drush 9 docs for installing prior versions of Drush.
- Composer. It is required that Drupal sites be built using Composer, with Drush listed as a dependency. See recommended-project (Drush must be added). If your Composer project doesn't yet depend on Drush, run
composer require drush/drush
to add it. - Execution. Change your working directory to your project root, and call Drush via
vendor/bin/drush
. To make this easier, append ./vendor/bin
to the end of your $PATH
; this allows you to call Drush via drush
once your working directory is set. If you only have only one Drupal codebase on your system, you may put /path/to/vendor/bin/drush
in your $PATH
; if you do this, then it is not necessary to set your working directory before calling Drush. - Completion. Optional. Append to .bashrc or equivalent for ZSH or Fish shell. Run
drush completion --help
for more details. - Multiple Codebases. Optional. If using the bash shell, consider installing the fd project, a small set of scripts that make it easier to switch between different project directories quickly, with type completion.
Note
- See Usage for details on using Drush.
- To use a non-default PHP, edit ~/.bashrc so that the desired PHP is in front of your $PATH. If that is not desirable, you can change your PATH for just one request:
PATH=/path/to/php:$PATH
drush status ...` - To use a custom php.ini for Drush requests, see this comment.
- See our guide on porting commandfiles from Drush 8 to later versions. Also note that alias and config files use a new .yml format in Drush 10+.
"},{"location":"install/#drupal-compatibility","title":"Drupal Compatibility","text":"Drush Version PHP Version End Of Life Drupal versions 7 8 9 10 Drush 12 8.1+ TBD \u2705 Drush 11 7.4+ Nov 2023 \u2705 \u2713 Drush 10 7.1+ (not 8) Jan 2022 \u2713 \u2713 Drush 9 5.6+ May 2020 \u2713 Drush 8 5.4.5+ Jan 2025 \u2705 \u2713\ufe0f Drush 7 5.3.0+ Jul 2017 \u2713 Drush 6 5.3.0+ Dec 2015 \u2713 Drush 5 5.2.0+ May 2015 \u2713 Legend \u2705 Supported and recommended \u2713 Compatible but no longer supported"},{"location":"io/","title":"Input / Output","text":" - The Input object holds information about the request such option and argument values. You may need to this information when coding a hook implementation. You don't need this object in your command callback method since these values are passed as parameters.
- The Output object is rarely needed. Instead, return an object that gets formatted via the Output Formatter system. If you want to send additional output, use the io system (see below).
"},{"location":"io/#the-io-system","title":"The io() system","text":" - If you need to ask the user a question, or print non-object content, use the io() system.
- A command callback gets access via
$this->io()
. - The main methods for gathering user input are
$this->io()->choice()
and $this->io()->confirm()
. - You may use any of the methods described in the Symfony Style docs.
"},{"location":"migrate/","title":"Defining and running migrations","text":" 10.4+
The Migrate API delivers services for migrating data from a source system to Drupal. This API is provided by the core migrate
module. In order to migrate data to Drupal, you'll need to create migrations for each type of destination data.
These commands are an alternative to https://www.drupal.org/project/migrate_tools. Don't use that module if you use these commands.
"},{"location":"migrate/#defining-migrations","title":"Defining migrations","text":"Learn how to create migrations from the Drupal official documentation:
- Migrate API overview: https://www.drupal.org/docs/8/api/migrate-api/migrate-api-overview
- Drupal API: https://api.drupal.org/api/drupal/core%21modules%21migrate%21migrate.api.php/group/migration
"},{"location":"migrate/#running-migrations","title":"Running migrations","text":"Drush provides a set of commands that allows to run migration operations such as importing, checking the current status of migrations, rolling-back migrations, stopping an ongoing migration, etc. Such commands are available only when the migrate
module is enabled. In order the get a full list of migrate commands, type:
drush --filter=migrate\n
To get help on each command run drush with the command name as parameter and the --help
option. For example next command will show details about the migrate:import Drush command:
drush migrate:import --help\n
"},{"location":"output-formats-filters/","title":"Output Formats, Fields and Filters","text":"Drush utilizes a powerful formatting and filtering system that provides the user with a lot of control over how output from various commands is rendered.
- Output formats may be used to select the data type used to print the output. For example, many commands allow the user to select between a human-readable table, or various machine-parsable formats such as yaml and json.
- Output fields may be used to select and order the data columns.
- Output filters may be used to limit which data rows are printed based on logical expressions.
"},{"location":"output-formats-filters/#output-formats","title":"Output Formats","text":"The --format
option may be used to select the data format used to print the output of a command. Most commands that produce informative output about some object or system can transform their data into different formats. For example, the version command may be printed in a human-readable table (the default), or in a json array:
$ drush version\n Drush version : 10.3.1\n$ drush version --format=json\n{\n\"drush-version\": \"10.3.1\"\n}\n
The available output formats are shown in the help
for each command: $ drush help version\nShow drush version.\n\nOptions:\n --format=<json> Select output format. Available: json, string, var_export, yaml. Default is key-value.\n
"},{"location":"output-formats-filters/#output-fields","title":"Output Fields","text":"If you wish to limit the number of columns produced by a command, use the --fields
option. List the field names in the order they should be displayed:
$ drush views:list --fields=machine-name,status\n+-------------------+----------+\n| Machine name | Status |\n+-------------------+----------+\n| block_content | Enabled |\n| comment | Enabled |\n| comments_recent | Enabled |\n| content | Enabled |\n| content_recent | Enabled |\n| files | Enabled |\n| frontpage | Enabled |\n| taxonomy_term | Enabled |\n| user_admin_people | Enabled |\n| watchdog | Enabled |\n| who_s_new | Enabled |\n| who_s_online | Enabled |\n| archive | Disabled |\n| glossary | Disabled |\n+-------------------+----------+\n
The available field names are shown in the help
text: $ drush help views:list\nGet a list of all views in the system.\n\nOptions:\n --fields=FIELDS Available fields: Machine name (machine-name), Name (label), Description (description), Status (status), Tag (tag) [default: \"machine-name,label,description,status\"]
Fields may be named either using their human-readable name, or via their machine name. Note also that some commands do not display all of their available data columns by default. To show all available fields, use --fields=*
There is also a singular form --field
available. If this form is used, it will also force the output format to string
.
$ drush views:list --field=machine-name \nblock_content\ncomment\ncomments_recent\ncontent\ncontent_recent\nfiles\nfrontpage\ntaxonomy_term\nuser_admin_people\nwatchdog\nwho_s_new\nwho_s_online\narchive\nglossary\n
"},{"location":"output-formats-filters/#output-filters","title":"Output Filters","text":"A number of Drush commands that output tabular data support a --filter
option that allows rows from the output to be selected with simple logic expressions.
In its simplest form, the --filter
option takes a string that indicates the value to filter by in the command's default filter field. For example, the role:list command specifies perms
as its default filter; the output of the role:list
command may be limited to only those roles that have a specified permission:
$ drush role:list --filter='post comments'\nauthenticated:\n label: 'Authenticated user'\nperms:\n - 'access comments'\n- 'access content'\n- 'access shortcuts'\n- 'access site-wide contact form'\n- 'access user contact forms'\n- 'post comments'\n- 'search content'\n- 'skip comment approval'\n- 'use text format basic_html'\n
Note that not all commands have a default filter field. Other fields in the output may be searched by using a simple expression in the --filter
term. For example, to list only the enabled extensions with the pm:list
command, you could run:
$ drush pm:list --filter='status=enabled'\n
To search for fields that contain a string using the operator *=
, or match a regular expression with the ~=
operator. For example, to find all views whose machine name contains the word content: drush views:list --filter='machine-name*=content'\n
To use a regular expression to find any core requirement notice whose title contains either php or gd drush core:requirements --filter='title~=#(php|gd)#i'\n
Finally, filter expressions may also use logical-and (&&
) or logical-or (||
) operations to separate multiple terms. Parenthesis are not supported. For example, to search both the title
and severity
fields in the core:requirements
command: drush core:requirements --filter='title~=#(php|gd)#i&&severity=warning'\n
The =
and *=
operators always use case-insensitive comparisons. The ~=
operator is case-sensitive, unless the i
PCRE modifier is used, as shown in the previous example.
"},{"location":"output-formats-filters/#comparison-of-filters-with-grep","title":"Comparison of Filters with Grep","text":"Using the --filter
feature is similar to using grep
. The main difference is that the filter feature does a semantic search, which is to say that it explicitly compares against the data in specific fields. In comparison, the grep
command does a line-based search.
Show only results where the severity is warning:
drush core:requirements --filter='severity=warning'
Show only lines that contain the string warning (either in the severity field, or somewhere else on the line):
drush core:requirements | grep -i warning
The table below compares and contrasts the two ways of searching.
Feature --filter grep Regular expressions Yes, with ~=
Yes Word-wrapped field data Searched correctly Might cause false negative Search just one field Yes Might get false positives Search multiple fields Yes, with ||
/&&
Yes (line-based searching) Searching hides header No Yes (unless it matches)"},{"location":"repl/","title":"REPL (a custom shell for Drupal)","text":"The php:cli command is interactive PHP REPL with your bootstrapped site (remote or local). It\u2019s a Drupal code playground. You can do quick code experimentation, grab some data, or run Drush commands. This can also help with debugging certain issues. See this blog post for an introduction. Run help
for a list of commands.
Any global PsySH configuration is loaded by Drush. If you prefer a config file that is specific to the project (and can be checked in with other source code), set the environment variable PSYSH_CONFIG=</path/to/config-file>
. This file then takes precedence over any global file.
Entity classes are available without their namespace. For example, Node::load() works instead of Drupal\\Node\\entity\\Noad::load().
"},{"location":"site-alias-manager/","title":"Site Alias Manager","text":"The Site Alias Manager (SAM) service is used to retrieve information about one or all of the site aliases for the current installation.
- An informative example is the browse command
- A commandfile gets access to the SAM by implementing the SiteAliasManagerAwareInterface and useing the SiteAliasManagerAwareTrait trait. Then you gain access via
$this->siteAliasManager()
. - If an alias was used for the current request, it is available via
$this->siteAliasManager()->getself()
. - The SAM generally deals in SiteAlias objects. That is how any given site alias is represented. See its methods for determining things like whether the alias points to a local host or remote host.
- Site alias docs.
- Dynamically alter site aliases.
- The SAM is also available for as a standalone Composer project. More information available in the README there.
"},{"location":"site-aliases/","title":"Site aliases","text":""},{"location":"site-aliases/#basic-usage","title":"Basic usage","text":"In its most basic form, the Drush site alias feature provides a way for teams to share short names that refer to the live and staging sites (usually remote) for a given Drupal site.
Add an alias file called $PROJECT/drush/sites/self.site.yml
, where $PROJECT
is the project root (location of composer.json file). The site alias file should be named self.site.yml
because this name is special, and is used to define the different environments (usually remote) of the current Drupal site.
The contents of the alias file should look something like the example below:
# File: self.site.yml\nlive:\n host: server.domain.com\n user: www-admin\n root: /other/path/to/live/drupal\n uri: http://example.com\nstage:\n host: server.domain.com\n user: www-admin\n root: /other/path/to/stage/drupal\n uri: http://stage.example.com\n
The top-level element names (live
and stage
in the example above) are used to identify the different environments available for this site. These may be used on the command line to select a different target environment to operate on by prepending an @
character, e.g. @live
or @stage
.
Following these steps, a cache:rebuild on the live environment would be:
$ drush @live cache:rebuild\n
All of the available aliases for a site's environments may be listed via:
$ drush site:alias @self\n
The elements of a site alias are:
- host: The fully-qualified domain name of the remote system hosting the Drupal instance. The
host
option must be omitted for local sites, as this option controls various operations, such as whether or not rsync parameters are for local or remote machines, and so on. - user: The username to log in as when using ssh or docker. If each user has to use own username, you can create an environment variable which holds the value, and reference via ${env.PROJECT_SSH_USER} (for example). Or you may omit the
user
item and specify a user in the ~/.ssh/config
file. - root: The Drupal root; must not be specified as a relative path.
- uri: The value of --uri should always be the same as when the site is being accessed from a web browser (e.g. http://example.com)
Drush typically uses ssh to run commands on remote systems; all team members should install ssh keys on the target servers (e.g. via ssh-add
).
"},{"location":"site-aliases/#advanced-usage","title":"Advanced usage","text":"It is also possible to create site alias files that reference other sites on the same local system. Site alias files for other local sites are usually stored in the directory ~/.drush/sites
; however, Drush does not search this location for alias files by default. To use this location, you must add the path in your Drush configuration file. For example, to re-add both of the default user alias path from Drush 8, put the following in your ~/.drush/drush.yml
configuration file:
drush:\n paths:\n alias-path:\n - '${env.HOME}/.drush/sites'\n - /etc/drush/sites\n
A canonical alias named example that points to a local Drupal site named at http://example.com like this:
# File: example.site.yml\ndev:\n root: /path/to/drupal\n uri: http://example.com\n
Note that the first part of the filename (in this case example defines the name of the site alias, and the top-level key dev defines the name of the environment.
With these definitions in place, it is possible to run commands targeting the dev environment of the target site via:
$ drush @example.dev status\n
This command is equivalent to the longer form: $ drush --root=/path/to/drupal --uri=http://example.com status\n
See Additional Site Alias Options for more information."},{"location":"site-aliases/#altering-aliases","title":"Altering aliases:","text":"See examples/Commands/SiteAliasAlterCommands.php) for an example.
"},{"location":"site-aliases/#site-specifications","title":"Site specifications:","text":"When a site alias name is provided on the command line, a site specification may be used instead. A site specification is a site alias that is not saved on the filesystem but instead is provided directly e.g. drush user@server/path/to/drupal#uri core:status
. See example site specifications.
"},{"location":"site-aliases/#environment-variables","title":"Environment variables","text":"Site aliases may reference environment variables, just like any Drush config file. For example, ${env.PROJECT_SSH_USER}
will be replaced by the value of the PROJECT_SSH_USER
environment value.
SSH site aliases may set environment variables via the env-vars
key. See below.
"},{"location":"site-aliases/#additional-site-alias-options","title":"Additional Site Alias Options","text":"Aliases are commonly used to define short names for local or remote Drupal installations; however, an alias is really nothing more than a collection of options.
- docker: When specified, Drush executes via
docker-compose
exec rather than ssh
. - service: the name of the container to run on.
- exec:
- options: Options for the exec subcommand.
- os: The operating system of the remote server. Valid values are Windows and Linux. Set this value for all remote aliases where the remote's OS differs from the local. This is especially relevant for the sql:sync command.
- ssh: Contains settings used to control how ssh commands are generated when running remote commands.
- options: Contains additional commandline options for the
ssh
command itself, e.g. -p 100
- tty: Usually, Drush will decide whether or not to create a tty (via the
ssh --t
option) based on whether the local Drush command is running interactively or not. To force Drush to always or never create a tty, set the ssh.tty
option to true or false, respectively. - paths: An array of aliases for common rsync targets. Relative aliases are always taken from the Drupal root.
- files: Path to files directory. This will be looked up if not specified.
- drush-script: Path to the remote Drush command.
- command: These options will only be set if the alias is used with the specified command. In the advanced example below, the option
--no-dump
will be selected whenever the @stage
alias is used in any of the following ways: drush @stage sql-sync @self @live
drush sql-sync @stage @live
drush sql-sync @live @stage
- env-vars: An array of key / value pairs that will be set as environment variables.
Complex example:
# File: remote.site.yml\nlive:\n host: server.domain.com\n user: www-admin\n root: /other/path/to/drupal\n uri: http://example.com\n ssh:\n options: '-p 100'\n paths:\n drush-script: '/path/to/drush'\n env-vars:\n PATH: /bin:/usr/bin:/home/www-admin/.composer/vendor/bin\n DRUPAL_ENV: live\n command:\n site:\n install:\n options:\n admin-password: 'secret-secret'\n
"},{"location":"site-aliases/#site-alias-files-for-service-providers","title":"Site Alias Files for Service Providers","text":"There are a number of service providers that manage Drupal sites as a service. Drush allows service providers to create collections of site alias files to reference all of the sites available to a single user. In order to do this, a new location must be defined in your Drush configuration file:
drush:\n paths:\n alias-path:\n - '${env.HOME}/.drush/sites/provider-name'\n
Site aliases stored in this directory may then be referenced by its full alias name, including its location, e.g.:
$ drush @provider-name.example.dev\n
Such alias files may still be referenced by their shorter name, e.g. @example.dev
. Note that it is necessary to individually list every location where site alias files may be stored; Drush never does recursive (deep) directory searches for alias files. The site:alias
command may also be used to list all of the sites and environments in a given location, e.g.:
$ drush site:alias @provider-name\n
Add the option --format=list
to show only the names of each site and environment without also showing the values in each alias record."},{"location":"site-aliases/#wildcard-aliases-for-service-providers","title":"Wildcard Aliases for Service Providers","text":"Some service providers that manage Drupal sites allow customers to create multiple \"environments\" for a site. It is common for these providers to also have a feature to automatically create Drush aliases for all of a user's sites. Rather than write one record for every environment in that site, it is also possible to write a single wildcard alias that represents all possible environments. This is possible if the contents of each environment alias are identical save for the name of the environment in one or more values. The variable ${env-name}
will be substituted with the environment name wherever it appears.
Example wildcard record:
# File: remote-example.site.yml\n'*':\n host: ${env-name}.server.domain.com\n user: www-admin\n root: /path/to/${env-name}\n uri: http://${env-name}.remote-example.com\n
With a wildcard record, any environment name may be used, and will always match. This is not desirable in instances where the specified environment does not exist (e.g. if the user made a typo). An alias alter hook in a policy file may be used to catch these mistakes and report an error. See SiteAliasAlterCommands for an example on how to do this.
"},{"location":"site-aliases/#docker-compose-and-other-transports","title":"Docker Compose and other transports","text":"The example below shows drush calling into a Docker hosted site. See the https://github.com/consolidation/site-alias and https://github.com/consolidation/site-process projects for more developer information about transports.
An example appears below. Edit to suit:
# File: mysite.site.yml\nlocal:\nThis environment is an example of the DockerCompose transport.\n docker:\n service: drupal\n exec:\n options: --user USER\nstage:\n uri: http://stage.example.com\n root: /path/to/remote/drupal/root\n host: mystagingserver.myisp.com\n user: publisher\n os: Linux\n paths:\n - files: sites/mydrupalsite.com/files\n - custom: /my/custom/path\n command:\n sql:\n sync:\n options:\n no-dump: true\ndev:\n root: /path/to/docroot\n uri: https://dev.example.com\n
"},{"location":"site-aliases/#example-of-rsync-with-exclude-paths","title":"Example of rsync with exclude-paths","text":"Note that most options typically passed to rsync via drush rsync
are \"passthrough options\", which is to say they appear after the --
separator on the command line. Passthrough options are actually arguments, and it is not possible to set default arguments in an alias record. The drush rsync
command does support two options, --mode
and --exclude-paths
, which are interpreted directly by Drush. Default values for these options may be specified in an alias record, as shown below.
dev:\n root: /path/to/docroot\n uri: https://dev.example.com\n command:\n core:\n rsync:\n options:\n mode: rlptz\n exclude-paths: 'css:imagecache:ctools:js:tmp:php:styles'\n
"},{"location":"usage/","title":"Usage","text":"Drush can be run in your shell by typing drush
from within your project root directory or anywhere within Drupal.
$ drush [options] <command> [argument1] [argument2]\n
Use the help command to get a list of available options and commands:
$ drush help pm:list\n
For even more documentation, use the topic command:
$ drush topic\n
"},{"location":"usage/#using-the-uri-option-and-root-options","title":"Using the --uri option and --root options.","text":"For multi-site installations, use a site alias or the --uri option to target a particular site.
$ drush --uri=http://example.com pm:install\n
If you are outside the Composer project and not using a site alias, you need to specify --root and --uri for Drush to locate and bootstrap the right Drupal site.
"},{"location":"usage/#site-aliases","title":"Site Aliases","text":"Drush lets you run commands on a remote server. Once defined, aliases can be referenced with the @ nomenclature, i.e.
# Run pending updates on staging site.\n$ drush @staging updatedb\n# Synchronize staging files to production\n$ drush rsync @staging:%files/ @live:%files\n# Synchronize database from production to local, excluding the cache table\n$ drush sql:sync --structure-tables-key=custom @live @self\n
See Site aliases for more information.
"},{"location":"using-drush-configuration/","title":"Drush Configuration","text":"Drush configuration is useful to cut down on typing out lengthy and repetitive command line options, and to avoid mistakes.
"},{"location":"using-drush-configuration/#directories-and-discovery","title":"Directories and Discovery","text":"drush.yml files are discovered as below, in order of precedence:
- Drupal site folder (e.g.
sites/{example.com}/drush.yml
). sites/all/drush
, WEBROOT/drush
, or PROJECTROOT/drush
. - In any location, as specified by the
--config
option. - User's .drush folder (i.e.
~/.drush/drush.yml
). - System-wide configuration folder (e.g.
/etc/drush/drush.yml
or C:\\ProgramData\\Drush\\drush.yml
).
If a configuration file is found in any of the above locations, it will be loaded and merged with other configuration files in the search list. Run drush status --fields=drush-conf
to see all discovered config files.
"},{"location":"using-drush-configuration/#environment-variables","title":"Environment variables","text":"Your Drush config file may reference environment variables using a syntax like ${env.HOME}
. For example see the drush.paths
examples below.
An alternative way to populate Drush configuration is to define environment variables that correspond to config keys. For example, to populate the options.uri
config item, create an environment variable DRUSH_OPTIONS_URI=http://example.com
. As you can see, variable names should be uppercased, prefixed with DRUSH_
, and periods replaced with dashes.
"},{"location":"using-drush-configuration/#config-examples","title":"Config examples","text":""},{"location":"using-drush-configuration/#specify-config-files-to-load","title":"Specify config files to load","text":"drush:\n paths:\n config:\n # Load any personal config files. Is silently skipped if not found. Filename must be drush.yml\n - ${env.HOME}/.drush/config/drush.yml\n
- The value may be path to a file, or to a directory containing drush.yml file(s).
- View discovered config paths:
drush status --fields=drush-conf --format=yaml
"},{"location":"using-drush-configuration/#specify-folders-to-search-for-drush-command-files","title":"Specify folders to search for Drush command files.","text":"These locations are always merged with include paths defined on the command line or in other configuration files. On the command line, paths may be separated by a colon :
on Unix-based systems or a semi-colon ;
on Windows, or multiple --include
options may be provided. Drush 8 and earlier did a deep search in ~/.drush
and /usr/share/drush/commands
when loading command files, so we mimic that here as an example.
drush:\n include:\n - '${env.HOME}/.drush/commands'\n - /usr/share/drush/commands\n
- View all loaded commands:
drush list
"},{"location":"using-drush-configuration/#specify-the-folders-to-search-for-drush-alias-files-siteyml","title":"Specify the folders to search for Drush alias files (*.site.yml).","text":"These locations are always merged with alias paths defined on the command line or in other configuration files. On the command line, paths may be separated by a colon :
on Unix-based systems or a semi-colon ;
on Windows, or multiple --alias-path
options may be provided. Note that Drush 8 and earlier did a deep search in ~/.drush
and /etc/drush
when loading alias files.
drush:\n paths:\n alias-path:\n - '${env.HOME}/.drush/sites'\n - /etc/drush/sites\n
- View all loaded site aliases: drush site:alias
"},{"location":"using-drush-configuration/#backup-directory","title":"Backup directory","text":"Specify a folder where Drush should store backup files, including temporary sql dump files created during sql:sync. If unspecified, defaults to $HOME/drush-backups
.
drush:\n paths:\n backup-dir: /tmp/drush-backups\n
"},{"location":"using-drush-configuration/#global-options","title":"Global options","text":"options:\n # Specify the base_url that should be used when generating links.\n uri: 'http://example.com/subdir'\n\n # Specify your Drupal core base directory (useful if you use symlinks).\n root: '/home/USER/workspace/drupal'\n\n # Enable verbose mode.\n verbose: true\n
"},{"location":"using-drush-configuration/#command-specific-options","title":"Command-specific options","text":"command:\n sql:\n cli:\n options:\n # Enable auto-complete in MySQL.\n extra: \"--auto-rehash\"\n dump:\n options:\n # Omit cache and similar tables (including during a sql:sync).\n structure-tables-key: common\n php:\n script:\n options:\n # Additional folders to search for scripts.\n script-path: 'sites/all/scripts:profiles/myprofile/scripts'\n core:\n rsync:\n options:\n # Ensure all rsync commands use verbose output.\n verbose: true\n\n site:\n install:\n options:\n # Set a predetermined username and password when using site:install.\n account-name: 'alice'\n account-pass: 'secret'\n
"},{"location":"using-drush-configuration/#non-options","title":"Non-options","text":"sql:\n # An explicit list of tables which should be included in sql-dump and sql-sync.\n tables:\n common:\n - user\n - permissions\n - role_permissions\n - role\n # List of tables whose *data* is skipped by the 'sql-dump' and 'sql-sync'\n # commands when the \"--structure-tables-key=common\" option is provided.\n # You may add specific tables to the existing array or add a new element.\n structure-tables:\n common:\n - cache\n - 'cache_*'\n - history\n - 'search_*'\n - 'sessions'\n - 'watchdog'\n # List of tables to be omitted entirely from SQL dumps made by the 'sql-dump'\n # and 'sql-sync' commands when the \"--skip-tables-key=common\" option is\n # provided on the command line. This is useful if your database contains\n # non-Drupal tables used by some other application or during a migration for\n # example. You may add new tables to the existing array or add a new element.\n skip-tables:\n common:\n - 'migration_*'\n\nssh:\n # Specify options to pass to ssh. The default is to prohibit\n # password authentication, and is included here, so you may add additional\n # parameters without losing the default configuration.\n options: '-o PasswordAuthentication=no'\n # This string is valid for Bash shell. Override in case you need something different. See https://github.com/drush-ops/drush/issues/3816.\n pipefail: 'set -o pipefail; '\n\nnotify:\n # Notify when command takes more than 30 seconds.\n duration: 30\n # Specify a command to run. Defaults to Notification Center (OSX) or libnotify (Linux)\n cmd: /path/to/program\n # See https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/NotifyCommands.php for more settings.\n\nxh:\n # Start profiling via xhprof/tideways and show a link to the run report.\n link: http://xhprof.local\n # See https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/XhprofCommands.php for more settings.\n profile-builtins: true\n profile-cpu: false\n profile-memory: false\n
"},{"location":"using-drush-configuration/#misc","title":"Misc","text":" - If you are authoring a commandfile and wish to access the user's configuration, see Command Authoring.
- Setting boolean options broke with Symfony 3. This will be fixed in a future release.
- Version-specific configuration. Limit the version of Drush that will load a configuration file by placing the Drush major version number in the filename, e.g.
drush10.yml
. - The Drush configuration system has been factored out of Drush and shared with the world at https://github.com/consolidation/config. Feel free to use it for your projects. Lots more usage information is there.
"},{"location":"commands/all/","title":"All commands","text":"Tip
Press the / key to Search for a command. Or use your browser's Find in Page feature.
- browse
- completion
- drupal:directory
- generate
- help
- jn:get
- list
- mk:docs
- runserver
- version
- archive:dump
- archive:restore
- cache:clear
- cache:get
- cache:rebuild
- cache:set
- cache:tags
- config:delete
- config:edit
- config:export
- config:get
- config:import
- config:pull
- config:set
- config:status
- core:cron
- core:edit
- core:requirements
- core:route
- core:rsync
- core:status
- core:topic
- deploy
- deploy:hook
- deploy:hook-status
- deploy:mark-complete
- entity:delete
- entity:save
- field:base-info
- field:base-override-create
- field:create
- field:delete
- field:formatters
- field:info
- field:types
- field:widgets
- image:derive
- image:flush
- locale:check
- locale:clear-status
- locale:export
- locale:import
- locale:import-all
- locale:update
- maint:get
- maint:set
- maint:status
- migrate:fields-source
- migrate:import
- migrate:messages
- migrate:reset-status
- migrate:rollback
- migrate:status
- migrate:stop
- php:cli
- php:eval
- php:script
- pm:install
- pm:list
- pm:uninstall
- queue:delete
- queue:list
- queue:run
- role:create
- role:delete
- role:list
- role:perm:add
- role:perm:remove
- site:alias
- site:install
- site:set
- site:ssh
- sql:cli
- sql:connect
- sql:create
- sql:drop
- sql:dump
- sql:query
- sql:sanitize
- sql:sync
- state:delete
- state:get
- state:set
- theme:install
- theme:uninstall
- twig:compile
- twig:debug
- twig:unused
- updatedb
- updatedb:status
- user:block
- user:cancel
- user:create
- user:information
- user:login
- user:password
- user:role:add
- user:role:remove
- user:unblock
- views:dev
- views:disable
- views:enable
- views:execute
- views:list
- watchdog:delete
- watchdog:list
- watchdog:show
- watchdog:show-one
- watchdog:tail
- yaml:get:value
- yaml:lint
- yaml:unset:key
- yaml:update:key
- yaml:update:value
"},{"location":"commands/archive_dump/","title":"archive:dump","text":"Backup your code, files, and database into a single file.
The following paths would be excluded from a code archive:
- .git
- vendor
- [docroot]/sites/@/settings.@.php
- Drupal files directory
- Composer packages installed paths (
composer info --path --format=json
)
The following directories would be excluded from a file archive:
"},{"location":"commands/archive_dump/#examples","title":"Examples","text":" drush archive:dump
. Create a site archive file in a temporary directory containing code, database and Drupal files. drush archive:dump --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing code, database and Drupal files. drush archive:dump --destination=/path/to/archive.tar.gz --overwrite
. Create (or overwrite if exists) /path/to/archive.tar.gz file containing code, database and Drupal files. drush archive:dump --code --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing the code only. drush archive:dump --exclude-code-paths=foo_bar.txt,web/sites/.+/settings.php --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing code, database and Drupal files but excluding foo_bar.txt file and settings.php files if found in web/sites/* subdirectories. drush archive:dump --files --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing the Drupal files only. drush archive:dump --database --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz archive file containing the database dump only.
"},{"location":"commands/archive_dump/#options","title":"Options","text":" - --code. Archive codebase.
- --files. Archive Drupal files.
- --db. Archive database SQL dump.
- --destination=DESTINATION. The full path and filename in which the archive should be stored. If omitted, it will be saved to the drush-backups directory.
- --overwrite. Overwrite destination file if exists.
- --description=DESCRIPTION. Describe the archive contents.
- --tags=TAGS. Add tags to the archive manifest. Delimit several by commas.
- --generator=GENERATOR. The generator name to store in the MANIFEST.yml file. The default is \"Drush archive-dump\".
- --generatorversion=GENERATORVERSION. The generator version number to store in the MANIFEST file. The default is Drush version.
- --exclude-code-paths=EXCLUDE-CODE-PATHS. Comma-separated list of paths (or regular expressions matching paths) to exclude from the code archive.
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/archive_dump/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/archive_dump/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/archive_restore/","title":"archive:restore","text":"Restore (import) your code, files, and database.
"},{"location":"commands/archive_restore/#examples","title":"Examples","text":" drush archive:restore /path/to/archive.tar.gz
. Restore the site from /path/to/archive.tar.gz archive file. drush archive:restore /path/to/archive.tar.gz --destination-path=/path/to/restore
. Restore the site from /path/to/archive.tar.gz archive file into /path/to/restore directory. drush archive:restore /path/to/archive.tar.gz --code --destination-path=/path/to/restore
. Restore the code from /path/to/archive.tar.gz archive file into /path/to/restore directory. drush archive:restore /path/to/archive.tar.gz --code-source-path=/code/source/path
. Restore database and Drupal files from /path/to/archive.tar.gz archive file and the code from /code/source/path directory. drush archive:restore /path/to/archive.tar.gz --files --destination-path=/path/to/restore
. Restore the Drupal files from /path/to/archive.tar.gz archive file into /path/to/restore directory drush archive:restore /path/to/archive.tar.gz --files-source-path=/files/source/path
. Restore code and database from /path/to/archive.tar.gz archive file and the Drupal files from /files/source/path directory. drush archive:restore /path/to/archive.tar.gz --files-destination-relative-path=web/site/foo-bar/files
. Restore the Drupal files from /path/to/archive.tar.gz archive file into web/site/foo-bar/files site's subdirectory. drush archive:restore /path/to/archive.tar.gz --db
. Restore the database from /path/to/archive.tar.gz archive file. drush archive:restore /path/to/archive.tar.gz --db-source-path=/path/to/database.sql
. Restore code and Drupal files from /path/to/archive.tar.gz archive file and the database from /path/to/database.sql dump file. drush archive:restore /path/to/archive.tar.gz --db-url=mysql://user:password@localhost/database_name --destination-path=/path/to/restore
. Restore code, database and Drupal files from /path/to/archive.tar.gz archive file into /path/to/restore directory using database URL.
"},{"location":"commands/archive_restore/#arguments","title":"Arguments","text":" - [path]. The full path to a single archive file (*.tar.gz) or a directory with components to import. * May contain the following components generated by
archive:dump
command: * 1) code (\"code\" directory); * 2) database dump file (\"database/database.sql\" file); * 3) Drupal files (\"files\" directory). - [site]. Destination site alias. Defaults to @self.
"},{"location":"commands/archive_restore/#options","title":"Options","text":" - --destination-path[=DESTINATION-PATH]. The base path to restore the code/files into.
- --overwrite. Overwrite files if exists when un-compressing an archive.
- --site-subdir[=SITE-SUBDIR]. Site subdirectory to put settings.local.php into. [default: default]
- --setup-database-connection[=SETUP-DATABASE-CONNECTION]. Sets up the database connection in settings.local.php file if either --db-url option or set of specific --db- options are provided. [default: 1*]
- --code. Import code.
- --code-source-path[=CODE-SOURCE-PATH]. Import code from specified directory. Has higher priority over \"path\" argument.
- --files. Import Drupal files.
- --files-source-path[=FILES-SOURCE-PATH]. Import Drupal files from specified directory. Has higher priority over \"path\" argument.
- --files-destination-relative-path[=FILES-DESTINATION-RELATIVE-PATH]. Import Drupal files into specified directory relative to Composer root.
- --db. Import database.
- --db-source-path[=DB-SOURCE-PATH]. Import database from specified dump file. Has higher priority over \"path\" argument.
- --db-driver[=DB-DRIVER]. Destination database driver. [default: mysql]
- --db-port[=DB-PORT]. Destination database port.
- --db-host[=DB-HOST]. Destination database host.
- --db-name[=DB-NAME]. Destination database name.
- --db-user[=DB-USER]. Destination database user.
- --db-password[=DB-PASSWORD]. Destination database user password.
- --db-prefix[=DB-PREFIX]. Destination database prefix.
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
- --no-setup-database-connection. Negate --setup-database-connection option.
"},{"location":"commands/archive_restore/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/archive_restore/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/browse/","title":"browse","text":"Display a link to a given path or open link in a browser.
"},{"location":"commands/browse/#examples","title":"Examples","text":" drush browse
. Open default web browser (if configured or detected) to the site front page. drush browse node/1
. Open web browser to the path node/1. drush @example.prod browse
. Open a browser to the web site specified in a site alias.
"},{"location":"commands/browse/#arguments","title":"Arguments","text":" - [path]. Path to open. If omitted, the site front page will be opened.
"},{"location":"commands/browse/#options","title":"Options","text":" - --browser[=BROWSER]. Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: 1]
- --redirect-port=REDIRECT-PORT. The port that the web server is redirected to (e.g. when running within a Vagrant environment).
- --no-browser. Negate --browser option.
"},{"location":"commands/browse/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/cache_clear/","title":"cache:clear","text":"Clear a specific cache, or all Drupal caches.
"},{"location":"commands/cache_clear/#examples","title":"Examples","text":" drush cc bin
. Choose a bin to clear. drush cc bin entity,bootstrap
. Clear the entity and bootstrap cache bins.
"},{"location":"commands/cache_clear/#arguments","title":"Arguments","text":" - type. The particular cache to clear. Omit this argument to choose from available types.
- [args].... Additional arguments as might be expected (e.g. bin name).
"},{"location":"commands/cache_clear/#options","title":"Options","text":" - --cache-clear[=CACHE-CLEAR]. Set to 0 to suppress normal cache clearing; the caller should then clear if needed. [default: 1]
- --no-cache-clear. Negate --cache-clear option.
"},{"location":"commands/cache_clear/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_clear/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_get/","title":"cache:get","text":"Fetch a cached object and display it.
"},{"location":"commands/cache_get/#examples","title":"Examples","text":" drush cache:get hook_info bootstrap
. Display the data for the cache id \"hook_info\" from the \"bootstrap\" bin. drush cache:get update_available_releases update
. Display the data for the cache id \"update_available_releases\" from the \"update\" bin.
"},{"location":"commands/cache_get/#arguments","title":"Arguments","text":" - cid. The id of the object to fetch.
- [bin]. The cache bin to fetch from.
"},{"location":"commands/cache_get/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: json]
- --fields=FIELDS. Available fields: Cache ID (cid), Data (data), Created (created), Expire (expire), Tags (tags), Checksum (checksum), Valid (valid)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/cache_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_get/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/cache_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_rebuild/","title":"cache:rebuild","text":"Rebuild all caches.
This is a copy of core/rebuild.php.
"},{"location":"commands/cache_rebuild/#options","title":"Options","text":" - --cache-clear[=CACHE-CLEAR]. Set to 0 to suppress normal cache clearing; the caller should then clear if needed. [default: 1]
- --no-cache-clear. Negate --cache-clear option.
"},{"location":"commands/cache_rebuild/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_rebuild/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_set/","title":"cache:set","text":"Cache an object expressed in JSON or var_export() format.
"},{"location":"commands/cache_set/#arguments","title":"Arguments","text":" - cid. id of the object to set.
- data. The object to set in the cache. Use - to read the object from STDIN.
- [bin]. The cache bin to store the object in.
- [expire]. 'CACHE_PERMANENT', or a Unix timestamp.
- [tags]. A comma delimited list of cache tags.
"},{"location":"commands/cache_set/#options","title":"Options","text":" - --input-format[=INPUT-FORMAT]. The format of value. Use json for complex values. [default: string]
- --cache-get. If the object is the result a previous fetch from the cache, only store the value in the 'data' property of the object in the cache.
"},{"location":"commands/cache_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_tags/","title":"cache:tags","text":"Invalidate by cache tags.
"},{"location":"commands/cache_tags/#examples","title":"Examples","text":" drush cache:tag node:12,user:4
. Purge content associated with two cache tags.
"},{"location":"commands/cache_tags/#arguments","title":"Arguments","text":" - tags. A comma delimited list of cache tags to clear.
"},{"location":"commands/cache_tags/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_tags/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/completion/","title":"completion","text":"Dump the shell completion script
The *%command.name% command dumps the shell completion script required to use shell autocompletion (currently, bash, fish, zsh completion are supported).
"},{"location":"commands/completion/#static-installation","title":"Static installation Dump the script to a global completion file and restart your shell:
*%command.full_name% | sudo tee /etc/bash_completion.d/drush\n
Or dump the script to a local file and source it:
*%command.full_name% > completion.sh\n\n<comment># source the file whenever you use the project\n*source completion.sh\n\n<comment># or add this line at the end of your \"~/.bashrc\" file:\n*source /path/to/completion.sh\n
","text":""},{"location":"commands/completion/#dynamic-installation","title":"Dynamic installation Add this to the end of your shell configuration file (e.g. *\"~/.bashrc\"):
*eval \"$(/home/runner/work/drush/drush/drush completion )\"\n
","text":""},{"location":"commands/completion/#arguments","title":"Arguments","text":" - [shell]. The shell type (e.g. \"bash\"), the value of the \"$SHELL\" env var will be used if this is not given
"},{"location":"commands/completion/#options","title":"Options","text":" - --debug. Tail the completion debug log
"},{"location":"commands/completion/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/config_delete/","title":"config:delete","text":"Delete a configuration key, or a whole object(s).
"},{"location":"commands/config_delete/#examples","title":"Examples","text":" drush config:delete system.site,system.rss
. Delete the system.site and system.rss config objects. drush config:delete system.site page.front
. Delete the 'page.front' key from the system.site object.
"},{"location":"commands/config_delete/#arguments","title":"Arguments","text":" - config_name. The config object name(s). Delimit multiple with commas.
- [key]. A config key to clear, May not be used with multiple config names.
"},{"location":"commands/config_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_edit/","title":"config:edit","text":"Open a config file in a text editor. Edits are imported after closing editor.
"},{"location":"commands/config_edit/#examples","title":"Examples","text":" drush config:edit image.style.large
. Edit the image style configurations. drush config:edit
. Choose a config file to edit. drush --bg config-edit image.style.large
. Return to shell prompt as soon as the editor window opens.
"},{"location":"commands/config_edit/#arguments","title":"Arguments","text":" - config_name. The config object name, for example system.site.
"},{"location":"commands/config_edit/#options","title":"Options","text":" - --editor=EDITOR. A string of bash which launches user's preferred text editor. Defaults to ${VISUAL-${EDITOR-vi}}.
- --bg. Launch editor in background process.
"},{"location":"commands/config_edit/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_edit/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_export/","title":"config:export","text":"Export Drupal configuration to a directory.
"},{"location":"commands/config_export/#examples","title":"Examples","text":" drush config:export
. Export configuration files to the site's config directory. drush config:export --destination
. Export configuration; Save files in a backup directory named config-export.
"},{"location":"commands/config_export/#options","title":"Options","text":" - --add. Run
git add -p
after exporting. This lets you choose which config changes to sync for commit. - --commit. Run
git add -A
and git commit
after exporting. This commits everything that was exported without prompting. - --message=MESSAGE. Commit comment for the exported configuration. Optional; may only be used with --commit.
- --destination[=DESTINATION]. An arbitrary directory that should receive the exported files. A backup directory is used when no value is provided.
- --diff. Show preview as a diff, instead of a change list.
- --format[=FORMAT].
"},{"location":"commands/config_export/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_export/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_get/","title":"config:get","text":"Display a config value, or a whole configuration object.
"},{"location":"commands/config_get/#examples","title":"Examples","text":" drush config:get system.site
. Displays the system.site config. drush config:get system.site page.front
. Gets system.site:page.front value.
"},{"location":"commands/config_get/#arguments","title":"Arguments","text":" - config_name. The config object name, for example system.site.
- [key]. The config key, for example page.front. Optional.
"},{"location":"commands/config_get/#options","title":"Options","text":" - --format[=FORMAT]. [default: yaml]
- --source[=SOURCE]. The config storage source to read. [default: active]
- --include-overridden. Apply module and settings.php overrides to values.
"},{"location":"commands/config_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_import/","title":"config:import","text":"Import config from the config directory.
"},{"location":"commands/config_import/#examples","title":"Examples","text":" drush config:import
. Update Drupal's configuration so it matches the contents of the config directory. drush config:import --partial --source=/app/config
. Import from the /app/config directory which typically contains one or a few yaml files. cat tmp.yml | drush config:set --input-format=yaml user.mail ? -
. Update the user.mail config object in its entirety.
"},{"location":"commands/config_import/#options","title":"Options","text":" - --source=SOURCE. An arbitrary directory that holds the configuration files.
- --partial. Allows for partial config imports from the source directory. Only updates and new configs will be processed with this flag (missing configs will not be deleted). No config transformation happens.
- --diff. Show preview as a diff.
"},{"location":"commands/config_import/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_import/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
"},{"location":"commands/config_import/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_pull/","title":"config:pull","text":"Export and transfer config from one environment to another.
"},{"location":"commands/config_pull/#examples","title":"Examples","text":" drush config:pull @prod @stage
. Export config from @prod and transfer to @stage. drush config:pull @prod @self:../config/sync
. Export config and transfer to a custom directory. Relative paths are calculated from Drupal root.
"},{"location":"commands/config_pull/#arguments","title":"Arguments","text":" - source. A site-alias or the name of a subdirectory within /sites whose config you want to copy from.
- destination. A site-alias or the name of a subdirectory within /sites whose config you want to replace.
"},{"location":"commands/config_pull/#options","title":"Options","text":" - --safe. Validate that there are no git uncommitted changes before proceeding
- --runner[=RUNNER]. Where to run the rsync command; defaults to the local site. Can also be source or destination.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: null]
- --fields=FIELDS. Available fields: Path (path)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/config_pull/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_pull/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
- Drupal config export instructions, including customizing config by environment. (docs:config:exporting)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/config_pull/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_set/","title":"config:set","text":"Save a config value directly. Does not perform a config import.
"},{"location":"commands/config_set/#examples","title":"Examples","text":" drush config:set system.site name MySite
. Sets a value for the key name of system.site config object. drush config:set system.site page.front /path/to/page
. Sets the given URL path as value for the config item with key page.front of system.site config object. drush config:set system.site '[]'
. Sets the given key to an empty array. drush config:set system.site 'NULL'
. Sets the given key to NULL. drush config:set --input-format=yaml user.role.authenticated permissions [foo,bar]
. Use a sequence as value for the key permissions of user.role.authenticated config object. drush config:set --input-format=yaml system.site page {403: '403', front: home}
. Use a mapping as value for the key page of system.site config object. drush config:set --input-format=yaml user.role.authenticated ? \"{label: 'Auth user', weight: 5}\"
. Update two top level keys (label, weight) in the system.site config object. cat tmp.yml | drush config:set --input-format=yaml user.mail ? -
. Update the user.mail config object in its entirety.
"},{"location":"commands/config_set/#arguments","title":"Arguments","text":" - config_name. The config object name, for example system.site.
- key. The config key, for example page.front. Use ? if you are updating multiple top-level keys.
- value. The value to assign to the config key. Use - to read from Stdin.
"},{"location":"commands/config_set/#options","title":"Options","text":" - --input-format[=INPUT-FORMAT]. Format to parse the object. Recognized values: string, yaml. Since JSON is a subset of YAML, $value may be in JSON format. [default: string]
"},{"location":"commands/config_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_status/","title":"config:status","text":"Display status of configuration (differences between the filesystem configuration and database configuration).
"},{"location":"commands/config_status/#examples","title":"Examples","text":" drush config:status
. Display configuration items that need to be synchronized. drush config:status --state=Identical
. Display configuration items that are in default state. drush config:status --state='Only in sync dir' --prefix=node.type.
. Display all content types that would be created in active storage on configuration import. drush config:status --state=Any --format=list
. List all config names. drush config:status 2>&1 | grep \"No differences\"
. Check there are no differences between database and exported config. Useful for CI.
"},{"location":"commands/config_status/#options","title":"Options","text":" - --state[=STATE]. A comma-separated list of states to filter results. [default: Only in DB,Only in sync dir,Different]
- --prefix=PREFIX. The config prefix. For example, system. No prefix will return all names in the system.
- --format=FORMAT. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Name (name), State (state)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/config_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_status/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/config_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_cron/","title":"core:cron","text":"Run all cron hooks in all active modules for specified site.
"},{"location":"commands/core_cron/#examples","title":"Examples","text":" drush maint:status && drush core:cron
. Run cron unless maintenance mode is enabled
"},{"location":"commands/core_cron/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_cron/#topics","title":"Topics","text":" - Crontab instructions for running your Drupal cron tasks via
drush cron
. (docs:cron)
"},{"location":"commands/core_cron/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_edit/","title":"core:edit","text":"Edit drush.yml, site alias, and Drupal settings.php files.
"},{"location":"commands/core_edit/#examples","title":"Examples","text":" drush core:edit
. Pick from a list of config/alias/settings files. Open selected in editor. drush --bg core-config
. Return to shell prompt as soon as the editor window opens. drush core:edit etc
. Edit the global configuration file. drush core:edit demo.alia
. Edit a particular alias file. drush core:edit sett
. Edit settings.php for the current Drupal site. drush core:edit --choice=2
. Edit the second file in the choice list.
"},{"location":"commands/core_edit/#arguments","title":"Arguments","text":" - [filter]. A substring for filtering the list of files. Omit this argument to choose from loaded files.
"},{"location":"commands/core_edit/#options","title":"Options","text":" - --editor=EDITOR. A string of bash which launches user's preferred text editor. Defaults to ${VISUAL-${EDITOR-vi}}.
- --bg. Launch editor in background process.
"},{"location":"commands/core_edit/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_edit/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_requirements/","title":"core:requirements","text":"Information about things that may be wrong in your Drupal installation.
"},{"location":"commands/core_requirements/#examples","title":"Examples","text":" drush core:requirements
. Show all status lines from the Status Report admin page. drush core:requirements --severity=2
. Show only the red lines from the Status Report admin page.
"},{"location":"commands/core_requirements/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --severity[=SEVERITY]. Only show status report messages with a severity greater than or equal to the specified value. [default: -1]
- --ignore[=IGNORE]. Comma-separated list of requirements to remove from output. Run with --format=yaml to see key values to use.
- --fields=FIELDS. Available fields: Title (title), Severity (severity), SID (sid), Description (description), Summary (value)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/core_requirements/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_requirements/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/core_requirements/#aliases","title":"Aliases","text":" - status-report
- rq
- core-requirements
Legend
- 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.
"},{"location":"commands/core_route/","title":"core:route","text":" 10.5+
View information about all routes or one route.
"},{"location":"commands/core_route/#examples","title":"Examples","text":" drush route
. View all routes. drush route --name=update.status
. View details about the update.status route. drush route --path=/user/1
. View details about the entity.user.canonical route. drush route --url=https://example.com/node/1
. View details about the entity.node.canonical route.
"},{"location":"commands/core_route/#options","title":"Options","text":" - --name=NAME. A route name.
- --path=PATH. An internal path or URL.
- --format[=FORMAT]. [default: yaml]
"},{"location":"commands/core_route/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_route/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_rsync/","title":"core:rsync","text":"Rsync Drupal code or files to/from another server using ssh.
"},{"location":"commands/core_rsync/#examples","title":"Examples","text":" drush rsync @dev @stage
. Rsync Drupal root from Drush alias dev to the alias stage. drush rsync ./ @stage:%files/img
. Rsync all files in the current directory to the imgdirectory in the file storage folder on the Drush alias stage. drush rsync @dev @stage -- --exclude=*.sql --delete
. Rsync Drupal root from the Drush alias dev to the alias stage, excluding all .sql files and delete all files on the destination that are no longer on the source. drush rsync @dev @stage --ssh-options=\"-o StrictHostKeyChecking=no\" -- --delete
. Customize how rsync connects with remote host via SSH. rsync options like --delete are placed after a --.
"},{"location":"commands/core_rsync/#arguments","title":"Arguments","text":" - source. A site alias and optional path. See rsync documentation and Site aliases.
- target. A site alias and optional path. See rsync documentation and Site aliases.
- [extra].... Additional parameters after the ssh statement.
"},{"location":"commands/core_rsync/#options","title":"Options","text":" - --exclude-paths=EXCLUDE-PATHS. List of paths to exclude, seperated by : (Unix-based systems) or ; (Windows).
- --include-paths=INCLUDE-PATHS. List of paths to include, seperated by : (Unix-based systems) or ; (Windows).
- --mode[=MODE]. The unary flags to pass to rsync; --mode=rultz implies rsync -rultz. Default is -akz. [default: akz]
- --ssh-options=SSH-OPTIONS. A string appended to ssh command during rsync, sql-sync, etc.
"},{"location":"commands/core_rsync/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_rsync/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
"},{"location":"commands/core_rsync/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_status/","title":"core:status","text":"An overview of the environment - Drush and Drupal.
"},{"location":"commands/core_status/#examples","title":"Examples","text":" drush core-status --field=files
. Emit just one field, not all the default fields. drush core-status --fields=*
. Emit all fields, not just the default ones.
"},{"location":"commands/core_status/#options","title":"Options","text":" - --project=PROJECT. A comma delimited list of projects. Their paths will be added to path-aliases section.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Drupal version (drupal-version), Site URI (uri), DB driver (db-driver), DB hostname (db-hostname), DB port (db-port), DB username (db-username), DB password (db-password), DB name (db-name), Database (db-status), Drupal bootstrap (bootstrap), Default theme (theme), Admin theme (admin-theme), PHP binary (php-bin), PHP config (php-conf), PHP OS (php-os), PHP version (php-version), Drush script (drush-script), Drush version (drush-version), Drush temp (drush-temp), Drush configs (drush-conf), Drush aliases (drush-alias-files), Alias search paths (alias-searchpaths), Install profile (install-profile), Drupal root (root), Drupal Settings (drupal-settings-file), Site path (site-path), Site path (site), Themes path (themes), Modules path (modules), Files, Public (files), Files, Private (private), Files, Temp (temp), Drupal config (config-sync), Files, Public (files-path), Files, Temp (temp-path), Other paths (%paths)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/core_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_status/#topics","title":"Topics","text":" - README.md (docs:readme)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/core_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_topic/","title":"core:topic","text":"Read detailed documentation on a given topic.
"},{"location":"commands/core_topic/#examples","title":"Examples","text":" drush topic
. Pick from all available topics. drush topic docs-repl
. Show documentation for the Drush interactive shell drush docs:r
. Filter topics for those starting with 'docs-r'.
"},{"location":"commands/core_topic/#arguments","title":"Arguments","text":" - topic_name. The name of the topic you wish to view. If omitted, list all topic descriptions (and names in parenthesis).
"},{"location":"commands/core_topic/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_topic/#topics","title":"Topics","text":""},{"location":"commands/core_topic/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/deploy/","title":"deploy","text":" 10.3+
Run several commands after performing a code deployment.
"},{"location":"commands/deploy/#examples","title":"Examples","text":" drush deploy -v -y
. Run updates with verbose logging and accept all prompts.
"},{"location":"commands/deploy/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
Legend
- 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.
"},{"location":"commands/deploy_hook-status/","title":"deploy:hook-status","text":"Prints information about pending deploy update hooks.
"},{"location":"commands/deploy_hook-status/#examples","title":"Examples","text":" drush deploy:hook-status
. Prints information about pending deploy hooks.
"},{"location":"commands/deploy_hook-status/#options","title":"Options","text":" - --format=FORMAT. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Module (module), Hook (hook), Description (description)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/deploy_hook-status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy_hook-status/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
- Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/deploy_hook/","title":"deploy:hook","text":" 10.3+
Run pending deploy update hooks.
"},{"location":"commands/deploy_hook/#examples","title":"Examples","text":" drush deploy:hook
. Run pending deploy hooks.
"},{"location":"commands/deploy_hook/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy_hook/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
Legend
- 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.
"},{"location":"commands/deploy_mark-complete/","title":"deploy:mark-complete","text":" 10.6.1+
Mark all deploy hooks as having run.
"},{"location":"commands/deploy_mark-complete/#examples","title":"Examples","text":" drush deploy:mark-complete
. Skip all pending deploy hooks and mark them as complete.
"},{"location":"commands/deploy_mark-complete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy_mark-complete/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
Legend
- 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.
"},{"location":"commands/drupal_directory/","title":"drupal:directory","text":"Return the filesystem path for modules/themes and other key folders.
"},{"location":"commands/drupal_directory/#examples","title":"Examples","text":" cd $(drush dd devel)
. Navigate into the devel module directory cd $(drush dd)
. Navigate to the root of your Drupal site cd $(drush dd files)
. Navigate to the files directory. drush dd @alias:%files
. Print the path to the files directory on the site @alias. edit $(drush dd devel)/devel.module
. Open devel module in your editor
"},{"location":"commands/drupal_directory/#arguments","title":"Arguments","text":" - [target]. A module/theme name, or special names like root, files, private, or an alias:path string such as @alias:%files.
"},{"location":"commands/drupal_directory/#options","title":"Options","text":" - --local-only. Reject any target that specifies a remote site.
"},{"location":"commands/drupal_directory/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/drupal_directory/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/entity_delete/","title":"entity:delete","text":"Delete content entities.
To delete configuration entities, see config:delete command.
"},{"location":"commands/entity_delete/#examples","title":"Examples","text":" drush entity:delete node --bundle=article
. Delete all article entities. drush entity:delete shortcut
. Delete all shortcut entities. drush entity:delete node 22,24
. Delete nodes 22 and 24. drush entity:delete user
. Delete all users except uid=1. drush entity:delete node --exclude=9,14,81
. Delete all nodes except node 9, 14 and 81. drush entity:delete node --chunks=5
. Delete all node entities in steps of 5.
"},{"location":"commands/entity_delete/#arguments","title":"Arguments","text":" - entity_type. An entity machine name.
- [ids]. A comma delimited list of Ids.
"},{"location":"commands/entity_delete/#options","title":"Options","text":" - --bundle=BUNDLE. Restrict deletion to the specified bundle. Ignored when ids is specified.
- --exclude=EXCLUDE. Exclude certain entities from deletion. Ignored when ids is specified.
- --chunks[=CHUNKS]. Specify how many entities will be deleted in the same step. [default: 50]
"},{"location":"commands/entity_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/entity_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/entity_save/","title":"entity:save","text":" 11.0+
Load and save entities.
"},{"location":"commands/entity_save/#examples","title":"Examples","text":" drush entity:save node --bundle=article
. Re-save all article entities. drush entity:save shortcut
. Re-save all shortcut entities. drush entity:save node 22,24
. Re-save nodes 22 and 24. drush entity:save node --exclude=9,14,81
. Re-save all nodes except node 9, 14 and 81. drush entity:save user
. Re-save all users. drush entity:save node --chunks=5
. Re-save all node entities in steps of 5.
"},{"location":"commands/entity_save/#arguments","title":"Arguments","text":" - entity_type. An entity machine name.
- [ids]. A comma delimited list of Ids.
"},{"location":"commands/entity_save/#options","title":"Options","text":" - --bundle=BUNDLE. Restrict to the specified bundle. Ignored when ids is specified.
- --exclude=EXCLUDE. Exclude certain entities. Ignored when ids is specified.
- --chunks[=CHUNKS]. Define how many entities will be loaded in the same step. [default: 50]
"},{"location":"commands/entity_save/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/entity_save/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_base-info/","title":"field:base-info","text":" 11.0+
List all base fields of an entity type
"},{"location":"commands/field_base-info/#examples","title":"Examples","text":" field:base-info taxonomy_term
. List all base fields. field:base-info
. List all base fields and fill in the remaining information through prompts.
"},{"location":"commands/field_base-info/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
"},{"location":"commands/field_base-info/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --show-machine-names. Show machine names instead of labels in option lists.
- --fields=FIELDS. Available fields: Label (label), Description (description), Field name (field_name), Field type (field_type), Required (required), Translatable (translatable), Cardinality (cardinality), Default value (default_value), Default value callback (default_value_callback), Allowed values (allowed_values), Allowed values function (allowed_values_function), Selection handler (handler), Target bundles (target_bundles)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_base-info/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_base-info/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/field_base-info/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_base-override-create/","title":"field:base-override-create","text":" 11.0+
Create a new base field override
"},{"location":"commands/field_base-override-create/#examples","title":"Examples","text":" field:base-field-override-create
. Create a base field override by answering the prompts. field:base-field-override-create taxonomy_term tag
. Create a base field override and fill in the remaining information through prompts. field:base-field-override-create taxonomy_term tag --field-name=name --field-label=Label --is-required=1
. Create a base field override in a completely non-interactive way.
"},{"location":"commands/field_base-override-create/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
- [bundle]. The machine name of the bundle.
"},{"location":"commands/field_base-override-create/#options","title":"Options","text":" - --field-name=FIELD-NAME. A unique machine-readable name containing letters, numbers, and underscores.
- --field-label=FIELD-LABEL. The field label
- --field-description=FIELD-DESCRIPTION. The field description
- --is-required=IS-REQUIRED. Whether the field is required
- --show-machine-names[=SHOW-MACHINE-NAMES]. Show machine names instead of labels in option lists.
"},{"location":"commands/field_base-override-create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_base-override-create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_create/","title":"field:create","text":" 11.0+
Create a new field
"},{"location":"commands/field_create/#examples","title":"Examples","text":" field:create
. Create a field by answering the prompts. field-create taxonomy_term tag
. Create a field and fill in the remaining information through prompts. field-create taxonomy_term tag --field-name=field_tag_label --field-label=Label --field-type=string --field-widget=string_textfield --is-required=1 --cardinality=2
. Create a field in a completely non-interactive way.
"},{"location":"commands/field_create/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type
- [bundle]. The machine name of the bundle
"},{"location":"commands/field_create/#options","title":"Options","text":" - --field-name=FIELD-NAME. A unique machine-readable name containing letters, numbers, and underscores.
- --field-label=FIELD-LABEL. The field label
- --field-description[=FIELD-DESCRIPTION]. Instructions to present to the user below this field on the editing form.
- --field-type=FIELD-TYPE. The field type
- --field-widget=FIELD-WIDGET. The field widget
- --is-required[=IS-REQUIRED]. Whether the field is required
- --is-translatable[=IS-TRANSLATABLE]. Whether the field is translatable
- --cardinality=CARDINALITY. The allowed number of values
- --target-type[=TARGET-TYPE]. The target entity type. Only necessary for entity reference fields.
- --target-bundle[=TARGET-BUNDLE]. The target bundle(s). Only necessary for entity reference fields.
- --show-machine-names[=SHOW-MACHINE-NAMES]. Show machine names instead of labels in option lists.
- --existing-field-name[=EXISTING-FIELD-NAME]. The name of an existing field you want to re-use. Only used in non-interactive context.
- --existing. Re-use an existing field.
"},{"location":"commands/field_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_delete/","title":"field:delete","text":" 11.0+
Delete a field
"},{"location":"commands/field_delete/#examples","title":"Examples","text":" field:delete
. Delete a field by answering the prompts. field-delete taxonomy_term tag
. Delete a field and fill in the remaining information through prompts. field-delete taxonomy_term tag --field-name=field_tag_label
. Delete a field in a non-interactive way. field-delete taxonomy_term --field-name=field_tag_label --all-bundles
. Delete a field from all bundles.
"},{"location":"commands/field_delete/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
- [bundle]. The machine name of the bundle.
"},{"location":"commands/field_delete/#options","title":"Options","text":" - --field-name=FIELD-NAME. The machine name of the field.
- --show-machine-names[=SHOW-MACHINE-NAMES]. Show machine names instead of labels in option lists.
- --all-bundles[=ALL-BUNDLES]. Whether to delete the field from all bundles.
"},{"location":"commands/field_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_formatters/","title":"field:formatters","text":"Lists field formatters.
"},{"location":"commands/field_formatters/#examples","title":"Examples","text":" drush field:formatters --field-type=entity_reference
. Lists field formatters applicable for entity reference fields.
"},{"location":"commands/field_formatters/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --field-type=FIELD-TYPE. Applicable field type.
- --fields=FIELDS. Available fields: ID (id), Label (label), Default Settings (default_settings), Field types (field_types), Settings (settings), Class (class), Provider (provider) [default: id label default_settings field_types]
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_formatters/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_formatters/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/field_info/","title":"field:info","text":" 11.0+
List all configurable fields of an entity bundle
"},{"location":"commands/field_info/#examples","title":"Examples","text":" field:info taxonomy_term tag
. List all fields. field:info
. List all fields and fill in the remaining information through prompts.
"},{"location":"commands/field_info/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
- [bundle]. The machine name of the bundle.
"},{"location":"commands/field_info/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --show-machine-names. Show machine names instead of labels in option lists.
- --fields=FIELDS. Available fields: Label (label), Description (description), Field name (field_name), Field type (field_type), Required (required), Translatable (translatable), Cardinality (cardinality), Default value (default_value), Default value callback (default_value_callback), Allowed values (allowed_values), Allowed values function (allowed_values_function), Selection handler (handler), Target bundles (target_bundles)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_info/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_info/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/field_info/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_types/","title":"field:types","text":"Lists field types.
"},{"location":"commands/field_types/#examples","title":"Examples","text":" drush field:types
. List all registered field types.
"},{"location":"commands/field_types/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Available fields: ID (id), Label (label), Default Widget (default_widget), Default Formatter (default_formatter), Settings (settings)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_types/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_types/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/field_widgets/","title":"field:widgets","text":"Lists field widgets.
"},{"location":"commands/field_widgets/#examples","title":"Examples","text":" drush field:widgets --field-type=entity_reference
. Lists field widgets applicable for entity reference fields.
"},{"location":"commands/field_widgets/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --field-type=FIELD-TYPE. Applicable field type.
- --fields=FIELDS. Available fields: ID (id), Label (label), Default Settings (default_settings), Field types (field_types), Settings (settings), Class (class), Provider (provider) [default: id label default_settings field_types]
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_widgets/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_widgets/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/generate/","title":"generate","text":"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.
See https://github.com/Chi-teck/drupal-code-generator for a README and bug reports.
"},{"location":"commands/generate/#examples","title":"Examples","text":" 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.
"},{"location":"commands/generate/#arguments","title":"Arguments","text":" - [generator]. A generator name. Omit to pick from available Generators.
"},{"location":"commands/generate/#options","title":"Options","text":" - --replace.
- --working-dir=WORKING-DIR. Absolute path to working directory.
- --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"commands/generate/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/generate/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"commands/generate/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/help/","title":"help","text":"Display usage details for a command.
"},{"location":"commands/help/#examples","title":"Examples","text":" drush help pm:uninstall
. Show help for a command. drush help pmu
. Show help for a command using an alias. drush help --format=xml
. Show all available commands in XML format. drush help --format=json
. All available commands, in JSON format.
"},{"location":"commands/help/#arguments","title":"Arguments","text":" - [command_name]. A command name
"},{"location":"commands/help/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,tsv,var_dump,var_export,xml,yaml [default: helpcli]
- --include-field-labels.
- --table-style[=TABLE-STYLE]. [default: compact]
"},{"location":"commands/help/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/help/#topics","title":"Topics","text":" Legend
- 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.
"},{"location":"commands/image_derive/","title":"image:derive","text":"Create an image derivative.
"},{"location":"commands/image_derive/#examples","title":"Examples","text":" drush image:derive thumbnail core/themes/bartik/screenshot.png
. Save thumbnail sized derivative of logo image.
"},{"location":"commands/image_derive/#arguments","title":"Arguments","text":" - style_name. An image style machine name.
- source. Path to a source image. Optionally prepend stream wrapper scheme. Relative paths calculated from Drupal root.
"},{"location":"commands/image_derive/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/image_derive/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/image_flush/","title":"image:flush","text":"Flush all derived images for a given style.
"},{"location":"commands/image_flush/#examples","title":"Examples","text":" drush image:flush
. Pick an image style and then delete its derivatives. drush image:flush thumbnail,large
. Delete all thumbnail and large derivatives. drush image:flush --all
. Flush all derived images. They will be regenerated on demand.
"},{"location":"commands/image_flush/#arguments","title":"Arguments","text":" - style_names. A comma delimited list of image style machine names. If not provided, user may choose from a list of names.
"},{"location":"commands/image_flush/#options","title":"Options","text":" - --all. Flush all derived images
"},{"location":"commands/image_flush/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/image_flush/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/jn_get/","title":"jn:get","text":"Execute a JSONAPI request.
"},{"location":"commands/jn_get/#examples","title":"Examples","text":" drush jn:get jsonapi/node/article
. Get a list of articles back as JSON. drush jn:get jsonapi/node/article | jq
. Pretty print JSON by piping to jq. See https://stedolan.github.io/jq/ for lots more jq features.
"},{"location":"commands/jn_get/#arguments","title":"Arguments","text":" - url. The JSONAPI URL to request.
"},{"location":"commands/jn_get/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: json]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/jn_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/list/","title":"list","text":"List available commands.
"},{"location":"commands/list/#examples","title":"Examples","text":" drush list
. List all commands. drush list --filter=devel_generate
. Show only commands starting with devel- drush list --format=xml
. List all commands in Symfony compatible xml format.
"},{"location":"commands/list/#options","title":"Options","text":" - --format[=FORMAT]. [default: listcli]
- --raw. Show a simple table of command names and descriptions.
- --filter=FILTER. Restrict command list to those commands defined in the specified file. Omit value to choose from a list of names.
"},{"location":"commands/list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/locale_check/","title":"locale:check","text":"Checks for available translation updates.
"},{"location":"commands/locale_check/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_check/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_clear-status/","title":"locale:clear-status","text":" 11.5+
Clears the translation status.
"},{"location":"commands/locale_clear-status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_clear-status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_export/","title":"locale:export","text":"Exports to a gettext translation file.
See Drupal Core: \\Drupal\\locale\\Form\\ExportForm::submitForm
"},{"location":"commands/locale_export/#examples","title":"Examples","text":" drush locale:export nl > nl.po
. Export the Dutch translations with all types. drush locale:export nl --types=customized,not-customized > nl.po
. Export the Dutch customized and not customized translations. drush locale:export --template > drupal.pot
. Export the source strings only as template file for translation.
"},{"location":"commands/locale_export/#arguments","title":"Arguments","text":" - [langcode]. The language code of the exported translations.
"},{"location":"commands/locale_export/#options","title":"Options","text":" - --template. POT file output of extracted source texts to be translated.
- --types=TYPES. A comma separated list of string types to include, defaults to all types. Recognized values: not-customized, customized, not-translated
"},{"location":"commands/locale_export/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_export/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_import-all/","title":"locale:import-all","text":" 12.2+
Imports multiple translation files from the defined directory.
"},{"location":"commands/locale_import-all/#examples","title":"Examples","text":" drush locale:import-all /var/www/translations
. Import all translations from the defined directory (non-recursively). Supported filename patterns are: {project}-{version}.{langcode}.po, {prefix}.{langcode}.po or {langcode}.po. drush locale:import-all /var/www/translations/custom --types=customized --override=all
. Import all custom translations from the defined directory (non-recursively) and override any existing translation. Supported filename patterns are: {project}-{version}.{langcode}.po, {prefix}.{langcode}.po or {langcode}.po.
"},{"location":"commands/locale_import-all/#arguments","title":"Arguments","text":" - directory. The path to directory with translation files to import.
"},{"location":"commands/locale_import-all/#options","title":"Options","text":" - --type=TYPE. String types to include, defaults to not-customized. Recognized values: not-customized, customized
- --override=OVERRIDE. Whether and how imported strings will override existing translations. Defaults to the Import behavior configured in the admin interface. Recognized values: none, customized, not-customized, all
"},{"location":"commands/locale_import-all/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_import-all/#aliases","title":"Aliases","text":" - locale-import-all
- locale:import:all
Legend
- 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.
"},{"location":"commands/locale_import/","title":"locale:import","text":"Imports to a gettext translation file.
"},{"location":"commands/locale_import/#examples","title":"Examples","text":" drush locale-import nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. drush locale-import --type=customized nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. Treat imported strings as custom translations. drush locale-import --override=none nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. Don't overwrite existing translations. Only append new translations. drush locale-import --override=not-customized nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. Only override non-customized translations, customized translations are kept. drush locale-import nl custom-translations.po --type=customized --override=all
. Import customized Dutch translations and override any existing translation.
"},{"location":"commands/locale_import/#arguments","title":"Arguments","text":" - langcode. The language code of the imported translations.
- file. Path and file name of the gettext file. Relative paths calculated from Drupal root.
"},{"location":"commands/locale_import/#options","title":"Options","text":" - --type[=TYPE]. String types to include, defaults to all types. Recognized values: not-customized, customized, not-translated [default: not-customized]
- --override=OVERRIDE. Whether and how imported strings will override existing translations. Defaults to the Import behavior configured in the admin interface. Recognized values: none, customized, not-customized, all
- --autocreate-language. Create the language in addition to import.
"},{"location":"commands/locale_import/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_import/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_update/","title":"locale:update","text":"Imports the available translation updates.
"},{"location":"commands/locale_update/#options","title":"Options","text":" - --langcodes=LANGCODES. A comma-separated list of language codes to update. If omitted, all translations will be updated.
"},{"location":"commands/locale_update/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_update/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/maint_get/","title":"maint:get","text":" 11.5+
Get maintenance mode. Returns 1 if enabled, 0 if not.
Consider using maint:status instead when chaining commands.
"},{"location":"commands/maint_get/#examples","title":"Examples","text":" drush maint:get
. Print value of maintenance mode in Drupal
"},{"location":"commands/maint_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/maint_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/maint_set/","title":"maint:set","text":" 11.5+
Set maintenance mode.
"},{"location":"commands/maint_set/#examples","title":"Examples","text":" drush maint:set 1
. Put site into Maintenance mode. drush maint:set 0
. Remove site from Maintenance mode.
"},{"location":"commands/maint_set/#arguments","title":"Arguments","text":" - value. The value to assign to the state key
"},{"location":"commands/maint_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/maint_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/maint_status/","title":"maint:status","text":" 11.5+
Fail if maintenance mode is enabled.
This commands fails with exit code of 3 when maintenance mode is on. This special exit code distinguishes from a failure to complete.
"},{"location":"commands/maint_status/#examples","title":"Examples","text":" drush maint:status && drush cron
. Only run cron when Drupal is not in maintenance mode.
"},{"location":"commands/maint_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/maint_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_fields-source/","title":"migrate:fields-source","text":" 10.4+
List the fields available for mapping in a source.
"},{"location":"commands/migrate_fields-source/#examples","title":"Examples","text":" migrate:fields-source article
. List fields for the source in the article migration.
"},{"location":"commands/migrate_fields-source/#arguments","title":"Arguments","text":" - migrationId. The ID of the migration.
"},{"location":"commands/migrate_fields-source/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Field name (machine_name), Description (description) [default: machine_name description]
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/migrate_fields-source/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_fields-source/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/migrate_fields-source/#aliases","title":"Aliases","text":" - mfs
- migrate-fields-source
Legend
- 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.
"},{"location":"commands/migrate_import/","title":"migrate:import","text":" 10.4+
Perform one or more migration processes.
"},{"location":"commands/migrate_import/#examples","title":"Examples","text":" migrate:import --all
. Perform all migrations migrate:import --all --no-progress
. Perform all migrations but avoid the progress bar migrate:import --tag=user,main_content
. Import all migrations tagged with user and main_content tags migrate:import classification,article
. Import new terms and nodes using migration classification and article migrate:import user --limit=2
. Import no more than 2 users using the user migration migrate:import user --idlist=5
. Import the user record with source ID 5 migrate:import node_revision --idlist=1:2,2:3,3:5
. Import the node revision record with source IDs [1,2], [2,3], and [3,5] migrate:import user --limit=50 --feedback=20
. Import 50 users and show process message every 20th record migrate:import --all --delete
. Perform all migrations and delete the destination items that are missing from source
"},{"location":"commands/migrate_import/#arguments","title":"Arguments","text":" - [migrationIds]. Comma-separated list of migration IDs.
"},{"location":"commands/migrate_import/#options","title":"Options","text":" - --all. Process all migrations
- --tag=TAG. A comma-separated list of migration tags to import
- --limit=LIMIT. Limit on the number of items to process in each migration
- --feedback=FEEDBACK. Frequency of progress messages, in items processed
- --idlist=IDLIST. Comma-separated list of IDs to import. As an ID may have more than one column, concatenate the columns with the colon ':' separator
- --update. In addition to processing unprocessed items from the source, update previously-imported items with the current data
- --force. Force an operation to run, even if all dependencies are not satisfied
- --execute-dependencies. Execute all dependent migrations first
- --timestamp. Show progress ending timestamp in progress messages
- --total. Show total processed item number in progress messages
- --progress[=PROGRESS]. Show progress bar [default: 1]
- --delete. Delete destination records missed from the source. Not compatible with --limit and --idlist options, and high_water_property source configuration key.
- --no-progress. Negate --progress option.
"},{"location":"commands/migrate_import/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_import/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_import/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_messages/","title":"migrate:messages","text":" 10.4+
View any messages associated with a migration.
"},{"location":"commands/migrate_messages/#examples","title":"Examples","text":" migrate:messages article
. Show all messages for the article migration migrate:messages node_revision --idlist=1:2,2:3,3:5
. Show messages related to node revision records with source IDs [1,2], [2,3], and [3,5]. migrate:messages custom_node_revision --idlist=1:\"r:1\",2:\"r:3\"
. Show messages related to node revision records with source IDs [1,\"r:1\"], and [2,\"r:3\"].
"},{"location":"commands/migrate_messages/#arguments","title":"Arguments","text":" - migrationId. The ID of the migration.
"},{"location":"commands/migrate_messages/#options","title":"Options","text":" - --idlist=IDLIST. Comma-separated list of IDs to import. As an ID may have more than one column, concatenate the columns with the colon ':' separator
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Level (level), Source ID(s) (source_ids), Destination ID(s) (destination_ids), Message (message), Source IDs hash (hash) [default: level source_ids destination_ids message hash]
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/migrate_messages/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_messages/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/migrate_messages/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_reset-status/","title":"migrate:reset-status","text":" 10.4+
Reset an active migration's status to idle.
"},{"location":"commands/migrate_reset-status/#arguments","title":"Arguments","text":" - migrationId. The ID of migration to reset.
"},{"location":"commands/migrate_reset-status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_reset-status/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_reset-status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_rollback/","title":"migrate:rollback","text":" 10.4+
Rollback one or more migrations.
"},{"location":"commands/migrate_rollback/#examples","title":"Examples","text":" migrate:rollback --all
. Rollback all migrations migrate:rollback --all --no-progress
. Rollback all migrations but avoid the progress bar migrate:rollback --tag=user,main_content
. Rollback all migrations tagged with user and main_content tags migrate:rollback classification,article
. Rollback terms and nodes imported by classification and article migrations migrate:rollback user --idlist=5
. Rollback imported user record with source ID 5
"},{"location":"commands/migrate_rollback/#arguments","title":"Arguments","text":" - [migrationIds]. Comma-separated list of migration IDs.
"},{"location":"commands/migrate_rollback/#options","title":"Options","text":" - --all. Process all migrations
- --tag=TAG. A comma-separated list of migration tags to rollback
- --feedback=FEEDBACK. Frequency of progress messages, in items processed
- --idlist=IDLIST. Comma-separated list of IDs to rollback. As an ID may have more than one column, concatenate the columns with the colon ':' separator
- --progress[=PROGRESS]. Show progress bar [default: 1]
- --no-progress. Negate --progress option.
"},{"location":"commands/migrate_rollback/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_rollback/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_rollback/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_status/","title":"migrate:status","text":" 10.4+
List all migrations with current status.
"},{"location":"commands/migrate_status/#examples","title":"Examples","text":" migrate:status
. Retrieve status for all migrations migrate:status --tag
. Retrieve status for all migrations, grouped by tag migrate:status --tag=user,main_content
. Retrieve status for all migrations tagged with user or main_content migrate:status classification,article
. Retrieve status for specific migrations migrate:status --field=id
. Retrieve a raw list of migration IDs. ms --fields=id,status --format=json
. Retrieve a Json serialized list of migrations, each item containing only the migration ID and its status.
"},{"location":"commands/migrate_status/#arguments","title":"Arguments","text":" - [migrationIds]. Restrict to a comma-separated list of migrations. Optional.
"},{"location":"commands/migrate_status/#options","title":"Options","text":" - --tag=TAG. A comma-separated list of migration tags to list. If only --tag is provided, all tagged migrations will be listed, grouped by tags.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Migration ID (id), Status (status), Total (total), Imported (imported), Needing update (needing_update), Unprocessed (unprocessed), Last Imported (last_imported) [default: id status total imported unprocessed last_imported]
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/migrate_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_status/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/migrate_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_stop/","title":"migrate:stop","text":" 10.4+
Stop an active migration operation.
"},{"location":"commands/migrate_stop/#arguments","title":"Arguments","text":" - migrationId. The ID of migration to stop.
"},{"location":"commands/migrate_stop/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_stop/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_stop/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/mk_docs/","title":"mk:docs","text":"Build a Markdown document for each Drush command/generator that is available on a site.
This command is an early step when building the www.drush.org static site. Adapt it to build a similar site listing the commands that are available on your site. Also see Drush's Github Actions workflow.
"},{"location":"commands/mk_docs/#examples","title":"Examples","text":" drush mk:docs
. Build many .md files in the docs/commands and docs/generators directories.
"},{"location":"commands/mk_docs/#arguments","title":"Arguments","text":" - command. The command to execute
"},{"location":"commands/mk_docs/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/php_cli/","title":"php:cli","text":"Open an interactive shell on a Drupal site.
"},{"location":"commands/php_cli/#examples","title":"Examples","text":" $node = Node::load(1)
. Entity classes are available without their namespace. For example, Node::load(1) works instead of Drupal\\Node\\entity\\Node::load(1). $paragraph = Paragraph::loadRevision(1)
. Also, a loadRevision static method is made available for easier load of revisions.
"},{"location":"commands/php_cli/#options","title":"Options","text":" - --version-history. Use command history based on Drupal version. Default is per site.
- --cwd=CWD. A directory to change to before launching the shell. Default is the project root directory
"},{"location":"commands/php_cli/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/php_cli/#topics","title":"Topics","text":" - Drush's PHP Shell. (docs:repl)
"},{"location":"commands/php_cli/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/php_eval/","title":"php:eval","text":"Evaluate arbitrary php code after bootstrapping Drupal (if available).
"},{"location":"commands/php_eval/#examples","title":"Examples","text":" drush php:eval '$node = \\Drupal ode\\Entity\\Node::load(1); print $node->getTitle();'
. Loads node with nid 1 and then prints its title. drush php:eval \"\\Drupal::service('file_system')->copy('$HOME/Pictures/image.jpg', 'public://image.jpg');\"
. Copies a file whose path is determined by an environment's variable. Use of double quotes so the variable $HOME gets replaced by its value. drush php:eval \"node_access_rebuild();\"
. Rebuild node access permissions.
"},{"location":"commands/php_eval/#arguments","title":"Arguments","text":" - code. PHP code. If shell escaping gets too tedious, consider using the php:script command.
"},{"location":"commands/php_eval/#options","title":"Options","text":" - --format[=FORMAT]. [default: var_dump]
"},{"location":"commands/php_eval/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/php_eval/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/php_script/","title":"php:script","text":"Run php a script after a full Drupal bootstrap.
A useful alternative to eval command when your php is lengthy or you can't be bothered to figure out bash quoting. If you plan to share a script with others, consider making a full Drush command instead, since that's more self-documenting. Drush provides commandline options to the script via a variable called $extra.
"},{"location":"commands/php_script/#examples","title":"Examples","text":" drush php:script example --script-path=/path/to/scripts:/another/path
. Run a script named example.php from specified paths drush php:script -
. Run PHP code from standard input. drush php:script
. List all available scripts. drush php:script foo -- apple --cider
. Run foo.php script with argument apple and option cider. Note the -- separator.
"},{"location":"commands/php_script/#arguments","title":"Arguments","text":""},{"location":"commands/php_script/#options","title":"Options","text":" - --format[=FORMAT]. [default: var_export]
- --script-path=SCRIPT-PATH. Additional paths to search for scripts, separated by : (Unix-based systems) or ; (Windows).
"},{"location":"commands/php_script/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/php_script/#topics","title":"Topics","text":" - An example Drush script. (docs:script)
"},{"location":"commands/php_script/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/pm_install/","title":"pm:install","text":"Enable one or more modules.
"},{"location":"commands/pm_install/#examples","title":"Examples","text":" drush pm:install --simulate content_moderation
. Display what modules would be installed but don't install them.
"},{"location":"commands/pm_install/#arguments","title":"Arguments","text":" - [modules].... A comma delimited list of modules.
"},{"location":"commands/pm_install/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/pm_install/#aliases","title":"Aliases","text":" - in
- install
- pm-install
- en
- pm-enable
- pm:enable
Legend
- 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.
"},{"location":"commands/pm_list/","title":"pm:list","text":"Show a list of available extensions (modules and themes).
"},{"location":"commands/pm_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --type[=TYPE]. Only show extensions having a given type. Choices: module, theme. [default: module,theme]
- --status[=STATUS]. Only show extensions having a given status. Choices: enabled or disabled. [default: enabled,disabled]
- --package=PACKAGE. Only show extensions having a given project packages (e.g. Development).
- --core. Only show extensions that are in Drupal core.
- --no-core. Only show extensions that are not provided by Drupal core.
- --fields=FIELDS. Available fields: Package (package), Project (project), Name (display_name), Name (name), Type (type), Path (path), Status (status), Version (version)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/pm_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/pm_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/pm_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/pm_uninstall/","title":"pm:uninstall","text":"Uninstall one or more modules and their dependent modules.
"},{"location":"commands/pm_uninstall/#examples","title":"Examples","text":" drush pm:uninstall --simulate field_ui
. Display what modules would be uninstalled but don't uninstall them.
"},{"location":"commands/pm_uninstall/#arguments","title":"Arguments","text":" - [modules].... A comma delimited list of modules.
"},{"location":"commands/pm_uninstall/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/pm_uninstall/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/queue_delete/","title":"queue:delete","text":"Delete all items in a specific queue.
"},{"location":"commands/queue_delete/#arguments","title":"Arguments","text":" - name. The name of the queue to delete, as defined in either hook_queue_info or hook_cron_queue_info.
"},{"location":"commands/queue_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/queue_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/queue_list/","title":"queue:list","text":"Returns a list of all defined queues.
"},{"location":"commands/queue_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Queue (queue), Items (items), Class (class)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/queue_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/queue_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/queue_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/queue_run/","title":"queue:run","text":"Run a specific queue by name.
"},{"location":"commands/queue_run/#arguments","title":"Arguments","text":" - name. The name of the queue to run, as defined in either hook_queue_info or hook_cron_queue_info.
"},{"location":"commands/queue_run/#options","title":"Options","text":" - --time-limit=TIME-LIMIT. The maximum number of seconds allowed to run the queue.
- --items-limit=ITEMS-LIMIT. The maximum number of items allowed to run the queue.
- --lease-time=LEASE-TIME. The maximum number of seconds that an item remains claimed.
"},{"location":"commands/queue_run/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/queue_run/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_create/","title":"role:create","text":"Create a new role.
"},{"location":"commands/role_create/#examples","title":"Examples","text":" drush role:create 'test_role' 'Test role'
. Create a new role with a machine name of 'test_role', and a human-readable name of 'Test role'.
"},{"location":"commands/role_create/#arguments","title":"Arguments","text":" - machine_name. The symbolic machine name for the role.
- [human_readable_name]. A descriptive name for the role.
"},{"location":"commands/role_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_delete/","title":"role:delete","text":"Delete a role.
"},{"location":"commands/role_delete/#examples","title":"Examples","text":" drush role:delete 'test_role'
. Delete the role 'test_role'.
"},{"location":"commands/role_delete/#arguments","title":"Arguments","text":" - machine_name. The symbolic machine name for the role.
"},{"location":"commands/role_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_list/","title":"role:list","text":"Display roles and their permissions.
"},{"location":"commands/role_list/#examples","title":"Examples","text":" drush role:list --filter='administer nodes'
. Display a list of roles that have the administer nodes permission assigned. drush role:list --filter='rid=anonymous'
. Display only the anonymous role.
"},{"location":"commands/role_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Available fields: ID (rid), Role Label (label), Permissions (perms)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/role_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/role_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_perm_add/","title":"role:perm:add","text":"Grant specified permission(s) to a role.
"},{"location":"commands/role_perm_add/#examples","title":"Examples","text":" drush role:perm:add anonymous 'post comments'
. Allow anon users to post comments. drush role:perm:add anonymous 'post comments,access content'
. Allow anon users to post comments and access content.
"},{"location":"commands/role_perm_add/#arguments","title":"Arguments","text":" - machine_name. The role to modify.
- permissions. The list of permission to grant, delimited by commas.
"},{"location":"commands/role_perm_add/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_perm_add/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_perm_remove/","title":"role:perm:remove","text":"Remove specified permission(s) from a role.
"},{"location":"commands/role_perm_remove/#examples","title":"Examples","text":" drush role:remove-perm anonymous
. Remove 2 permissions from anon users.
"},{"location":"commands/role_perm_remove/#arguments","title":"Arguments","text":" - machine_name. The role to modify.
- permissions. The list of permission to grant, delimited by commas.
"},{"location":"commands/role_perm_remove/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_perm_remove/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/runserver/","title":"runserver","text":"Runs PHP's built-in http server for development.
- Don't use this for production, it is neither scalable nor secure for this use.
- If you run multiple servers simultaneously, you will need to assign each a unique port.
- Use Ctrl-C or equivalent to stop the server when complete.
"},{"location":"commands/runserver/#examples","title":"Examples","text":" drush rs 8080
. Start a web server on 127.0.0.1, port 8080. drush rs 10.0.0.28:80
. Start runserver on 10.0.0.28, port 80. drush rs [::1]:80
. Start runserver on IPv6 localhost ::1, port 80. drush rs --dns localhost:8888/user
. Start runserver on localhost (using rDNS to determine binding IP), port 8888, and open /user in browser. drush rs /
. Start runserver on default IP/port (127.0.0.1, port 8888), and open / in browser. drush rs :9000/admin
. Start runserver on 127.0.0.1, port 9000, and open /admin in browser. Note that you need a colon when you specify port and path, but no IP. drush --quiet rs
. Silence logging the printing of web requests to the console.
"},{"location":"commands/runserver/#arguments","title":"Arguments","text":" - [uri]. IP address and port number to bind to and path to open in web browser. Format is addr:port/path. Only opens a browser if a path is specified.
"},{"location":"commands/runserver/#options","title":"Options","text":" - --default-server=DEFAULT-SERVER. A default addr:port/path to use for any values not specified as an argument.
- --browser[=BROWSER]. Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: 1]
- --dns. Resolve hostnames/IPs using DNS/rDNS (if possible) to determine binding IPs and/or human friendly hostnames for URLs and browser.
- --no-browser. Negate --browser option.
"},{"location":"commands/runserver/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/runserver/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_alias/","title":"site:alias","text":"Show site alias details, or a list of available site aliases.
"},{"location":"commands/site_alias/#examples","title":"Examples","text":" drush site:alias
. List all alias records known to drush. drush site:alias @dev
. Print an alias record for the alias dev.
"},{"location":"commands/site_alias/#arguments","title":"Arguments","text":" - [site]. Site alias or site specification.
"},{"location":"commands/site_alias/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/site_alias/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_alias/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/site_alias/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_install/","title":"site:install","text":"Install Drupal along with modules/themes/configuration/profile.
"},{"location":"commands/site_install/#examples","title":"Examples","text":" drush si demo_umami --locale=da
. (Re)install using the Umami install profile. Set default language to Danish. drush si --db-url=mysql://root:pass@localhost:port/dbname
. Install using the specified DB params. drush si --db-url=sqlite://sites/example.com/files/.ht.sqlite
. Install using SQLite drush si --db-url=sqlite://:memory:
. Install using SQLite in-memory database. drush si --account-pass=mom
. Re-install with specified uid1 password. drush si --existing-config
. Install based on the yml files stored in the config export/import directory. drush si standard install_configure_form.enable_update_status_emails=NULL
. Disable email notification during install and later. If your server has no mail transfer agent, this gets rid of an error during install.
"},{"location":"commands/site_install/#arguments","title":"Arguments","text":" - [profile].... An install profile name. Defaults to standard unless an install profile is marked as a distribution. Use minimal for a bare minimum installation. Additional info for the install profile may also be provided with additional arguments. The key is in the form [form name].[parameter name]
"},{"location":"commands/site_install/#options","title":"Options","text":" - --db-url=DB-URL. A Drupal 6 style database URL. Required for initial install, not re-install. If omitted and required, Drush prompts for this item.
- --db-prefix=DB-PREFIX. An optional table prefix to use for initial install.
- --db-su=DB-SU. Account to use when creating a new database. Must have Grant permission (mysql only). Optional.
- --db-su-pw=DB-SU-PW. Password for the db-su account. Optional.
- --account-name[=ACCOUNT-NAME]. uid1 name. [default: admin]
- --account-mail[=ACCOUNT-MAIL]. uid1 email. [default: admin@example.com]
- --site-mail[=SITE-MAIL]. From: for system mailings. [default: admin@example.com]
- --account-pass=ACCOUNT-PASS. uid1 pass. Defaults to a randomly generated password. If desired, set a fixed password in drush.yml.
- --locale[=LOCALE]. A short language code. Sets the default site language. Language files must already be present. [default: en]
- --site-name[=SITE-NAME]. Site name [default: Drush Site-Install]
- --site-pass=SITE-PASS.
- --sites-subdir=SITES-SUBDIR. Name of directory under sites which should be created.
- --config-dir=CONFIG-DIR.
- --existing-config. Configuration from sync directory should be imported during installation.
"},{"location":"commands/site_install/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_install/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_set/","title":"site:set","text":"Set a site alias that will persist for the current session.
Stores the site alias being used in the current session in a temporary file.
"},{"location":"commands/site_set/#examples","title":"Examples","text":" drush site:set @dev
. Set the current session to use the @dev alias. drush site:set user@server/path/to/drupal#sitename
. Set the current session to use a remote site via site specification. drush site:set /path/to/drupal#sitename
. Set the current session to use a local site via site specification. drush site:set -
. Go back to the previously-set site (like cd -
). drush site:set
. Without an argument, any existing site becomes unset.
"},{"location":"commands/site_set/#arguments","title":"Arguments","text":" - [site]. Site specification to use, or - for previous site. Omit this argument to unset.
"},{"location":"commands/site_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_set/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
"},{"location":"commands/site_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_ssh/","title":"site:ssh","text":"Connect to a webserver via SSH, and optionally run a shell command.
"},{"location":"commands/site_ssh/#examples","title":"Examples","text":" drush @mysite ssh
. Open an interactive shell on @mysite's server. drush @prod ssh \"ls /tmp\"
. Run ls /tmp on @prod site. drush @prod ssh \"git pull\"
. Run git pull on the Drupal root directory on the @prod site. drush ssh \"git pull\"
. Run git pull on the local Drupal root directory.
"},{"location":"commands/site_ssh/#arguments","title":"Arguments","text":" - [code].... Code which should run at remote host.
"},{"location":"commands/site_ssh/#options","title":"Options","text":" - --cd=CD. Directory to change to. Defaults to Drupal root.
- --ssh-options=SSH-OPTIONS. A string of extra options that will be passed to the ssh command (e.g. -p 100)
- --tty. Create a tty (e.g. to run an interactive program).
"},{"location":"commands/site_ssh/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_ssh/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
"},{"location":"commands/site_ssh/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_cli/","title":"sql:cli","text":"Open a SQL command-line interface using Drupal's credentials.
"},{"location":"commands/sql_cli/#examples","title":"Examples","text":" drush sql:cli
. Open a SQL command-line interface using Drupal's credentials. drush sql:cli --extra=--progress-reports
. Open a SQL CLI and skip reading table information. drush sql:cli < example.sql
. Import sql statements from a file into the current database.
"},{"location":"commands/sql_cli/#options","title":"Options","text":" - --extra=EXTRA. Add custom options to the connect string (e.g. --extra=--skip-column-names)
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_cli/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_cli/#topics","title":"Topics","text":" - Example policy file. (docs:policy)
"},{"location":"commands/sql_cli/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_connect/","title":"sql:connect","text":"A string for connecting to the DB.
"},{"location":"commands/sql_connect/#examples","title":"Examples","text":" $(drush sql:connect) < example.sql
. Bash: Import SQL statements from a file into the current database. eval (drush sql:connect) < example.sql
. Fish: Import SQL statements from a file into the current database.
"},{"location":"commands/sql_connect/#options","title":"Options","text":" - --extra=EXTRA. Add custom options to the connect string (e.g. --extra=--skip-column-names)
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_connect/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_connect/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_create/","title":"sql:create","text":"Create a database.
"},{"location":"commands/sql_create/#examples","title":"Examples","text":" drush sql:create
. Create the database for the current site. drush @site.test sql:create
. Create the database as specified for @site.test. drush sql:create --db-su=root --db-su-pw=rootpassword --db-url=\"mysql://drupal_db_user:drupal_db_password@127.0.0.1/drupal_db\"
. Create the database as specified in the db-url option.
"},{"location":"commands/sql_create/#options","title":"Options","text":" - --db-su=DB-SU. Account to use when creating a new database.
- --db-su-pw=DB-SU-PW. Password for the db-su account.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_drop/","title":"sql:drop","text":"Drop all tables in a given database.
"},{"location":"commands/sql_drop/#options","title":"Options","text":" - --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_drop/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_drop/#topics","title":"Topics","text":" - Example policy file. (docs:policy)
"},{"location":"commands/sql_drop/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_dump/","title":"sql:dump","text":"Exports the Drupal DB as SQL using mysqldump or equivalent.
--create-db is used by sql-sync, since including the DROP TABLE statements interferes with the import when the database is created.
"},{"location":"commands/sql_dump/#examples","title":"Examples","text":" drush sql:dump --result-file=../18.sql
. Save SQL dump to the directory above Drupal root. drush sql:dump --skip-tables-key=common
. Skip standard tables. See Drush configuration drush sql:dump --extra-dump=--no-data
. Pass extra option to mysqldump command.
"},{"location":"commands/sql_dump/#options","title":"Options","text":" - --result-file=RESULT-FILE. Save to a file. The file should be relative to Drupal root. If --result-file is provided with the value 'auto', a date-based filename will be created under ~/drush-backups directory.
- --create-db. Omit DROP TABLE statements. Used by Postgres and Oracle only.
- --data-only. Dump data without statements to create any of the schema.
- --ordered-dump. Order by primary key and add line breaks for efficient diffs. Slows down the dump. Mysql only.
- --gzip. Compress the dump using the gzip program which must be in your $PATH.
- --extra=EXTRA. Add custom arguments/options when connecting to database (used internally to list tables).
- --extra-dump=EXTRA-DUMP. Add custom arguments/options to the dumping of the database (e.g. mysqldump command).
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: null]
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
- --fields=FIELDS. Available fields: Path (path)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/sql_dump/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_dump/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/sql_dump/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_query/","title":"sql:query","text":"Execute a query against a database.
"},{"location":"commands/sql_query/#examples","title":"Examples","text":" drush sql:query \"SELECT * FROM users WHERE uid=1\"
. Browse user record. Table prefixes, if used, must be added to table names by hand. drush sql:query --db-prefix \"SELECT * FROM {users}\"
. Browse user record. Table prefixes are honored. Caution: All curly-braces will be stripped. $(drush sql:connect) < example.sql
. Import sql statements from a file into the current database. drush sql:query --file=example.sql
. Alternate way to import sql statements from a file. drush php:eval --format=json \"return \\Drupal::service('database')->query('SELECT * FROM users LIMIT 5')->fetchAll()\"
. Get data back in JSON format. See https://github.com/drush-ops/drush/issues/3071#issuecomment-347929777. $(drush sql:connect) -e \"SELECT * FROM users LIMIT 5;\"
. Results are formatted in a pretty table with borders and column headers.
"},{"location":"commands/sql_query/#arguments","title":"Arguments","text":" - [query]. An SQL query. Ignored if --file is provided.
"},{"location":"commands/sql_query/#options","title":"Options","text":" - --result-file[=RESULT-FILE]. Save to a file. The file should be relative to Drupal root.
- --file=FILE. Path to a file containing the SQL to be run. Gzip files are accepted.
- --file-delete. Delete the --file after running it.
- --extra=EXTRA. Add custom options to the connect string (e.g. --extra=--skip-column-names)
- --db-prefix. Enable replacement of braces in your query.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_query/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_query/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_sanitize/","title":"sql:sanitize","text":"Sanitize the database by removing or obfuscating user data.
Commandfiles may add custom operations by implementing:
- `#[CLI\\Hook(type: HookManager::ON_EVENT, target: SanitizeCommands::CONFIRMS)]`. Display summary to user before confirmation.\n- `#[CLI\\Hook(type: HookManager::POST_COMMAND_HOOK, target: SanitizeCommands::SANITIZE)]`. Run queries or call APIs to perform sanitizing\n
Several working commandfiles may be found at https://github.com/drush-ops/drush/tree/12.x/src/Drupal/Commands/sql
"},{"location":"commands/sql_sanitize/#examples","title":"Examples","text":" drush sql:sanitize --sanitize-password=no
. Sanitize database without modifying any passwords. drush sql:sanitize --allowlist-fields=field_biography,field_phone_number
. Sanitizes database but exempts two user fields from modification.
"},{"location":"commands/sql_sanitize/#options","title":"Options","text":" - --allowlist-fields[=ALLOWLIST-FIELDS]. A comma delimited list of fields exempt from sanitization.
- --sanitize-email[=SANITIZE-EMAIL]. The pattern for test email addresses in the sanitization operation, or no to keep email addresses unchanged. May contain replacement patterns %uid, %mail or %name. [default: user+%uid@localhost.localdomain]
- --sanitize-password[=SANITIZE-PASSWORD]. By default, passwords are randomized. Specify no to disable that. Specify any other value to set all passwords to that value.
"},{"location":"commands/sql_sanitize/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_sanitize/#topics","title":"Topics","text":" - Drush hooks. (docs:hooks)
"},{"location":"commands/sql_sanitize/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_sync/","title":"sql:sync","text":"Copy DB data from a source site to a target site. Transfers data via rsync.
"},{"location":"commands/sql_sync/#examples","title":"Examples","text":" drush sql:sync @source @self
. Copy the database from the site with the alias 'source' to the local site. drush sql:sync @self @target
. Copy the database from the local site to the site with the alias 'target'. drush sql:sync #prod #dev
. Copy the database from the site in /sites/prod to the site in /sites/dev (multisite installation).
"},{"location":"commands/sql_sync/#arguments","title":"Arguments","text":" - source. A site-alias or site specification whose database you want to copy from.
- target. A site-alias or site specification whose database you want to replace.
"},{"location":"commands/sql_sync/#options","title":"Options","text":" - --no-dump. Do not dump the sql database; always use an existing dump file.
- --no-sync. Do not rsync the database dump file from source to target.
- --runner=RUNNER. Where to run the rsync command; defaults to the local site. Can also be source or target.
- --create-db. Create a new database before importing the database dump on the target machine.
- --db-su=DB-SU. Account to use when creating a new database (e.g. root).
- --db-su-pw=DB-SU-PW. Password for the db-su account.
- --target-dump=TARGET-DUMP. The path for storing the sql-dump on target machine.
- --source-dump[=SOURCE-DUMP]. The path for retrieving the sql-dump on source machine.
- --extra-dump=EXTRA-DUMP. Add custom arguments/options to the dumping of the database (e.g. mysqldump command).
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
"},{"location":"commands/sql_sync/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_sync/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
- Example policy file. (docs:policy)
- Drush configuration. (docs:configuration)
- Extend sql-sync to allow transfer of the sql dump file via http. (docs:example-sync-via-http)
"},{"location":"commands/sql_sync/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/state_delete/","title":"state:delete","text":"Delete a state entry.
"},{"location":"commands/state_delete/#examples","title":"Examples","text":" drush state:del system.cron_last
. Delete state entry for system.cron_last.
"},{"location":"commands/state_delete/#arguments","title":"Arguments","text":" - key. The state key, for example system.cron_last.
"},{"location":"commands/state_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/state_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/state_get/","title":"state:get","text":"Display a state value.
"},{"location":"commands/state_get/#examples","title":"Examples","text":" drush state:get system.cron_last
. Displays last cron run timestamp drush state:get drupal_css_cache_files --format=yaml
. Displays an array of css files in yaml format.
"},{"location":"commands/state_get/#arguments","title":"Arguments","text":""},{"location":"commands/state_get/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: string]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/state_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/state_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/state_set/","title":"state:set","text":"Set a state value.
"},{"location":"commands/state_set/#examples","title":"Examples","text":" drush sset system.maintenance_mode 1 --input-format=integer
. Put site into Maintenance mode. drush state:set system.cron_last 1406682882 --input-format=integer
. Sets a timestamp for last cron run. php -r \"print json_encode(array('drupal', 'simpletest'));\" | drush state-set --input-format=json foo.name -
. Set a key to a complex value (e.g. array) drush state:set twig_debug TRUE
. Enable the Twig debug mode (since Drupal 10.1) drush state:set twig_autoreload TRUE
. Enable Twig auto reload (since Drupal 10.1) drush state:set twig_cache_disable TRUE
. Disable the Twig, page, render and dynamic page caches (since Drupal 10.1) drush state:set disable_rendered_output_cache_bins TRUE
. Disables render cache, dynamic page cache, and page cache. (since Drupal 10.1)
"},{"location":"commands/state_set/#arguments","title":"Arguments","text":" - key. The state key, for example: system.cron_last.
- value. The value to assign to the state key. Use - to read from Stdin.
"},{"location":"commands/state_set/#options","title":"Options","text":" - --input-format[=INPUT-FORMAT]. Type for the value. Other recognized values: string, integer, float, boolean, json, yaml. [default: auto]
"},{"location":"commands/state_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/state_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/theme_install/","title":"theme:install","text":"Install one or more themes.
"},{"location":"commands/theme_install/#arguments","title":"Arguments","text":" - [themes].... A comma delimited list of themes.
"},{"location":"commands/theme_install/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/theme_install/#aliases","title":"Aliases","text":" - thin
- theme:enable
- then
- theme-enable
Legend
- 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.
"},{"location":"commands/theme_uninstall/","title":"theme:uninstall","text":"Uninstall themes.
"},{"location":"commands/theme_uninstall/#arguments","title":"Arguments","text":" - [themes].... A comma delimited list of themes.
"},{"location":"commands/theme_uninstall/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/theme_uninstall/#aliases","title":"Aliases","text":" - theme:un
- thun
- theme-uninstall
Legend
- 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.
"},{"location":"commands/twig_compile/","title":"twig:compile","text":"Compile all Twig template(s).
"},{"location":"commands/twig_compile/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/twig_compile/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/twig_debug/","title":"twig:debug","text":" 12.1+
Enables Twig debug and disables caching Twig templates.
"},{"location":"commands/twig_debug/#arguments","title":"Arguments","text":" - mode. Debug mode. Recognized values: on, off.
"},{"location":"commands/twig_debug/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/twig_debug/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/twig_unused/","title":"twig:unused","text":"Find potentially unused Twig templates.
Immediately before running this command, web crawl your entire web site. Or use your Production PHPStorage dir for comparison.
"},{"location":"commands/twig_unused/#examples","title":"Examples","text":" drush twig:unused --field=template /var/www/mass.local/docroot/modules/custom,/var/www/mass.local/docroot/themes/custom
. Output a simple list of potentially unused templates.
"},{"location":"commands/twig_unused/#arguments","title":"Arguments","text":" - searchpaths. A comma delimited list of paths to recursively search
"},{"location":"commands/twig_unused/#options","title":"Options","text":" - --format=FORMAT. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Template (template), Compiled (compiled)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/twig_unused/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/twig_unused/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/updatedb/","title":"updatedb","text":"Apply any database updates required (as with running update.php).
"},{"location":"commands/updatedb/#options","title":"Options","text":" - --cache-clear[=CACHE-CLEAR]. Clear caches upon completion. [default: 1]
- --no-cache-clear. Negate --cache-clear option.
"},{"location":"commands/updatedb/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/updatedb/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
"},{"location":"commands/updatedb/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/updatedb_status/","title":"updatedb:status","text":"List any pending database updates.
"},{"location":"commands/updatedb_status/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Module (module), Update ID (update_id), Description (description), Type (type)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/updatedb_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/updatedb_status/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/updatedb_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_block/","title":"user:block","text":"Block the specified user(s).
"},{"location":"commands/user_block/#examples","title":"Examples","text":" drush user:block user3
. Block the user whose name is user3 drush user:cancel user3 --delete-content
. Delete the user whose name is user3 and delete her content. drush user:cancel user3 --reassign-content
. Delete the user whose name is user3 and reassign her content to the anonymous user.
"},{"location":"commands/user_block/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_block/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_block/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_block/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_cancel/","title":"user:cancel","text":"Block or delete user account(s) with the specified name(s).
- Existing content may be deleted or reassigned to the Anonymous user. See options.
- By default only nodes are deleted or reassigned. Custom entity types need own code to support cancellation. See https://www.drupal.org/project/drupal/issues/3043725 for updates.
"},{"location":"commands/user_cancel/#examples","title":"Examples","text":" drush user:cancel username
. Block the user account with the name username. drush user:cancel --delete-content username
. Delete the user account with the name username and delete all content created by that user. drush user:cancel --reassign-content username
. Delete the user account with the name username and assign all her content to the anonymous user.
"},{"location":"commands/user_cancel/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_cancel/#options","title":"Options","text":" - --delete-content. Delete the user, and delete all content created by that user.
- --reassign-content. Delete the user and make its content belong to the anonymous user.
- --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_cancel/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_cancel/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_create/","title":"user:create","text":"Create a user account.
"},{"location":"commands/user_create/#examples","title":"Examples","text":" drush user:create newuser --mail='person@example.com' --password='letmein'
. Create a new user account with the name newuser, the email address person@example.com, and the password letmein
"},{"location":"commands/user_create/#arguments","title":"Arguments","text":" - name. The name of the account to add
"},{"location":"commands/user_create/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --password=PASSWORD. The password for the new account
- --mail=MAIL. The email address for the new account
- --fields=FIELDS. Available fields: User ID (uid), User name (name), Password (pass), User mail (mail), User theme (theme), Signature (signature), Signature format (signature_format), User created (user_created), Created (created), User last access (user_access), Last access (access), User last login (user_login), Last login (login), User status (user_status), Status (status), Time zone (timezone), User picture (picture), Initial user mail (init), User roles (roles), Group Audience (group_audience), Language code (langcode), Uuid (uuid)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/user_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_create/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/user_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_information/","title":"user:information","text":"Print information about the specified user(s).
"},{"location":"commands/user_information/#examples","title":"Examples","text":" drush user:information someguy,somegal
. Display information about the someguy and somegal user accounts. drush user:information --mail=someguy@somegal.com
. Display information for a given email account. drush user:information --uid=5
. Display information for a given user id. drush uinf --uid=$(drush sqlq \"SELECT GROUP_CONCAT(entity_id) FROM user__roles WHERE roles_target_id = 'administrator'\")
. Display information for all administrators.
"},{"location":"commands/user_information/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_information/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
- --fields=FIELDS. Available fields: User ID (uid), User name (name), Password (pass), User mail (mail), User theme (theme), Signature (signature), Signature format (signature_format), User created (user_created), Created (created), User last access (user_access), Last access (access), User last login (user_login), Last login (login), User status (user_status), Status (status), Time zone (timezone), User picture (picture), Initial user mail (init), User roles (roles), Group Audience (group_audience), Language code (langcode), Uuid (uuid)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/user_information/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_information/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/user_information/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_login/","title":"user:login","text":"Display a one time login link for user ID 1, or another user.
"},{"location":"commands/user_login/#examples","title":"Examples","text":" drush user:login
. Open browser to homepage, logged in as uid=1. drush user:login --name=ryan node/add/blog
. Open browser (if configured or detected) for a one-time login link for username ryan that redirects to node/add/blog. drush user:login --uid=123
. Open browser and login as user with uid \"123\". drush user:login --mail=foo@bar.com
. Open browser and login as user with mail \"foo@bar.com\".
"},{"location":"commands/user_login/#arguments","title":"Arguments","text":" - [path]. Optional path to redirect to after logging in.
"},{"location":"commands/user_login/#options","title":"Options","text":" - --name[=NAME]. A user name to log in as.
- --uid[=UID]. A user ID to log in as.
- --mail[=MAIL]. A user email to log in as.
- --browser[=BROWSER]. Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: 1]
- --redirect-port=REDIRECT-PORT. A custom port for redirecting to (e.g., when running within a Vagrant environment)
- --no-browser. Negate --browser option.
"},{"location":"commands/user_login/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_login/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_password/","title":"user:password","text":"Set the password for the user account with the specified name.
"},{"location":"commands/user_password/#examples","title":"Examples","text":" drush user:password someuser 'correct horse battery staple'
. Set the password for the username someuser. See https://xkcd.com/936
"},{"location":"commands/user_password/#arguments","title":"Arguments","text":" - name. The name of the account to modify.
- password. The new password for the account.
"},{"location":"commands/user_password/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_password/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_role_add/","title":"user:role:add","text":"Add a role to the specified user accounts.
"},{"location":"commands/user_role_add/#examples","title":"Examples","text":" drush user:role:add 'editor' user3
. Add the editor role to user3
"},{"location":"commands/user_role_add/#arguments","title":"Arguments","text":" - role. The machine name of the role to add.
- [names]. A comma delimited list of user names.
"},{"location":"commands/user_role_add/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_role_add/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_role_add/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_role_remove/","title":"user:role:remove","text":"Remove a role from the specified user accounts.
"},{"location":"commands/user_role_remove/#examples","title":"Examples","text":" drush user:role:remove 'power_user' user3
. Remove the power_user role from user3
"},{"location":"commands/user_role_remove/#arguments","title":"Arguments","text":" - role. The machine name of the role to add.
- [names]. A comma delimited list of user names.
"},{"location":"commands/user_role_remove/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_role_remove/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_role_remove/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_unblock/","title":"user:unblock","text":"Unblock the specified user(s).
"},{"location":"commands/user_unblock/#examples","title":"Examples","text":" drush user:unblock user3
. Unblock the user whose name is user3
"},{"location":"commands/user_unblock/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_unblock/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_unblock/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_unblock/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/version/","title":"version","text":"Show Drush version.
"},{"location":"commands/version/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Drush version (drush-version)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/version/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/version/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/views_dev/","title":"views:dev","text":"Set several Views settings to more developer-oriented values.
"},{"location":"commands/views_dev/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_dev/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_disable/","title":"views:disable","text":"Disable the specified views.
"},{"location":"commands/views_disable/#examples","title":"Examples","text":" drush vdis frontpage taxonomy_term
. Disable the frontpage and taxonomy_term views.
"},{"location":"commands/views_disable/#arguments","title":"Arguments","text":" - views. A comma delimited list of view names.
"},{"location":"commands/views_disable/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_disable/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_enable/","title":"views:enable","text":"Enable the specified views.
"},{"location":"commands/views_enable/#examples","title":"Examples","text":" drush ven frontpage,taxonomy_term
. Enable the frontpage and taxonomy_term views.
"},{"location":"commands/views_enable/#arguments","title":"Arguments","text":" - views. A comma delimited list of view names.
"},{"location":"commands/views_enable/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_enable/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_execute/","title":"views:execute","text":"Execute a view and show a count of the results, or the rendered HTML.
"},{"location":"commands/views_execute/#examples","title":"Examples","text":" drush views:execute my_view
. Show the rendered HTML for the default display for the my_view View. drush views:execute my_view page_1 3 --count
. Show a count of my_view:page_1 where the first contextual filter value is 3. drush views:execute my_view page_1 3,foo
. Show the rendered HTML of my_view:page_1 where the first two contextual filter values are 3 and 'foo' respectively.
"},{"location":"commands/views_execute/#arguments","title":"Arguments","text":" - view_name. The name of the view to execute.
- [display]. The display ID to execute. If none specified, the default display will be used.
- [view_args]. A comma delimited list of values, corresponding to contextual filters.
"},{"location":"commands/views_execute/#options","title":"Options","text":" - --count[=COUNT]. Display a count of the results instead of each row.
- --show-admin-links. Show contextual admin links in the rendered markup.
"},{"location":"commands/views_execute/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_execute/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_list/","title":"views:list","text":"Get a list of all views in the system.
"},{"location":"commands/views_list/#examples","title":"Examples","text":" drush vl
. Show a list of all available views. drush vl --name=blog
. Show a list of views which names contain 'blog'. drush vl --tags=tag1,tag2
. Show a list of views tagged with 'tag1' or 'tag2'. drush vl --status=enabled
. Show a list of enabled views.
"},{"location":"commands/views_list/#options","title":"Options","text":" - --name=NAME.
- --tags=TAGS. A comma-separated list of views tags by which to filter the results.
- --status=STATUS. Filter views by status. Choices: enabled, disabled.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Machine name (machine-name), Name (label), Description (description), Status (status), Tag (tag)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/views_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/views_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_delete/","title":"watchdog:delete","text":"Delete watchdog log records.
"},{"location":"commands/watchdog_delete/#examples","title":"Examples","text":" drush watchdog:delete all
. Delete all messages. drush watchdog:delete 64
. Delete messages with id 64. drush watchdog:delete \"cron run succesful\"
. Delete messages containing the string \"cron run succesful\". drush watchdog:delete --severity=Notice
. Delete all messages with a severity of notice. drush watchdog:delete --type=cron
. Delete all messages of type cron.
"},{"location":"commands/watchdog_delete/#arguments","title":"Arguments","text":" - [substring]. Delete all log records with this text in the messages.
"},{"location":"commands/watchdog_delete/#options","title":"Options","text":" - --severity=SEVERITY. Delete messages of a given severity level.
- --type=TYPE. Delete messages of a given type.
"},{"location":"commands/watchdog_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_delete/#aliases","title":"Aliases","text":" - wd-del
- wd-delete
- wd
- watchdog-delete
Legend
- 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.
"},{"location":"commands/watchdog_list/","title":"watchdog:list","text":"Interactively filter the watchdog message listing.
"},{"location":"commands/watchdog_list/#examples","title":"Examples","text":" drush watchdog:list
. Prompt for message type or severity, then run watchdog:show.
"},{"location":"commands/watchdog_list/#arguments","title":"Arguments","text":" - [substring]. A substring to look search in error messages.
"},{"location":"commands/watchdog_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --count[=COUNT]. The number of messages to show. [default: 10]
- --extended. Return extended information about each message.
- --severity. Restrict to messages of a given severity level (numeric or string).
- --type. Restrict to messages of a given type.
- --fields=FIELDS. Available fields: ID (wid), Type (type), Message (message), Severity (severity), Location (location), Hostname (hostname), Date (date), Username (username)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/watchdog_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/watchdog_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_show-one/","title":"watchdog:show-one","text":"Show one log record by ID.
"},{"location":"commands/watchdog_show-one/#arguments","title":"Arguments","text":""},{"location":"commands/watchdog_show-one/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/watchdog_show-one/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_show-one/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_show/","title":"watchdog:show","text":"Show watchdog messages.
"},{"location":"commands/watchdog_show/#examples","title":"Examples","text":" drush watchdog:show
. Show a listing of most recent 10 messages. drush watchdog:show \"cron run successful\"
. Show a listing of most recent 10 messages containing the string cron run successful. drush watchdog:show --count=46
. Show a listing of most recent 46 messages. drush watchdog:show --severity=Notice
. Show a listing of most recent 10 messages with a severity of notice. drush watchdog:show --severity-min=Warning
. Show a listing of most recent 10 messages with a severity of warning or higher. drush watchdog:show --type=php
. Show a listing of most recent 10 messages of type php
"},{"location":"commands/watchdog_show/#arguments","title":"Arguments","text":" - [substring]. A substring to look search in error messages.
"},{"location":"commands/watchdog_show/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --count[=COUNT]. The number of messages to show. [default: 10]
- --severity=SEVERITY. Restrict to messages of a given severity level (numeric or string).
- --severity-min=SEVERITY-MIN. Restrict to messages of a given severity level and higher.
- --type=TYPE. Restrict to messages of a given type.
- --extended. Return extended information about each message.
- --fields=FIELDS. Available fields: ID (wid), Type (type), Message (message), Severity (severity), Location (location), Hostname (hostname), Date (date), Username (username), Uid (uid)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/watchdog_show/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_show/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/watchdog_show/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_tail/","title":"watchdog:tail","text":" 10.6+
Tail watchdog messages.
"},{"location":"commands/watchdog_tail/#examples","title":"Examples","text":" drush watchdog:tail
. Continuously tail watchdog messages. drush watchdog:tail \"cron run successful\"
. Continuously tail watchdog messages, filtering on the string cron run successful. drush watchdog:tail --severity=Notice
. Continuously tail watchdog messages, filtering severity of notice. drush watchdog:tail --severity-min=Warning
. Continuously tail watchdog messages, filtering for a severity of warning or higher. drush watchdog:tail --type=php
. Continuously tail watchdog messages, filtering on type equals php.
"},{"location":"commands/watchdog_tail/#arguments","title":"Arguments","text":" - [substring]. A substring to look search in error messages.
"},{"location":"commands/watchdog_tail/#options","title":"Options","text":" - --severity=SEVERITY. Restrict to messages of a given severity level (numeric or string).
- --severity-min=SEVERITY-MIN. Restrict to messages of a given severity level and higher.
- --type=TYPE. Restrict to messages of a given type.
- --extended. Return extended information about each message.
"},{"location":"commands/watchdog_tail/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_tail/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_get_value/","title":"yaml:get:value","text":" 12.0+
Get a value for a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_get_value/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The key for the value to get, in dot notation.
"},{"location":"commands/yaml_get_value/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_get_value/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_lint/","title":"yaml:lint","text":" 12.0+
Validates that a given YAML file has valid syntax.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_lint/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
"},{"location":"commands/yaml_lint/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_lint/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_unset_key/","title":"yaml:unset:key","text":" 12.0+
Unset a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_unset_key/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The key to unset, in dot notation
"},{"location":"commands/yaml_unset_key/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_unset_key/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_update_key/","title":"yaml:update:key","text":" 12.0+
Update a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_update_key/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The original key, in dot notation
- new-key. The new key, in dot notation
"},{"location":"commands/yaml_update_key/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_update_key/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_update_value/","title":"yaml:update:value","text":" 12.0+
Update the value for a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_update_value/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The key for the value to set, in dot notation
- value. The new value
"},{"location":"commands/yaml_update_value/#options","title":"Options","text":" - -t, --type=TYPE. Set the variable type for the value. Accepted types are int, integer, bool, boolean, str, and string.
"},{"location":"commands/yaml_update_value/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_update_value/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"contribute/CONTRIBUTING/","title":"Guidelines","text":"Drush is built by people like you! Please join us.
"},{"location":"contribute/CONTRIBUTING/#git-and-pull-requests","title":"Git and Pull requests","text":" - Contributions are submitted, reviewed, and accepted using GitHub pull requests.
- The latest changes are in the
12.x
branch. PR's should initially target this branch. - See the test-specific README.md for instructions on running the test suite. Test before you push. Get familiar with Unish, our test suite. Optionally run tests in the provided Docker containers.
- We maintain branches named 12.x, 11.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions.
"},{"location":"contribute/CONTRIBUTING/#development-environment","title":"Development Environment","text":" - You may choose to use the DDEV for a standardized development environment.
- See
composer run-script -l
for a list of helper scripts.
"},{"location":"contribute/CONTRIBUTING/#coding-style","title":"Coding style","text":" - Do write comments. You don't have to comment every line, but if you come up with something that's a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are nearly worthless!
- We use PSR-12.
- Keep it compatible. Do not introduce changes to the public API, or configurations too casually. Don't make incompatible changes without good reasons!
- Run
composer cs
to check the project for coding style issues and run composer cbf
to fix them automatically where possible. These scripts use PHP_CodeSniffer
in background.
"},{"location":"contribute/CONTRIBUTING/#documentation","title":"Documentation","text":" - The docs are on our web site. You may also read these from within Drush, with the
drush topic
command. - Documentation should be kept up-to-date. This means, whenever you add a new API method, add a new hook or change the database model, pack the relevant changes to the docs in the same pull request.
"},{"location":"contribute/unish/","title":"Unish","text":"Drush's test suite (aka Unish) is based on PHPUnit. In order to maintain high quality, our tests are run on every push. See CircleCi.
"},{"location":"contribute/unish/#usage","title":"Usage","text":" git clone https://github.com/drush-ops/drush.git
cd drush
composer install
- Review the configuration settings in tests/phpunit.xml.dist. If customization is needed, copy phpunit.xml.dist to phpunit.xml and edit away.
- Run all test suites:
composer test
"},{"location":"contribute/unish/#ddev","title":"DDEV","text":" 11.0+
Drush's own tests may be run within provided Docker containers via DDEV
- Start containers:
ddev start
- Run a test:
ddev exec drupal composer functional -- --filter testUserRole
- See the DDEV's XDebug docs for help on enabling Xdebug.
"},{"location":"contribute/unish/#advanced-usage","title":"Advanced usage","text":" - Run only one test suite
composer unit
composer integration
composer functional
- Run only tests matching a regex:
composer functional -- --filter testUserRole
- Skip slow tests (usually those with network usage):
composer functional -- --exclude-group slow
- XML results:
composer functional -- --log-junit results.xml
- Ad-hoc testing with the SUT
composer sut:si
. See composer.json for details. UNISH_DIRTY=1 composer functional -- --filter testUserRole
./drush @sut.dev status
"},{"location":"contribute/unish/#about-the-test-suites","title":"About the Test Suites","text":" - Unit tests operate on functions that take values and return results without creating side effects. No database connection is required to run these tests, and no Drupal site is set up.
- Integration tests set up a test dependency injection container and operate by calling the Symfony Application APIs directly. A Drupal site called the System Under Test is set up and used for the tests. The SUT is set up and installed only once, and then is re-used for all tests. Integration tests therefore cannot make destructive changes to the SUT database. Also, Drupal is bootstrapped only once (always using the standard Drupal kernel, never the install or update kernel). This means that all commands run at
@bootstrap full
, and it is not possible to test loading different Drush configuration files and so on. It is not possible to test argument / option parsing. The shutdown and error handlers are not installed, so PHP deprecation warnings will be evidenced in the integration tests. - Functional tests operate by
exec
ing the Drush executable. All functional tests therefore run in their own separate processes. The Drupal System Under Test is set up every time it is needed by any functional test. It is therefore okay if a functional test changes the state of the SUT. The codebase is re-used, so no destructive changes should be made to the code.
"},{"location":"contribute/unish/#drush-test-traits","title":"Drush Test Traits","text":"Drush provides test traits that may be used to test your own Drush extensions. Adding the traits varies slightly depending how you package your Drush extension.
- An extension that ships inside a contributed module - DevelCommandsTest for an example. More examples are SchedulerDrushTest and Views Bulk Operations. Remember to add
drush/drush
to your module's composer.json (require-dev
section). - A standalone Drush extension or one that ships outside of a module - example drush extension
Once you successfully have use Drush\\TestTraits\\DrushTestTrait
in your test class, you are able to write simple tests that call your extension's commands and makes assertions against the output.
public function testMyCommand()\n {\n $this->drush('my:command', ['param'], ['flag' => 'value']);\n $this->assertOutputEquals('The parameter is \"param\" and the \"flag\" option is \"value\"');\n }\n
"},{"location":"examples/ArtCommands.php/","title":"ArtCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\AnnotationData;\nuse Consolidation\\AnnotatedCommand\\CommandData;\nuse Consolidation\\AnnotatedCommand\\Events\\CustomEventAwareInterface;\nuse Consolidation\\AnnotatedCommand\\Events\\CustomEventAwareTrait;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Consolidation\\OutputFormatters\\StructuredData\\RowsOfFields;\nuse Drush\\Attributes as CLI;\nuse Drush\\Style\\DrushStyle;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\n/**\n * Run these commands using the --include option - e.g. `drush --include=/path/to/drush/examples art sandwich`\n *\n * See [Drush Test Traits](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.\n */\n\nclass ArtCommands extends DrushCommands implements CustomEventAwareInterface\n{\n use CustomEventAwareTrait;\n\n /** @var string[] */\n protected ?array $arts;\n\n /**\n * Show a fabulous picture.\n */\n #[CLI\\Command(name: 'artwork:show', aliases: ['arts'])]\n #[CLI\\Argument(name: 'art', description: 'The name of the art to display')]\n #[CLI\\Usage(name: 'drush art sandwich', description: 'Show a marvelous picture of a sandwich with pickles.')]\n public function art($art = '')\n {\n $data = $this->getArt();\n $name = $data[$art]['name'];\n $description = $data[$art]['description'];\n $path = $data[$art]['path'];\n $msg = dt(\n 'Okay. Here is {art}: {description}',\n ['art' => $name, 'description' => $description]\n );\n $this->output()->writeln(\"\\n\" . $msg . \"\\n\");\n $this->printFile($path);\n }\n\n /**\n * Show a table of information about available art.\n */\n #[CLI\\Command(name: 'artwork:list', aliases: ['artls'])]\n #[CLI\\FieldLabels(labels: ['name' => 'Name', 'description' => 'Description', 'path' => 'Path'])]\n #[CLI\\DefaultTableFields(fields: ['name', 'description'])]\n #[CLI\\FilterDefaultField(field: 'name')]\n public function listArt($options = ['format' => 'table']): RowsOfFields\n {\n $data = $this->getArt();\n return new RowsOfFields($data);\n }\n\n /**\n * Commandfiles may also add topics. These will appear in\n * the list of topics when `drush topic` is executed.\n * To view the topic below, run `drush --include=/full/path/to/examples topic`\n */\n\n /**\n * Ruminations on the true meaning and philosophy of artwork.\n */\n #[CLI\\Command(name: 'artwork:explain')]\n #[CLI\\Topics(isTopic: true, path: __DIR__ . '/art-topic.md')]\n #[CLI\\Help(hidden: true)]\n public function ruminate(): void\n {\n self::printFile($this->commandData);\n }\n\n /**\n * Return the available built-in art. Any Drush commandfile may provide\n * more art by implementing a 'drush-art' on-event hook. This on-event\n * hook is defined in the 'findArt' method below.\n */\n #[CLI\\Hook(type: HookManager::ON_EVENT, target: 'drush-art')]\n public function builtInArt()\n {\n return [\n 'drush' => [\n 'name' => 'Drush',\n 'description' => 'The Drush logo.',\n 'path' => __DIR__ . '/art/drush-nocolor.txt',\n ],\n 'sandwich' => [\n 'name' => 'Sandwich',\n 'description' => 'A tasty meal with bread often consumed at lunchtime.',\n 'path' => __DIR__ . '/art/sandwich-nocolor.txt',\n ],\n ];\n }\n\n #[CLI\\Hook(type: HookManager::INTERACT, target: 'artwork:show')]\n public function interact(InputInterface $input, OutputInterface $output, AnnotationData $annotationData)\n {\n $io = new DrushStyle($input, $output);\n\n // If the user did not specify any artwork, then prompt for one.\n $art = $input->getArgument('art');\n if (empty($art)) {\n $data = $this->getArt();\n $selections = $this->convertArtListToKeyValue($data);\n $selection = $io->choice('Select art to display', $selections);\n $input->setArgument('art', $selection);\n }\n }\n\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: 'artwork:show')]\n public function artValidate(CommandData $commandData)\n {\n $art = $commandData->input()->getArgument('art');\n $data = $this->getArt();\n if (!isset($data[$art])) {\n throw new \\Exception(dt('I do not have any art called \"{name}\".', ['name' => $art]));\n }\n }\n\n /**\n * Get a list of available artwork. Cache result for future fast access.\n */\n protected function getArt(): array\n {\n if (!isset($this->arts)) {\n $this->arts = $this->findArt();\n }\n return $this->arts;\n }\n\n /**\n * Use custom defined on-event hook 'drush-art' to find available artwork.\n */\n protected function findArt()\n {\n $arts = [];\n $handlers = $this->getCustomEventHandlers('drush-art');\n foreach ($handlers as $handler) {\n $handlerResult = $handler();\n $arts = array_merge($arts, $handlerResult);\n }\n return $arts;\n }\n\n /**\n * Given a list of artwork, convert to a 'key' => 'Name: Description' array.\n */\n protected function convertArtListToKeyValue(array $data): array\n {\n $result = [];\n foreach ($data as $key => $item) {\n $result[$key] = $item['name'] . ': ' . $item['description'];\n }\n return $result;\n }\n}\n
"},{"location":"examples/PolicyCommands.php/","title":"PolicyCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\CommandData;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Drush\\Attributes as CLI;\nuse Drush\\Commands\\core\\RsyncCommands;\nuse Drush\\Commands\\core\\UpdateDBCommands;\nuse Drush\\Commands\\DrushCommands;\nuse Drush\\Commands\\sql\\SqlSyncCommands;\nuse Symfony\\Component\\Console\\Input\\InputOption;\n\n/**\n * Load this commandfile using the --include option - e.g. `drush --include=/path/to/drush/examples`\n *\n * See [Drush Test Traits](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.\n */\n\nclass PolicyCommands extends DrushCommands\n{\n /**\n * Prevent catastrophic braino. Note that this file has to be local to the\n * machine that initiates the sql:sync command.\n *\n * @throws \\Exception\n */\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: SqlSyncCommands::SYNC)]\n public function sqlSyncValidate(CommandData $commandData)\n {\n if ($commandData->input()->getArgument('destination') == '@prod') {\n throw new \\Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__]));\n }\n }\n\n /**\n * Limit rsync operations to production site.\n */\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: RsyncCommands::RSYNC)]\n public function rsyncValidate(CommandData $commandData)\n {\n if (preg_match(\"/^@prod/\", $commandData->input()->getArgument('destination'))) {\n throw new \\Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));\n }\n }\n\n /**\n * Unauthorized may not execute updates.\n */\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: UpdateDBCommands::UPDATEDB)]\n public function validateUpdateDb(CommandData $commandData)\n {\n if (!$commandData->input()->getOption('secret') == 'mysecret') {\n throw new \\Exception(dt('UpdateDb command requires a secret token per site policy.'));\n }\n }\n\n #[CLI\\Hook(type: HookManager::OPTION_HOOK, target: UpdateDBCommands::UPDATEDB)]\n #[CLI\\Option(name: 'secret', description: 'A required token else user may not run updatedb command.')]\n public function optionsetUpdateDb($options = ['secret' => self::REQ])\n {\n }\n}\n
"},{"location":"examples/SiteAliasAlterCommands.php/","title":"SiteAliasAlterCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\AnnotationData;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareInterface;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareTrait;\nuse Drush\\Attributes as CLI;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\n\n/**\n * Load this example by using the --include option - e.g. `drush --include=/path/to/drush/examples`\n */\nclass SiteAliasAlterCommands extends DrushCommands implements SiteAliasManagerAwareInterface\n{\n use SiteAliasManagerAwareTrait;\n\n /**\n * A few example alterations to site aliases.\n */\n #[CLI\\Hook(type: HookManager::PRE_INITIALIZE, target: '*')]\n public function alter(InputInterface $input, AnnotationData $annotationData)\n {\n $self = $this->siteAliasManager()->getSelf();\n if ($self->isRemote()) {\n // Always pass along ssh keys.\n if (!$self->has('ssh.options')) {\n // Don't edit the alias - edit the general config service instead.\n $this->getConfig()->set('ssh.options', '-o ForwardAgent=yes');\n }\n\n // Change the SSH user.\n $input->setOption('remote-user', 'mw2');\n\n // Test to see if specific environment really exists in wildcard\n // aliases, but only if the target is a specific host.\n $host = $self->get('host');\n if (preg_match('#\\.myserver.com$#', $host)) {\n $ip = gethostbyname($host);\n // If the return value of gethostbyname equals its input parameter,\n // that indicates failure.\n if ($host == $ip) {\n $aliasName = $self->name();\n throw new \\Exception(\"The alias $aliasName refers to an environment that does not exist.\");\n }\n }\n }\n }\n}\n
"},{"location":"examples/SyncViaHttpCommands.php/","title":"SyncViaHttpCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\CommandData;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Drush\\Attributes as CLI;\nuse Drush\\Commands\\DrushCommands;\nuse Drush\\Commands\\sql\\SqlSyncCommands;\nuse Drush\\Drush;\nuse Drush\\Exec\\ExecTrait;\nuse Symfony\\Component\\Filesystem\\Filesystem;\n\n/**\n * Load this commandfile using the --include option - e.g. `drush --include=/path/to/drush/examples`\n */\n\nclass SyncViaHttpCommands extends DrushCommands\n{\n /**\n * When a hook extends a command with additional options, it must\n * implement declare those option(s) in a @hook option like this one. Doing so will add\n * the option to the help text for the modified command, and will also\n * allow the new option to be specified on the command line. Without\n * this, Drush will fail with an error when a user attempts to use\n * an unknown option.\n */\n #[CLI\\Hook(type: HookManager::OPTION_HOOK, target: SqlSyncCommands::SYNC)]\n #[CLI\\Option(name: 'http-sync', description: 'Copy the database via http instead of rsync. Value is the url that the existing database dump can be found at.')]\n #[CLI\\Option(name: 'http-sync-user', description: 'Username for the protected directory containing the sql dump.')]\n #[CLI\\Option(name: 'http-sync-password', description: 'Password for the same directory.')]\n public function optionsetSqlSync()\n {\n }\n\n /**\n * During the pre hook, determine if the http-sync option has been\n * specified. If it has been, then disable the normal ssh + rsync\n * dump-and-transfer that sql-sync usually does, and transfer the\n * database dump via an http download.\n */\n #[CLI\\Hook(type: HookManager::PRE_COMMAND_HOOK, target: SqlSyncCommands::SYNC)]\n public function preSqlSync(CommandData $commandData)\n {\n $sql_dump_download_url = $commandData->input()->getOption('http-sync');\n if (!empty($sql_dump_download_url)) {\n $user = $commandData->input()->getOption('http-sync-user');\n $password = $commandData->input()->getOption('http-sync-password');\n $source_dump_file = $this->downloadFile($sql_dump_download_url, $user, $password);\n $commandData->input()->setOption('target-dump', $source_dump_file);\n $commandData->input()->setOption('no-dump', true);\n $commandData->input()->setOption('no-sync', true);\n }\n }\n\n /**\n * Downloads a file.\n *\n * Optionally uses user authentication, using either wget or curl, as available.\n */\n protected function downloadFile($url, $user = false, $password = false, $destination = false, $overwrite = true)\n {\n static $use_wget;\n if ($use_wget === null) {\n $use_wget = ExecTrait::programExists('wget');\n }\n\n $destination_tmp = drush_tempnam('download_file');\n if ($use_wget) {\n $args = ['wget', '-q', '--timeout=30'];\n if ($user && $password) {\n $args = array_merge($args, [\"--user=$user\", \"--password=$password\", '-O', $destination_tmp, $url]);\n } else {\n $args = array_merge($args, ['-O', $destination_tmp, $url]);\n }\n } else {\n $args = ['curl', '-s', '-L', '--connect-timeout 30'];\n if ($user && $password) {\n $args = array_merge($args, ['--user', \"$user:$password\", '-o', $destination_tmp, $url]);\n } else {\n $args = array_merge($args, ['-o', $destination_tmp, $url]);\n }\n }\n $process = Drush::process($args);\n $process->mustRun();\n\n if (!Drush::simulate()) {\n if (!drush_file_not_empty($destination_tmp) && $file = @file_get_contents($url)) {\n @file_put_contents($destination_tmp, $file);\n }\n if (!drush_file_not_empty($destination_tmp)) {\n // Download failed.\n throw new \\Exception(dt(\"The URL !url could not be downloaded.\", ['!url' => $url]));\n }\n }\n if ($destination) {\n $fs = new Filesystem();\n $fs->rename($destination_tmp, $destination, $overwrite);\n return $destination;\n }\n return $destination_tmp;\n }\n}\n
"},{"location":"examples/XkcdCommands.php/","title":"XkcdCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Drush\\Attributes as CLI;\nuse Drush\\Exec\\ExecTrait;\n\n/**\n * Run these commands using the --include option - e.g. `drush --include=/path/to/drush/examples xkcd`\n *\n * For an example of a Drush extension with tests for Drush:\n * - https://github.com/drush-ops/example-drush-extension\n */\n\nclass XkcdCommands extends DrushCommands\n{\n use ExecTrait;\n\n /**\n * Retrieve and display xkcd cartoons.\n */\n #[CLI\\Command(name: 'xkcd:fetch', aliases: ['xkcd'])]\n #[CLI\\Option(name: 'search', description: 'Optional argument to retrieve the cartoons matching an index number, keyword search or \"random\". If omitted the latest cartoon will be retrieved.')]\n #[CLI\\Option(name: 'image-viewer', description: 'Command to use to view images (e.g. xv, firefox). Defaults to \"display\" (from ImageMagick).')]\n #[CLI\\Option(name: 'google-custom-search-api-key', description: 'Google Custom Search API Key, available from https://code.google.com/apis/console/. Default key limited to 100 queries/day globally.')]\n #[CLI\\Usage(name: 'drush xkcd', description: 'Retrieve and display the latest cartoon.')]\n #[CLI\\Usage(name: 'drush xkcd sandwich', description: 'Retrieve and display cartoons about sandwiches.')]\n #[CLI\\Usage(name: 'drush xkcd 123 --image-viewer=eog', description: 'Retrieve and display cartoon #123 in eog.')]\n #[CLI\\Usage(name: 'drush xkcd random --image-viewer=firefox', description: 'Retrieve and display a random cartoon in Firefox.')]\n public function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIzaSyDpE01VDNNT73s6CEeJRdSg5jukoG244ek'])\n {\n $this->doFetch($search, $options);\n }\n\n /**\n * @param $search\n * @param array $options\n * @throws \\Exception\n */\n protected function doFetch($search, array $options): void\n {\n if (empty($search)) {\n $this->startBrowser('http://xkcd.com');\n } elseif (is_numeric($search)) {\n $this->startBrowser('http://xkcd.com/' . $search);\n } elseif ($search == 'random') {\n $xkcd_response = @json_decode(file_get_contents('http://xkcd.com/info.0.json'));\n if (!empty($xkcd_response->num)) {\n $this->startBrowser('http://xkcd.com/' . rand(1, $xkcd_response->num));\n }\n } else {\n // This uses an API key with a limited number of searches per.\n $search_response = @json_decode(file_get_contents('https://www.googleapis.com/customsearch/v1?key=' . $options['google-custom-search-api-key'] . '&cx=012652707207066138651:zudjtuwe28q&q=' . $search));\n if (!empty($search_response->items)) {\n foreach ($search_response->items as $item) {\n $this->startBrowser($item->link);\n }\n } else {\n throw new \\Exception(dt('The search failed or produced no results.'));\n }\n }\n }\n}\n
"},{"location":"examples/example.drush.yml/","title":"drush.yml","text":"#\n# A minimalist Drush config file.\n# See https://www.drush.org/latest/using-drush-configuration/ for lots more documentation.\n#\n\n# Preflight configuration.\ndrush:\ninclude:\n- '${env.HOME}/.drush/commands'\n- /usr/share/drush/commands\npaths:\nconfig:\n# Load additional config files. Is silently skipped if not found. Filename must be drush.yml\n- ${env.HOME}/.drush/config/drush.yml\nalias-path:\n- '${env.HOME}/.drush/sites'\n- /etc/drush/sites\n\n# Global options.\noptions:\n# Specify the base_url that should be used when generating links.\n# uri: 'http://example.com/subdir'\n\n# Command-specific options.\ncommand:\nsql:\ndump:\noptions:\n# Uncomment to omit cache and similar tables (including during a sql:sync).\n# structure-tables-key: common\n\n# Non-options.\nssh:\n# Specify options to pass to ssh. The default is to prohibit\n# password authentication, and is included here, so you may add additional\n# parameters without losing the default configuration.\noptions: '-o PasswordAuthentication=no'\n# This string is valid for Bash shell. Override in case you need something different. See https://github.com/drush-ops/drush/issues/3816.\npipefail: 'set -o pipefail; '\n
"},{"location":"examples/example.prompt.sh/","title":"prompt.sh","text":"# -*- mode: shell-script; mode: flyspell-prog; ispell-local-dictionary: \"american\" -*-\n#\n# Example PS1 prompt.\n#\n# Note: This file does a lot, and is designed for Bash. If you want to show the\n# currently set alias in your prompt, use the first 2 values below as an example.\n\n# This section can be used for the POWERLEVEL9K theme for Oh My Zsh.\n#FILE=\"${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$\"\n#POWERLEVEL9K_CUSTOM_DRUSH=\"[ -r $FILE ] && cat $FILE\"\n#POWERLEVEL9K_CUSTOM_DRUSH_BACKGROUND=\"green\"\n#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs custom_drush)\n\n#\n# Note that your Bash session must already have the __git_ps1 function available.\n# Typically this is provided by git-prompt.sh, see instructions for downloading\n# and including this file here:\n# https://github.com/git/git/blob/10.x/contrib/completion/git-prompt.sh\n#\n# Features:\n#\n# Displays Git repository and Drush alias status in your prompt.\n\n__drush_ps1() {\nf=\"${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$\"\nif [ -f $f ]\nthen\n__DRUPAL_SITE=$(cat \"$f\")\nelse\n__DRUPAL_SITE=\"$DRUPAL_SITE\"\nfi\n\n# Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a\n# __drush_ps1_colorize_alias() function for color hints in your Drush PS1\n# prompt. See example.prompt.sh for an example implementation.\nif [ -n \"${__DRUPAL_SITE-}\" ] && [ -n \"${DRUSH_PS1_SHOWCOLORHINTS-}\" ]; then\n__drush_ps1_colorize_alias\n fi\n\n[[ -n \"$__DRUPAL_SITE\" ]] && printf \"${1:- (%s)}\" \"$__DRUPAL_SITE\"\n}\n\nif [ -n \"$(type -t __git_ps1)\" ] && [ \"$(type -t __git_ps1)\" = function ] && [ \"$(type -t __drush_ps1)\" ] && [ \"$(type -t __drush_ps1)\" = function ]; then\n\n# This line enables color hints in your Drush prompt. Modify the below\n# __drush_ps1_colorize_alias() to customize your color theme.\nDRUSH_PS1_SHOWCOLORHINTS=true\n\n# Git offers various prompt customization options as well as seen in\n# https://github.com/git/git/blob/10.x/contrib/completion/git-prompt.sh.\n# Adjust the following lines to enable the corresponding features:\n#\nGIT_PS1_SHOWDIRTYSTATE=true\nGIT_PS1_SHOWUPSTREAM=auto\n # GIT_PS1_SHOWSTASHSTATE=true\n# GIT_PS1_SHOWUNTRACKEDFILES=true\nGIT_PS1_SHOWCOLORHINTS=true\n\n# The following line sets your bash prompt according to this example:\n#\n# username@hostname ~/working-directory (git-branch)[@drush-alias] $\n#\n# See http://ss64.com/bash/syntax-prompt.html for customization options.\nexport PROMPT_COMMAND='__git_ps1 \"\\u@\\h \\w\" \"$(__drush_ps1 \"[%s]\") \\\\\\$ \"'\n\n# PROMPT_COMMAND is used in the example above rather than PS1 because neither\n# Git nor Drush color hints are compatible with PS1. If you don't want color\n# hints, however, and prefer to use PS1, you can still do so by commenting out\n# the PROMPT_COMMAND line above and uncommenting the PS1 line below:\n#\n# export PS1='\\u@\\h \\w$(__git_ps1 \" (%s)\")$(__drush_ps1 \"[%s]\")\\$ '\n\n__drush_ps1_colorize_alias() {\nif [[ -n ${ZSH_VERSION-} ]]; then\nlocal COLOR_BLUE='%F{blue}'\nlocal COLOR_CYAN='%F{cyan}'\nlocal COLOR_GREEN='%F{green}'\nlocal COLOR_MAGENTA='%F{magenta}'\nlocal COLOR_RED='%F{red}'\nlocal COLOR_WHITE='%F{white}'\nlocal COLOR_YELLOW='%F{yellow}'\nlocal COLOR_NONE='%f'\nelse\n# Using \\[ and \\] around colors is necessary to prevent issues with\n# command line editing/browsing/completion.\nlocal COLOR_BLUE='\\[\\e[94m\\]'\nlocal COLOR_CYAN='\\[\\e[36m\\]'\nlocal COLOR_GREEN='\\[\\e[32m\\]'\nlocal COLOR_MAGENTA='\\[\\e[35m\\]'\nlocal COLOR_RED='\\[\\e[91m\\]'\nlocal COLOR_WHITE='\\[\\e[37m\\]'\nlocal COLOR_YELLOW='\\[\\e[93m\\]'\nlocal COLOR_NONE='\\[\\e[0m\\]'\nfi\n\n# Customize your color theme below.\ncase \"$__DRUPAL_SITE\" in\n*.live|*.prod) local ENV_COLOR=\"$COLOR_RED\" ;;\n*.stage|*.test) local ENV_COLOR=\"$COLOR_YELLOW\" ;;\n*.local) local ENV_COLOR=\"$COLOR_GREEN\" ;;\n*) local ENV_COLOR=\"$COLOR_BLUE\" ;;\nesac\n\n__DRUPAL_SITE=\"${ENV_COLOR}${__DRUPAL_SITE}${COLOR_NONE}\"\n}\n\nfi\n
"},{"location":"examples/example.site.yml/","title":"site.yml","text":"#\n# A minimalist Drush site alias file.\n# See https://www.drush.org/latest/site-aliases/ for lots more documentation.\n#\n# File: self.site.yml\nlive:\nhost: www.domain.com\nuser: www-admin\nroot: /other/path/to/drupal\nuri: http://www.example.com\nssh:\noptions: '-p 100'\npaths:\ndrush-script: '/path/to/drush'\nenv-vars:\nPATH: /bin:/usr/bin:/home/www-admin/.composer/vendor/bin\nDRUPAL_ENV: live\ncommand:\nsite:\ninstall:\noptions:\nadmin-password: 'secret-secret'\nstage:\nhost: stage.domain.com\nuser: www-admin\nroot: /other/path/to/drupal\nuri: http://stage.example.com\n
"},{"location":"examples/git-bisect.example.sh/","title":"git-bisect.sh","text":"#!/usr/bin/env sh\n\n#\n# Git bisect is a helpful way to discover which commit an error\n# occurred in. This example file gives simple instructions for\n# using git bisect with Drush to quickly find erroneous commits\n# in Drush commands or Drupal modules, presuming that you can\n# trigger the error condition via Drush (e.g. using `drush php-eval`).\n#\n# Follow these simple steps:\n#\n# $ git bisect start\n# $ git bisect bad # Tell git that the current commit does not work\n# $ git bisect good bcadd5a # Tell drush that the commithash 12345 worked fine\n# $ git bisect run mytestscript.sh\n#\n# 'git bisect run' will continue to call 'git bisect good' and 'git bisect bad',\n# based on whether the script's exit code was 0 or 1, respectively.\n#\n# Replace 'mytestscript.sh' in the example above with a custom script that you\n# write yourself. Use the example script at the end of this document as a\n# guide. Replace the example command with one that calls the Drush command\n# that you would like to test, and replace the 'grep' string with a value\n# that appears when the error exists in the commit, but does not appear when\n# commit is okay.\n#\n# If you are using Drush to test Drupal or an external Drush module, use:\n#\n# $ git bisect run drush mycommand --strict=2\n#\n# This presumes that there is one or more '[warning]' or '[error]'\n# messages emitted when there is a problem, and no warnings or errors\n# when the commit is okay. Omit '--strict=2' to ignore warnings, and\n# signal failure only when 'error' messages are emitted.\n#\n# If you need to test for an error condition explicitly, to find errors\n# that do not return any warning or error log messages on their own, you\n# can use the Drush php-eval command to force an error when `myfunction()`\n# returns FALSE. Replace 'myfunction()' with the name of an appropriate\n# function in your module that can be used to detect the error condition\n# you are looking for.\n#\n# $ git bisect run drush ev 'if(!myfunction()) { return drush_set_error(\"ERR\"); }'\n#\ndrush mycommand --myoption 2>&1 | grep -q 'string that indicates there was a problem'\nif [ $? == 0 ] ; then\nexit 1\nelse\nexit 0\nfi\n
"},{"location":"examples/helloworld.script/","title":"Helloworld.script","text":"<?php\n\n//\n// This example demonstrates how to write a drush\n// script. These scripts are run with the php:script command.\n//\nuse Drush\\Drush;\n\n$this->output()->writeln(\"Hello world!\");\n$this->output()->writeln(\"The extra options/arguments to this command were:\");\n$this->output()->writeln(print_r($extra, true));\n\n//\n// We can check which site was bootstrapped via\n// the '@self' alias, which is defined only if\n// there is a bootstrapped site.\n//\n$self = Drush::aliasManager()->getSelf();;\nif (!$self->hasRoot()) {\n $this->output()->writeln('No bootstrapped site.');\n}\nelse {\n $this->output()->writeln('The following site is bootstrapped:');\n $this->output()->writeln(print_r($self->legacyRecord(), true));\n}\n
"},{"location":"generators/all/","title":"All generators","text":"Tip
Press the / key to Search for a command. Or use your browser's Find in Page feature.
- composer
- controller
- field
- hook
- install-file
- javascript
- layout
- module
- phpstorm-meta
- readme
- render-element
- service-provider
- single-directory-component
- drush:alias-file
- drush:command-file
- drush:generator
- drush:symfony-command
- entity:bundle-class
- entity:configuration
- entity:content
- form:config
- form:confirm
- form:simple
- misc:apache-virtual-host
- misc:nginx-virtual-host
- plugin:action
- plugin:block
- plugin:ckeditor
- plugin:condition
- plugin:constraint
- plugin:entity-reference-selection
- plugin:field:formatter
- plugin:field:type
- plugin:field:widget
- plugin:filter
- plugin:manager
- plugin:menu-link
- plugin:migrate:destination
- plugin:migrate:process
- plugin:migrate:source
- plugin:queue-worker
- plugin:rest-resource
- plugin:views:argument-default
- plugin:views:field
- plugin:views:style
- service:access-checker
- service:breadcrumb-builder
- service:cache-context
- service:custom
- service:event-subscriber
- service:logger
- service:middleware
- service:param-converter
- service:path-processor
- service:request-policy
- service:response-policy
- service:route-subscriber
- service:theme-negotiator
- service:twig-extension
- service:uninstall-validator
- test:browser
- test:kernel
- test:nightwatch
- test:unit
- test:webdriver
- theme
- theme:settings
- yml:breakpoints
- yml:links:action
- yml:links:contextual
- yml:links:menu
- yml:links:task
- yml:migration
- yml:module-libraries
- yml:permissions
- yml:routing
- yml:services
- yml:theme-libraries
"},{"location":"generators/composer/","title":"composer","text":"Generates a composer.json file
"},{"location":"generators/composer/#examples","title":"Examples","text":" drush generate composer
. Generates a composer.json file
"},{"location":"generators/composer/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/composer/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/composer/#aliases","title":"Aliases","text":""},{"location":"generators/controller/","title":"controller","text":"Generates a controller
"},{"location":"generators/controller/#examples","title":"Examples","text":" drush generate controller
. Generates a controller
"},{"location":"generators/controller/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/controller/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_alias-file/","title":"drush:alias-file","text":"Generates a Drush site alias file.
"},{"location":"generators/drush_alias-file/#examples","title":"Examples","text":" drush generate drush:alias-file
. Generates a Drush site alias file.
"},{"location":"generators/drush_alias-file/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_alias-file/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_alias-file/#aliases","title":"Aliases","text":""},{"location":"generators/drush_command-file/","title":"drush:command-file","text":"Generates a Drush command file.
"},{"location":"generators/drush_command-file/#examples","title":"Examples","text":" drush generate drush:command-file
. Generates a Drush command file.
"},{"location":"generators/drush_command-file/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_command-file/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_command-file/#aliases","title":"Aliases","text":""},{"location":"generators/drush_generator/","title":"drush:generator","text":"Generates Drush generator
"},{"location":"generators/drush_generator/#examples","title":"Examples","text":" drush generate drush:generator
. Generates Drush generator
"},{"location":"generators/drush_generator/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_generator/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_generator/#aliases","title":"Aliases","text":""},{"location":"generators/drush_symfony-command/","title":"drush:symfony-command","text":"Generates Symfony console command
"},{"location":"generators/drush_symfony-command/#examples","title":"Examples","text":" drush generate drush:symfony-command
. Generates Symfony console command
"},{"location":"generators/drush_symfony-command/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_symfony-command/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_symfony-command/#aliases","title":"Aliases","text":""},{"location":"generators/entity_bundle-class/","title":"entity:bundle-class","text":" 11.0+
Generate a bundle class for a content entity.
"},{"location":"generators/entity_bundle-class/#examples","title":"Examples","text":" drush generate entity:bundle-class
. Generate a bundle class for a content entity.
"},{"location":"generators/entity_bundle-class/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/entity_bundle-class/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/entity_bundle-class/#aliases","title":"Aliases","text":""},{"location":"generators/entity_configuration/","title":"entity:configuration","text":"Generates configuration entity
"},{"location":"generators/entity_configuration/#examples","title":"Examples","text":" drush generate entity:configuration
. Generates configuration entity
"},{"location":"generators/entity_configuration/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/entity_configuration/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/entity_configuration/#aliases","title":"Aliases","text":""},{"location":"generators/entity_content/","title":"entity:content","text":"Generates content entity
"},{"location":"generators/entity_content/#examples","title":"Examples","text":" drush generate entity:content
. Generates content entity
"},{"location":"generators/entity_content/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/entity_content/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/entity_content/#aliases","title":"Aliases","text":""},{"location":"generators/field/","title":"field","text":"Generates a field
"},{"location":"generators/field/#examples","title":"Examples","text":" drush generate field
. Generates a field
"},{"location":"generators/field/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/field/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_config/","title":"form:config","text":"Generates a configuration form
"},{"location":"generators/form_config/#examples","title":"Examples","text":" drush generate form:config
. Generates a configuration form
"},{"location":"generators/form_config/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/form_config/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_config/#aliases","title":"Aliases","text":""},{"location":"generators/form_confirm/","title":"form:confirm","text":"Generates a confirmation form
"},{"location":"generators/form_confirm/#examples","title":"Examples","text":" drush generate form:confirm
. Generates a confirmation form
"},{"location":"generators/form_confirm/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/form_confirm/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_confirm/#aliases","title":"Aliases","text":""},{"location":"generators/form_simple/","title":"form:simple","text":"Generates simple form
"},{"location":"generators/form_simple/#examples","title":"Examples","text":" drush generate form:simple
. Generates simple form
"},{"location":"generators/form_simple/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/form_simple/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_simple/#aliases","title":"Aliases","text":""},{"location":"generators/hook/","title":"hook","text":"Generates a hook
"},{"location":"generators/hook/#examples","title":"Examples","text":" drush generate hook
. Generates a hook
"},{"location":"generators/hook/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/hook/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/install-file/","title":"install-file","text":"Generates an install file
"},{"location":"generators/install-file/#examples","title":"Examples","text":" drush generate install-file
. Generates an install file
"},{"location":"generators/install-file/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/install-file/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/javascript/","title":"javascript","text":"Generates Drupal JavaScript file
"},{"location":"generators/javascript/#examples","title":"Examples","text":" drush generate javascript
. Generates Drupal JavaScript file
"},{"location":"generators/javascript/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/javascript/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/layout/","title":"layout","text":"Generates a layout
"},{"location":"generators/layout/#examples","title":"Examples","text":" drush generate layout
. Generates a layout
"},{"location":"generators/layout/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/layout/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/misc_apache-virtual-host/","title":"misc:apache-virtual-host","text":"Generates an Apache site configuration file
"},{"location":"generators/misc_apache-virtual-host/#examples","title":"Examples","text":" drush generate misc:apache-virtual-host
. Generates an Apache site configuration file
"},{"location":"generators/misc_apache-virtual-host/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/misc_apache-virtual-host/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/misc_apache-virtual-host/#aliases","title":"Aliases","text":""},{"location":"generators/misc_nginx-virtual-host/","title":"misc:nginx-virtual-host","text":"Generates an Nginx site configuration file
"},{"location":"generators/misc_nginx-virtual-host/#examples","title":"Examples","text":" drush generate misc:nginx-virtual-host
. Generates an Nginx site configuration file
"},{"location":"generators/misc_nginx-virtual-host/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/misc_nginx-virtual-host/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/misc_nginx-virtual-host/#aliases","title":"Aliases","text":""},{"location":"generators/module/","title":"module","text":"Generates Drupal module
"},{"location":"generators/module/#examples","title":"Examples","text":" drush generate module
. Generates Drupal module
"},{"location":"generators/module/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/module/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/phpstorm-meta/","title":"phpstorm-meta","text":"Generates PhpStorm metadata
"},{"location":"generators/phpstorm-meta/#examples","title":"Examples","text":" drush generate phpstorm-meta
. Generates PhpStorm metadata
"},{"location":"generators/phpstorm-meta/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/phpstorm-meta/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_action/","title":"plugin:action","text":"Generates action plugin
"},{"location":"generators/plugin_action/#examples","title":"Examples","text":" drush generate plugin:action
. Generates action plugin
"},{"location":"generators/plugin_action/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_action/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_action/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_block/","title":"plugin:block","text":"Generates block plugin
"},{"location":"generators/plugin_block/#examples","title":"Examples","text":" drush generate plugin:block
. Generates block plugin
"},{"location":"generators/plugin_block/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_block/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_block/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_ckeditor/","title":"plugin:ckeditor","text":"Generates CKEditor plugin
"},{"location":"generators/plugin_ckeditor/#examples","title":"Examples","text":" drush generate plugin:ckeditor
. Generates CKEditor plugin
"},{"location":"generators/plugin_ckeditor/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_ckeditor/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_ckeditor/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_condition/","title":"plugin:condition","text":"Generates condition plugin
"},{"location":"generators/plugin_condition/#examples","title":"Examples","text":" drush generate plugin:condition
. Generates condition plugin
"},{"location":"generators/plugin_condition/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_condition/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_condition/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_constraint/","title":"plugin:constraint","text":"Generates constraint plugin
"},{"location":"generators/plugin_constraint/#examples","title":"Examples","text":" drush generate plugin:constraint
. Generates constraint plugin
"},{"location":"generators/plugin_constraint/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_constraint/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_constraint/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_entity-reference-selection/","title":"plugin:entity-reference-selection","text":"Generates entity reference selection plugin
"},{"location":"generators/plugin_entity-reference-selection/#examples","title":"Examples","text":" drush generate plugin:entity-reference-selection
. Generates entity reference selection plugin
"},{"location":"generators/plugin_entity-reference-selection/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_entity-reference-selection/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_entity-reference-selection/#aliases","title":"Aliases","text":" - entity-reference-selection
"},{"location":"generators/plugin_field_formatter/","title":"plugin:field:formatter","text":"Generates field formatter plugin
"},{"location":"generators/plugin_field_formatter/#examples","title":"Examples","text":" drush generate plugin:field:formatter
. Generates field formatter plugin
"},{"location":"generators/plugin_field_formatter/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_field_formatter/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_field_formatter/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_field_type/","title":"plugin:field:type","text":"Generates field type plugin
"},{"location":"generators/plugin_field_type/#examples","title":"Examples","text":" drush generate plugin:field:type
. Generates field type plugin
"},{"location":"generators/plugin_field_type/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_field_type/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_field_type/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_field_widget/","title":"plugin:field:widget","text":"Generates field widget plugin
"},{"location":"generators/plugin_field_widget/#examples","title":"Examples","text":" drush generate plugin:field:widget
. Generates field widget plugin
"},{"location":"generators/plugin_field_widget/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_field_widget/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_field_widget/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_filter/","title":"plugin:filter","text":"Generates filter plugin
"},{"location":"generators/plugin_filter/#examples","title":"Examples","text":" drush generate plugin:filter
. Generates filter plugin
"},{"location":"generators/plugin_filter/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_filter/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_filter/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_manager/","title":"plugin:manager","text":"Generates plugin manager
"},{"location":"generators/plugin_manager/#examples","title":"Examples","text":" drush generate plugin:manager
. Generates plugin manager
"},{"location":"generators/plugin_manager/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_manager/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_menu-link/","title":"plugin:menu-link","text":"Generates menu-link plugin
"},{"location":"generators/plugin_menu-link/#examples","title":"Examples","text":" drush generate plugin:menu-link
. Generates menu-link plugin
"},{"location":"generators/plugin_menu-link/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_menu-link/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_menu-link/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_migrate_destination/","title":"plugin:migrate:destination","text":"Generates migrate destination plugin
"},{"location":"generators/plugin_migrate_destination/#examples","title":"Examples","text":" drush generate plugin:migrate:destination
. Generates migrate destination plugin
"},{"location":"generators/plugin_migrate_destination/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_migrate_destination/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_migrate_destination/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_migrate_process/","title":"plugin:migrate:process","text":"Generates migrate process plugin
"},{"location":"generators/plugin_migrate_process/#examples","title":"Examples","text":" drush generate plugin:migrate:process
. Generates migrate process plugin
"},{"location":"generators/plugin_migrate_process/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_migrate_process/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_migrate_process/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_migrate_source/","title":"plugin:migrate:source","text":"Generates migrate source plugin
"},{"location":"generators/plugin_migrate_source/#examples","title":"Examples","text":" drush generate plugin:migrate:source
. Generates migrate source plugin
"},{"location":"generators/plugin_migrate_source/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_migrate_source/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_migrate_source/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_queue-worker/","title":"plugin:queue-worker","text":"Generates queue worker plugin
"},{"location":"generators/plugin_queue-worker/#examples","title":"Examples","text":" drush generate plugin:queue-worker
. Generates queue worker plugin
"},{"location":"generators/plugin_queue-worker/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_queue-worker/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_queue-worker/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_rest-resource/","title":"plugin:rest-resource","text":"Generates rest resource plugin
"},{"location":"generators/plugin_rest-resource/#examples","title":"Examples","text":" drush generate plugin:rest-resource
. Generates rest resource plugin
"},{"location":"generators/plugin_rest-resource/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_rest-resource/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_rest-resource/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_views_argument-default/","title":"plugin:views:argument-default","text":"Generates views default argument plugin
"},{"location":"generators/plugin_views_argument-default/#examples","title":"Examples","text":" drush generate plugin:views:argument-default
. Generates views default argument plugin
"},{"location":"generators/plugin_views_argument-default/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_views_argument-default/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_views_argument-default/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_views_field/","title":"plugin:views:field","text":"Generates views field plugin
"},{"location":"generators/plugin_views_field/#examples","title":"Examples","text":" drush generate plugin:views:field
. Generates views field plugin
"},{"location":"generators/plugin_views_field/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_views_field/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_views_field/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_views_style/","title":"plugin:views:style","text":"Generates views style plugin
"},{"location":"generators/plugin_views_style/#examples","title":"Examples","text":" drush generate plugin:views:style
. Generates views style plugin
"},{"location":"generators/plugin_views_style/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_views_style/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_views_style/#aliases","title":"Aliases","text":""},{"location":"generators/readme/","title":"readme","text":"Generates README file
"},{"location":"generators/readme/#examples","title":"Examples","text":" drush generate readme
. Generates README file
"},{"location":"generators/readme/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/readme/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/render-element/","title":"render-element","text":"Generates Drupal render element
"},{"location":"generators/render-element/#examples","title":"Examples","text":" drush generate render-element
. Generates Drupal render element
"},{"location":"generators/render-element/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/render-element/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service-provider/","title":"service-provider","text":"Generates a service provider
"},{"location":"generators/service-provider/#examples","title":"Examples","text":" drush generate service-provider
. Generates a service provider
"},{"location":"generators/service-provider/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service-provider/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_access-checker/","title":"service:access-checker","text":"Generates an access checker service
"},{"location":"generators/service_access-checker/#examples","title":"Examples","text":" drush generate service:access-checker
. Generates an access checker service
"},{"location":"generators/service_access-checker/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_access-checker/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_access-checker/#aliases","title":"Aliases","text":""},{"location":"generators/service_breadcrumb-builder/","title":"service:breadcrumb-builder","text":"Generates a breadcrumb builder service
"},{"location":"generators/service_breadcrumb-builder/#examples","title":"Examples","text":" drush generate service:breadcrumb-builder
. Generates a breadcrumb builder service
"},{"location":"generators/service_breadcrumb-builder/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_breadcrumb-builder/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_breadcrumb-builder/#aliases","title":"Aliases","text":""},{"location":"generators/service_cache-context/","title":"service:cache-context","text":"Generates a cache context service
"},{"location":"generators/service_cache-context/#examples","title":"Examples","text":" drush generate service:cache-context
. Generates a cache context service
"},{"location":"generators/service_cache-context/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_cache-context/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_cache-context/#aliases","title":"Aliases","text":""},{"location":"generators/service_custom/","title":"service:custom","text":"Generates a custom Drupal service
"},{"location":"generators/service_custom/#examples","title":"Examples","text":" drush generate service:custom
. Generates a custom Drupal service
"},{"location":"generators/service_custom/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_custom/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_custom/#aliases","title":"Aliases","text":""},{"location":"generators/service_event-subscriber/","title":"service:event-subscriber","text":"Generates an event subscriber
"},{"location":"generators/service_event-subscriber/#examples","title":"Examples","text":" drush generate service:event-subscriber
. Generates an event subscriber
"},{"location":"generators/service_event-subscriber/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_event-subscriber/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_event-subscriber/#aliases","title":"Aliases","text":""},{"location":"generators/service_logger/","title":"service:logger","text":"Generates a logger service
"},{"location":"generators/service_logger/#examples","title":"Examples","text":" drush generate service:logger
. Generates a logger service
"},{"location":"generators/service_logger/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_logger/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_logger/#aliases","title":"Aliases","text":""},{"location":"generators/service_middleware/","title":"service:middleware","text":"Generates a middleware
"},{"location":"generators/service_middleware/#examples","title":"Examples","text":" drush generate service:middleware
. Generates a middleware
"},{"location":"generators/service_middleware/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_middleware/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_middleware/#aliases","title":"Aliases","text":""},{"location":"generators/service_param-converter/","title":"service:param-converter","text":"Generates a param converter service
"},{"location":"generators/service_param-converter/#examples","title":"Examples","text":" drush generate service:param-converter
. Generates a param converter service
"},{"location":"generators/service_param-converter/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_param-converter/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_param-converter/#aliases","title":"Aliases","text":""},{"location":"generators/service_path-processor/","title":"service:path-processor","text":"Generates a path processor service
"},{"location":"generators/service_path-processor/#examples","title":"Examples","text":" drush generate service:path-processor
. Generates a path processor service
"},{"location":"generators/service_path-processor/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_path-processor/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_path-processor/#aliases","title":"Aliases","text":""},{"location":"generators/service_request-policy/","title":"service:request-policy","text":"Generates a request policy service
"},{"location":"generators/service_request-policy/#examples","title":"Examples","text":" drush generate service:request-policy
. Generates a request policy service
"},{"location":"generators/service_request-policy/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_request-policy/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_request-policy/#aliases","title":"Aliases","text":""},{"location":"generators/service_response-policy/","title":"service:response-policy","text":"Generates a response policy service
"},{"location":"generators/service_response-policy/#examples","title":"Examples","text":" drush generate service:response-policy
. Generates a response policy service
"},{"location":"generators/service_response-policy/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_response-policy/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_response-policy/#aliases","title":"Aliases","text":""},{"location":"generators/service_route-subscriber/","title":"service:route-subscriber","text":"Generates a route subscriber
"},{"location":"generators/service_route-subscriber/#examples","title":"Examples","text":" drush generate service:route-subscriber
. Generates a route subscriber
"},{"location":"generators/service_route-subscriber/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_route-subscriber/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_route-subscriber/#aliases","title":"Aliases","text":""},{"location":"generators/service_theme-negotiator/","title":"service:theme-negotiator","text":"Generates a theme negotiator
"},{"location":"generators/service_theme-negotiator/#examples","title":"Examples","text":" drush generate service:theme-negotiator
. Generates a theme negotiator
"},{"location":"generators/service_theme-negotiator/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_theme-negotiator/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_theme-negotiator/#aliases","title":"Aliases","text":""},{"location":"generators/service_twig-extension/","title":"service:twig-extension","text":"Generates Twig extension service
"},{"location":"generators/service_twig-extension/#examples","title":"Examples","text":" drush generate service:twig-extension
. Generates Twig extension service
"},{"location":"generators/service_twig-extension/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_twig-extension/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_twig-extension/#aliases","title":"Aliases","text":""},{"location":"generators/service_uninstall-validator/","title":"service:uninstall-validator","text":"Generates a uninstall validator service
"},{"location":"generators/service_uninstall-validator/#examples","title":"Examples","text":" drush generate service:uninstall-validator
. Generates a uninstall validator service
"},{"location":"generators/service_uninstall-validator/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_uninstall-validator/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_uninstall-validator/#aliases","title":"Aliases","text":""},{"location":"generators/single-directory-component/","title":"single-directory-component","text":"Generates Drupal SDC theme component
"},{"location":"generators/single-directory-component/#examples","title":"Examples","text":" drush generate single-directory-component
. Generates Drupal SDC theme component
"},{"location":"generators/single-directory-component/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/single-directory-component/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/single-directory-component/#aliases","title":"Aliases","text":""},{"location":"generators/test_browser/","title":"test:browser","text":"Generates a browser based test
"},{"location":"generators/test_browser/#examples","title":"Examples","text":" drush generate test:browser
. Generates a browser based test
"},{"location":"generators/test_browser/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_browser/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_browser/#aliases","title":"Aliases","text":""},{"location":"generators/test_kernel/","title":"test:kernel","text":"Generates a kernel based test
"},{"location":"generators/test_kernel/#examples","title":"Examples","text":" drush generate test:kernel
. Generates a kernel based test
"},{"location":"generators/test_kernel/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_kernel/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_kernel/#aliases","title":"Aliases","text":""},{"location":"generators/test_nightwatch/","title":"test:nightwatch","text":"Generates a nightwatch test
"},{"location":"generators/test_nightwatch/#examples","title":"Examples","text":" drush generate test:nightwatch
. Generates a nightwatch test
"},{"location":"generators/test_nightwatch/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_nightwatch/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_nightwatch/#aliases","title":"Aliases","text":""},{"location":"generators/test_unit/","title":"test:unit","text":"Generates a unit test
"},{"location":"generators/test_unit/#examples","title":"Examples","text":" drush generate test:unit
. Generates a unit test
"},{"location":"generators/test_unit/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_unit/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_unit/#aliases","title":"Aliases","text":""},{"location":"generators/test_webdriver/","title":"test:webdriver","text":"Generates a test that supports JavaScript
"},{"location":"generators/test_webdriver/#examples","title":"Examples","text":" drush generate test:webdriver
. Generates a test that supports JavaScript
"},{"location":"generators/test_webdriver/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_webdriver/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_webdriver/#aliases","title":"Aliases","text":""},{"location":"generators/theme/","title":"theme","text":"Generates Drupal theme
"},{"location":"generators/theme/#examples","title":"Examples","text":" drush generate theme
. Generates Drupal theme
"},{"location":"generators/theme/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/theme/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/theme_settings/","title":"theme:settings","text":"Generates Drupal theme-settings.php file
"},{"location":"generators/theme_settings/#examples","title":"Examples","text":" drush generate theme:settings
. Generates Drupal theme-settings.php file
"},{"location":"generators/theme_settings/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/theme_settings/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_breakpoints/","title":"yml:breakpoints","text":"Generates a breakpoints yml file
"},{"location":"generators/yml_breakpoints/#examples","title":"Examples","text":" drush generate yml:breakpoints
. Generates a breakpoints yml file
"},{"location":"generators/yml_breakpoints/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_breakpoints/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_breakpoints/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_action/","title":"yml:links:action","text":"Generates a links.action yml file
"},{"location":"generators/yml_links_action/#examples","title":"Examples","text":" drush generate yml:links:action
. Generates a links.action yml file
"},{"location":"generators/yml_links_action/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_action/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_action/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_contextual/","title":"yml:links:contextual","text":"Generates links.contextual yml file
"},{"location":"generators/yml_links_contextual/#examples","title":"Examples","text":" drush generate yml:links:contextual
. Generates links.contextual yml file
"},{"location":"generators/yml_links_contextual/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_contextual/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_contextual/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_menu/","title":"yml:links:menu","text":"Generates a links.menu yml file
"},{"location":"generators/yml_links_menu/#examples","title":"Examples","text":" drush generate yml:links:menu
. Generates a links.menu yml file
"},{"location":"generators/yml_links_menu/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_menu/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_menu/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_task/","title":"yml:links:task","text":"Generates a links.task yml file
"},{"location":"generators/yml_links_task/#examples","title":"Examples","text":" drush generate yml:links:task
. Generates a links.task yml file
"},{"location":"generators/yml_links_task/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_task/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_task/#aliases","title":"Aliases","text":""},{"location":"generators/yml_migration/","title":"yml:migration","text":"Generates a migration yml file
"},{"location":"generators/yml_migration/#examples","title":"Examples","text":" drush generate yml:migration
. Generates a migration yml file
"},{"location":"generators/yml_migration/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_migration/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_migration/#aliases","title":"Aliases","text":""},{"location":"generators/yml_module-libraries/","title":"yml:module-libraries","text":"Generates module libraries yml file
"},{"location":"generators/yml_module-libraries/#examples","title":"Examples","text":" drush generate yml:module-libraries
. Generates module libraries yml file
"},{"location":"generators/yml_module-libraries/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_module-libraries/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_module-libraries/#aliases","title":"Aliases","text":""},{"location":"generators/yml_permissions/","title":"yml:permissions","text":"Generates a permissions yml file
"},{"location":"generators/yml_permissions/#examples","title":"Examples","text":" drush generate yml:permissions
. Generates a permissions yml file
"},{"location":"generators/yml_permissions/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_permissions/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_permissions/#aliases","title":"Aliases","text":" - permissions
- permissions.yml
"},{"location":"generators/yml_routing/","title":"yml:routing","text":"Generates a routing yml file
"},{"location":"generators/yml_routing/#examples","title":"Examples","text":" drush generate yml:routing
. Generates a routing yml file
"},{"location":"generators/yml_routing/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_routing/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_routing/#aliases","title":"Aliases","text":""},{"location":"generators/yml_services/","title":"yml:services","text":"Generates a services yml file
"},{"location":"generators/yml_services/#examples","title":"Examples","text":" drush generate yml:services
. Generates a services yml file
"},{"location":"generators/yml_services/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_services/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_services/#aliases","title":"Aliases","text":""},{"location":"generators/yml_theme-libraries/","title":"yml:theme-libraries","text":"Generates theme libraries yml file
"},{"location":"generators/yml_theme-libraries/#examples","title":"Examples","text":" drush generate yml:theme-libraries
. Generates theme libraries yml file
"},{"location":"generators/yml_theme-libraries/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_theme-libraries/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_theme-libraries/#aliases","title":"Aliases","text":""}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands and generators. Similarly, it runs update.php, executes SQL queries, runs content migrations, and misc utilities like cron or cache rebuild. Drush can be extended by 3rd party commandfiles.
"},{"location":"#resources","title":"Resources","text":" - Installing and Upgrading
- Commands and Generators
- API Documentation
- Drush packages available via Composer
- A list of modules that include Drush integration
- Drush expects all participants to abide by the Drupal Code of Conduct.
- Drush 8 is no longer recommended, but here are its docs.
"},{"location":"#support","title":"Support","text":" - Post support requests to Drupal Answers. Tag question with drush.
- Report bugs and request features in the GitHub Drush Issue Queue.
- Use pull requests (PRs) to contribute to Drush. Guidelines.
"},{"location":"#faq","title":"FAQ","text":""},{"location":"#what-does-drush-stand-for","title":"What does Drush stand for?","text":"A: The Drupal Shell.
"},{"location":"#how-do-i-pronounce-drush","title":"How do I pronounce Drush?","text":"Some people pronounce the dru with a long 'u' like Drupal. Fidelity points go to them, but they are in the minority. Most pronounce Drush so that it rhymes with hush, rush, flush, etc. This is the preferred pronunciation.
"},{"location":"#credits","title":"Credits","text":" - Maintained by Moshe Weitzman with much help from the folks listed at https://github.com/orgs/drush-ops/people.
- Originally developed by Arto Bendiken for Drupal 4.7.
- Redesigned by Franz Heinzmann in May 2007 for Drupal 5.
- Thanks to JetBrains for supporting this project and open source software.
"},{"location":"bootstrap/","title":"The Drush Bootstrap Process","text":"When preparing to run a command, Drush works by bootstrapping the Drupal environment in very much the same way that is done during a normal page request from the web server, so most Drush commands run in the context of a fully-initialized website.
For efficiency and convenience, some Drush commands can work without first bootstrapping a Drupal site, or by only partially bootstrapping a site. This is faster than a full bootstrap. It is also a matter of convenience, because some commands are useful even when you don't have a working Drupal site.
Commands may specify their bootstrap level with via an attribute or an annotation. Commands supplied by Drupal modules are always full
.
PHP8 AttributeAnnotation use Drush\\Attributes as CLI;\n\n#[CLI\\Bootstrap(level: DrupalBootLevels::NONE)]\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
/**\n * @bootstrap none\n*/\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
Prior to bootstrapping, Drush goes through the preflight process, where the following things occur:
Preflight
- Commandline arguments are parsed.
- Configuration files are read.
- The site-alias included on the commandline is loaded if present.
- The local selected site is determined, if any.
- Dependency injection is done.
- Global commandfiles are loaded. Commandfiles that ship with modules are loaded later, during
bootstrap @full
. - The command is dispatched via the Symfony Console component.
Bootstrapping is done from a Symfony Console command hook. The different bootstrap levels are described below.
"},{"location":"bootstrap/#none","title":"none","text":"Only run Drush preflight, without considering Drupal at all. Any code that operates on the Drush installation, and not specifically any Drupal directory, should bootstrap to this phase.
"},{"location":"bootstrap/#root","title":"root","text":"Set up and test for a valid Drupal root, either through the --root options, or evaluated based on the current working directory. Any code that interacts with an entire Drupal installation, and not a specific site on the Drupal installation should use this bootstrap phase.
"},{"location":"bootstrap/#site","title":"site","text":"Set up a Drupal site directory and the correct environment variables to allow Drupal to find the configuration file. If no site is specified with the --uri options, Drush will assume the site is 'default', which mimics Drupal's behaviour. Note that it is necessary to specify a full URI, e.g. --uri=http://example.com, in order for certain Drush commands and Drupal modules to behave correctly. See the Drush configuration for more information. Any code that needs to modify or interact with a specific Drupal site's settings.php file should bootstrap to this phase.
"},{"location":"bootstrap/#configuration","title":"configuration","text":"Load the settings from the Drupal sites directory. This phase is analogous to the DRUPAL_BOOTSTRAP_CONFIGURATION bootstrap phase in Drupal itself, and this is also the first step where Drupal specific code is included. This phase is commonly used for code that interacts with the Drupal install API, as both install.php and update.php start at this phase.
"},{"location":"bootstrap/#database","title":"database","text":"Connect to the Drupal database using the database credentials loaded during the previous bootstrap phase. This phase is analogous to the DRUPAL_BOOTSTRAP_DATABASE bootstrap phase in Drupal. Any code that needs to interact with the Drupal database API needs to be bootstrapped to at least this phase.
"},{"location":"bootstrap/#full","title":"full","text":"Fully initialize Drupal. This is analogous to the DRUPAL_BOOTSTRAP_FULL bootstrap phase in Drupal. Any code that interacts with the general Drupal API should be bootstrapped to this phase.
"},{"location":"bootstrap/#max","title":"max","text":"This is not an actual bootstrap phase. Commands that use the \"max\" bootstrap level will cause Drush to bootstrap as far as possible, and then run the command regardless of the bootstrap phase that was reached. This is useful for Drush commands that work without a bootstrapped site, but that provide additional information or capabilities in the presence of a bootstrapped site. For example, drush status
will show progressively more information the farther the site bootstraps.
"},{"location":"commands/","title":"Creating Custom Commands","text":"Tip
- Drush 12 expects commandfiles to use a create() method to inject Drupal and Drush dependencies. Prior versions used a drush.services.yml file which is now deprecated and will be removed in Drush 13.
- Drush 12 expects all commandfiles in the
<module-name>/Drush/<Commands|Generators>
directory. The Drush
subdirectory is a new requirement.
Creating a new Drush command is easy. Follow the steps below.
- Run
drush generate drush:command-file
. - Drush will prompt for the machine name of the module that should \"own\" the file. The module selected must already exist and be enabled. Use
drush generate module
to create a new module. - Drush will then report that it created a commandfile. Edit as needed.
- Use the classes for the core Drush commands at /src/Commands as inspiration and documentation.
- See the dependency injection docs for interfaces you can implement to gain access to Drush config, Drupal site aliases, etc. Also note the create() method for injecting Drupal or Drush dependencies.
- Write PHPUnit tests based on Drush Test Traits.
"},{"location":"commands/#attributes-or-annotations","title":"Attributes or Annotations","text":"The following are both valid ways to declare a command:
PHP8 AttributesAnnotations use Drush\\Attributes as CLI;\n\n/**\n * Retrieve and display xkcd cartoons (attribute variant).\n */\n#[CLI\\Command(name: 'xkcd:fetch-attributes', aliases: ['xkcd-attributes'])]\n#[CLI\\Argument(name: 'search', description: 'Optional argument to retrieve the cartoons matching an index, keyword, or \"random\".')]\n#[CLI\\Option(name: 'image-viewer', description: 'Command to use to view images (e.g. xv, firefox).', suggestedValues: ['open', 'xv', 'firefox'])]\n#[CLI\\Option(name: 'google-custom-search-api-key', description: 'Google Custom Search API Key')]\n#[CLI\\Usage(name: 'drush xkcd', description: 'Retrieve and display the latest cartoon')]\n#[CLI\\Usage(name: 'drush xkcd sandwich', description: 'Retrieve and display cartoons about sandwiches.')]\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
/**\n * @command xkcd:fetch\n * @param $search Optional argument to retrieve the cartoons matching an index number, keyword, or \"random\".\n * @option image-viewer Command to use to view images (e.g. xv, firefox).\n * @option google-custom-search-api-key Google Custom Search API Key.\n * @usage drush xkcd\n * Retrieve and display the latest cartoon.\n * @usage drush xkcd sandwich\n * Retrieve and display cartoons about sandwiches.\n * @aliases xkcd\n*/\npublic function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIza']) {\n $this->doFetch($search, $options);\n}\n
- A commandfile that will only be used on PHP8+ should use PHP Attributes instead of Annotations.
- See Attributes provided by Drush core. Custom code can add additional attributes.
"},{"location":"commands/#altering-command-info","title":"Altering Command Info","text":"Drush command info (annotations/attributes) can be altered from other modules. This is done by creating and registering command info alterers. Alterers are classes that are able to intercept and manipulate an existing command annotation.
In the module that wants to alter a command info, add a class that:
- The generator class namespace, relative to base namespace, should be
Drupal\\<module-name>\\Drush\\CommandInfoAlterers
and the class file should be located under the src/Drush/CommandInfoAlterers
directory. - The filename must have a name like FooCommandInfoAlterer.php. The prefix
Foo
can be whatever string you want. The file must end in CommandInfoAlterer.php
. - The class must implement the
\\Consolidation\\AnnotatedCommand\\CommandInfoAltererInterface
. - Implement the alteration logic in the
alterCommandInfo()
method. - Along with the alter code, it's strongly recommended to log a debug message explaining what exactly was altered. This makes things easier on others who may need to debug the interaction of the alter code with other modules. Also it's a good practice to inject the the logger in the class constructor.
For an example, see WootCommandInfoAlterer provided by the testing 'woot' module.
"},{"location":"commands/#symfony-console-commands","title":"Symfony Console Commands","text":"Drush lists and runs Symfony Console commands, in addition to more typical annotated commands. See this test and this commandfile.
"},{"location":"commands/#auto-discovered-commands-psr4","title":"Auto-discovered commands (PSR4)","text":"Such commands are auto-discovered by their class PSR4 namespace and class/file name suffix. Drush will auto-discover commands if:
Auto-discovered commandfiles should declare their Drush version compatibility via a conflict
directive. For example, a Composer-managed site-wide command that works with both Drush 11 and Drush 12 might contain something similar to the following in its composer.json file:
\"conflict\": {\n\"drush/drush\": \"<11.0\",\n}\n
Using require
in place of conflict
is not recommended. Symlinked packages
While it is good practice to make your custom commands into a Composer package, please beware that symlinked packages (by using the composer repository type Path) will not be discovered by Drush. When in development, it is recommended to specify your package's path in your drush.yml
to have quick access to your commands.
"},{"location":"commands/#site-wide-commands","title":"Site-wide Commands","text":"Commandfiles that are installed in a Drupal site and are not bundled inside a Drupal module are called site-wide commandfiles. Site-wide commands may either be added directly to the Drupal site's repository (e.g. for site-specific policy files), or via composer require
. See the examples/Commands folder for examples. In general, it's preferable to use modules to carry your Drush commands.
Here are some examples of valid commandfile names and namespaces:
- Simple
- Filename: $PROJECT_ROOT/drush/Commands/ExampleCommands.php
- Namespace: Drush\\Commands
- Nested in a subdirectory committed to the site's repository
- Filename: $PROJECT_ROOT/drush/Commands/example/ExampleCommands.php
- Namespace: Drush\\Commands\\example
- Nested in a subdirectory installed via a Composer package
- Filename: $PROJECT_ROOT/drush/Commands/contrib/dev_modules/ExampleCommands.php
- Namespace: Drush\\Commands\\dev_modules
Note: Make sure you do not include src
in the path to your command. Your command may not be discovered and have additional problems.
If a commandfile is added via a Composer package, then it may declare any dependencies that it may need in its composer.json file. Site-wide commandfiles that are committed directly to a site's repository only have access to the dependencies already available in the site.
A site-wide commandfile should have tests that run with each (major) version of Drush that is supported. You may model your test suite after the example drush extension project.
"},{"location":"commands/#global-commands-discovered-by-configuration","title":"Global commands discovered by configuration","text":"Deprecation
Configuration discovery has been deprecated and will be removed in a future version of Drush. It is recommended that you avoid global Drush commands, and favor site-wide or PSR4 discovered commandfiles instead. If you really need commands that are not part of any Drupal site, consider making a stand-alone script or custom .phar instead. See ahoy, Robo and g1a/starter as potential starting points.
Global commandfiles discoverable by configuration are not supported by default; in order to enable them, you must configure your drush.yml
configuration file to add an include
search location.
For example:
drush:\npaths:\ninclude:\n- '${env.home}/.drush/commands'\n
With this configuration in place, global commands may be placed as described in the Site-Wide Drush Commands section above. Global commandfiles may not declare any dependencies of their own; they may only use those dependencies already available via the autoloader. Tip
- The filename must be have a name like Commands/ExampleCommands.php
- The prefix
Example
can be whatever string you want. - The file must end in
Commands.php
- The directory above
Commands
must be one of: - A Folder listed in the 'include' option. Include may be provided via config or via CLI.
- ../drush, /drush or /sites/all/drush. These paths are relative to Drupal root.
"},{"location":"config-exporting/","title":"Exporting and Importing Configuration","text":"Drush provides commands to export, pull, and import Drupal configuration files.
"},{"location":"config-exporting/#simple-value-changes","title":"Simple - value changes","text":"It is not necessary to alter configuration values to make simple value changes to configuration variables, as this may be done by the configuration override system.
The configuration override system allows you to change configuration values for a given instance of a site (e.g. the development server) by setting configuration variables in the site's settings.php file. For example, to change the name of a local development site:
$config['system.site']['name'] = 'Local Install of Awesome Widgets, Inc.';\n
Note that the configuration override system is a Drupal feature, not a Drush feature. It should be the preferred method for changing configuration values on a per-environment basis; however, it does not work for some things, such as enabling and disabling modules."},{"location":"config-exporting/#advanced-variation-by-environment","title":"Advanced - variation by environment","text":" - Drupal supports excluding development modules from enabling on higher environments.
- See Config Split module for more advanced needs.
"},{"location":"cron/","title":"Running Drupal cron tasks from Drush","text":"Drupal cron tasks are often set up to be run via a wget/curl call to cron.php; this same task can also be accomplished via the cron command, which circumvents the need to provide a web server interface to cron.
"},{"location":"cron/#quick-start","title":"Quick start","text":"If you just want to get started quickly, here is a crontab entry that will run cron once every hour at ten minutes after the hour:
10 * * * * cd [DOCROOT] && /usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin COLUMNS=72 ../vendor/bin/drush --uri=your.drupalsite.org --quiet maint:status && /vendor/bin/drush --uri=your.drupalsite.org --quiet cron\n
You should set up crontab to run your cron tasks as the same user that runs the web server; for example, if you run your web server as the user www-data:
sudo crontab -u www-data -e\n
You might need to edit the crontab entry shown above slightly for your particular setup; for example, if you have installed Drush to some directory other than /usr/local/drush, then you will need to adjust the path to drush appropriately. We'll break down the meaning of each section of the crontab entry in the documentation that continues below.
"},{"location":"cron/#setting-the-schedule","title":"Setting the schedule","text":"See man 5 crontab
for information on how to format the information in a crontab entry. In the example above, the schedule for the crontab is set by the string 10 * * * *
. These fields are the minute, hour, day of month, month and day of week; *
means essentially 'all values', so 10 * * * *
will run any time the minute == 10 (once every hour).
"},{"location":"cron/#setting-the-path","title":"Setting the PATH","text":"We use /usr/bin/env to run Drush so that we can set up some necessary environment variables that Drush needs to execute. By default, cron will run each command with an empty PATH, which would not work well with Drush. To find out what your PATH needs to be, just type:
echo $PATH\n
Take the value that is output and place it into your crontab entry in the place of the one shown above. You can remove any entry that is known to not be of interest to Drush (e.g. /usr/games), or is only useful in a graphic environment (e.g. /usr/X11/bin).
"},{"location":"cron/#setting-columns","title":"Setting COLUMNS","text":"When running Drush in a terminal, the number of columns will be automatically determined by Drush by way of the tput command, which queries the active terminal to determine what the width of the screen is. When running Drush from cron, there will not be any terminal set, and the call to tput will produce an error message. Spurious error messages are undesirable, as cron is often configured to send email whenever any output is produced, so it is important to make an effort to insure that successful runs of cron complete with no output.
In some cases, Drush is smart enough to recognize that there is no terminal -- if the terminal value is empty or \"dumb\", for example. However, there are some \"non-terminal\" values that Drush does not recognize, such as \"unknown.\" If you manually set COLUMNS
, then Drush will respect your setting and will not attempt to call tput.
"},{"location":"cron/#using-quiet","title":"Using --quiet","text":"By default, Drush will print a success message when the run of cron is completed. The --quiet flag will suppress these and other progress messages, again avoiding an unnecessary email message.
"},{"location":"cron/#specifying-the-drupal-site-to-run","title":"Specifying the Drupal site to run","text":"There are many ways to tell Drush which Drupal site to select for the active command, and any may be used here. The example uses cd [DOCROOT]
, but you could also use the --root and --uri flags.
"},{"location":"cron/#avoiding-maintenance-mode","title":"Avoiding Maintenance mode","text":"The call to maint:status checks to see if the site is in maintenance mode. If yes, cron will not run and the command returns a failure. It is not safe to run cron while the site is in maintenance. See https://drupal.slack.com/archives/C45SW3FLM/p1675287662331809.
"},{"location":"dependency-injection/","title":"Dependency Injection","text":"Drush command files obtain references to the resources they need through a technique called dependency injection. When using this programing paradigm, a class by convention will never use the new
operator to instantiate dependencies. Instead, it will store the other objects it needs in class variables, and provide a way for other code to assign an object to that variable.
"},{"location":"dependency-injection/#types-of-injection","title":"Types of Injection","text":"There are two ways that a class can receive its dependencies. One is called \u201cconstructor injection\u201d, and the other is called \u201csetter injection\u201d.
Example of constructor injection:
public function __construct(DependencyType $service)\n {\n $this->service = $service;\n }\n
Example of setter injection:
public function setService(DependencyType $service)\n {\n $this->service = $service;\n }\n
The code that is responsible for providing the dependencies a class needs is usually an object called the dependency injection container."},{"location":"dependency-injection/#create-method","title":"create() method","text":" 11.6+
Tip
Drush 11 and prior required dependency injection via a drush.services.yml file. This approach is deprecated in Drush 12 and will be removed in Drush 13.
Drush command files can inject services by adding a create() method to the commandfile. See creating commands for instructions on how to use the Drupal Code Generator to create a simple command file starter. A create() method and a constructor will look something like this:
class WootStaticFactoryCommands extends DrushCommands\n{\n protected $configFactory;\n\n protected function __construct($configFactory)\n {\n $this->configFactory = $configFactory;\n }\n\n public static function create(ContainerInterface $container, DrushContainer $drush): self\n {\n return new static($container->get('config.factory'));\n }\n
See the Drupal Documentation for details on how to inject Drupal services into your command file. Drush's approach mimics Drupal's blocks, forms, and controllers. Note that if you do not need to pull any services from the Drush container, then you may omit the second parameter to the create()
method.
"},{"location":"dependency-injection/#createearly-method","title":"createEarly() method","text":" 12.0+ Drush commands that need to be instantiated prior to bootstrap may do so by utilizing the createEarly()
static factory. This method looks and functions exacty like the create()
static factory, except it is only passed the Drush container. The Drupal container is not available to command handlers that use createEarly()
.
Note also that Drush commands packaged with Drupal modules are not discovered until after Drupal bootstraps, and therefore cannot use createEarly()
. This mechanism is only usable by PSR-4 discovered commands packaged with Composer projects that are not Drupal modules.
"},{"location":"dependency-injection/#inflection","title":"Inflection","text":"Tip
Inflection is deprecated in Drush 12; use create()
or createEarly()
instead. Some classes are no longer available for inflection in Drush 12, and more (or potentially all) may be removed in Drush 13.
Drush will also inject dependencies that it provides using a technique called inflection. Inflection is a kind of dependency injection that works by way of a set of provided inflection interfaces, one for each available service. Each of these interfaces will define one or more setter methods (usually only one); these will automatically be called by Drush when the commandfile object is instantiated. The command only needs to implement this method and save the provided object in a class field. There is usually a corresponding trait that may be included via a use
statement to fulfill this requirement.
For example:
<?php\nnamespace Drupal\\my_module\\Commands;\n\nuse Drush\\Commands\\DrushCommands;\nuse Consolidation\\OutputFormatters\\StructuredData\\ListDataFromKeys;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareInterface;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareTrait;\n\nclass MyModuleCommands extends DrushCommands implements SiteAliasManagerAwareInterface\n{\n use SiteAliasManagerAwareTrait;\n\n /**\n * Prints the current alias name and info.\n */\n #[CLI\\Command(name: 'mymodule:myAlias')]\n public function myAlias(): ListDataFromKeys \n {\n $selfAlias = $this->siteAliasManager()->getSelf();\n $this->logger()->success(\u2018The current alias is {name}\u2019, [\u2018name\u2019 => $selfAlias]);\n return new ListDataFromKeys($aliasRecord->export());\n }\n}\n
All Drush command files extend DrushCommands. DrushCommands implements ConfigAwareInterface, IOAwareInterface, LoggerAwareInterface, which gives access to $this->getConfig()
, $this->logger()
and other ways to do input and output. See the IO documentation for more information.
Any additional services that are desired must be injected by implementing the appropriate inflection interface.
Additional Interfaces:
- SiteAliasManagerAwareInterface: The site alias manager allows alias records to be obtained.
- CustomEventAwareInterface: Allows command files to define and fire custom events that other command files can hook.
Note that although the autoloader and Drush dependency injection container is available and may be injected into your command file if needed, this should be avoided. Favor using services that can be injected from Drupal or Drush. Some of the objects in the container are not part of the Drush public API, and may not maintain compatibility in minor and patch releases.
"},{"location":"deploycommand/","title":"Deploy","text":" 10.3+
The deploy command standardizes how Drupal deployments work. The intent is your deployment script updates the codebase for the target site and then this command performs the following:
drush updatedb --no-cache-clear\ndrush cache:rebuild\ndrush config:import\ndrush cache:rebuild\ndrush deploy:hook\n
"},{"location":"deploycommand/#authoring-update-functions","title":"Authoring update functions","text":"Below are the 3 types of update functions run by this command, in order. Choose the most appropriate for your need.
Function Drupal API Purpose HOOK_update_n() Not allowed Low level changes. HOOK_post_update_NAME() Allowed Runs before config is imported. HOOK_deploy_NAME() Allowed Runs after config is imported."},{"location":"deploycommand/#configuration","title":"Configuration","text":"If you need to customize this command, you should use Drush configuration for the subcommands listed above (e.g. updatedb, config:import, etc.).
"},{"location":"generators/","title":"Overview","text":"Tip
Drush 11 and prior required generators to define a drush.services.yml file. This is no longer used with Drush 12+ generators. See create() method for injecting dependencies.
Generators jump start your coding by building all the boring boilerplate code for you. After running the generate command, you have a guide for where to insert your custom logic.
Drush's generators reuse classes provided by the excellent Drupal Code Generator project. See its Commands directory for inspiration.
"},{"location":"generators/#writing-custom-generators","title":"Writing Custom Generators","text":"Drupal modules may supply their own Generators, just like they can supply Commands.
See Woot module, which Drush uses for testing. Specifically,
- Write a class similar to ExampleGenerator. Implement your custom logic in the generate() method. Typically this class is placed under the src/Drush/Generators directory.
- Add a .twig file to the same directory. This template specifies what gets output from the generator.
"},{"location":"generators/#auto-discovered-generators-psr4","title":"Auto-discovered Generators (PSR4)","text":"Generators that don't ship inside Drupal modules are called global generators. For example see CustomDrushGenerator. In general, it is better to use modules to carry your generators. If you still prefer using a global generator, please note:
- The generator class should be PSR4 auto-loadable.
- The generator class namespace, relative to base namespace, should be
Drush\\Generators
. For instance, if a Drush generator provider third party library maps this PSR4 autoload entry: \"autoload\": {\n\"psr-4\": {\n\"My\\\\Custom\\\\Library\\\\\": \"src\"\n}\n}\n
then the Drush global generator class namespace should be My\\Custom\\Library\\Drush\\Generators
and the class file should be located under the src/Drush/Generators
directory. - The filename must have a name like FooGenerator.php. The prefix
Foo
can be whatever string you want. The file must end in Generator.php
.
"},{"location":"generators/#site-wide-generators","title":"Site-wide Generators","text":"Sitewide generators (as opposed to auto-discovered PSR4) have a namespace that starts with \\Drush\\Generators
, the directory above Generators must be one of: 1. A Folder listed in the --include option. include may be provided via config or via CLI. 1. ../drush
, /drush
or /sites/all/drush
. These paths are relative to Drupal root.
"},{"location":"hooks/","title":"Hooks","text":""},{"location":"hooks/#core-hooks","title":"Core Hooks","text":"All commandfiles may implement methods that are called by Drush at various times in the request cycle. To implement one, add a #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: 'pm:install')]
(for example) to the top of your method. The class constants for hooks are located in HookManager.
- Documentation about available hooks.
- To see how core commands implement a hook, you can search the Drush source code.
"},{"location":"hooks/#custom-hooks","title":"Custom Hooks","text":"Drush commands can define custom events that other command files can hook. You can find examples in CacheCommands and SanitizeCommands
First, the command must implement CustomEventAwareInterface and use CustomEventAwareTrait, as described in the dependency injection documentation.
Then, the command may ask the provided hook manager to return a list of handlers with a certain attribute. In the example below, the my-event
label is used:
/**\n * This command uses a custom event 'my-event' to collect data. Note that\n * the event handlers will not be found unless the hook manager is\n * injected into this command handler object via `setHookManager()`\n * (defined in CustomEventAwareTrait).\n */\n #[CLI\\Command(name: 'example:command')] \n public function exampleCommand()\n {\n $myEventHandlers = $this->getCustomEventHandlers('my-event');\n $result = [];\n foreach ($myEventHandlers as $handler) {\n $result[] = $handler();\n }\n sort($result);\n return implode(',', $result);\n }\n
Other commandfiles may provide implementations via a PHP8 Attribute or an Annotation.
PHP8 AttributesAnnotations /**\n * #[CLI\\Hook(type: HookManager::ON_EVENT, target: 'my-event')]\n */\npublic function hookOne()\n{\n return 'one';\n}\n
/**\n * @hook on-event my-event\n */\npublic function hookOne()\n{\n return 'one';\n}\n
"},{"location":"install/","title":"Install","text":"Tip
Drush only supports one install method. It requires that your Drupal site be built with Composer and Drush be listed as a dependency.
See the Drush 8 or Drush 9 docs for installing prior versions of Drush.
- Composer. It is required that Drupal sites be built using Composer, with Drush listed as a dependency. See recommended-project (Drush must be added). If your Composer project doesn't yet depend on Drush, run
composer require drush/drush
to add it. - Execution. Change your working directory to your project root, and call Drush via
vendor/bin/drush
. To make this easier, append ./vendor/bin
to the end of your $PATH
; this allows you to call Drush via drush
once your working directory is set. If you only have only one Drupal codebase on your system, you may put /path/to/vendor/bin/drush
in your $PATH
; if you do this, then it is not necessary to set your working directory before calling Drush. - Completion. Optional. Append to .bashrc or equivalent for ZSH or Fish shell. Run
drush completion --help
for more details. - Multiple Codebases. Optional. If using the bash shell, consider installing the fd project, a small set of scripts that make it easier to switch between different project directories quickly, with type completion.
Note
- See Usage for details on using Drush.
- To use a non-default PHP, edit ~/.bashrc so that the desired PHP is in front of your $PATH. If that is not desirable, you can change your PATH for just one request:
PATH=/path/to/php:$PATH
drush status ...` - To use a custom php.ini for Drush requests, see this comment.
- See our guide on porting commandfiles from Drush 8 to later versions. Also note that alias and config files use a new .yml format in Drush 10+.
"},{"location":"install/#drupal-compatibility","title":"Drupal Compatibility","text":"Drush Version PHP Version End Of Life Drupal versions 7 8 9 10 Drush 12 8.1+ TBD \u2705 Drush 11 7.4+ Nov 2023 \u2705 \u2713 Drush 10 7.1+ (not 8) Jan 2022 \u2713 \u2713 Drush 9 5.6+ May 2020 \u2713 Drush 8 5.4.5+ Jan 2025 \u2705 \u2713\ufe0f Drush 7 5.3.0+ Jul 2017 \u2713 Drush 6 5.3.0+ Dec 2015 \u2713 Drush 5 5.2.0+ May 2015 \u2713 Legend \u2705 Supported and recommended \u2713 Compatible but no longer supported"},{"location":"io/","title":"Input / Output","text":" - The Input object holds information about the request such option and argument values. You may need to this information when coding a hook implementation. You don't need this object in your command callback method since these values are passed as parameters.
- The Output object is rarely needed. Instead, return an object that gets formatted via the Output Formatter system. If you want to send additional output, use the io system (see below).
"},{"location":"io/#the-io-system","title":"The io() system","text":" - If you need to ask the user a question, or print non-object content, use the io() system.
- A command callback gets access via
$this->io()
. - The main methods for gathering user input are
$this->io()->choice()
and $this->io()->confirm()
. - You may use any of the methods described in the Symfony Style docs.
"},{"location":"migrate/","title":"Defining and running migrations","text":" 10.4+
The Migrate API delivers services for migrating data from a source system to Drupal. This API is provided by the core migrate
module. In order to migrate data to Drupal, you'll need to create migrations for each type of destination data.
These commands are an alternative to https://www.drupal.org/project/migrate_tools. Don't use that module if you use these commands.
"},{"location":"migrate/#defining-migrations","title":"Defining migrations","text":"Learn how to create migrations from the Drupal official documentation:
- Migrate API overview: https://www.drupal.org/docs/8/api/migrate-api/migrate-api-overview
- Drupal API: https://api.drupal.org/api/drupal/core%21modules%21migrate%21migrate.api.php/group/migration
"},{"location":"migrate/#running-migrations","title":"Running migrations","text":"Drush provides a set of commands that allows to run migration operations such as importing, checking the current status of migrations, rolling-back migrations, stopping an ongoing migration, etc. Such commands are available only when the migrate
module is enabled. In order the get a full list of migrate commands, type:
drush --filter=migrate\n
To get help on each command run drush with the command name as parameter and the --help
option. For example next command will show details about the migrate:import Drush command:
drush migrate:import --help\n
"},{"location":"output-formats-filters/","title":"Output Formats, Fields and Filters","text":"Drush utilizes a powerful formatting and filtering system that provides the user with a lot of control over how output from various commands is rendered.
- Output formats may be used to select the data type used to print the output. For example, many commands allow the user to select between a human-readable table, or various machine-parsable formats such as yaml and json.
- Output fields may be used to select and order the data columns.
- Output filters may be used to limit which data rows are printed based on logical expressions.
"},{"location":"output-formats-filters/#output-formats","title":"Output Formats","text":"The --format
option may be used to select the data format used to print the output of a command. Most commands that produce informative output about some object or system can transform their data into different formats. For example, the version command may be printed in a human-readable table (the default), or in a json array:
$ drush version\n Drush version : 10.3.1\n$ drush version --format=json\n{\n\"drush-version\": \"10.3.1\"\n}\n
The available output formats are shown in the help
for each command: $ drush help version\nShow drush version.\n\nOptions:\n --format=<json> Select output format. Available: json, string, var_export, yaml. Default is key-value.\n
"},{"location":"output-formats-filters/#output-fields","title":"Output Fields","text":"If you wish to limit the number of columns produced by a command, use the --fields
option. List the field names in the order they should be displayed:
$ drush views:list --fields=machine-name,status\n+-------------------+----------+\n| Machine name | Status |\n+-------------------+----------+\n| block_content | Enabled |\n| comment | Enabled |\n| comments_recent | Enabled |\n| content | Enabled |\n| content_recent | Enabled |\n| files | Enabled |\n| frontpage | Enabled |\n| taxonomy_term | Enabled |\n| user_admin_people | Enabled |\n| watchdog | Enabled |\n| who_s_new | Enabled |\n| who_s_online | Enabled |\n| archive | Disabled |\n| glossary | Disabled |\n+-------------------+----------+\n
The available field names are shown in the help
text: $ drush help views:list\nGet a list of all views in the system.\n\nOptions:\n --fields=FIELDS Available fields: Machine name (machine-name), Name (label), Description (description), Status (status), Tag (tag) [default: \"machine-name,label,description,status\"]
Fields may be named either using their human-readable name, or via their machine name. Note also that some commands do not display all of their available data columns by default. To show all available fields, use --fields=*
There is also a singular form --field
available. If this form is used, it will also force the output format to string
.
$ drush views:list --field=machine-name \nblock_content\ncomment\ncomments_recent\ncontent\ncontent_recent\nfiles\nfrontpage\ntaxonomy_term\nuser_admin_people\nwatchdog\nwho_s_new\nwho_s_online\narchive\nglossary\n
"},{"location":"output-formats-filters/#output-filters","title":"Output Filters","text":"A number of Drush commands that output tabular data support a --filter
option that allows rows from the output to be selected with simple logic expressions.
In its simplest form, the --filter
option takes a string that indicates the value to filter by in the command's default filter field. For example, the role:list command specifies perms
as its default filter; the output of the role:list
command may be limited to only those roles that have a specified permission:
$ drush role:list --filter='post comments'\nauthenticated:\n label: 'Authenticated user'\nperms:\n - 'access comments'\n- 'access content'\n- 'access shortcuts'\n- 'access site-wide contact form'\n- 'access user contact forms'\n- 'post comments'\n- 'search content'\n- 'skip comment approval'\n- 'use text format basic_html'\n
Note that not all commands have a default filter field. Other fields in the output may be searched by using a simple expression in the --filter
term. For example, to list only the enabled extensions with the pm:list
command, you could run:
$ drush pm:list --filter='status=enabled'\n
To search for fields that contain a string using the operator *=
, or match a regular expression with the ~=
operator. For example, to find all views whose machine name contains the word content: drush views:list --filter='machine-name*=content'\n
To use a regular expression to find any core requirement notice whose title contains either php or gd drush core:requirements --filter='title~=#(php|gd)#i'\n
Finally, filter expressions may also use logical-and (&&
) or logical-or (||
) operations to separate multiple terms. Parenthesis are not supported. For example, to search both the title
and severity
fields in the core:requirements
command: drush core:requirements --filter='title~=#(php|gd)#i&&severity=warning'\n
The =
and *=
operators always use case-insensitive comparisons. The ~=
operator is case-sensitive, unless the i
PCRE modifier is used, as shown in the previous example.
"},{"location":"output-formats-filters/#comparison-of-filters-with-grep","title":"Comparison of Filters with Grep","text":"Using the --filter
feature is similar to using grep
. The main difference is that the filter feature does a semantic search, which is to say that it explicitly compares against the data in specific fields. In comparison, the grep
command does a line-based search.
Show only results where the severity is warning:
drush core:requirements --filter='severity=warning'
Show only lines that contain the string warning (either in the severity field, or somewhere else on the line):
drush core:requirements | grep -i warning
The table below compares and contrasts the two ways of searching.
Feature --filter grep Regular expressions Yes, with ~=
Yes Word-wrapped field data Searched correctly Might cause false negative Search just one field Yes Might get false positives Search multiple fields Yes, with ||
/&&
Yes (line-based searching) Searching hides header No Yes (unless it matches)"},{"location":"repl/","title":"REPL (a custom shell for Drupal)","text":"The php:cli command is interactive PHP REPL with your bootstrapped site (remote or local). It\u2019s a Drupal code playground. You can do quick code experimentation, grab some data, or run Drush commands. This can also help with debugging certain issues. See this blog post for an introduction. Run help
for a list of commands.
Any global PsySH configuration is loaded by Drush. If you prefer a config file that is specific to the project (and can be checked in with other source code), set the environment variable PSYSH_CONFIG=</path/to/config-file>
. This file then takes precedence over any global file.
Entity classes are available without their namespace. For example, Node::load() works instead of Drupal\\Node\\entity\\Noad::load().
"},{"location":"site-alias-manager/","title":"Site Alias Manager","text":"The Site Alias Manager (SAM) service is used to retrieve information about one or all of the site aliases for the current installation.
- An informative example is the browse command
- A commandfile gets access to the SAM by implementing the SiteAliasManagerAwareInterface and useing the SiteAliasManagerAwareTrait trait. Then you gain access via
$this->siteAliasManager()
. - If an alias was used for the current request, it is available via
$this->siteAliasManager()->getself()
. - The SAM generally deals in SiteAlias objects. That is how any given site alias is represented. See its methods for determining things like whether the alias points to a local host or remote host.
- Site alias docs.
- Dynamically alter site aliases.
- The SAM is also available for as a standalone Composer project. More information available in the README there.
"},{"location":"site-aliases/","title":"Site aliases","text":""},{"location":"site-aliases/#basic-usage","title":"Basic usage","text":"In its most basic form, the Drush site alias feature provides a way for teams to share short names that refer to the live and staging sites (usually remote) for a given Drupal site.
Add an alias file called $PROJECT/drush/sites/self.site.yml
, where $PROJECT
is the project root (location of composer.json file). The site alias file should be named self.site.yml
because this name is special, and is used to define the different environments (usually remote) of the current Drupal site.
The contents of the alias file should look something like the example below:
# File: self.site.yml\nlive:\n host: server.domain.com\n user: www-admin\n root: /other/path/to/live/drupal\n uri: http://example.com\nstage:\n host: server.domain.com\n user: www-admin\n root: /other/path/to/stage/drupal\n uri: http://stage.example.com\n
The top-level element names (live
and stage
in the example above) are used to identify the different environments available for this site. These may be used on the command line to select a different target environment to operate on by prepending an @
character, e.g. @live
or @stage
.
Following these steps, a cache:rebuild on the live environment would be:
$ drush @live cache:rebuild\n
All of the available aliases for a site's environments may be listed via:
$ drush site:alias @self\n
The elements of a site alias are:
- host: The fully-qualified domain name of the remote system hosting the Drupal instance. The
host
option must be omitted for local sites, as this option controls various operations, such as whether or not rsync parameters are for local or remote machines, and so on. - user: The username to log in as when using ssh or docker. If each user has to use own username, you can create an environment variable which holds the value, and reference via ${env.PROJECT_SSH_USER} (for example). Or you may omit the
user
item and specify a user in the ~/.ssh/config
file. - root: The Drupal root; must not be specified as a relative path.
- uri: The value of --uri should always be the same as when the site is being accessed from a web browser (e.g. http://example.com)
Drush typically uses ssh to run commands on remote systems; all team members should install ssh keys on the target servers (e.g. via ssh-add
).
"},{"location":"site-aliases/#advanced-usage","title":"Advanced usage","text":"It is also possible to create site alias files that reference other sites on the same local system. Site alias files for other local sites are usually stored in the directory ~/.drush/sites
; however, Drush does not search this location for alias files by default. To use this location, you must add the path in your Drush configuration file. For example, to re-add both of the default user alias path from Drush 8, put the following in your ~/.drush/drush.yml
configuration file:
drush:\n paths:\n alias-path:\n - '${env.HOME}/.drush/sites'\n - /etc/drush/sites\n
A canonical alias named example that points to a local Drupal site named at http://example.com like this:
# File: example.site.yml\ndev:\n root: /path/to/drupal\n uri: http://example.com\n
Note that the first part of the filename (in this case example defines the name of the site alias, and the top-level key dev defines the name of the environment.
With these definitions in place, it is possible to run commands targeting the dev environment of the target site via:
$ drush @example.dev status\n
This command is equivalent to the longer form: $ drush --root=/path/to/drupal --uri=http://example.com status\n
See Additional Site Alias Options for more information."},{"location":"site-aliases/#altering-aliases","title":"Altering aliases:","text":"See examples/Commands/SiteAliasAlterCommands.php) for an example.
"},{"location":"site-aliases/#site-specifications","title":"Site specifications:","text":"When a site alias name is provided on the command line, a site specification may be used instead. A site specification is a site alias that is not saved on the filesystem but instead is provided directly e.g. drush user@server/path/to/drupal#uri core:status
. See example site specifications.
"},{"location":"site-aliases/#environment-variables","title":"Environment variables","text":"Site aliases may reference environment variables, just like any Drush config file. For example, ${env.PROJECT_SSH_USER}
will be replaced by the value of the PROJECT_SSH_USER
environment value.
SSH site aliases may set environment variables via the env-vars
key. See below.
"},{"location":"site-aliases/#additional-site-alias-options","title":"Additional Site Alias Options","text":"Aliases are commonly used to define short names for local or remote Drupal installations; however, an alias is really nothing more than a collection of options.
- docker: When specified, Drush executes via
docker-compose
exec rather than ssh
. - service: the name of the container to run on.
- exec:
- options: Options for the exec subcommand.
- os: The operating system of the remote server. Valid values are Windows and Linux. Set this value for all remote aliases where the remote's OS differs from the local. This is especially relevant for the sql:sync command.
- ssh: Contains settings used to control how ssh commands are generated when running remote commands.
- options: Contains additional commandline options for the
ssh
command itself, e.g. -p 100
- tty: Usually, Drush will decide whether or not to create a tty (via the
ssh --t
option) based on whether the local Drush command is running interactively or not. To force Drush to always or never create a tty, set the ssh.tty
option to true or false, respectively. - paths: An array of aliases for common rsync targets. Relative aliases are always taken from the Drupal root.
- files: Path to files directory. This will be looked up if not specified.
- drush-script: Path to the remote Drush command.
- command: These options will only be set if the alias is used with the specified command. In the advanced example below, the option
--no-dump
will be selected whenever the @stage
alias is used in any of the following ways: drush @stage sql-sync @self @live
drush sql-sync @stage @live
drush sql-sync @live @stage
- env-vars: An array of key / value pairs that will be set as environment variables.
Complex example:
# File: remote.site.yml\nlive:\n host: server.domain.com\n user: www-admin\n root: /other/path/to/drupal\n uri: http://example.com\n ssh:\n options: '-p 100'\n paths:\n drush-script: '/path/to/drush'\n env-vars:\n PATH: /bin:/usr/bin:/home/www-admin/.composer/vendor/bin\n DRUPAL_ENV: live\n command:\n site:\n install:\n options:\n admin-password: 'secret-secret'\n
"},{"location":"site-aliases/#site-alias-files-for-service-providers","title":"Site Alias Files for Service Providers","text":"There are a number of service providers that manage Drupal sites as a service. Drush allows service providers to create collections of site alias files to reference all of the sites available to a single user. In order to do this, a new location must be defined in your Drush configuration file:
drush:\n paths:\n alias-path:\n - '${env.HOME}/.drush/sites/provider-name'\n
Site aliases stored in this directory may then be referenced by its full alias name, including its location, e.g.:
$ drush @provider-name.example.dev\n
Such alias files may still be referenced by their shorter name, e.g. @example.dev
. Note that it is necessary to individually list every location where site alias files may be stored; Drush never does recursive (deep) directory searches for alias files. The site:alias
command may also be used to list all of the sites and environments in a given location, e.g.:
$ drush site:alias @provider-name\n
Add the option --format=list
to show only the names of each site and environment without also showing the values in each alias record."},{"location":"site-aliases/#wildcard-aliases-for-service-providers","title":"Wildcard Aliases for Service Providers","text":"Some service providers that manage Drupal sites allow customers to create multiple \"environments\" for a site. It is common for these providers to also have a feature to automatically create Drush aliases for all of a user's sites. Rather than write one record for every environment in that site, it is also possible to write a single wildcard alias that represents all possible environments. This is possible if the contents of each environment alias are identical save for the name of the environment in one or more values. The variable ${env-name}
will be substituted with the environment name wherever it appears.
Example wildcard record:
# File: remote-example.site.yml\n'*':\n host: ${env-name}.server.domain.com\n user: www-admin\n root: /path/to/${env-name}\n uri: http://${env-name}.remote-example.com\n
With a wildcard record, any environment name may be used, and will always match. This is not desirable in instances where the specified environment does not exist (e.g. if the user made a typo). An alias alter hook in a policy file may be used to catch these mistakes and report an error. See SiteAliasAlterCommands for an example on how to do this.
"},{"location":"site-aliases/#docker-compose-and-other-transports","title":"Docker Compose and other transports","text":"The example below shows drush calling into a Docker hosted site. See the https://github.com/consolidation/site-alias and https://github.com/consolidation/site-process projects for more developer information about transports.
An example appears below. Edit to suit:
# File: mysite.site.yml\nlocal:\nThis environment is an example of the DockerCompose transport.\n docker:\n service: drupal\n exec:\n options: --user USER\nstage:\n uri: http://stage.example.com\n root: /path/to/remote/drupal/root\n host: mystagingserver.myisp.com\n user: publisher\n os: Linux\n paths:\n - files: sites/mydrupalsite.com/files\n - custom: /my/custom/path\n command:\n sql:\n sync:\n options:\n no-dump: true\ndev:\n root: /path/to/docroot\n uri: https://dev.example.com\n
"},{"location":"site-aliases/#example-of-rsync-with-exclude-paths","title":"Example of rsync with exclude-paths","text":"Note that most options typically passed to rsync via drush rsync
are \"passthrough options\", which is to say they appear after the --
separator on the command line. Passthrough options are actually arguments, and it is not possible to set default arguments in an alias record. The drush rsync
command does support two options, --mode
and --exclude-paths
, which are interpreted directly by Drush. Default values for these options may be specified in an alias record, as shown below.
dev:\n root: /path/to/docroot\n uri: https://dev.example.com\n command:\n core:\n rsync:\n options:\n mode: rlptz\n exclude-paths: 'css:imagecache:ctools:js:tmp:php:styles'\n
"},{"location":"usage/","title":"Usage","text":"Drush can be run in your shell by typing drush
from within your project root directory or anywhere within Drupal.
$ drush [options] <command> [argument1] [argument2]\n
Use the help command to get a list of available options and commands:
$ drush help pm:list\n
For even more documentation, use the topic command:
$ drush topic\n
"},{"location":"usage/#using-the-uri-option-and-root-options","title":"Using the --uri option and --root options.","text":"For multi-site installations, use a site alias or the --uri option to target a particular site.
$ drush --uri=http://example.com pm:install\n
If you are outside the Composer project and not using a site alias, you need to specify --root and --uri for Drush to locate and bootstrap the right Drupal site.
"},{"location":"usage/#site-aliases","title":"Site Aliases","text":"Drush lets you run commands on a remote server. Once defined, aliases can be referenced with the @ nomenclature, i.e.
# Run pending updates on staging site.\n$ drush @staging updatedb\n# Synchronize staging files to production\n$ drush rsync @staging:%files/ @live:%files\n# Synchronize database from production to local, excluding the cache table\n$ drush sql:sync --structure-tables-key=custom @live @self\n
See Site aliases for more information.
"},{"location":"using-drush-configuration/","title":"Drush Configuration","text":"Drush configuration is useful to cut down on typing out lengthy and repetitive command line options, and to avoid mistakes.
"},{"location":"using-drush-configuration/#directories-and-discovery","title":"Directories and Discovery","text":"drush.yml files are discovered as below, in order of precedence:
- Drupal site folder (e.g.
sites/{example.com}/drush.yml
). sites/all/drush
, WEBROOT/drush
, or PROJECTROOT/drush
. - In any location, as specified by the
--config
option. - User's .drush folder (i.e.
~/.drush/drush.yml
). - System-wide configuration folder (e.g.
/etc/drush/drush.yml
or C:\\ProgramData\\Drush\\drush.yml
).
If a configuration file is found in any of the above locations, it will be loaded and merged with other configuration files in the search list. Run drush status --fields=drush-conf
to see all discovered config files.
"},{"location":"using-drush-configuration/#environment-variables","title":"Environment variables","text":"Your Drush config file may reference environment variables using a syntax like ${env.HOME}
. For example see the drush.paths
examples below.
An alternative way to populate Drush configuration is to define environment variables that correspond to config keys. For example, to populate the options.uri
config item, create an environment variable DRUSH_OPTIONS_URI=http://example.com
. As you can see, variable names should be uppercased, prefixed with DRUSH_
, and periods replaced with dashes.
"},{"location":"using-drush-configuration/#config-examples","title":"Config examples","text":""},{"location":"using-drush-configuration/#specify-config-files-to-load","title":"Specify config files to load","text":"drush:\n paths:\n config:\n # Load any personal config files. Is silently skipped if not found. Filename must be drush.yml\n - ${env.HOME}/.drush/config/drush.yml\n
- The value may be path to a file, or to a directory containing drush.yml file(s).
- View discovered config paths:
drush status --fields=drush-conf --format=yaml
"},{"location":"using-drush-configuration/#specify-folders-to-search-for-drush-command-files","title":"Specify folders to search for Drush command files.","text":"These locations are always merged with include paths defined on the command line or in other configuration files. On the command line, paths may be separated by a colon :
on Unix-based systems or a semi-colon ;
on Windows, or multiple --include
options may be provided. Drush 8 and earlier did a deep search in ~/.drush
and /usr/share/drush/commands
when loading command files, so we mimic that here as an example.
drush:\n include:\n - '${env.HOME}/.drush/commands'\n - /usr/share/drush/commands\n
- View all loaded commands:
drush list
"},{"location":"using-drush-configuration/#specify-the-folders-to-search-for-drush-alias-files-siteyml","title":"Specify the folders to search for Drush alias files (*.site.yml).","text":"These locations are always merged with alias paths defined on the command line or in other configuration files. On the command line, paths may be separated by a colon :
on Unix-based systems or a semi-colon ;
on Windows, or multiple --alias-path
options may be provided. Note that Drush 8 and earlier did a deep search in ~/.drush
and /etc/drush
when loading alias files.
drush:\n paths:\n alias-path:\n - '${env.HOME}/.drush/sites'\n - /etc/drush/sites\n
- View all loaded site aliases: drush site:alias
"},{"location":"using-drush-configuration/#backup-directory","title":"Backup directory","text":"Specify a folder where Drush should store backup files, including temporary sql dump files created during sql:sync. If unspecified, defaults to $HOME/drush-backups
.
drush:\n paths:\n backup-dir: /tmp/drush-backups\n
"},{"location":"using-drush-configuration/#global-options","title":"Global options","text":"options:\n # Specify the base_url that should be used when generating links.\n uri: 'http://example.com/subdir'\n\n # Specify your Drupal core base directory (useful if you use symlinks).\n root: '/home/USER/workspace/drupal'\n\n # Enable verbose mode.\n verbose: true\n
"},{"location":"using-drush-configuration/#command-specific-options","title":"Command-specific options","text":"command:\n sql:\n cli:\n options:\n # Enable auto-complete in MySQL.\n extra: \"--auto-rehash\"\n dump:\n options:\n # Omit cache and similar tables (including during a sql:sync).\n structure-tables-key: common\n php:\n script:\n options:\n # Additional folders to search for scripts.\n script-path: 'sites/all/scripts:profiles/myprofile/scripts'\n core:\n rsync:\n options:\n # Ensure all rsync commands use verbose output.\n verbose: true\n\n site:\n install:\n options:\n # Set a predetermined username and password when using site:install.\n account-name: 'alice'\n account-pass: 'secret'\n
"},{"location":"using-drush-configuration/#non-options","title":"Non-options","text":"sql:\n # An explicit list of tables which should be included in sql-dump and sql-sync.\n tables:\n common:\n - user\n - permissions\n - role_permissions\n - role\n # List of tables whose *data* is skipped by the 'sql-dump' and 'sql-sync'\n # commands when the \"--structure-tables-key=common\" option is provided.\n # You may add specific tables to the existing array or add a new element.\n structure-tables:\n common:\n - cache\n - 'cache_*'\n - history\n - 'search_*'\n - 'sessions'\n - 'watchdog'\n # List of tables to be omitted entirely from SQL dumps made by the 'sql-dump'\n # and 'sql-sync' commands when the \"--skip-tables-key=common\" option is\n # provided on the command line. This is useful if your database contains\n # non-Drupal tables used by some other application or during a migration for\n # example. You may add new tables to the existing array or add a new element.\n skip-tables:\n common:\n - 'migration_*'\n\nssh:\n # Specify options to pass to ssh. The default is to prohibit\n # password authentication, and is included here, so you may add additional\n # parameters without losing the default configuration.\n options: '-o PasswordAuthentication=no'\n # This string is valid for Bash shell. Override in case you need something different. See https://github.com/drush-ops/drush/issues/3816.\n pipefail: 'set -o pipefail; '\n\nnotify:\n # Notify when command takes more than 30 seconds.\n duration: 30\n # Specify a command to run. Defaults to Notification Center (OSX) or libnotify (Linux)\n cmd: /path/to/program\n # See https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/NotifyCommands.php for more settings.\n\nxh:\n # Start profiling via xhprof/tideways and show a link to the run report.\n link: http://xhprof.local\n # See https://github.com/drush-ops/drush/blob/12.x/src/Commands/core/XhprofCommands.php for more settings.\n profile-builtins: true\n profile-cpu: false\n profile-memory: false\n
"},{"location":"using-drush-configuration/#misc","title":"Misc","text":" - If you are authoring a commandfile and wish to access the user's configuration, see Command Authoring.
- Setting boolean options broke with Symfony 3. This will be fixed in a future release.
- Version-specific configuration. Limit the version of Drush that will load a configuration file by placing the Drush major version number in the filename, e.g.
drush10.yml
. - The Drush configuration system has been factored out of Drush and shared with the world at https://github.com/consolidation/config. Feel free to use it for your projects. Lots more usage information is there.
"},{"location":"commands/all/","title":"All commands","text":"Tip
Press the / key to Search for a command. Or use your browser's Find in Page feature.
- browse
- completion
- drupal:directory
- generate
- help
- jn:get
- list
- mk:docs
- runserver
- version
- archive:dump
- archive:restore
- cache:clear
- cache:get
- cache:rebuild
- cache:set
- cache:tags
- config:delete
- config:edit
- config:export
- config:get
- config:import
- config:pull
- config:set
- config:status
- core:cron
- core:edit
- core:requirements
- core:route
- core:rsync
- core:status
- core:topic
- deploy
- deploy:hook
- deploy:hook-status
- deploy:mark-complete
- entity:delete
- entity:save
- field:base-info
- field:base-override-create
- field:create
- field:delete
- field:formatters
- field:info
- field:types
- field:widgets
- image:derive
- image:flush
- locale:check
- locale:clear-status
- locale:export
- locale:import
- locale:import-all
- locale:update
- maint:get
- maint:set
- maint:status
- migrate:fields-source
- migrate:import
- migrate:messages
- migrate:reset-status
- migrate:rollback
- migrate:status
- migrate:stop
- php:cli
- php:eval
- php:script
- pm:install
- pm:list
- pm:uninstall
- queue:delete
- queue:list
- queue:run
- role:create
- role:delete
- role:list
- role:perm:add
- role:perm:remove
- site:alias
- site:install
- site:set
- site:ssh
- sql:cli
- sql:connect
- sql:create
- sql:drop
- sql:dump
- sql:query
- sql:sanitize
- sql:sync
- state:delete
- state:get
- state:set
- theme:install
- theme:uninstall
- twig:compile
- twig:debug
- twig:unused
- updatedb
- updatedb:status
- user:block
- user:cancel
- user:create
- user:information
- user:login
- user:password
- user:role:add
- user:role:remove
- user:unblock
- views:dev
- views:disable
- views:enable
- views:execute
- views:list
- watchdog:delete
- watchdog:list
- watchdog:show
- watchdog:show-one
- watchdog:tail
- yaml:get:value
- yaml:lint
- yaml:unset:key
- yaml:update:key
- yaml:update:value
"},{"location":"commands/archive_dump/","title":"archive:dump","text":"Backup your code, files, and database into a single file.
The following paths would be excluded from a code archive:
- .git
- vendor
- [docroot]/sites/@/settings.@.php
- Drupal files directory
- Composer packages installed paths (
composer info --path --format=json
)
The following directories would be excluded from a file archive:
"},{"location":"commands/archive_dump/#examples","title":"Examples","text":" drush archive:dump
. Create a site archive file in a temporary directory containing code, database and Drupal files. drush archive:dump --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing code, database and Drupal files. drush archive:dump --destination=/path/to/archive.tar.gz --overwrite
. Create (or overwrite if exists) /path/to/archive.tar.gz file containing code, database and Drupal files. drush archive:dump --code --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing the code only. drush archive:dump --exclude-code-paths=foo_bar.txt,web/sites/.+/settings.php --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing code, database and Drupal files but excluding foo_bar.txt file and settings.php files if found in web/sites/* subdirectories. drush archive:dump --files --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz file containing the Drupal files only. drush archive:dump --database --destination=/path/to/archive.tar.gz
. Create /path/to/archive.tar.gz archive file containing the database dump only.
"},{"location":"commands/archive_dump/#options","title":"Options","text":" - --code. Archive codebase.
- --files. Archive Drupal files.
- --db. Archive database SQL dump.
- --destination=DESTINATION. The full path and filename in which the archive should be stored. If omitted, it will be saved to the drush-backups directory.
- --overwrite. Overwrite destination file if exists.
- --description=DESCRIPTION. Describe the archive contents.
- --tags=TAGS. Add tags to the archive manifest. Delimit several by commas.
- --generator=GENERATOR. The generator name to store in the MANIFEST.yml file. The default is \"Drush archive-dump\".
- --generatorversion=GENERATORVERSION. The generator version number to store in the MANIFEST file. The default is Drush version.
- --exclude-code-paths=EXCLUDE-CODE-PATHS. Comma-separated list of paths (or regular expressions matching paths) to exclude from the code archive.
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/archive_dump/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/archive_dump/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/archive_restore/","title":"archive:restore","text":"Restore (import) your code, files, and database.
"},{"location":"commands/archive_restore/#examples","title":"Examples","text":" drush archive:restore /path/to/archive.tar.gz
. Restore the site from /path/to/archive.tar.gz archive file. drush archive:restore /path/to/archive.tar.gz --destination-path=/path/to/restore
. Restore the site from /path/to/archive.tar.gz archive file into /path/to/restore directory. drush archive:restore /path/to/archive.tar.gz --code --destination-path=/path/to/restore
. Restore the code from /path/to/archive.tar.gz archive file into /path/to/restore directory. drush archive:restore /path/to/archive.tar.gz --code-source-path=/code/source/path
. Restore database and Drupal files from /path/to/archive.tar.gz archive file and the code from /code/source/path directory. drush archive:restore /path/to/archive.tar.gz --files --destination-path=/path/to/restore
. Restore the Drupal files from /path/to/archive.tar.gz archive file into /path/to/restore directory drush archive:restore /path/to/archive.tar.gz --files-source-path=/files/source/path
. Restore code and database from /path/to/archive.tar.gz archive file and the Drupal files from /files/source/path directory. drush archive:restore /path/to/archive.tar.gz --files-destination-relative-path=web/site/foo-bar/files
. Restore the Drupal files from /path/to/archive.tar.gz archive file into web/site/foo-bar/files site's subdirectory. drush archive:restore /path/to/archive.tar.gz --db
. Restore the database from /path/to/archive.tar.gz archive file. drush archive:restore /path/to/archive.tar.gz --db-source-path=/path/to/database.sql
. Restore code and Drupal files from /path/to/archive.tar.gz archive file and the database from /path/to/database.sql dump file. drush archive:restore /path/to/archive.tar.gz --db-url=mysql://user:password@localhost/database_name --destination-path=/path/to/restore
. Restore code, database and Drupal files from /path/to/archive.tar.gz archive file into /path/to/restore directory using database URL.
"},{"location":"commands/archive_restore/#arguments","title":"Arguments","text":" - [path]. The full path to a single archive file (*.tar.gz) or a directory with components to import. * May contain the following components generated by
archive:dump
command: * 1) code (\"code\" directory); * 2) database dump file (\"database/database.sql\" file); * 3) Drupal files (\"files\" directory). - [site]. Destination site alias. Defaults to @self.
"},{"location":"commands/archive_restore/#options","title":"Options","text":" - --destination-path[=DESTINATION-PATH]. The base path to restore the code/files into.
- --overwrite. Overwrite files if exists when un-compressing an archive.
- --site-subdir[=SITE-SUBDIR]. Site subdirectory to put settings.local.php into. [default: default]
- --setup-database-connection[=SETUP-DATABASE-CONNECTION]. Sets up the database connection in settings.local.php file if either --db-url option or set of specific --db- options are provided. [default: 1*]
- --code. Import code.
- --code-source-path[=CODE-SOURCE-PATH]. Import code from specified directory. Has higher priority over \"path\" argument.
- --files. Import Drupal files.
- --files-source-path[=FILES-SOURCE-PATH]. Import Drupal files from specified directory. Has higher priority over \"path\" argument.
- --files-destination-relative-path[=FILES-DESTINATION-RELATIVE-PATH]. Import Drupal files into specified directory relative to Composer root.
- --db. Import database.
- --db-source-path[=DB-SOURCE-PATH]. Import database from specified dump file. Has higher priority over \"path\" argument.
- --db-driver[=DB-DRIVER]. Destination database driver. [default: mysql]
- --db-port[=DB-PORT]. Destination database port.
- --db-host[=DB-HOST]. Destination database host.
- --db-name[=DB-NAME]. Destination database name.
- --db-user[=DB-USER]. Destination database user.
- --db-password[=DB-PASSWORD]. Destination database user password.
- --db-prefix[=DB-PREFIX]. Destination database prefix.
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
- --no-setup-database-connection. Negate --setup-database-connection option.
"},{"location":"commands/archive_restore/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/archive_restore/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/browse/","title":"browse","text":"Display a link to a given path or open link in a browser.
"},{"location":"commands/browse/#examples","title":"Examples","text":" drush browse
. Open default web browser (if configured or detected) to the site front page. drush browse node/1
. Open web browser to the path node/1. drush @example.prod browse
. Open a browser to the web site specified in a site alias.
"},{"location":"commands/browse/#arguments","title":"Arguments","text":" - [path]. Path to open. If omitted, the site front page will be opened.
"},{"location":"commands/browse/#options","title":"Options","text":" - --browser[=BROWSER]. Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: 1]
- --redirect-port=REDIRECT-PORT. The port that the web server is redirected to (e.g. when running within a Vagrant environment).
- --no-browser. Negate --browser option.
"},{"location":"commands/browse/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/cache_clear/","title":"cache:clear","text":"Clear a specific cache, or all Drupal caches.
"},{"location":"commands/cache_clear/#examples","title":"Examples","text":" drush cc bin
. Choose a bin to clear. drush cc bin entity,bootstrap
. Clear the entity and bootstrap cache bins.
"},{"location":"commands/cache_clear/#arguments","title":"Arguments","text":" - type. The particular cache to clear. Omit this argument to choose from available types.
- [args].... Additional arguments as might be expected (e.g. bin name).
"},{"location":"commands/cache_clear/#options","title":"Options","text":" - --cache-clear[=CACHE-CLEAR]. Set to 0 to suppress normal cache clearing; the caller should then clear if needed. [default: 1]
- --no-cache-clear. Negate --cache-clear option.
"},{"location":"commands/cache_clear/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_clear/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_get/","title":"cache:get","text":"Fetch a cached object and display it.
"},{"location":"commands/cache_get/#examples","title":"Examples","text":" drush cache:get hook_info bootstrap
. Display the data for the cache id \"hook_info\" from the \"bootstrap\" bin. drush cache:get update_available_releases update
. Display the data for the cache id \"update_available_releases\" from the \"update\" bin.
"},{"location":"commands/cache_get/#arguments","title":"Arguments","text":" - cid. The id of the object to fetch.
- [bin]. The cache bin to fetch from.
"},{"location":"commands/cache_get/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: json]
- --fields=FIELDS. Available fields: Cache ID (cid), Data (data), Created (created), Expire (expire), Tags (tags), Checksum (checksum), Valid (valid)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/cache_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_get/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/cache_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_rebuild/","title":"cache:rebuild","text":"Rebuild all caches.
This is a copy of core/rebuild.php.
"},{"location":"commands/cache_rebuild/#options","title":"Options","text":" - --cache-clear[=CACHE-CLEAR]. Set to 0 to suppress normal cache clearing; the caller should then clear if needed. [default: 1]
- --no-cache-clear. Negate --cache-clear option.
"},{"location":"commands/cache_rebuild/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_rebuild/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_set/","title":"cache:set","text":"Cache an object expressed in JSON or var_export() format.
"},{"location":"commands/cache_set/#arguments","title":"Arguments","text":" - cid. id of the object to set.
- data. The object to set in the cache. Use - to read the object from STDIN.
- [bin]. The cache bin to store the object in.
- [expire]. 'CACHE_PERMANENT', or a Unix timestamp.
- [tags]. A comma delimited list of cache tags.
"},{"location":"commands/cache_set/#options","title":"Options","text":" - --input-format[=INPUT-FORMAT]. The format of value. Use json for complex values. [default: string]
- --cache-get. If the object is the result a previous fetch from the cache, only store the value in the 'data' property of the object in the cache.
"},{"location":"commands/cache_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/cache_tags/","title":"cache:tags","text":"Invalidate by cache tags.
"},{"location":"commands/cache_tags/#examples","title":"Examples","text":" drush cache:tag node:12,user:4
. Purge content associated with two cache tags.
"},{"location":"commands/cache_tags/#arguments","title":"Arguments","text":" - tags. A comma delimited list of cache tags to clear.
"},{"location":"commands/cache_tags/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/cache_tags/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/completion/","title":"completion","text":"Dump the shell completion script
The *%command.name% command dumps the shell completion script required to use shell autocompletion (currently, bash, fish, zsh completion are supported).
"},{"location":"commands/completion/#static-installation","title":"Static installation Dump the script to a global completion file and restart your shell:
*%command.full_name% | sudo tee /etc/bash_completion.d/drush\n
Or dump the script to a local file and source it:
*%command.full_name% > completion.sh\n\n<comment># source the file whenever you use the project\n*source completion.sh\n\n<comment># or add this line at the end of your \"~/.bashrc\" file:\n*source /path/to/completion.sh\n
","text":""},{"location":"commands/completion/#dynamic-installation","title":"Dynamic installation Add this to the end of your shell configuration file (e.g. *\"~/.bashrc\"):
*eval \"$(/home/runner/work/drush/drush/drush completion )\"\n
","text":""},{"location":"commands/completion/#arguments","title":"Arguments","text":" - [shell]. The shell type (e.g. \"bash\"), the value of the \"$SHELL\" env var will be used if this is not given
"},{"location":"commands/completion/#options","title":"Options","text":" - --debug. Tail the completion debug log
"},{"location":"commands/completion/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/config_delete/","title":"config:delete","text":"Delete a configuration key, or a whole object(s).
"},{"location":"commands/config_delete/#examples","title":"Examples","text":" drush config:delete system.site,system.rss
. Delete the system.site and system.rss config objects. drush config:delete system.site page.front
. Delete the 'page.front' key from the system.site object.
"},{"location":"commands/config_delete/#arguments","title":"Arguments","text":" - config_name. The config object name(s). Delimit multiple with commas.
- [key]. A config key to clear, May not be used with multiple config names.
"},{"location":"commands/config_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_edit/","title":"config:edit","text":"Open a config file in a text editor. Edits are imported after closing editor.
"},{"location":"commands/config_edit/#examples","title":"Examples","text":" drush config:edit image.style.large
. Edit the image style configurations. drush config:edit
. Choose a config file to edit. drush --bg config-edit image.style.large
. Return to shell prompt as soon as the editor window opens.
"},{"location":"commands/config_edit/#arguments","title":"Arguments","text":" - config_name. The config object name, for example system.site.
"},{"location":"commands/config_edit/#options","title":"Options","text":" - --editor=EDITOR. A string of bash which launches user's preferred text editor. Defaults to ${VISUAL-${EDITOR-vi}}.
- --bg. Launch editor in background process.
"},{"location":"commands/config_edit/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_edit/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_export/","title":"config:export","text":"Export Drupal configuration to a directory.
"},{"location":"commands/config_export/#examples","title":"Examples","text":" drush config:export
. Export configuration files to the site's config directory. drush config:export --destination
. Export configuration; Save files in a backup directory named config-export.
"},{"location":"commands/config_export/#options","title":"Options","text":" - --add. Run
git add -p
after exporting. This lets you choose which config changes to sync for commit. - --commit. Run
git add -A
and git commit
after exporting. This commits everything that was exported without prompting. - --message=MESSAGE. Commit comment for the exported configuration. Optional; may only be used with --commit.
- --destination[=DESTINATION]. An arbitrary directory that should receive the exported files. A backup directory is used when no value is provided.
- --diff. Show preview as a diff, instead of a change list.
- --format[=FORMAT].
"},{"location":"commands/config_export/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_export/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_get/","title":"config:get","text":"Display a config value, or a whole configuration object.
"},{"location":"commands/config_get/#examples","title":"Examples","text":" drush config:get system.site
. Displays the system.site config. drush config:get system.site page.front
. Gets system.site:page.front value.
"},{"location":"commands/config_get/#arguments","title":"Arguments","text":" - config_name. The config object name, for example system.site.
- [key]. The config key, for example page.front. Optional.
"},{"location":"commands/config_get/#options","title":"Options","text":" - --format[=FORMAT]. [default: yaml]
- --source[=SOURCE]. The config storage source to read. [default: active]
- --include-overridden. Apply module and settings.php overrides to values.
"},{"location":"commands/config_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_import/","title":"config:import","text":"Import config from the config directory.
"},{"location":"commands/config_import/#examples","title":"Examples","text":" drush config:import
. Update Drupal's configuration so it matches the contents of the config directory. drush config:import --partial --source=/app/config
. Import from the /app/config directory which typically contains one or a few yaml files. cat tmp.yml | drush config:set --input-format=yaml user.mail ? -
. Update the user.mail config object in its entirety.
"},{"location":"commands/config_import/#options","title":"Options","text":" - --source=SOURCE. An arbitrary directory that holds the configuration files.
- --partial. Allows for partial config imports from the source directory. Only updates and new configs will be processed with this flag (missing configs will not be deleted). No config transformation happens.
- --diff. Show preview as a diff.
"},{"location":"commands/config_import/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_import/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
"},{"location":"commands/config_import/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_pull/","title":"config:pull","text":"Export and transfer config from one environment to another.
"},{"location":"commands/config_pull/#examples","title":"Examples","text":" drush config:pull @prod @stage
. Export config from @prod and transfer to @stage. drush config:pull @prod @self:../config/sync
. Export config and transfer to a custom directory. Relative paths are calculated from Drupal root.
"},{"location":"commands/config_pull/#arguments","title":"Arguments","text":" - source. A site-alias or the name of a subdirectory within /sites whose config you want to copy from.
- destination. A site-alias or the name of a subdirectory within /sites whose config you want to replace.
"},{"location":"commands/config_pull/#options","title":"Options","text":" - --safe. Validate that there are no git uncommitted changes before proceeding
- --runner[=RUNNER]. Where to run the rsync command; defaults to the local site. Can also be source or destination.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: null]
- --fields=FIELDS. Available fields: Path (path)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/config_pull/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_pull/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
- Drupal config export instructions, including customizing config by environment. (docs:config:exporting)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/config_pull/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_set/","title":"config:set","text":"Save a config value directly. Does not perform a config import.
"},{"location":"commands/config_set/#examples","title":"Examples","text":" drush config:set system.site name MySite
. Sets a value for the key name of system.site config object. drush config:set system.site page.front /path/to/page
. Sets the given URL path as value for the config item with key page.front of system.site config object. drush config:set system.site '[]'
. Sets the given key to an empty array. drush config:set system.site 'NULL'
. Sets the given key to NULL. drush config:set --input-format=yaml user.role.authenticated permissions [foo,bar]
. Use a sequence as value for the key permissions of user.role.authenticated config object. drush config:set --input-format=yaml system.site page {403: '403', front: home}
. Use a mapping as value for the key page of system.site config object. drush config:set --input-format=yaml user.role.authenticated ? \"{label: 'Auth user', weight: 5}\"
. Update two top level keys (label, weight) in the system.site config object. cat tmp.yml | drush config:set --input-format=yaml user.mail ? -
. Update the user.mail config object in its entirety.
"},{"location":"commands/config_set/#arguments","title":"Arguments","text":" - config_name. The config object name, for example system.site.
- key. The config key, for example page.front. Use ? if you are updating multiple top-level keys.
- value. The value to assign to the config key. Use - to read from Stdin.
"},{"location":"commands/config_set/#options","title":"Options","text":" - --input-format[=INPUT-FORMAT]. Format to parse the object. Recognized values: string, yaml. Since JSON is a subset of YAML, $value may be in JSON format. [default: string]
"},{"location":"commands/config_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/config_status/","title":"config:status","text":"Display status of configuration (differences between the filesystem configuration and database configuration).
"},{"location":"commands/config_status/#examples","title":"Examples","text":" drush config:status
. Display configuration items that need to be synchronized. drush config:status --state=Identical
. Display configuration items that are in default state. drush config:status --state='Only in sync dir' --prefix=node.type.
. Display all content types that would be created in active storage on configuration import. drush config:status --state=Any --format=list
. List all config names. drush config:status 2>&1 | grep \"No differences\"
. Check there are no differences between database and exported config. Useful for CI.
"},{"location":"commands/config_status/#options","title":"Options","text":" - --state[=STATE]. A comma-separated list of states to filter results. [default: Only in DB,Only in sync dir,Different]
- --prefix=PREFIX. The config prefix. For example, system. No prefix will return all names in the system.
- --format=FORMAT. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Name (name), State (state)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/config_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/config_status/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/config_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_cron/","title":"core:cron","text":"Run all cron hooks in all active modules for specified site.
"},{"location":"commands/core_cron/#examples","title":"Examples","text":" drush maint:status && drush core:cron
. Run cron unless maintenance mode is enabled
"},{"location":"commands/core_cron/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_cron/#topics","title":"Topics","text":" - Crontab instructions for running your Drupal cron tasks via
drush cron
. (docs:cron)
"},{"location":"commands/core_cron/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_edit/","title":"core:edit","text":"Edit drush.yml, site alias, and Drupal settings.php files.
"},{"location":"commands/core_edit/#examples","title":"Examples","text":" drush core:edit
. Pick from a list of config/alias/settings files. Open selected in editor. drush --bg core-config
. Return to shell prompt as soon as the editor window opens. drush core:edit etc
. Edit the global configuration file. drush core:edit demo.alia
. Edit a particular alias file. drush core:edit sett
. Edit settings.php for the current Drupal site. drush core:edit --choice=2
. Edit the second file in the choice list.
"},{"location":"commands/core_edit/#arguments","title":"Arguments","text":" - [filter]. A substring for filtering the list of files. Omit this argument to choose from loaded files.
"},{"location":"commands/core_edit/#options","title":"Options","text":" - --editor=EDITOR. A string of bash which launches user's preferred text editor. Defaults to ${VISUAL-${EDITOR-vi}}.
- --bg. Launch editor in background process.
"},{"location":"commands/core_edit/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_edit/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_requirements/","title":"core:requirements","text":"Information about things that may be wrong in your Drupal installation.
"},{"location":"commands/core_requirements/#examples","title":"Examples","text":" drush core:requirements
. Show all status lines from the Status Report admin page. drush core:requirements --severity=2
. Show only the red lines from the Status Report admin page.
"},{"location":"commands/core_requirements/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --severity[=SEVERITY]. Only show status report messages with a severity greater than or equal to the specified value. [default: -1]
- --ignore[=IGNORE]. Comma-separated list of requirements to remove from output. Run with --format=yaml to see key values to use.
- --fields=FIELDS. Available fields: Title (title), Severity (severity), SID (sid), Description (description), Summary (value)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/core_requirements/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_requirements/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/core_requirements/#aliases","title":"Aliases","text":" - status-report
- rq
- core-requirements
Legend
- 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.
"},{"location":"commands/core_route/","title":"core:route","text":" 10.5+
View information about all routes or one route.
"},{"location":"commands/core_route/#examples","title":"Examples","text":" drush route
. View all routes. drush route --name=update.status
. View details about the update.status route. drush route --path=/user/1
. View details about the entity.user.canonical route. drush route --url=https://example.com/node/1
. View details about the entity.node.canonical route.
"},{"location":"commands/core_route/#options","title":"Options","text":" - --name=NAME. A route name.
- --path=PATH. An internal path or URL.
- --format[=FORMAT]. [default: yaml]
"},{"location":"commands/core_route/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_route/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_rsync/","title":"core:rsync","text":"Rsync Drupal code or files to/from another server using ssh.
"},{"location":"commands/core_rsync/#examples","title":"Examples","text":" drush rsync @dev @stage
. Rsync Drupal root from Drush alias dev to the alias stage. drush rsync ./ @stage:%files/img
. Rsync all files in the current directory to the imgdirectory in the file storage folder on the Drush alias stage. drush rsync @dev @stage -- --exclude=*.sql --delete
. Rsync Drupal root from the Drush alias dev to the alias stage, excluding all .sql files and delete all files on the destination that are no longer on the source. drush rsync @dev @stage --ssh-options=\"-o StrictHostKeyChecking=no\" -- --delete
. Customize how rsync connects with remote host via SSH. rsync options like --delete are placed after a --.
"},{"location":"commands/core_rsync/#arguments","title":"Arguments","text":" - source. A site alias and optional path. See rsync documentation and Site aliases.
- target. A site alias and optional path. See rsync documentation and Site aliases.
- [extra].... Additional parameters after the ssh statement.
"},{"location":"commands/core_rsync/#options","title":"Options","text":" - --exclude-paths=EXCLUDE-PATHS. List of paths to exclude, seperated by : (Unix-based systems) or ; (Windows).
- --include-paths=INCLUDE-PATHS. List of paths to include, seperated by : (Unix-based systems) or ; (Windows).
- --mode[=MODE]. The unary flags to pass to rsync; --mode=rultz implies rsync -rultz. Default is -akz. [default: akz]
- --ssh-options=SSH-OPTIONS. A string appended to ssh command during rsync, sql-sync, etc.
"},{"location":"commands/core_rsync/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_rsync/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
"},{"location":"commands/core_rsync/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_status/","title":"core:status","text":"An overview of the environment - Drush and Drupal.
"},{"location":"commands/core_status/#examples","title":"Examples","text":" drush core-status --field=files
. Emit just one field, not all the default fields. drush core-status --fields=*
. Emit all fields, not just the default ones.
"},{"location":"commands/core_status/#options","title":"Options","text":" - --project=PROJECT. A comma delimited list of projects. Their paths will be added to path-aliases section.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Drupal version (drupal-version), Site URI (uri), DB driver (db-driver), DB hostname (db-hostname), DB port (db-port), DB username (db-username), DB password (db-password), DB name (db-name), Database (db-status), Drupal bootstrap (bootstrap), Default theme (theme), Admin theme (admin-theme), PHP binary (php-bin), PHP config (php-conf), PHP OS (php-os), PHP version (php-version), Drush script (drush-script), Drush version (drush-version), Drush temp (drush-temp), Drush configs (drush-conf), Drush aliases (drush-alias-files), Alias search paths (alias-searchpaths), Install profile (install-profile), Drupal root (root), Drupal Settings (drupal-settings-file), Site path (site-path), Site path (site), Themes path (themes), Modules path (modules), Files, Public (files), Files, Private (private), Files, Temp (temp), Drupal config (config-sync), Files, Public (files-path), Files, Temp (temp-path), Other paths (%paths)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/core_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_status/#topics","title":"Topics","text":" - README.md (docs:readme)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/core_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/core_topic/","title":"core:topic","text":"Read detailed documentation on a given topic.
"},{"location":"commands/core_topic/#examples","title":"Examples","text":" drush topic
. Pick from all available topics. drush topic docs-repl
. Show documentation for the Drush interactive shell drush docs:r
. Filter topics for those starting with 'docs-r'.
"},{"location":"commands/core_topic/#arguments","title":"Arguments","text":" - topic_name. The name of the topic you wish to view. If omitted, list all topic descriptions (and names in parenthesis).
"},{"location":"commands/core_topic/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/core_topic/#topics","title":"Topics","text":""},{"location":"commands/core_topic/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/deploy/","title":"deploy","text":" 10.3+
Run several commands after performing a code deployment.
"},{"location":"commands/deploy/#examples","title":"Examples","text":" drush deploy -v -y
. Run updates with verbose logging and accept all prompts.
"},{"location":"commands/deploy/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
Legend
- 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.
"},{"location":"commands/deploy_hook-status/","title":"deploy:hook-status","text":"Prints information about pending deploy update hooks.
"},{"location":"commands/deploy_hook-status/#examples","title":"Examples","text":" drush deploy:hook-status
. Prints information about pending deploy hooks.
"},{"location":"commands/deploy_hook-status/#options","title":"Options","text":" - --format=FORMAT. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Module (module), Hook (hook), Description (description)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/deploy_hook-status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy_hook-status/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
- Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/deploy_hook/","title":"deploy:hook","text":" 10.3+
Run pending deploy update hooks.
"},{"location":"commands/deploy_hook/#examples","title":"Examples","text":" drush deploy:hook
. Run pending deploy hooks.
"},{"location":"commands/deploy_hook/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy_hook/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
Legend
- 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.
"},{"location":"commands/deploy_mark-complete/","title":"deploy:mark-complete","text":" 10.6.1+
Mark all deploy hooks as having run.
"},{"location":"commands/deploy_mark-complete/#examples","title":"Examples","text":" drush deploy:mark-complete
. Skip all pending deploy hooks and mark them as complete.
"},{"location":"commands/deploy_mark-complete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/deploy_mark-complete/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
Legend
- 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.
"},{"location":"commands/drupal_directory/","title":"drupal:directory","text":"Return the filesystem path for modules/themes and other key folders.
"},{"location":"commands/drupal_directory/#examples","title":"Examples","text":" cd $(drush dd devel)
. Navigate into the devel module directory cd $(drush dd)
. Navigate to the root of your Drupal site cd $(drush dd files)
. Navigate to the files directory. drush dd @alias:%files
. Print the path to the files directory on the site @alias. edit $(drush dd devel)/devel.module
. Open devel module in your editor
"},{"location":"commands/drupal_directory/#arguments","title":"Arguments","text":" - [target]. A module/theme name, or special names like root, files, private, or an alias:path string such as @alias:%files.
"},{"location":"commands/drupal_directory/#options","title":"Options","text":" - --local-only. Reject any target that specifies a remote site.
"},{"location":"commands/drupal_directory/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/drupal_directory/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/entity_delete/","title":"entity:delete","text":"Delete content entities.
To delete configuration entities, see config:delete command.
"},{"location":"commands/entity_delete/#examples","title":"Examples","text":" drush entity:delete node --bundle=article
. Delete all article entities. drush entity:delete shortcut
. Delete all shortcut entities. drush entity:delete node 22,24
. Delete nodes 22 and 24. drush entity:delete user
. Delete all users except uid=1. drush entity:delete node --exclude=9,14,81
. Delete all nodes except node 9, 14 and 81. drush entity:delete node --chunks=5
. Delete all node entities in steps of 5.
"},{"location":"commands/entity_delete/#arguments","title":"Arguments","text":" - entity_type. An entity machine name.
- [ids]. A comma delimited list of Ids.
"},{"location":"commands/entity_delete/#options","title":"Options","text":" - --bundle=BUNDLE. Restrict deletion to the specified bundle. Ignored when ids is specified.
- --exclude=EXCLUDE. Exclude certain entities from deletion. Ignored when ids is specified.
- --chunks[=CHUNKS]. Specify how many entities will be deleted in the same step. [default: 50]
"},{"location":"commands/entity_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/entity_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/entity_save/","title":"entity:save","text":" 11.0+
Load and save entities.
"},{"location":"commands/entity_save/#examples","title":"Examples","text":" drush entity:save node --bundle=article
. Re-save all article entities. drush entity:save shortcut
. Re-save all shortcut entities. drush entity:save node 22,24
. Re-save nodes 22 and 24. drush entity:save node --exclude=9,14,81
. Re-save all nodes except node 9, 14 and 81. drush entity:save user
. Re-save all users. drush entity:save node --chunks=5
. Re-save all node entities in steps of 5.
"},{"location":"commands/entity_save/#arguments","title":"Arguments","text":" - entity_type. An entity machine name.
- [ids]. A comma delimited list of Ids.
"},{"location":"commands/entity_save/#options","title":"Options","text":" - --bundle=BUNDLE. Restrict to the specified bundle. Ignored when ids is specified.
- --exclude=EXCLUDE. Exclude certain entities. Ignored when ids is specified.
- --chunks[=CHUNKS]. Define how many entities will be loaded in the same step. [default: 50]
"},{"location":"commands/entity_save/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/entity_save/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_base-info/","title":"field:base-info","text":" 11.0+
List all base fields of an entity type
"},{"location":"commands/field_base-info/#examples","title":"Examples","text":" field:base-info taxonomy_term
. List all base fields. field:base-info
. List all base fields and fill in the remaining information through prompts.
"},{"location":"commands/field_base-info/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
"},{"location":"commands/field_base-info/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --show-machine-names. Show machine names instead of labels in option lists.
- --fields=FIELDS. Available fields: Label (label), Description (description), Field name (field_name), Field type (field_type), Required (required), Translatable (translatable), Cardinality (cardinality), Default value (default_value), Default value callback (default_value_callback), Allowed values (allowed_values), Allowed values function (allowed_values_function), Selection handler (handler), Target bundles (target_bundles)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_base-info/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_base-info/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/field_base-info/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_base-override-create/","title":"field:base-override-create","text":" 11.0+
Create a new base field override
"},{"location":"commands/field_base-override-create/#examples","title":"Examples","text":" field:base-field-override-create
. Create a base field override by answering the prompts. field:base-field-override-create taxonomy_term tag
. Create a base field override and fill in the remaining information through prompts. field:base-field-override-create taxonomy_term tag --field-name=name --field-label=Label --is-required=1
. Create a base field override in a completely non-interactive way.
"},{"location":"commands/field_base-override-create/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
- [bundle]. The machine name of the bundle.
"},{"location":"commands/field_base-override-create/#options","title":"Options","text":" - --field-name=FIELD-NAME. A unique machine-readable name containing letters, numbers, and underscores.
- --field-label=FIELD-LABEL. The field label
- --field-description=FIELD-DESCRIPTION. The field description
- --is-required=IS-REQUIRED. Whether the field is required
- --show-machine-names[=SHOW-MACHINE-NAMES]. Show machine names instead of labels in option lists.
"},{"location":"commands/field_base-override-create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_base-override-create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_create/","title":"field:create","text":" 11.0+
Create a new field
"},{"location":"commands/field_create/#examples","title":"Examples","text":" field:create
. Create a field by answering the prompts. field-create taxonomy_term tag
. Create a field and fill in the remaining information through prompts. field-create taxonomy_term tag --field-name=field_tag_label --field-label=Label --field-type=string --field-widget=string_textfield --is-required=1 --cardinality=2
. Create a field in a completely non-interactive way.
"},{"location":"commands/field_create/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type
- [bundle]. The machine name of the bundle
"},{"location":"commands/field_create/#options","title":"Options","text":" - --field-name=FIELD-NAME. A unique machine-readable name containing letters, numbers, and underscores.
- --field-label=FIELD-LABEL. The field label
- --field-description[=FIELD-DESCRIPTION]. Instructions to present to the user below this field on the editing form.
- --field-type=FIELD-TYPE. The field type
- --field-widget=FIELD-WIDGET. The field widget
- --is-required[=IS-REQUIRED]. Whether the field is required
- --is-translatable[=IS-TRANSLATABLE]. Whether the field is translatable
- --cardinality=CARDINALITY. The allowed number of values
- --target-type[=TARGET-TYPE]. The target entity type. Only necessary for entity reference fields.
- --target-bundle[=TARGET-BUNDLE]. The target bundle(s). Only necessary for entity reference fields.
- --show-machine-names[=SHOW-MACHINE-NAMES]. Show machine names instead of labels in option lists.
- --existing-field-name[=EXISTING-FIELD-NAME]. The name of an existing field you want to re-use. Only used in non-interactive context.
- --existing. Re-use an existing field.
"},{"location":"commands/field_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_delete/","title":"field:delete","text":" 11.0+
Delete a field
"},{"location":"commands/field_delete/#examples","title":"Examples","text":" field:delete
. Delete a field by answering the prompts. field-delete taxonomy_term tag
. Delete a field and fill in the remaining information through prompts. field-delete taxonomy_term tag --field-name=field_tag_label
. Delete a field in a non-interactive way. field-delete taxonomy_term --field-name=field_tag_label --all-bundles
. Delete a field from all bundles.
"},{"location":"commands/field_delete/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
- [bundle]. The machine name of the bundle.
"},{"location":"commands/field_delete/#options","title":"Options","text":" - --field-name=FIELD-NAME. The machine name of the field.
- --show-machine-names[=SHOW-MACHINE-NAMES]. Show machine names instead of labels in option lists.
- --all-bundles[=ALL-BUNDLES]. Whether to delete the field from all bundles.
"},{"location":"commands/field_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_formatters/","title":"field:formatters","text":"Lists field formatters.
"},{"location":"commands/field_formatters/#examples","title":"Examples","text":" drush field:formatters --field-type=entity_reference
. Lists field formatters applicable for entity reference fields.
"},{"location":"commands/field_formatters/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --field-type=FIELD-TYPE. Applicable field type.
- --fields=FIELDS. Available fields: ID (id), Label (label), Default Settings (default_settings), Field types (field_types), Settings (settings), Class (class), Provider (provider) [default: id label default_settings field_types]
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_formatters/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_formatters/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/field_info/","title":"field:info","text":" 11.0+
List all configurable fields of an entity bundle
"},{"location":"commands/field_info/#examples","title":"Examples","text":" field:info taxonomy_term tag
. List all fields. field:info
. List all fields and fill in the remaining information through prompts.
"},{"location":"commands/field_info/#arguments","title":"Arguments","text":" - [entityType]. The machine name of the entity type.
- [bundle]. The machine name of the bundle.
"},{"location":"commands/field_info/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --show-machine-names. Show machine names instead of labels in option lists.
- --fields=FIELDS. Available fields: Label (label), Description (description), Field name (field_name), Field type (field_type), Required (required), Translatable (translatable), Cardinality (cardinality), Default value (default_value), Default value callback (default_value_callback), Allowed values (allowed_values), Allowed values function (allowed_values_function), Selection handler (handler), Target bundles (target_bundles)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_info/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_info/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/field_info/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/field_types/","title":"field:types","text":"Lists field types.
"},{"location":"commands/field_types/#examples","title":"Examples","text":" drush field:types
. List all registered field types.
"},{"location":"commands/field_types/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Available fields: ID (id), Label (label), Default Widget (default_widget), Default Formatter (default_formatter), Settings (settings)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_types/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_types/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/field_widgets/","title":"field:widgets","text":"Lists field widgets.
"},{"location":"commands/field_widgets/#examples","title":"Examples","text":" drush field:widgets --field-type=entity_reference
. Lists field widgets applicable for entity reference fields.
"},{"location":"commands/field_widgets/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --field-type=FIELD-TYPE. Applicable field type.
- --fields=FIELDS. Available fields: ID (id), Label (label), Default Settings (default_settings), Field types (field_types), Settings (settings), Class (class), Provider (provider) [default: id label default_settings field_types]
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/field_widgets/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/field_widgets/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/generate/","title":"generate","text":"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.
See https://github.com/Chi-teck/drupal-code-generator for a README and bug reports.
"},{"location":"commands/generate/#examples","title":"Examples","text":" 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.
"},{"location":"commands/generate/#arguments","title":"Arguments","text":" - [generator]. A generator name. Omit to pick from available Generators.
"},{"location":"commands/generate/#options","title":"Options","text":" - --replace.
- --working-dir=WORKING-DIR. Absolute path to working directory.
- --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"commands/generate/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/generate/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"commands/generate/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/help/","title":"help","text":"Display usage details for a command.
"},{"location":"commands/help/#examples","title":"Examples","text":" drush help pm:uninstall
. Show help for a command. drush help pmu
. Show help for a command using an alias. drush help --format=xml
. Show all available commands in XML format. drush help --format=json
. All available commands, in JSON format.
"},{"location":"commands/help/#arguments","title":"Arguments","text":" - [command_name]. A command name
"},{"location":"commands/help/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,tsv,var_dump,var_export,xml,yaml [default: helpcli]
- --include-field-labels.
- --table-style[=TABLE-STYLE]. [default: compact]
"},{"location":"commands/help/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/help/#topics","title":"Topics","text":" Legend
- 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.
"},{"location":"commands/image_derive/","title":"image:derive","text":"Create an image derivative.
"},{"location":"commands/image_derive/#examples","title":"Examples","text":" drush image:derive thumbnail core/themes/bartik/screenshot.png
. Save thumbnail sized derivative of logo image.
"},{"location":"commands/image_derive/#arguments","title":"Arguments","text":" - style_name. An image style machine name.
- source. Path to a source image. Optionally prepend stream wrapper scheme. Relative paths calculated from Drupal root.
"},{"location":"commands/image_derive/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/image_derive/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/image_flush/","title":"image:flush","text":"Flush all derived images for a given style.
"},{"location":"commands/image_flush/#examples","title":"Examples","text":" drush image:flush
. Pick an image style and then delete its derivatives. drush image:flush thumbnail,large
. Delete all thumbnail and large derivatives. drush image:flush --all
. Flush all derived images. They will be regenerated on demand.
"},{"location":"commands/image_flush/#arguments","title":"Arguments","text":" - style_names. A comma delimited list of image style machine names. If not provided, user may choose from a list of names.
"},{"location":"commands/image_flush/#options","title":"Options","text":" - --all. Flush all derived images
"},{"location":"commands/image_flush/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/image_flush/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/jn_get/","title":"jn:get","text":"Execute a JSONAPI request.
"},{"location":"commands/jn_get/#examples","title":"Examples","text":" drush jn:get jsonapi/node/article
. Get a list of articles back as JSON. drush jn:get jsonapi/node/article | jq
. Pretty print JSON by piping to jq. See https://stedolan.github.io/jq/ for lots more jq features.
"},{"location":"commands/jn_get/#arguments","title":"Arguments","text":" - url. The JSONAPI URL to request.
"},{"location":"commands/jn_get/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: json]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/jn_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/list/","title":"list","text":"List available commands.
"},{"location":"commands/list/#examples","title":"Examples","text":" drush list
. List all commands. drush list --filter=devel_generate
. Show only commands starting with devel- drush list --format=xml
. List all commands in Symfony compatible xml format.
"},{"location":"commands/list/#options","title":"Options","text":" - --format[=FORMAT]. [default: listcli]
- --raw. Show a simple table of command names and descriptions.
- --filter=FILTER. Restrict command list to those commands defined in the specified file. Omit value to choose from a list of names.
"},{"location":"commands/list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/locale_check/","title":"locale:check","text":"Checks for available translation updates.
"},{"location":"commands/locale_check/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_check/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_clear-status/","title":"locale:clear-status","text":" 11.5+
Clears the translation status.
"},{"location":"commands/locale_clear-status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_clear-status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_export/","title":"locale:export","text":"Exports to a gettext translation file.
See Drupal Core: \\Drupal\\locale\\Form\\ExportForm::submitForm
"},{"location":"commands/locale_export/#examples","title":"Examples","text":" drush locale:export nl > nl.po
. Export the Dutch translations with all types. drush locale:export nl --types=customized,not-customized > nl.po
. Export the Dutch customized and not customized translations. drush locale:export --template > drupal.pot
. Export the source strings only as template file for translation.
"},{"location":"commands/locale_export/#arguments","title":"Arguments","text":" - [langcode]. The language code of the exported translations.
"},{"location":"commands/locale_export/#options","title":"Options","text":" - --template. POT file output of extracted source texts to be translated.
- --types=TYPES. A comma separated list of string types to include, defaults to all types. Recognized values: not-customized, customized, not-translated
"},{"location":"commands/locale_export/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_export/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_import-all/","title":"locale:import-all","text":" 12.2+
Imports multiple translation files from the defined directory.
"},{"location":"commands/locale_import-all/#examples","title":"Examples","text":" drush locale:import-all /var/www/translations
. Import all translations from the defined directory (non-recursively). Supported filename patterns are: {project}-{version}.{langcode}.po, {prefix}.{langcode}.po or {langcode}.po. drush locale:import-all /var/www/translations/custom --types=customized --override=all
. Import all custom translations from the defined directory (non-recursively) and override any existing translation. Supported filename patterns are: {project}-{version}.{langcode}.po, {prefix}.{langcode}.po or {langcode}.po.
"},{"location":"commands/locale_import-all/#arguments","title":"Arguments","text":" - directory. The path to directory with translation files to import.
"},{"location":"commands/locale_import-all/#options","title":"Options","text":" - --type=TYPE. String types to include, defaults to not-customized. Recognized values: not-customized, customized
- --override=OVERRIDE. Whether and how imported strings will override existing translations. Defaults to the Import behavior configured in the admin interface. Recognized values: none, customized, not-customized, all
"},{"location":"commands/locale_import-all/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_import-all/#aliases","title":"Aliases","text":" - locale-import-all
- locale:import:all
Legend
- 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.
"},{"location":"commands/locale_import/","title":"locale:import","text":"Imports to a gettext translation file.
"},{"location":"commands/locale_import/#examples","title":"Examples","text":" drush locale-import nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. drush locale-import --type=customized nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. Treat imported strings as custom translations. drush locale-import --override=none nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. Don't overwrite existing translations. Only append new translations. drush locale-import --override=not-customized nl drupal-8.4.2.nl.po
. Import the Dutch drupal core translation. Only override non-customized translations, customized translations are kept. drush locale-import nl custom-translations.po --type=customized --override=all
. Import customized Dutch translations and override any existing translation.
"},{"location":"commands/locale_import/#arguments","title":"Arguments","text":" - langcode. The language code of the imported translations.
- file. Path and file name of the gettext file. Relative paths calculated from Drupal root.
"},{"location":"commands/locale_import/#options","title":"Options","text":" - --type[=TYPE]. String types to include, defaults to all types. Recognized values: not-customized, customized, not-translated [default: not-customized]
- --override=OVERRIDE. Whether and how imported strings will override existing translations. Defaults to the Import behavior configured in the admin interface. Recognized values: none, customized, not-customized, all
- --autocreate-language. Create the language in addition to import.
"},{"location":"commands/locale_import/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_import/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/locale_update/","title":"locale:update","text":"Imports the available translation updates.
"},{"location":"commands/locale_update/#options","title":"Options","text":" - --langcodes=LANGCODES. A comma-separated list of language codes to update. If omitted, all translations will be updated.
"},{"location":"commands/locale_update/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/locale_update/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/maint_get/","title":"maint:get","text":" 11.5+
Get maintenance mode. Returns 1 if enabled, 0 if not.
Consider using maint:status instead when chaining commands.
"},{"location":"commands/maint_get/#examples","title":"Examples","text":" drush maint:get
. Print value of maintenance mode in Drupal
"},{"location":"commands/maint_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/maint_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/maint_set/","title":"maint:set","text":" 11.5+
Set maintenance mode.
"},{"location":"commands/maint_set/#examples","title":"Examples","text":" drush maint:set 1
. Put site into Maintenance mode. drush maint:set 0
. Remove site from Maintenance mode.
"},{"location":"commands/maint_set/#arguments","title":"Arguments","text":" - value. The value to assign to the state key
"},{"location":"commands/maint_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/maint_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/maint_status/","title":"maint:status","text":" 11.5+
Fail if maintenance mode is enabled.
This commands fails with exit code of 3 when maintenance mode is on. This special exit code distinguishes from a failure to complete.
"},{"location":"commands/maint_status/#examples","title":"Examples","text":" drush maint:status && drush cron
. Only run cron when Drupal is not in maintenance mode.
"},{"location":"commands/maint_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/maint_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_fields-source/","title":"migrate:fields-source","text":" 10.4+
List the fields available for mapping in a source.
"},{"location":"commands/migrate_fields-source/#examples","title":"Examples","text":" migrate:fields-source article
. List fields for the source in the article migration.
"},{"location":"commands/migrate_fields-source/#arguments","title":"Arguments","text":" - migrationId. The ID of the migration.
"},{"location":"commands/migrate_fields-source/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Field name (machine_name), Description (description) [default: machine_name description]
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/migrate_fields-source/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_fields-source/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/migrate_fields-source/#aliases","title":"Aliases","text":" - mfs
- migrate-fields-source
Legend
- 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.
"},{"location":"commands/migrate_import/","title":"migrate:import","text":" 10.4+
Perform one or more migration processes.
"},{"location":"commands/migrate_import/#examples","title":"Examples","text":" migrate:import --all
. Perform all migrations migrate:import --all --no-progress
. Perform all migrations but avoid the progress bar migrate:import --tag=user,main_content
. Import all migrations tagged with user and main_content tags migrate:import classification,article
. Import new terms and nodes using migration classification and article migrate:import user --limit=2
. Import no more than 2 users using the user migration migrate:import user --idlist=5
. Import the user record with source ID 5 migrate:import node_revision --idlist=1:2,2:3,3:5
. Import the node revision record with source IDs [1,2], [2,3], and [3,5] migrate:import user --limit=50 --feedback=20
. Import 50 users and show process message every 20th record migrate:import --all --delete
. Perform all migrations and delete the destination items that are missing from source
"},{"location":"commands/migrate_import/#arguments","title":"Arguments","text":" - [migrationIds]. Comma-separated list of migration IDs.
"},{"location":"commands/migrate_import/#options","title":"Options","text":" - --all. Process all migrations
- --tag=TAG. A comma-separated list of migration tags to import
- --limit=LIMIT. Limit on the number of items to process in each migration
- --feedback=FEEDBACK. Frequency of progress messages, in items processed
- --idlist=IDLIST. Comma-separated list of IDs to import. As an ID may have more than one column, concatenate the columns with the colon ':' separator
- --update. In addition to processing unprocessed items from the source, update previously-imported items with the current data
- --force. Force an operation to run, even if all dependencies are not satisfied
- --execute-dependencies. Execute all dependent migrations first
- --timestamp. Show progress ending timestamp in progress messages
- --total. Show total processed item number in progress messages
- --progress[=PROGRESS]. Show progress bar [default: 1]
- --delete. Delete destination records missed from the source. Not compatible with --limit and --idlist options, and high_water_property source configuration key.
- --no-progress. Negate --progress option.
"},{"location":"commands/migrate_import/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_import/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_import/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_messages/","title":"migrate:messages","text":" 10.4+
View any messages associated with a migration.
"},{"location":"commands/migrate_messages/#examples","title":"Examples","text":" migrate:messages article
. Show all messages for the article migration migrate:messages node_revision --idlist=1:2,2:3,3:5
. Show messages related to node revision records with source IDs [1,2], [2,3], and [3,5]. migrate:messages custom_node_revision --idlist=1:\"r:1\",2:\"r:3\"
. Show messages related to node revision records with source IDs [1,\"r:1\"], and [2,\"r:3\"].
"},{"location":"commands/migrate_messages/#arguments","title":"Arguments","text":" - migrationId. The ID of the migration.
"},{"location":"commands/migrate_messages/#options","title":"Options","text":" - --idlist=IDLIST. Comma-separated list of IDs to import. As an ID may have more than one column, concatenate the columns with the colon ':' separator
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Level (level), Source ID(s) (source_ids), Destination ID(s) (destination_ids), Message (message), Source IDs hash (hash) [default: level source_ids destination_ids message hash]
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/migrate_messages/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_messages/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/migrate_messages/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_reset-status/","title":"migrate:reset-status","text":" 10.4+
Reset an active migration's status to idle.
"},{"location":"commands/migrate_reset-status/#arguments","title":"Arguments","text":" - migrationId. The ID of migration to reset.
"},{"location":"commands/migrate_reset-status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_reset-status/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_reset-status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_rollback/","title":"migrate:rollback","text":" 10.4+
Rollback one or more migrations.
"},{"location":"commands/migrate_rollback/#examples","title":"Examples","text":" migrate:rollback --all
. Rollback all migrations migrate:rollback --all --no-progress
. Rollback all migrations but avoid the progress bar migrate:rollback --tag=user,main_content
. Rollback all migrations tagged with user and main_content tags migrate:rollback classification,article
. Rollback terms and nodes imported by classification and article migrations migrate:rollback user --idlist=5
. Rollback imported user record with source ID 5
"},{"location":"commands/migrate_rollback/#arguments","title":"Arguments","text":" - [migrationIds]. Comma-separated list of migration IDs.
"},{"location":"commands/migrate_rollback/#options","title":"Options","text":" - --all. Process all migrations
- --tag=TAG. A comma-separated list of migration tags to rollback
- --feedback=FEEDBACK. Frequency of progress messages, in items processed
- --idlist=IDLIST. Comma-separated list of IDs to rollback. As an ID may have more than one column, concatenate the columns with the colon ':' separator
- --progress[=PROGRESS]. Show progress bar [default: 1]
- --no-progress. Negate --progress option.
"},{"location":"commands/migrate_rollback/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_rollback/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_rollback/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_status/","title":"migrate:status","text":" 10.4+
List all migrations with current status.
"},{"location":"commands/migrate_status/#examples","title":"Examples","text":" migrate:status
. Retrieve status for all migrations migrate:status --tag
. Retrieve status for all migrations, grouped by tag migrate:status --tag=user,main_content
. Retrieve status for all migrations tagged with user or main_content migrate:status classification,article
. Retrieve status for specific migrations migrate:status --field=id
. Retrieve a raw list of migration IDs. ms --fields=id,status --format=json
. Retrieve a Json serialized list of migrations, each item containing only the migration ID and its status.
"},{"location":"commands/migrate_status/#arguments","title":"Arguments","text":" - [migrationIds]. Restrict to a comma-separated list of migrations. Optional.
"},{"location":"commands/migrate_status/#options","title":"Options","text":" - --tag=TAG. A comma-separated list of migration tags to list. If only --tag is provided, all tagged migrations will be listed, grouped by tags.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Migration ID (id), Status (status), Total (total), Imported (imported), Needing update (needing_update), Unprocessed (unprocessed), Last Imported (last_imported) [default: id status total imported unprocessed last_imported]
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/migrate_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_status/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/migrate_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/migrate_stop/","title":"migrate:stop","text":" 10.4+
Stop an active migration operation.
"},{"location":"commands/migrate_stop/#arguments","title":"Arguments","text":" - migrationId. The ID of migration to stop.
"},{"location":"commands/migrate_stop/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/migrate_stop/#topics","title":"Topics","text":" - Defining and running migrations. (docs:migrate)
"},{"location":"commands/migrate_stop/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/mk_docs/","title":"mk:docs","text":"Build a Markdown document for each Drush command/generator that is available on a site.
This command is an early step when building the www.drush.org static site. Adapt it to build a similar site listing the commands that are available on your site. Also see Drush's Github Actions workflow.
"},{"location":"commands/mk_docs/#examples","title":"Examples","text":" drush mk:docs
. Build many .md files in the docs/commands and docs/generators directories.
"},{"location":"commands/mk_docs/#arguments","title":"Arguments","text":" - command. The command to execute
"},{"location":"commands/mk_docs/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
Legend
- 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.
"},{"location":"commands/php_cli/","title":"php:cli","text":"Open an interactive shell on a Drupal site.
"},{"location":"commands/php_cli/#examples","title":"Examples","text":" $node = Node::load(1)
. Entity classes are available without their namespace. For example, Node::load(1) works instead of Drupal\\Node\\entity\\Node::load(1). $paragraph = Paragraph::loadRevision(1)
. Also, a loadRevision static method is made available for easier load of revisions.
"},{"location":"commands/php_cli/#options","title":"Options","text":" - --version-history. Use command history based on Drupal version. Default is per site.
- --cwd=CWD. A directory to change to before launching the shell. Default is the project root directory
"},{"location":"commands/php_cli/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/php_cli/#topics","title":"Topics","text":" - Drush's PHP Shell. (docs:repl)
"},{"location":"commands/php_cli/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/php_eval/","title":"php:eval","text":"Evaluate arbitrary php code after bootstrapping Drupal (if available).
"},{"location":"commands/php_eval/#examples","title":"Examples","text":" drush php:eval '$node = \\Drupal ode\\Entity\\Node::load(1); print $node->getTitle();'
. Loads node with nid 1 and then prints its title. drush php:eval \"\\Drupal::service('file_system')->copy('$HOME/Pictures/image.jpg', 'public://image.jpg');\"
. Copies a file whose path is determined by an environment's variable. Use of double quotes so the variable $HOME gets replaced by its value. drush php:eval \"node_access_rebuild();\"
. Rebuild node access permissions.
"},{"location":"commands/php_eval/#arguments","title":"Arguments","text":" - code. PHP code. If shell escaping gets too tedious, consider using the php:script command.
"},{"location":"commands/php_eval/#options","title":"Options","text":" - --format[=FORMAT]. [default: var_dump]
"},{"location":"commands/php_eval/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/php_eval/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/php_script/","title":"php:script","text":"Run php a script after a full Drupal bootstrap.
A useful alternative to eval command when your php is lengthy or you can't be bothered to figure out bash quoting. If you plan to share a script with others, consider making a full Drush command instead, since that's more self-documenting. Drush provides commandline options to the script via a variable called $extra.
"},{"location":"commands/php_script/#examples","title":"Examples","text":" drush php:script example --script-path=/path/to/scripts:/another/path
. Run a script named example.php from specified paths drush php:script -
. Run PHP code from standard input. drush php:script
. List all available scripts. drush php:script foo -- apple --cider
. Run foo.php script with argument apple and option cider. Note the -- separator.
"},{"location":"commands/php_script/#arguments","title":"Arguments","text":""},{"location":"commands/php_script/#options","title":"Options","text":" - --format[=FORMAT]. [default: var_export]
- --script-path=SCRIPT-PATH. Additional paths to search for scripts, separated by : (Unix-based systems) or ; (Windows).
"},{"location":"commands/php_script/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/php_script/#topics","title":"Topics","text":" - An example Drush script. (docs:script)
"},{"location":"commands/php_script/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/pm_install/","title":"pm:install","text":"Enable one or more modules.
"},{"location":"commands/pm_install/#examples","title":"Examples","text":" drush pm:install --simulate content_moderation
. Display what modules would be installed but don't install them.
"},{"location":"commands/pm_install/#arguments","title":"Arguments","text":" - [modules].... A comma delimited list of modules.
"},{"location":"commands/pm_install/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/pm_install/#aliases","title":"Aliases","text":" - in
- install
- pm-install
- en
- pm-enable
- pm:enable
Legend
- 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.
"},{"location":"commands/pm_list/","title":"pm:list","text":"Show a list of available extensions (modules and themes).
"},{"location":"commands/pm_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --type[=TYPE]. Only show extensions having a given type. Choices: module, theme. [default: module,theme]
- --status[=STATUS]. Only show extensions having a given status. Choices: enabled or disabled. [default: enabled,disabled]
- --package=PACKAGE. Only show extensions having a given project packages (e.g. Development).
- --core. Only show extensions that are in Drupal core.
- --no-core. Only show extensions that are not provided by Drupal core.
- --fields=FIELDS. Available fields: Package (package), Project (project), Name (display_name), Name (name), Type (type), Path (path), Status (status), Version (version)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/pm_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/pm_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/pm_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/pm_uninstall/","title":"pm:uninstall","text":"Uninstall one or more modules and their dependent modules.
"},{"location":"commands/pm_uninstall/#examples","title":"Examples","text":" drush pm:uninstall --simulate field_ui
. Display what modules would be uninstalled but don't uninstall them.
"},{"location":"commands/pm_uninstall/#arguments","title":"Arguments","text":" - [modules].... A comma delimited list of modules.
"},{"location":"commands/pm_uninstall/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/pm_uninstall/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/queue_delete/","title":"queue:delete","text":"Delete all items in a specific queue.
"},{"location":"commands/queue_delete/#arguments","title":"Arguments","text":" - name. The name of the queue to delete, as defined in either hook_queue_info or hook_cron_queue_info.
"},{"location":"commands/queue_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/queue_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/queue_list/","title":"queue:list","text":"Returns a list of all defined queues.
"},{"location":"commands/queue_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Queue (queue), Items (items), Class (class)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/queue_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/queue_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/queue_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/queue_run/","title":"queue:run","text":"Run a specific queue by name.
"},{"location":"commands/queue_run/#arguments","title":"Arguments","text":" - name. The name of the queue to run, as defined in either hook_queue_info or hook_cron_queue_info.
"},{"location":"commands/queue_run/#options","title":"Options","text":" - --time-limit=TIME-LIMIT. The maximum number of seconds allowed to run the queue.
- --items-limit=ITEMS-LIMIT. The maximum number of items allowed to run the queue.
- --lease-time=LEASE-TIME. The maximum number of seconds that an item remains claimed.
"},{"location":"commands/queue_run/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/queue_run/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_create/","title":"role:create","text":"Create a new role.
"},{"location":"commands/role_create/#examples","title":"Examples","text":" drush role:create 'test_role' 'Test role'
. Create a new role with a machine name of 'test_role', and a human-readable name of 'Test role'.
"},{"location":"commands/role_create/#arguments","title":"Arguments","text":" - machine_name. The symbolic machine name for the role.
- [human_readable_name]. A descriptive name for the role.
"},{"location":"commands/role_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_delete/","title":"role:delete","text":"Delete a role.
"},{"location":"commands/role_delete/#examples","title":"Examples","text":" drush role:delete 'test_role'
. Delete the role 'test_role'.
"},{"location":"commands/role_delete/#arguments","title":"Arguments","text":" - machine_name. The symbolic machine name for the role.
"},{"location":"commands/role_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_list/","title":"role:list","text":"Display roles and their permissions.
"},{"location":"commands/role_list/#examples","title":"Examples","text":" drush role:list --filter='administer nodes'
. Display a list of roles that have the administer nodes permission assigned. drush role:list --filter='rid=anonymous'
. Display only the anonymous role.
"},{"location":"commands/role_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Available fields: ID (rid), Role Label (label), Permissions (perms)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/role_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/role_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_perm_add/","title":"role:perm:add","text":"Grant specified permission(s) to a role.
"},{"location":"commands/role_perm_add/#examples","title":"Examples","text":" drush role:perm:add anonymous 'post comments'
. Allow anon users to post comments. drush role:perm:add anonymous 'post comments,access content'
. Allow anon users to post comments and access content.
"},{"location":"commands/role_perm_add/#arguments","title":"Arguments","text":" - machine_name. The role to modify.
- permissions. The list of permission to grant, delimited by commas.
"},{"location":"commands/role_perm_add/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_perm_add/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/role_perm_remove/","title":"role:perm:remove","text":"Remove specified permission(s) from a role.
"},{"location":"commands/role_perm_remove/#examples","title":"Examples","text":" drush role:remove-perm anonymous
. Remove 2 permissions from anon users.
"},{"location":"commands/role_perm_remove/#arguments","title":"Arguments","text":" - machine_name. The role to modify.
- permissions. The list of permission to grant, delimited by commas.
"},{"location":"commands/role_perm_remove/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/role_perm_remove/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/runserver/","title":"runserver","text":"Runs PHP's built-in http server for development.
- Don't use this for production, it is neither scalable nor secure for this use.
- If you run multiple servers simultaneously, you will need to assign each a unique port.
- Use Ctrl-C or equivalent to stop the server when complete.
"},{"location":"commands/runserver/#examples","title":"Examples","text":" drush rs 8080
. Start a web server on 127.0.0.1, port 8080. drush rs 10.0.0.28:80
. Start runserver on 10.0.0.28, port 80. drush rs [::1]:80
. Start runserver on IPv6 localhost ::1, port 80. drush rs --dns localhost:8888/user
. Start runserver on localhost (using rDNS to determine binding IP), port 8888, and open /user in browser. drush rs /
. Start runserver on default IP/port (127.0.0.1, port 8888), and open / in browser. drush rs :9000/admin
. Start runserver on 127.0.0.1, port 9000, and open /admin in browser. Note that you need a colon when you specify port and path, but no IP. drush --quiet rs
. Silence logging the printing of web requests to the console.
"},{"location":"commands/runserver/#arguments","title":"Arguments","text":" - [uri]. IP address and port number to bind to and path to open in web browser. Format is addr:port/path. Only opens a browser if a path is specified.
"},{"location":"commands/runserver/#options","title":"Options","text":" - --default-server=DEFAULT-SERVER. A default addr:port/path to use for any values not specified as an argument.
- --browser[=BROWSER]. Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: 1]
- --dns. Resolve hostnames/IPs using DNS/rDNS (if possible) to determine binding IPs and/or human friendly hostnames for URLs and browser.
- --no-browser. Negate --browser option.
"},{"location":"commands/runserver/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/runserver/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_alias/","title":"site:alias","text":"Show site alias details, or a list of available site aliases.
"},{"location":"commands/site_alias/#examples","title":"Examples","text":" drush site:alias
. List all alias records known to drush. drush site:alias @dev
. Print an alias record for the alias dev.
"},{"location":"commands/site_alias/#arguments","title":"Arguments","text":" - [site]. Site alias or site specification.
"},{"location":"commands/site_alias/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/site_alias/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_alias/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
- Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/site_alias/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_install/","title":"site:install","text":"Install Drupal along with modules/themes/configuration/profile.
"},{"location":"commands/site_install/#examples","title":"Examples","text":" drush si demo_umami --locale=da
. (Re)install using the Umami install profile. Set default language to Danish. drush si --db-url=mysql://root:pass@localhost:port/dbname
. Install using the specified DB params. drush si --db-url=sqlite://sites/example.com/files/.ht.sqlite
. Install using SQLite drush si --db-url=sqlite://:memory:
. Install using SQLite in-memory database. drush si --account-pass=mom
. Re-install with specified uid1 password. drush si --existing-config
. Install based on the yml files stored in the config export/import directory. drush si standard install_configure_form.enable_update_status_emails=NULL
. Disable email notification during install and later. If your server has no mail transfer agent, this gets rid of an error during install.
"},{"location":"commands/site_install/#arguments","title":"Arguments","text":" - [profile].... An install profile name. Defaults to standard unless an install profile is marked as a distribution. Use minimal for a bare minimum installation. Additional info for the install profile may also be provided with additional arguments. The key is in the form [form name].[parameter name]
"},{"location":"commands/site_install/#options","title":"Options","text":" - --db-url=DB-URL. A Drupal 6 style database URL. Required for initial install, not re-install. If omitted and required, Drush prompts for this item.
- --db-prefix=DB-PREFIX. An optional table prefix to use for initial install.
- --db-su=DB-SU. Account to use when creating a new database. Must have Grant permission (mysql only). Optional.
- --db-su-pw=DB-SU-PW. Password for the db-su account. Optional.
- --account-name[=ACCOUNT-NAME]. uid1 name. [default: admin]
- --account-mail[=ACCOUNT-MAIL]. uid1 email. [default: admin@example.com]
- --site-mail[=SITE-MAIL]. From: for system mailings. [default: admin@example.com]
- --account-pass=ACCOUNT-PASS. uid1 pass. Defaults to a randomly generated password. If desired, set a fixed password in drush.yml.
- --locale[=LOCALE]. A short language code. Sets the default site language. Language files must already be present. [default: en]
- --site-name[=SITE-NAME]. Site name [default: Drush Site-Install]
- --site-pass=SITE-PASS.
- --sites-subdir=SITES-SUBDIR. Name of directory under sites which should be created.
- --config-dir=CONFIG-DIR.
- --existing-config. Configuration from sync directory should be imported during installation.
"},{"location":"commands/site_install/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_install/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_set/","title":"site:set","text":"Set a site alias that will persist for the current session.
Stores the site alias being used in the current session in a temporary file.
"},{"location":"commands/site_set/#examples","title":"Examples","text":" drush site:set @dev
. Set the current session to use the @dev alias. drush site:set user@server/path/to/drupal#sitename
. Set the current session to use a remote site via site specification. drush site:set /path/to/drupal#sitename
. Set the current session to use a local site via site specification. drush site:set -
. Go back to the previously-set site (like cd -
). drush site:set
. Without an argument, any existing site becomes unset.
"},{"location":"commands/site_set/#arguments","title":"Arguments","text":" - [site]. Site specification to use, or - for previous site. Omit this argument to unset.
"},{"location":"commands/site_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_set/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
"},{"location":"commands/site_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/site_ssh/","title":"site:ssh","text":"Connect to a webserver via SSH, and optionally run a shell command.
"},{"location":"commands/site_ssh/#examples","title":"Examples","text":" drush @mysite ssh
. Open an interactive shell on @mysite's server. drush @prod ssh \"ls /tmp\"
. Run ls /tmp on @prod site. drush @prod ssh \"git pull\"
. Run git pull on the Drupal root directory on the @prod site. drush ssh \"git pull\"
. Run git pull on the local Drupal root directory.
"},{"location":"commands/site_ssh/#arguments","title":"Arguments","text":" - [code].... Code which should run at remote host.
"},{"location":"commands/site_ssh/#options","title":"Options","text":" - --cd=CD. Directory to change to. Defaults to Drupal root.
- --ssh-options=SSH-OPTIONS. A string of extra options that will be passed to the ssh command (e.g. -p 100)
- --tty. Create a tty (e.g. to run an interactive program).
"},{"location":"commands/site_ssh/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/site_ssh/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
"},{"location":"commands/site_ssh/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_cli/","title":"sql:cli","text":"Open a SQL command-line interface using Drupal's credentials.
"},{"location":"commands/sql_cli/#examples","title":"Examples","text":" drush sql:cli
. Open a SQL command-line interface using Drupal's credentials. drush sql:cli --extra=--progress-reports
. Open a SQL CLI and skip reading table information. drush sql:cli < example.sql
. Import sql statements from a file into the current database.
"},{"location":"commands/sql_cli/#options","title":"Options","text":" - --extra=EXTRA. Add custom options to the connect string (e.g. --extra=--skip-column-names)
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_cli/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_cli/#topics","title":"Topics","text":" - Example policy file. (docs:policy)
"},{"location":"commands/sql_cli/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_connect/","title":"sql:connect","text":"A string for connecting to the DB.
"},{"location":"commands/sql_connect/#examples","title":"Examples","text":" $(drush sql:connect) < example.sql
. Bash: Import SQL statements from a file into the current database. eval (drush sql:connect) < example.sql
. Fish: Import SQL statements from a file into the current database.
"},{"location":"commands/sql_connect/#options","title":"Options","text":" - --extra=EXTRA. Add custom options to the connect string (e.g. --extra=--skip-column-names)
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_connect/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_connect/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_create/","title":"sql:create","text":"Create a database.
"},{"location":"commands/sql_create/#examples","title":"Examples","text":" drush sql:create
. Create the database for the current site. drush @site.test sql:create
. Create the database as specified for @site.test. drush sql:create --db-su=root --db-su-pw=rootpassword --db-url=\"mysql://drupal_db_user:drupal_db_password@127.0.0.1/drupal_db\"
. Create the database as specified in the db-url option.
"},{"location":"commands/sql_create/#options","title":"Options","text":" - --db-su=DB-SU. Account to use when creating a new database.
- --db-su-pw=DB-SU-PW. Password for the db-su account.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_drop/","title":"sql:drop","text":"Drop all tables in a given database.
"},{"location":"commands/sql_drop/#options","title":"Options","text":" - --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_drop/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_drop/#topics","title":"Topics","text":" - Example policy file. (docs:policy)
"},{"location":"commands/sql_drop/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_dump/","title":"sql:dump","text":"Exports the Drupal DB as SQL using mysqldump or equivalent.
--create-db is used by sql-sync, since including the DROP TABLE statements interferes with the import when the database is created.
"},{"location":"commands/sql_dump/#examples","title":"Examples","text":" drush sql:dump --result-file=../18.sql
. Save SQL dump to the directory above Drupal root. drush sql:dump --skip-tables-key=common
. Skip standard tables. See Drush configuration drush sql:dump --extra-dump=--no-data
. Pass extra option to mysqldump command.
"},{"location":"commands/sql_dump/#options","title":"Options","text":" - --result-file=RESULT-FILE. Save to a file. The file should be relative to Drupal root. If --result-file is provided with the value 'auto', a date-based filename will be created under ~/drush-backups directory.
- --create-db. Omit DROP TABLE statements. Used by Postgres and Oracle only.
- --data-only. Dump data without statements to create any of the schema.
- --ordered-dump. Order by primary key and add line breaks for efficient diffs. Slows down the dump. Mysql only.
- --gzip. Compress the dump using the gzip program which must be in your $PATH.
- --extra=EXTRA. Add custom arguments/options when connecting to database (used internally to list tables).
- --extra-dump=EXTRA-DUMP. Add custom arguments/options to the dumping of the database (e.g. mysqldump command).
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: null]
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
- --fields=FIELDS. Available fields: Path (path)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/sql_dump/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_dump/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/sql_dump/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_query/","title":"sql:query","text":"Execute a query against a database.
"},{"location":"commands/sql_query/#examples","title":"Examples","text":" drush sql:query \"SELECT * FROM users WHERE uid=1\"
. Browse user record. Table prefixes, if used, must be added to table names by hand. drush sql:query --db-prefix \"SELECT * FROM {users}\"
. Browse user record. Table prefixes are honored. Caution: All curly-braces will be stripped. $(drush sql:connect) < example.sql
. Import sql statements from a file into the current database. drush sql:query --file=example.sql
. Alternate way to import sql statements from a file. drush php:eval --format=json \"return \\Drupal::service('database')->query('SELECT * FROM users LIMIT 5')->fetchAll()\"
. Get data back in JSON format. See https://github.com/drush-ops/drush/issues/3071#issuecomment-347929777. $(drush sql:connect) -e \"SELECT * FROM users LIMIT 5;\"
. Results are formatted in a pretty table with borders and column headers.
"},{"location":"commands/sql_query/#arguments","title":"Arguments","text":" - [query]. An SQL query. Ignored if --file is provided.
"},{"location":"commands/sql_query/#options","title":"Options","text":" - --result-file[=RESULT-FILE]. Save to a file. The file should be relative to Drupal root.
- --file=FILE. Path to a file containing the SQL to be run. Gzip files are accepted.
- --file-delete. Delete the --file after running it.
- --extra=EXTRA. Add custom options to the connect string (e.g. --extra=--skip-column-names)
- --db-prefix. Enable replacement of braces in your query.
- --database[=DATABASE]. The DB connection key if using multiple connections in settings.php. [default: default]
- --db-url=DB-URL. A Drupal 6 style database URL. For example mysql://root:pass@localhost:port/dbname
- --target[=TARGET]. The name of a target within the specified database connection. [default: default]
- --show-passwords. Show password on the CLI. Useful for debugging.
"},{"location":"commands/sql_query/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_query/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_sanitize/","title":"sql:sanitize","text":"Sanitize the database by removing or obfuscating user data.
Commandfiles may add custom operations by implementing:
- `#[CLI\\Hook(type: HookManager::ON_EVENT, target: SanitizeCommands::CONFIRMS)]`. Display summary to user before confirmation.\n- `#[CLI\\Hook(type: HookManager::POST_COMMAND_HOOK, target: SanitizeCommands::SANITIZE)]`. Run queries or call APIs to perform sanitizing\n
Several working commandfiles may be found at https://github.com/drush-ops/drush/tree/12.x/src/Drupal/Commands/sql
"},{"location":"commands/sql_sanitize/#examples","title":"Examples","text":" drush sql:sanitize --sanitize-password=no
. Sanitize database without modifying any passwords. drush sql:sanitize --allowlist-fields=field_biography,field_phone_number
. Sanitizes database but exempts two user fields from modification.
"},{"location":"commands/sql_sanitize/#options","title":"Options","text":" - --allowlist-fields[=ALLOWLIST-FIELDS]. A comma delimited list of fields exempt from sanitization.
- --sanitize-email[=SANITIZE-EMAIL]. The pattern for test email addresses in the sanitization operation, or no to keep email addresses unchanged. May contain replacement patterns %uid, %mail or %name. [default: user+%uid@localhost.localdomain]
- --sanitize-password[=SANITIZE-PASSWORD]. By default, passwords are randomized. Specify no to disable that. Specify any other value to set all passwords to that value.
"},{"location":"commands/sql_sanitize/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_sanitize/#topics","title":"Topics","text":" - Drush hooks. (docs:hooks)
"},{"location":"commands/sql_sanitize/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/sql_sync/","title":"sql:sync","text":"Copy DB data from a source site to a target site. Transfers data via rsync.
"},{"location":"commands/sql_sync/#examples","title":"Examples","text":" drush sql:sync @source @self
. Copy the database from the site with the alias 'source' to the local site. drush sql:sync @self @target
. Copy the database from the local site to the site with the alias 'target'. drush sql:sync #prod #dev
. Copy the database from the site in /sites/prod to the site in /sites/dev (multisite installation).
"},{"location":"commands/sql_sync/#arguments","title":"Arguments","text":" - source. A site-alias or site specification whose database you want to copy from.
- target. A site-alias or site specification whose database you want to replace.
"},{"location":"commands/sql_sync/#options","title":"Options","text":" - --no-dump. Do not dump the sql database; always use an existing dump file.
- --no-sync. Do not rsync the database dump file from source to target.
- --runner=RUNNER. Where to run the rsync command; defaults to the local site. Can also be source or target.
- --create-db. Create a new database before importing the database dump on the target machine.
- --db-su=DB-SU. Account to use when creating a new database (e.g. root).
- --db-su-pw=DB-SU-PW. Password for the db-su account.
- --target-dump=TARGET-DUMP. The path for storing the sql-dump on target machine.
- --source-dump[=SOURCE-DUMP]. The path for retrieving the sql-dump on source machine.
- --extra-dump=EXTRA-DUMP. Add custom arguments/options to the dumping of the database (e.g. mysqldump command).
- --skip-tables-key=SKIP-TABLES-KEY. A key in the $skip_tables array. @see Site aliases
- --structure-tables-key=STRUCTURE-TABLES-KEY. A key in the $structure_tables array. @see Site aliases
- --tables-key=TABLES-KEY. A key in the $tables array.
- --skip-tables-list=SKIP-TABLES-LIST. A comma-separated list of tables to exclude completely.
- --structure-tables-list=STRUCTURE-TABLES-LIST. A comma-separated list of tables to include for structure, but not data.
- --tables-list=TABLES-LIST. A comma-separated list of tables to transfer.
"},{"location":"commands/sql_sync/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/sql_sync/#topics","title":"Topics","text":" - Creating site aliases for running Drush on remote sites. (docs:aliases)
- Example policy file. (docs:policy)
- Drush configuration. (docs:configuration)
- Extend sql-sync to allow transfer of the sql dump file via http. (docs:example-sync-via-http)
"},{"location":"commands/sql_sync/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/state_delete/","title":"state:delete","text":"Delete a state entry.
"},{"location":"commands/state_delete/#examples","title":"Examples","text":" drush state:del system.cron_last
. Delete state entry for system.cron_last.
"},{"location":"commands/state_delete/#arguments","title":"Arguments","text":" - key. The state key, for example system.cron_last.
"},{"location":"commands/state_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/state_delete/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/state_get/","title":"state:get","text":"Display a state value.
"},{"location":"commands/state_get/#examples","title":"Examples","text":" drush state:get system.cron_last
. Displays last cron run timestamp drush state:get drupal_css_cache_files --format=yaml
. Displays an array of css files in yaml format.
"},{"location":"commands/state_get/#arguments","title":"Arguments","text":""},{"location":"commands/state_get/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: string]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/state_get/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/state_get/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/state_set/","title":"state:set","text":"Set a state value.
"},{"location":"commands/state_set/#examples","title":"Examples","text":" drush sset system.maintenance_mode 1 --input-format=integer
. Put site into Maintenance mode. drush state:set system.cron_last 1406682882 --input-format=integer
. Sets a timestamp for last cron run. php -r \"print json_encode(array('drupal', 'simpletest'));\" | drush state-set --input-format=json foo.name -
. Set a key to a complex value (e.g. array) drush state:set twig_debug TRUE
. Enable the Twig debug mode (since Drupal 10.1) drush state:set twig_autoreload TRUE
. Enable Twig auto reload (since Drupal 10.1) drush state:set twig_cache_disable TRUE
. Disable the Twig, page, render and dynamic page caches (since Drupal 10.1) drush state:set disable_rendered_output_cache_bins TRUE
. Disables render cache, dynamic page cache, and page cache. (since Drupal 10.1)
"},{"location":"commands/state_set/#arguments","title":"Arguments","text":" - key. The state key, for example: system.cron_last.
- value. The value to assign to the state key. Use - to read from Stdin.
"},{"location":"commands/state_set/#options","title":"Options","text":" - --input-format[=INPUT-FORMAT]. Type for the value. Other recognized values: string, integer, float, boolean, json, yaml. [default: auto]
"},{"location":"commands/state_set/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/state_set/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/theme_install/","title":"theme:install","text":"Install one or more themes.
"},{"location":"commands/theme_install/#arguments","title":"Arguments","text":" - [themes].... A comma delimited list of themes.
"},{"location":"commands/theme_install/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/theme_install/#aliases","title":"Aliases","text":" - thin
- theme:enable
- then
- theme-enable
Legend
- 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.
"},{"location":"commands/theme_uninstall/","title":"theme:uninstall","text":"Uninstall themes.
"},{"location":"commands/theme_uninstall/#arguments","title":"Arguments","text":" - [themes].... A comma delimited list of themes.
"},{"location":"commands/theme_uninstall/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/theme_uninstall/#aliases","title":"Aliases","text":" - theme:un
- thun
- theme-uninstall
Legend
- 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.
"},{"location":"commands/twig_compile/","title":"twig:compile","text":"Compile all Twig template(s).
"},{"location":"commands/twig_compile/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/twig_compile/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/twig_debug/","title":"twig:debug","text":" 12.1+
Enables Twig debug and disables caching Twig templates.
"},{"location":"commands/twig_debug/#arguments","title":"Arguments","text":" - mode. Debug mode. Recognized values: on, off.
"},{"location":"commands/twig_debug/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/twig_debug/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/twig_unused/","title":"twig:unused","text":"Find potentially unused Twig templates.
Immediately before running this command, web crawl your entire web site. Or use your Production PHPStorage dir for comparison.
"},{"location":"commands/twig_unused/#examples","title":"Examples","text":" drush twig:unused --field=template /var/www/mass.local/docroot/modules/custom,/var/www/mass.local/docroot/themes/custom
. Output a simple list of potentially unused templates.
"},{"location":"commands/twig_unused/#arguments","title":"Arguments","text":" - searchpaths. A comma delimited list of paths to recursively search
"},{"location":"commands/twig_unused/#options","title":"Options","text":" - --format=FORMAT. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Template (template), Compiled (compiled)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/twig_unused/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/twig_unused/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/updatedb/","title":"updatedb","text":"Apply any database updates required (as with running update.php).
"},{"location":"commands/updatedb/#options","title":"Options","text":" - --cache-clear[=CACHE-CLEAR]. Clear caches upon completion. [default: 1]
- --no-cache-clear. Negate --cache-clear option.
"},{"location":"commands/updatedb/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/updatedb/#topics","title":"Topics","text":" - Deploy command for Drupal. (docs:deploy)
"},{"location":"commands/updatedb/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/updatedb_status/","title":"updatedb:status","text":"List any pending database updates.
"},{"location":"commands/updatedb_status/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Module (module), Update ID (update_id), Description (description), Type (type)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/updatedb_status/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/updatedb_status/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/updatedb_status/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_block/","title":"user:block","text":"Block the specified user(s).
"},{"location":"commands/user_block/#examples","title":"Examples","text":" drush user:block user3
. Block the user whose name is user3 drush user:cancel user3 --delete-content
. Delete the user whose name is user3 and delete her content. drush user:cancel user3 --reassign-content
. Delete the user whose name is user3 and reassign her content to the anonymous user.
"},{"location":"commands/user_block/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_block/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_block/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_block/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_cancel/","title":"user:cancel","text":"Block or delete user account(s) with the specified name(s).
- Existing content may be deleted or reassigned to the Anonymous user. See options.
- By default only nodes are deleted or reassigned. Custom entity types need own code to support cancellation. See https://www.drupal.org/project/drupal/issues/3043725 for updates.
"},{"location":"commands/user_cancel/#examples","title":"Examples","text":" drush user:cancel username
. Block the user account with the name username. drush user:cancel --delete-content username
. Delete the user account with the name username and delete all content created by that user. drush user:cancel --reassign-content username
. Delete the user account with the name username and assign all her content to the anonymous user.
"},{"location":"commands/user_cancel/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_cancel/#options","title":"Options","text":" - --delete-content. Delete the user, and delete all content created by that user.
- --reassign-content. Delete the user and make its content belong to the anonymous user.
- --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_cancel/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_cancel/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_create/","title":"user:create","text":"Create a user account.
"},{"location":"commands/user_create/#examples","title":"Examples","text":" drush user:create newuser --mail='person@example.com' --password='letmein'
. Create a new user account with the name newuser, the email address person@example.com, and the password letmein
"},{"location":"commands/user_create/#arguments","title":"Arguments","text":" - name. The name of the account to add
"},{"location":"commands/user_create/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --password=PASSWORD. The password for the new account
- --mail=MAIL. The email address for the new account
- --fields=FIELDS. Available fields: User ID (uid), User name (name), Password (pass), User mail (mail), User theme (theme), Signature (signature), Signature format (signature_format), User created (user_created), Created (created), User last access (user_access), Last access (access), User last login (user_login), Last login (login), User status (user_status), Status (status), Time zone (timezone), User picture (picture), Initial user mail (init), User roles (roles), Group Audience (group_audience), Language code (langcode), Uuid (uuid)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/user_create/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_create/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/user_create/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_information/","title":"user:information","text":"Print information about the specified user(s).
"},{"location":"commands/user_information/#examples","title":"Examples","text":" drush user:information someguy,somegal
. Display information about the someguy and somegal user accounts. drush user:information --mail=someguy@somegal.com
. Display information for a given email account. drush user:information --uid=5
. Display information for a given user id. drush uinf --uid=$(drush sqlq \"SELECT GROUP_CONCAT(entity_id) FROM user__roles WHERE roles_target_id = 'administrator'\")
. Display information for all administrators.
"},{"location":"commands/user_information/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_information/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
- --fields=FIELDS. Available fields: User ID (uid), User name (name), Password (pass), User mail (mail), User theme (theme), Signature (signature), Signature format (signature_format), User created (user_created), Created (created), User last access (user_access), Last access (access), User last login (user_login), Last login (login), User status (user_status), Status (status), Time zone (timezone), User picture (picture), Initial user mail (init), User roles (roles), Group Audience (group_audience), Language code (langcode), Uuid (uuid)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/user_information/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_information/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/user_information/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_login/","title":"user:login","text":"Display a one time login link for user ID 1, or another user.
"},{"location":"commands/user_login/#examples","title":"Examples","text":" drush user:login
. Open browser to homepage, logged in as uid=1. drush user:login --name=ryan node/add/blog
. Open browser (if configured or detected) for a one-time login link for username ryan that redirects to node/add/blog. drush user:login --uid=123
. Open browser and login as user with uid \"123\". drush user:login --mail=foo@bar.com
. Open browser and login as user with mail \"foo@bar.com\".
"},{"location":"commands/user_login/#arguments","title":"Arguments","text":" - [path]. Optional path to redirect to after logging in.
"},{"location":"commands/user_login/#options","title":"Options","text":" - --name[=NAME]. A user name to log in as.
- --uid[=UID]. A user ID to log in as.
- --mail[=MAIL]. A user email to log in as.
- --browser[=BROWSER]. Open the URL in the default browser. Use --no-browser to avoid opening a browser. [default: 1]
- --redirect-port=REDIRECT-PORT. A custom port for redirecting to (e.g., when running within a Vagrant environment)
- --no-browser. Negate --browser option.
"},{"location":"commands/user_login/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_login/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_password/","title":"user:password","text":"Set the password for the user account with the specified name.
"},{"location":"commands/user_password/#examples","title":"Examples","text":" drush user:password someuser 'correct horse battery staple'
. Set the password for the username someuser. See https://xkcd.com/936
"},{"location":"commands/user_password/#arguments","title":"Arguments","text":" - name. The name of the account to modify.
- password. The new password for the account.
"},{"location":"commands/user_password/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_password/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_role_add/","title":"user:role:add","text":"Add a role to the specified user accounts.
"},{"location":"commands/user_role_add/#examples","title":"Examples","text":" drush user:role:add 'editor' user3
. Add the editor role to user3
"},{"location":"commands/user_role_add/#arguments","title":"Arguments","text":" - role. The machine name of the role to add.
- [names]. A comma delimited list of user names.
"},{"location":"commands/user_role_add/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_role_add/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_role_add/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_role_remove/","title":"user:role:remove","text":"Remove a role from the specified user accounts.
"},{"location":"commands/user_role_remove/#examples","title":"Examples","text":" drush user:role:remove 'power_user' user3
. Remove the power_user role from user3
"},{"location":"commands/user_role_remove/#arguments","title":"Arguments","text":" - role. The machine name of the role to add.
- [names]. A comma delimited list of user names.
"},{"location":"commands/user_role_remove/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_role_remove/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_role_remove/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/user_unblock/","title":"user:unblock","text":"Unblock the specified user(s).
"},{"location":"commands/user_unblock/#examples","title":"Examples","text":" drush user:unblock user3
. Unblock the user whose name is user3
"},{"location":"commands/user_unblock/#arguments","title":"Arguments","text":" - [names]. A comma delimited list of user names.
"},{"location":"commands/user_unblock/#options","title":"Options","text":" - --uid=UID. A comma delimited list of user ids to lookup (an alternative to names).
- --mail=MAIL. A comma delimited list of emails to lookup (an alternative to names).
"},{"location":"commands/user_unblock/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/user_unblock/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/version/","title":"version","text":"Show Drush version.
"},{"location":"commands/version/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Drush version (drush-version)
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/version/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/version/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
Legend
- 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.
"},{"location":"commands/views_dev/","title":"views:dev","text":"Set several Views settings to more developer-oriented values.
"},{"location":"commands/views_dev/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_dev/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_disable/","title":"views:disable","text":"Disable the specified views.
"},{"location":"commands/views_disable/#examples","title":"Examples","text":" drush vdis frontpage taxonomy_term
. Disable the frontpage and taxonomy_term views.
"},{"location":"commands/views_disable/#arguments","title":"Arguments","text":" - views. A comma delimited list of view names.
"},{"location":"commands/views_disable/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_disable/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_enable/","title":"views:enable","text":"Enable the specified views.
"},{"location":"commands/views_enable/#examples","title":"Examples","text":" drush ven frontpage,taxonomy_term
. Enable the frontpage and taxonomy_term views.
"},{"location":"commands/views_enable/#arguments","title":"Arguments","text":" - views. A comma delimited list of view names.
"},{"location":"commands/views_enable/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_enable/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_execute/","title":"views:execute","text":"Execute a view and show a count of the results, or the rendered HTML.
"},{"location":"commands/views_execute/#examples","title":"Examples","text":" drush views:execute my_view
. Show the rendered HTML for the default display for the my_view View. drush views:execute my_view page_1 3 --count
. Show a count of my_view:page_1 where the first contextual filter value is 3. drush views:execute my_view page_1 3,foo
. Show the rendered HTML of my_view:page_1 where the first two contextual filter values are 3 and 'foo' respectively.
"},{"location":"commands/views_execute/#arguments","title":"Arguments","text":" - view_name. The name of the view to execute.
- [display]. The display ID to execute. If none specified, the default display will be used.
- [view_args]. A comma delimited list of values, corresponding to contextual filters.
"},{"location":"commands/views_execute/#options","title":"Options","text":" - --count[=COUNT]. Display a count of the results instead of each row.
- --show-admin-links. Show contextual admin links in the rendered markup.
"},{"location":"commands/views_execute/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_execute/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/views_list/","title":"views:list","text":"Get a list of all views in the system.
"},{"location":"commands/views_list/#examples","title":"Examples","text":" drush vl
. Show a list of all available views. drush vl --name=blog
. Show a list of views which names contain 'blog'. drush vl --tags=tag1,tag2
. Show a list of views tagged with 'tag1' or 'tag2'. drush vl --status=enabled
. Show a list of enabled views.
"},{"location":"commands/views_list/#options","title":"Options","text":" - --name=NAME.
- --tags=TAGS. A comma-separated list of views tags by which to filter the results.
- --status=STATUS. Filter views by status. Choices: enabled, disabled.
- --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --fields=FIELDS. Available fields: Machine name (machine-name), Name (label), Description (description), Status (status), Tag (tag)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/views_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/views_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/views_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_delete/","title":"watchdog:delete","text":"Delete watchdog log records.
"},{"location":"commands/watchdog_delete/#examples","title":"Examples","text":" drush watchdog:delete all
. Delete all messages. drush watchdog:delete 64
. Delete messages with id 64. drush watchdog:delete \"cron run succesful\"
. Delete messages containing the string \"cron run succesful\". drush watchdog:delete --severity=Notice
. Delete all messages with a severity of notice. drush watchdog:delete --type=cron
. Delete all messages of type cron.
"},{"location":"commands/watchdog_delete/#arguments","title":"Arguments","text":" - [substring]. Delete all log records with this text in the messages.
"},{"location":"commands/watchdog_delete/#options","title":"Options","text":" - --severity=SEVERITY. Delete messages of a given severity level.
- --type=TYPE. Delete messages of a given type.
"},{"location":"commands/watchdog_delete/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_delete/#aliases","title":"Aliases","text":" - wd-del
- wd-delete
- wd
- watchdog-delete
Legend
- 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.
"},{"location":"commands/watchdog_list/","title":"watchdog:list","text":"Interactively filter the watchdog message listing.
"},{"location":"commands/watchdog_list/#examples","title":"Examples","text":" drush watchdog:list
. Prompt for message type or severity, then run watchdog:show.
"},{"location":"commands/watchdog_list/#arguments","title":"Arguments","text":" - [substring]. A substring to look search in error messages.
"},{"location":"commands/watchdog_list/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --count[=COUNT]. The number of messages to show. [default: 10]
- --extended. Return extended information about each message.
- --severity. Restrict to messages of a given severity level (numeric or string).
- --type. Restrict to messages of a given type.
- --fields=FIELDS. Available fields: ID (wid), Type (type), Message (message), Severity (severity), Location (location), Hostname (hostname), Date (date), Username (username)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/watchdog_list/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_list/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/watchdog_list/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_show-one/","title":"watchdog:show-one","text":"Show one log record by ID.
"},{"location":"commands/watchdog_show-one/#arguments","title":"Arguments","text":""},{"location":"commands/watchdog_show-one/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,string,table,tsv,var_dump,var_export,xml,yaml [default: yaml]
- --fields=FIELDS. Limit output to only the listed elements. Name top-level elements by key, e.g. \"--fields=name,date\", or use dot notation to select a nested element, e.g. \"--fields=a.b.c as example\".
- --field=FIELD. Select just one field, and force format to string.
"},{"location":"commands/watchdog_show-one/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_show-one/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_show/","title":"watchdog:show","text":"Show watchdog messages.
"},{"location":"commands/watchdog_show/#examples","title":"Examples","text":" drush watchdog:show
. Show a listing of most recent 10 messages. drush watchdog:show \"cron run successful\"
. Show a listing of most recent 10 messages containing the string cron run successful. drush watchdog:show --count=46
. Show a listing of most recent 46 messages. drush watchdog:show --severity=Notice
. Show a listing of most recent 10 messages with a severity of notice. drush watchdog:show --severity-min=Warning
. Show a listing of most recent 10 messages with a severity of warning or higher. drush watchdog:show --type=php
. Show a listing of most recent 10 messages of type php
"},{"location":"commands/watchdog_show/#arguments","title":"Arguments","text":" - [substring]. A substring to look search in error messages.
"},{"location":"commands/watchdog_show/#options","title":"Options","text":" - --format[=FORMAT]. Format the result data. Available formats: csv,json,list,null,php,print-r,sections,string,table,tsv,var_dump,var_export,xml,yaml [default: table]
- --count[=COUNT]. The number of messages to show. [default: 10]
- --severity=SEVERITY. Restrict to messages of a given severity level (numeric or string).
- --severity-min=SEVERITY-MIN. Restrict to messages of a given severity level and higher.
- --type=TYPE. Restrict to messages of a given type.
- --extended. Return extended information about each message.
- --fields=FIELDS. Available fields: ID (wid), Type (type), Message (message), Severity (severity), Location (location), Hostname (hostname), Date (date), Username (username), Uid (uid)
- --field=FIELD. Select just one field, and force format to string.
- --filter[=FILTER]. Filter output based on provided expression
"},{"location":"commands/watchdog_show/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_show/#topics","title":"Topics","text":" - Output formatters and filters: control the command output (docs:output-formats-filters)
"},{"location":"commands/watchdog_show/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/watchdog_tail/","title":"watchdog:tail","text":" 10.6+
Tail watchdog messages.
"},{"location":"commands/watchdog_tail/#examples","title":"Examples","text":" drush watchdog:tail
. Continuously tail watchdog messages. drush watchdog:tail \"cron run successful\"
. Continuously tail watchdog messages, filtering on the string cron run successful. drush watchdog:tail --severity=Notice
. Continuously tail watchdog messages, filtering severity of notice. drush watchdog:tail --severity-min=Warning
. Continuously tail watchdog messages, filtering for a severity of warning or higher. drush watchdog:tail --type=php
. Continuously tail watchdog messages, filtering on type equals php.
"},{"location":"commands/watchdog_tail/#arguments","title":"Arguments","text":" - [substring]. A substring to look search in error messages.
"},{"location":"commands/watchdog_tail/#options","title":"Options","text":" - --severity=SEVERITY. Restrict to messages of a given severity level (numeric or string).
- --severity-min=SEVERITY-MIN. Restrict to messages of a given severity level and higher.
- --type=TYPE. Restrict to messages of a given type.
- --extended. Return extended information about each message.
"},{"location":"commands/watchdog_tail/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/watchdog_tail/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_get_value/","title":"yaml:get:value","text":" 12.0+
Get a value for a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_get_value/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The key for the value to get, in dot notation.
"},{"location":"commands/yaml_get_value/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_get_value/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_lint/","title":"yaml:lint","text":" 12.0+
Validates that a given YAML file has valid syntax.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_lint/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
"},{"location":"commands/yaml_lint/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_lint/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_unset_key/","title":"yaml:unset:key","text":" 12.0+
Unset a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_unset_key/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The key to unset, in dot notation
"},{"location":"commands/yaml_unset_key/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_unset_key/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_update_key/","title":"yaml:update:key","text":" 12.0+
Update a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_update_key/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The original key, in dot notation
- new-key. The new key, in dot notation
"},{"location":"commands/yaml_update_key/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_update_key/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"commands/yaml_update_value/","title":"yaml:update:value","text":" 12.0+
Update the value for a specific key in a YAML file.
See https://github.com/grasmash/yaml-cli for a README and bug reports.
"},{"location":"commands/yaml_update_value/#arguments","title":"Arguments","text":" - filename. The filename of the YAML file
- key. The key for the value to set, in dot notation
- value. The new value
"},{"location":"commands/yaml_update_value/#options","title":"Options","text":" - -t, --type=TYPE. Set the variable type for the value. Accepted types are int, integer, bool, boolean, str, and string.
"},{"location":"commands/yaml_update_value/#global-options","title":"Global Options","text":" - -v|vv|vvv, --verbose. Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
- -y, --yes. Auto-accept the default for all user prompts. Equivalent to --no-interaction.
- -l, --uri=URI. A base URL for building links and selecting a multi-site. Defaults to https://default.
- To see all global options, run
drush topic
and pick the first choice.
"},{"location":"commands/yaml_update_value/#aliases","title":"Aliases","text":" Legend
- 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.
"},{"location":"contribute/CONTRIBUTING/","title":"Guidelines","text":"Drush is built by people like you! Please join us.
"},{"location":"contribute/CONTRIBUTING/#git-and-pull-requests","title":"Git and Pull requests","text":" - Contributions are submitted, reviewed, and accepted using GitHub pull requests.
- The latest changes are in the
12.x
branch. PR's should initially target this branch. - See the test-specific README.md for instructions on running the test suite. Test before you push. Get familiar with Unish, our test suite. Optionally run tests in the provided Docker containers.
- We maintain branches named 12.x, 11.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions.
"},{"location":"contribute/CONTRIBUTING/#development-environment","title":"Development Environment","text":" - You may choose to use the DDEV for a standardized development environment.
- See
composer run-script -l
for a list of helper scripts.
"},{"location":"contribute/CONTRIBUTING/#coding-style","title":"Coding style","text":" - Do write comments. You don't have to comment every line, but if you come up with something that's a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are nearly worthless!
- We use PSR-12.
- Keep it compatible. Do not introduce changes to the public API, or configurations too casually. Don't make incompatible changes without good reasons!
- Run
composer cs
to check the project for coding style issues and run composer cbf
to fix them automatically where possible. These scripts use PHP_CodeSniffer
in background.
"},{"location":"contribute/CONTRIBUTING/#documentation","title":"Documentation","text":" - The docs are on our web site. You may also read these from within Drush, with the
drush topic
command. - Documentation should be kept up-to-date. This means, whenever you add a new API method, add a new hook or change the database model, pack the relevant changes to the docs in the same pull request.
"},{"location":"contribute/unish/","title":"Unish","text":"Drush's test suite (aka Unish) is based on PHPUnit. In order to maintain high quality, our tests are run on every push. See CircleCi.
"},{"location":"contribute/unish/#usage","title":"Usage","text":" git clone https://github.com/drush-ops/drush.git
cd drush
composer install
- Review the configuration settings in tests/phpunit.xml.dist. If customization is needed, copy phpunit.xml.dist to phpunit.xml and edit away.
- Run all test suites:
composer test
"},{"location":"contribute/unish/#ddev","title":"DDEV","text":" 11.0+
Drush's own tests may be run within provided Docker containers via DDEV
- Start containers:
ddev start
- Run a test:
ddev exec drupal composer functional -- --filter testUserRole
- See the DDEV's XDebug docs for help on enabling Xdebug.
"},{"location":"contribute/unish/#advanced-usage","title":"Advanced usage","text":" - Run only one test suite
composer unit
composer integration
composer functional
- Run only tests matching a regex:
composer functional -- --filter testUserRole
- Skip slow tests (usually those with network usage):
composer functional -- --exclude-group slow
- XML results:
composer functional -- --log-junit results.xml
- Ad-hoc testing with the SUT
composer sut:si
. See composer.json for details. UNISH_DIRTY=1 composer functional -- --filter testUserRole
./drush @sut.dev status
"},{"location":"contribute/unish/#about-the-test-suites","title":"About the Test Suites","text":" - Unit tests operate on functions that take values and return results without creating side effects. No database connection is required to run these tests, and no Drupal site is set up.
- Integration tests set up a test dependency injection container and operate by calling the Symfony Application APIs directly. A Drupal site called the System Under Test is set up and used for the tests. The SUT is set up and installed only once, and then is re-used for all tests. Integration tests therefore cannot make destructive changes to the SUT database. Also, Drupal is bootstrapped only once (always using the standard Drupal kernel, never the install or update kernel). This means that all commands run at
@bootstrap full
, and it is not possible to test loading different Drush configuration files and so on. It is not possible to test argument / option parsing. The shutdown and error handlers are not installed, so PHP deprecation warnings will be evidenced in the integration tests. - Functional tests operate by
exec
ing the Drush executable. All functional tests therefore run in their own separate processes. The Drupal System Under Test is set up every time it is needed by any functional test. It is therefore okay if a functional test changes the state of the SUT. The codebase is re-used, so no destructive changes should be made to the code.
"},{"location":"contribute/unish/#drush-test-traits","title":"Drush Test Traits","text":"Drush provides test traits that may be used to test your own Drush extensions. Adding the traits varies slightly depending how you package your Drush extension.
- An extension that ships inside a contributed module - DevelCommandsTest for an example. More examples are SchedulerDrushTest and Views Bulk Operations. Remember to add
drush/drush
to your module's composer.json (require-dev
section). - A standalone Drush extension or one that ships outside of a module - example drush extension
Once you successfully have use Drush\\TestTraits\\DrushTestTrait
in your test class, you are able to write simple tests that call your extension's commands and makes assertions against the output.
public function testMyCommand()\n {\n $this->drush('my:command', ['param'], ['flag' => 'value']);\n $this->assertOutputEquals('The parameter is \"param\" and the \"flag\" option is \"value\"');\n }\n
"},{"location":"examples/ArtCommands.php/","title":"ArtCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\AnnotationData;\nuse Consolidation\\AnnotatedCommand\\CommandData;\nuse Consolidation\\AnnotatedCommand\\Events\\CustomEventAwareInterface;\nuse Consolidation\\AnnotatedCommand\\Events\\CustomEventAwareTrait;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Consolidation\\OutputFormatters\\StructuredData\\RowsOfFields;\nuse Drush\\Attributes as CLI;\nuse Drush\\Style\\DrushStyle;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\n/**\n * Run these commands using the --include option - e.g. `drush --include=/path/to/drush/examples art sandwich`\n *\n * See [Drush Test Traits](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.\n */\n\nclass ArtCommands extends DrushCommands implements CustomEventAwareInterface\n{\n use CustomEventAwareTrait;\n\n /** @var string[] */\n protected ?array $arts;\n\n /**\n * Show a fabulous picture.\n */\n #[CLI\\Command(name: 'artwork:show', aliases: ['arts'])]\n #[CLI\\Argument(name: 'art', description: 'The name of the art to display')]\n #[CLI\\Usage(name: 'drush art sandwich', description: 'Show a marvelous picture of a sandwich with pickles.')]\n public function art($art = '')\n {\n $data = $this->getArt();\n $name = $data[$art]['name'];\n $description = $data[$art]['description'];\n $path = $data[$art]['path'];\n $msg = dt(\n 'Okay. Here is {art}: {description}',\n ['art' => $name, 'description' => $description]\n );\n $this->output()->writeln(\"\\n\" . $msg . \"\\n\");\n $this->printFile($path);\n }\n\n /**\n * Show a table of information about available art.\n */\n #[CLI\\Command(name: 'artwork:list', aliases: ['artls'])]\n #[CLI\\FieldLabels(labels: ['name' => 'Name', 'description' => 'Description', 'path' => 'Path'])]\n #[CLI\\DefaultTableFields(fields: ['name', 'description'])]\n #[CLI\\FilterDefaultField(field: 'name')]\n public function listArt($options = ['format' => 'table']): RowsOfFields\n {\n $data = $this->getArt();\n return new RowsOfFields($data);\n }\n\n /**\n * Commandfiles may also add topics. These will appear in\n * the list of topics when `drush topic` is executed.\n * To view the topic below, run `drush --include=/full/path/to/examples topic`\n */\n\n /**\n * Ruminations on the true meaning and philosophy of artwork.\n */\n #[CLI\\Command(name: 'artwork:explain')]\n #[CLI\\Topics(isTopic: true, path: __DIR__ . '/art-topic.md')]\n #[CLI\\Help(hidden: true)]\n public function ruminate(): void\n {\n self::printFile($this->commandData);\n }\n\n /**\n * Return the available built-in art. Any Drush commandfile may provide\n * more art by implementing a 'drush-art' on-event hook. This on-event\n * hook is defined in the 'findArt' method below.\n */\n #[CLI\\Hook(type: HookManager::ON_EVENT, target: 'drush-art')]\n public function builtInArt()\n {\n return [\n 'drush' => [\n 'name' => 'Drush',\n 'description' => 'The Drush logo.',\n 'path' => __DIR__ . '/art/drush-nocolor.txt',\n ],\n 'sandwich' => [\n 'name' => 'Sandwich',\n 'description' => 'A tasty meal with bread often consumed at lunchtime.',\n 'path' => __DIR__ . '/art/sandwich-nocolor.txt',\n ],\n ];\n }\n\n #[CLI\\Hook(type: HookManager::INTERACT, target: 'artwork:show')]\n public function interact(InputInterface $input, OutputInterface $output, AnnotationData $annotationData)\n {\n $io = new DrushStyle($input, $output);\n\n // If the user did not specify any artwork, then prompt for one.\n $art = $input->getArgument('art');\n if (empty($art)) {\n $data = $this->getArt();\n $selections = $this->convertArtListToKeyValue($data);\n $selection = $io->choice('Select art to display', $selections);\n $input->setArgument('art', $selection);\n }\n }\n\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: 'artwork:show')]\n public function artValidate(CommandData $commandData)\n {\n $art = $commandData->input()->getArgument('art');\n $data = $this->getArt();\n if (!isset($data[$art])) {\n throw new \\Exception(dt('I do not have any art called \"{name}\".', ['name' => $art]));\n }\n }\n\n /**\n * Get a list of available artwork. Cache result for future fast access.\n */\n protected function getArt(): array\n {\n if (!isset($this->arts)) {\n $this->arts = $this->findArt();\n }\n return $this->arts;\n }\n\n /**\n * Use custom defined on-event hook 'drush-art' to find available artwork.\n */\n protected function findArt()\n {\n $arts = [];\n $handlers = $this->getCustomEventHandlers('drush-art');\n foreach ($handlers as $handler) {\n $handlerResult = $handler();\n $arts = array_merge($arts, $handlerResult);\n }\n return $arts;\n }\n\n /**\n * Given a list of artwork, convert to a 'key' => 'Name: Description' array.\n */\n protected function convertArtListToKeyValue(array $data): array\n {\n $result = [];\n foreach ($data as $key => $item) {\n $result[$key] = $item['name'] . ': ' . $item['description'];\n }\n return $result;\n }\n}\n
"},{"location":"examples/PolicyCommands.php/","title":"PolicyCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\CommandData;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Drush\\Attributes as CLI;\nuse Drush\\Commands\\core\\RsyncCommands;\nuse Drush\\Commands\\core\\UpdateDBCommands;\nuse Drush\\Commands\\DrushCommands;\nuse Drush\\Commands\\sql\\SqlSyncCommands;\nuse Symfony\\Component\\Console\\Input\\InputOption;\n\n/**\n * Load this commandfile using the --include option - e.g. `drush --include=/path/to/drush/examples`\n *\n * See [Drush Test Traits](https://github.com/drush-ops/drush/blob/12.x/docs/contribute/unish.md#about-the-test-suites) for info on testing Drush commands.\n */\n\nclass PolicyCommands extends DrushCommands\n{\n /**\n * Prevent catastrophic braino. Note that this file has to be local to the\n * machine that initiates the sql:sync command.\n *\n * @throws \\Exception\n */\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: SqlSyncCommands::SYNC)]\n public function sqlSyncValidate(CommandData $commandData)\n {\n if ($commandData->input()->getArgument('destination') == '@prod') {\n throw new \\Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__]));\n }\n }\n\n /**\n * Limit rsync operations to production site.\n */\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: RsyncCommands::RSYNC)]\n public function rsyncValidate(CommandData $commandData)\n {\n if (preg_match(\"/^@prod/\", $commandData->input()->getArgument('destination'))) {\n throw new \\Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));\n }\n }\n\n /**\n * Unauthorized may not execute updates.\n */\n #[CLI\\Hook(type: HookManager::ARGUMENT_VALIDATOR, target: UpdateDBCommands::UPDATEDB)]\n public function validateUpdateDb(CommandData $commandData)\n {\n if (!$commandData->input()->getOption('secret') == 'mysecret') {\n throw new \\Exception(dt('UpdateDb command requires a secret token per site policy.'));\n }\n }\n\n #[CLI\\Hook(type: HookManager::OPTION_HOOK, target: UpdateDBCommands::UPDATEDB)]\n #[CLI\\Option(name: 'secret', description: 'A required token else user may not run updatedb command.')]\n public function optionsetUpdateDb($options = ['secret' => self::REQ])\n {\n }\n}\n
"},{"location":"examples/SiteAliasAlterCommands.php/","title":"SiteAliasAlterCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\AnnotationData;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareInterface;\nuse Consolidation\\SiteAlias\\SiteAliasManagerAwareTrait;\nuse Drush\\Attributes as CLI;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\n\n/**\n * Load this example by using the --include option - e.g. `drush --include=/path/to/drush/examples`\n */\nclass SiteAliasAlterCommands extends DrushCommands implements SiteAliasManagerAwareInterface\n{\n use SiteAliasManagerAwareTrait;\n\n /**\n * A few example alterations to site aliases.\n */\n #[CLI\\Hook(type: HookManager::PRE_INITIALIZE, target: '*')]\n public function alter(InputInterface $input, AnnotationData $annotationData)\n {\n $self = $this->siteAliasManager()->getSelf();\n if ($self->isRemote()) {\n // Always pass along ssh keys.\n if (!$self->has('ssh.options')) {\n // Don't edit the alias - edit the general config service instead.\n $this->getConfig()->set('ssh.options', '-o ForwardAgent=yes');\n }\n\n // Change the SSH user.\n $input->setOption('remote-user', 'mw2');\n\n // Test to see if specific environment really exists in wildcard\n // aliases, but only if the target is a specific host.\n $host = $self->get('host');\n if (preg_match('#\\.myserver.com$#', $host)) {\n $ip = gethostbyname($host);\n // If the return value of gethostbyname equals its input parameter,\n // that indicates failure.\n if ($host == $ip) {\n $aliasName = $self->name();\n throw new \\Exception(\"The alias $aliasName refers to an environment that does not exist.\");\n }\n }\n }\n }\n}\n
"},{"location":"examples/SyncViaHttpCommands.php/","title":"SyncViaHttpCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Consolidation\\AnnotatedCommand\\CommandData;\nuse Consolidation\\AnnotatedCommand\\Hooks\\HookManager;\nuse Drush\\Attributes as CLI;\nuse Drush\\Commands\\DrushCommands;\nuse Drush\\Commands\\sql\\SqlSyncCommands;\nuse Drush\\Drush;\nuse Drush\\Exec\\ExecTrait;\nuse Symfony\\Component\\Filesystem\\Filesystem;\n\n/**\n * Load this commandfile using the --include option - e.g. `drush --include=/path/to/drush/examples`\n */\n\nclass SyncViaHttpCommands extends DrushCommands\n{\n /**\n * When a hook extends a command with additional options, it must\n * implement declare those option(s) in a @hook option like this one. Doing so will add\n * the option to the help text for the modified command, and will also\n * allow the new option to be specified on the command line. Without\n * this, Drush will fail with an error when a user attempts to use\n * an unknown option.\n */\n #[CLI\\Hook(type: HookManager::OPTION_HOOK, target: SqlSyncCommands::SYNC)]\n #[CLI\\Option(name: 'http-sync', description: 'Copy the database via http instead of rsync. Value is the url that the existing database dump can be found at.')]\n #[CLI\\Option(name: 'http-sync-user', description: 'Username for the protected directory containing the sql dump.')]\n #[CLI\\Option(name: 'http-sync-password', description: 'Password for the same directory.')]\n public function optionsetSqlSync()\n {\n }\n\n /**\n * During the pre hook, determine if the http-sync option has been\n * specified. If it has been, then disable the normal ssh + rsync\n * dump-and-transfer that sql-sync usually does, and transfer the\n * database dump via an http download.\n */\n #[CLI\\Hook(type: HookManager::PRE_COMMAND_HOOK, target: SqlSyncCommands::SYNC)]\n public function preSqlSync(CommandData $commandData)\n {\n $sql_dump_download_url = $commandData->input()->getOption('http-sync');\n if (!empty($sql_dump_download_url)) {\n $user = $commandData->input()->getOption('http-sync-user');\n $password = $commandData->input()->getOption('http-sync-password');\n $source_dump_file = $this->downloadFile($sql_dump_download_url, $user, $password);\n $commandData->input()->setOption('target-dump', $source_dump_file);\n $commandData->input()->setOption('no-dump', true);\n $commandData->input()->setOption('no-sync', true);\n }\n }\n\n /**\n * Downloads a file.\n *\n * Optionally uses user authentication, using either wget or curl, as available.\n */\n protected function downloadFile($url, $user = false, $password = false, $destination = false, $overwrite = true)\n {\n static $use_wget;\n if ($use_wget === null) {\n $use_wget = ExecTrait::programExists('wget');\n }\n\n $destination_tmp = drush_tempnam('download_file');\n if ($use_wget) {\n $args = ['wget', '-q', '--timeout=30'];\n if ($user && $password) {\n $args = array_merge($args, [\"--user=$user\", \"--password=$password\", '-O', $destination_tmp, $url]);\n } else {\n $args = array_merge($args, ['-O', $destination_tmp, $url]);\n }\n } else {\n $args = ['curl', '-s', '-L', '--connect-timeout 30'];\n if ($user && $password) {\n $args = array_merge($args, ['--user', \"$user:$password\", '-o', $destination_tmp, $url]);\n } else {\n $args = array_merge($args, ['-o', $destination_tmp, $url]);\n }\n }\n $process = Drush::process($args);\n $process->mustRun();\n\n if (!Drush::simulate()) {\n if (!drush_file_not_empty($destination_tmp) && $file = @file_get_contents($url)) {\n @file_put_contents($destination_tmp, $file);\n }\n if (!drush_file_not_empty($destination_tmp)) {\n // Download failed.\n throw new \\Exception(dt(\"The URL !url could not be downloaded.\", ['!url' => $url]));\n }\n }\n if ($destination) {\n $fs = new Filesystem();\n $fs->rename($destination_tmp, $destination, $overwrite);\n return $destination;\n }\n return $destination_tmp;\n }\n}\n
"},{"location":"examples/XkcdCommands.php/","title":"XkcdCommands.php","text":"<?php\n\nnamespace Drush\\Commands;\n\nuse Drush\\Attributes as CLI;\nuse Drush\\Exec\\ExecTrait;\n\n/**\n * Run these commands using the --include option - e.g. `drush --include=/path/to/drush/examples xkcd`\n *\n * For an example of a Drush extension with tests for Drush:\n * - https://github.com/drush-ops/example-drush-extension\n */\n\nclass XkcdCommands extends DrushCommands\n{\n use ExecTrait;\n\n /**\n * Retrieve and display xkcd cartoons.\n */\n #[CLI\\Command(name: 'xkcd:fetch', aliases: ['xkcd'])]\n #[CLI\\Option(name: 'search', description: 'Optional argument to retrieve the cartoons matching an index number, keyword search or \"random\". If omitted the latest cartoon will be retrieved.')]\n #[CLI\\Option(name: 'image-viewer', description: 'Command to use to view images (e.g. xv, firefox). Defaults to \"display\" (from ImageMagick).')]\n #[CLI\\Option(name: 'google-custom-search-api-key', description: 'Google Custom Search API Key, available from https://code.google.com/apis/console/. Default key limited to 100 queries/day globally.')]\n #[CLI\\Usage(name: 'drush xkcd', description: 'Retrieve and display the latest cartoon.')]\n #[CLI\\Usage(name: 'drush xkcd sandwich', description: 'Retrieve and display cartoons about sandwiches.')]\n #[CLI\\Usage(name: 'drush xkcd 123 --image-viewer=eog', description: 'Retrieve and display cartoon #123 in eog.')]\n #[CLI\\Usage(name: 'drush xkcd random --image-viewer=firefox', description: 'Retrieve and display a random cartoon in Firefox.')]\n public function fetch($search = null, $options = ['image-viewer' => 'open', 'google-custom-search-api-key' => 'AIzaSyDpE01VDNNT73s6CEeJRdSg5jukoG244ek'])\n {\n $this->doFetch($search, $options);\n }\n\n /**\n * @param $search\n * @param array $options\n * @throws \\Exception\n */\n protected function doFetch($search, array $options): void\n {\n if (empty($search)) {\n $this->startBrowser('http://xkcd.com');\n } elseif (is_numeric($search)) {\n $this->startBrowser('http://xkcd.com/' . $search);\n } elseif ($search == 'random') {\n $xkcd_response = @json_decode(file_get_contents('http://xkcd.com/info.0.json'));\n if (!empty($xkcd_response->num)) {\n $this->startBrowser('http://xkcd.com/' . rand(1, $xkcd_response->num));\n }\n } else {\n // This uses an API key with a limited number of searches per.\n $search_response = @json_decode(file_get_contents('https://www.googleapis.com/customsearch/v1?key=' . $options['google-custom-search-api-key'] . '&cx=012652707207066138651:zudjtuwe28q&q=' . $search));\n if (!empty($search_response->items)) {\n foreach ($search_response->items as $item) {\n $this->startBrowser($item->link);\n }\n } else {\n throw new \\Exception(dt('The search failed or produced no results.'));\n }\n }\n }\n}\n
"},{"location":"examples/example.drush.yml/","title":"drush.yml","text":"#\n# A minimalist Drush config file.\n# See https://www.drush.org/latest/using-drush-configuration/ for lots more documentation.\n#\n\n# Preflight configuration.\ndrush:\ninclude:\n- '${env.HOME}/.drush/commands'\n- /usr/share/drush/commands\npaths:\nconfig:\n# Load additional config files. Is silently skipped if not found. Filename must be drush.yml\n- ${env.HOME}/.drush/config/drush.yml\nalias-path:\n- '${env.HOME}/.drush/sites'\n- /etc/drush/sites\n\n# Global options.\noptions:\n# Specify the base_url that should be used when generating links.\n# uri: 'http://example.com/subdir'\n\n# Command-specific options.\ncommand:\nsql:\ndump:\noptions:\n# Uncomment to omit cache and similar tables (including during a sql:sync).\n# structure-tables-key: common\n\n# Non-options.\nssh:\n# Specify options to pass to ssh. The default is to prohibit\n# password authentication, and is included here, so you may add additional\n# parameters without losing the default configuration.\noptions: '-o PasswordAuthentication=no'\n# This string is valid for Bash shell. Override in case you need something different. See https://github.com/drush-ops/drush/issues/3816.\npipefail: 'set -o pipefail; '\n
"},{"location":"examples/example.prompt.sh/","title":"prompt.sh","text":"# -*- mode: shell-script; mode: flyspell-prog; ispell-local-dictionary: \"american\" -*-\n#\n# Example PS1 prompt.\n#\n# Note: This file does a lot, and is designed for Bash. If you want to show the\n# currently set alias in your prompt, use the first 2 values below as an example.\n\n# This section can be used for the POWERLEVEL9K theme for Oh My Zsh.\n#FILE=\"${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$\"\n#POWERLEVEL9K_CUSTOM_DRUSH=\"[ -r $FILE ] && cat $FILE\"\n#POWERLEVEL9K_CUSTOM_DRUSH_BACKGROUND=\"green\"\n#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs custom_drush)\n\n#\n# Note that your Bash session must already have the __git_ps1 function available.\n# Typically this is provided by git-prompt.sh, see instructions for downloading\n# and including this file here:\n# https://github.com/git/git/blob/10.x/contrib/completion/git-prompt.sh\n#\n# Features:\n#\n# Displays Git repository and Drush alias status in your prompt.\n\n__drush_ps1() {\nf=\"${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$\"\nif [ -f $f ]\nthen\n__DRUPAL_SITE=$(cat \"$f\")\nelse\n__DRUPAL_SITE=\"$DRUPAL_SITE\"\nfi\n\n# Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a\n# __drush_ps1_colorize_alias() function for color hints in your Drush PS1\n# prompt. See example.prompt.sh for an example implementation.\nif [ -n \"${__DRUPAL_SITE-}\" ] && [ -n \"${DRUSH_PS1_SHOWCOLORHINTS-}\" ]; then\n__drush_ps1_colorize_alias\n fi\n\n[[ -n \"$__DRUPAL_SITE\" ]] && printf \"${1:- (%s)}\" \"$__DRUPAL_SITE\"\n}\n\nif [ -n \"$(type -t __git_ps1)\" ] && [ \"$(type -t __git_ps1)\" = function ] && [ \"$(type -t __drush_ps1)\" ] && [ \"$(type -t __drush_ps1)\" = function ]; then\n\n# This line enables color hints in your Drush prompt. Modify the below\n# __drush_ps1_colorize_alias() to customize your color theme.\nDRUSH_PS1_SHOWCOLORHINTS=true\n\n# Git offers various prompt customization options as well as seen in\n# https://github.com/git/git/blob/10.x/contrib/completion/git-prompt.sh.\n# Adjust the following lines to enable the corresponding features:\n#\nGIT_PS1_SHOWDIRTYSTATE=true\nGIT_PS1_SHOWUPSTREAM=auto\n # GIT_PS1_SHOWSTASHSTATE=true\n# GIT_PS1_SHOWUNTRACKEDFILES=true\nGIT_PS1_SHOWCOLORHINTS=true\n\n# The following line sets your bash prompt according to this example:\n#\n# username@hostname ~/working-directory (git-branch)[@drush-alias] $\n#\n# See http://ss64.com/bash/syntax-prompt.html for customization options.\nexport PROMPT_COMMAND='__git_ps1 \"\\u@\\h \\w\" \"$(__drush_ps1 \"[%s]\") \\\\\\$ \"'\n\n# PROMPT_COMMAND is used in the example above rather than PS1 because neither\n# Git nor Drush color hints are compatible with PS1. If you don't want color\n# hints, however, and prefer to use PS1, you can still do so by commenting out\n# the PROMPT_COMMAND line above and uncommenting the PS1 line below:\n#\n# export PS1='\\u@\\h \\w$(__git_ps1 \" (%s)\")$(__drush_ps1 \"[%s]\")\\$ '\n\n__drush_ps1_colorize_alias() {\nif [[ -n ${ZSH_VERSION-} ]]; then\nlocal COLOR_BLUE='%F{blue}'\nlocal COLOR_CYAN='%F{cyan}'\nlocal COLOR_GREEN='%F{green}'\nlocal COLOR_MAGENTA='%F{magenta}'\nlocal COLOR_RED='%F{red}'\nlocal COLOR_WHITE='%F{white}'\nlocal COLOR_YELLOW='%F{yellow}'\nlocal COLOR_NONE='%f'\nelse\n# Using \\[ and \\] around colors is necessary to prevent issues with\n# command line editing/browsing/completion.\nlocal COLOR_BLUE='\\[\\e[94m\\]'\nlocal COLOR_CYAN='\\[\\e[36m\\]'\nlocal COLOR_GREEN='\\[\\e[32m\\]'\nlocal COLOR_MAGENTA='\\[\\e[35m\\]'\nlocal COLOR_RED='\\[\\e[91m\\]'\nlocal COLOR_WHITE='\\[\\e[37m\\]'\nlocal COLOR_YELLOW='\\[\\e[93m\\]'\nlocal COLOR_NONE='\\[\\e[0m\\]'\nfi\n\n# Customize your color theme below.\ncase \"$__DRUPAL_SITE\" in\n*.live|*.prod) local ENV_COLOR=\"$COLOR_RED\" ;;\n*.stage|*.test) local ENV_COLOR=\"$COLOR_YELLOW\" ;;\n*.local) local ENV_COLOR=\"$COLOR_GREEN\" ;;\n*) local ENV_COLOR=\"$COLOR_BLUE\" ;;\nesac\n\n__DRUPAL_SITE=\"${ENV_COLOR}${__DRUPAL_SITE}${COLOR_NONE}\"\n}\n\nfi\n
"},{"location":"examples/example.site.yml/","title":"site.yml","text":"#\n# A minimalist Drush site alias file.\n# See https://www.drush.org/latest/site-aliases/ for lots more documentation.\n#\n# File: self.site.yml\nlive:\nhost: www.domain.com\nuser: www-admin\nroot: /other/path/to/drupal\nuri: http://www.example.com\nssh:\noptions: '-p 100'\npaths:\ndrush-script: '/path/to/drush'\nenv-vars:\nPATH: /bin:/usr/bin:/home/www-admin/.composer/vendor/bin\nDRUPAL_ENV: live\ncommand:\nsite:\ninstall:\noptions:\nadmin-password: 'secret-secret'\nstage:\nhost: stage.domain.com\nuser: www-admin\nroot: /other/path/to/drupal\nuri: http://stage.example.com\n
"},{"location":"examples/git-bisect.example.sh/","title":"git-bisect.sh","text":"#!/usr/bin/env sh\n\n#\n# Git bisect is a helpful way to discover which commit an error\n# occurred in. This example file gives simple instructions for\n# using git bisect with Drush to quickly find erroneous commits\n# in Drush commands or Drupal modules, presuming that you can\n# trigger the error condition via Drush (e.g. using `drush php-eval`).\n#\n# Follow these simple steps:\n#\n# $ git bisect start\n# $ git bisect bad # Tell git that the current commit does not work\n# $ git bisect good bcadd5a # Tell drush that the commithash 12345 worked fine\n# $ git bisect run mytestscript.sh\n#\n# 'git bisect run' will continue to call 'git bisect good' and 'git bisect bad',\n# based on whether the script's exit code was 0 or 1, respectively.\n#\n# Replace 'mytestscript.sh' in the example above with a custom script that you\n# write yourself. Use the example script at the end of this document as a\n# guide. Replace the example command with one that calls the Drush command\n# that you would like to test, and replace the 'grep' string with a value\n# that appears when the error exists in the commit, but does not appear when\n# commit is okay.\n#\n# If you are using Drush to test Drupal or an external Drush module, use:\n#\n# $ git bisect run drush mycommand --strict=2\n#\n# This presumes that there is one or more '[warning]' or '[error]'\n# messages emitted when there is a problem, and no warnings or errors\n# when the commit is okay. Omit '--strict=2' to ignore warnings, and\n# signal failure only when 'error' messages are emitted.\n#\n# If you need to test for an error condition explicitly, to find errors\n# that do not return any warning or error log messages on their own, you\n# can use the Drush php-eval command to force an error when `myfunction()`\n# returns FALSE. Replace 'myfunction()' with the name of an appropriate\n# function in your module that can be used to detect the error condition\n# you are looking for.\n#\n# $ git bisect run drush ev 'if(!myfunction()) { return drush_set_error(\"ERR\"); }'\n#\ndrush mycommand --myoption 2>&1 | grep -q 'string that indicates there was a problem'\nif [ $? == 0 ] ; then\nexit 1\nelse\nexit 0\nfi\n
"},{"location":"examples/helloworld.script/","title":"Helloworld.script","text":"<?php\n\n//\n// This example demonstrates how to write a drush\n// script. These scripts are run with the php:script command.\n//\nuse Drush\\Drush;\n\n$this->output()->writeln(\"Hello world!\");\n$this->output()->writeln(\"The extra options/arguments to this command were:\");\n$this->output()->writeln(print_r($extra, true));\n\n//\n// We can check which site was bootstrapped via\n// the '@self' alias, which is defined only if\n// there is a bootstrapped site.\n//\n$self = Drush::aliasManager()->getSelf();;\nif (!$self->hasRoot()) {\n $this->output()->writeln('No bootstrapped site.');\n}\nelse {\n $this->output()->writeln('The following site is bootstrapped:');\n $this->output()->writeln(print_r($self->legacyRecord(), true));\n}\n
"},{"location":"generators/all/","title":"All generators","text":"Tip
Press the / key to Search for a command. Or use your browser's Find in Page feature.
- composer
- controller
- field
- hook
- install-file
- javascript
- layout
- module
- phpstorm-meta
- readme
- render-element
- service-provider
- single-directory-component
- drush:alias-file
- drush:command-file
- drush:generator
- drush:symfony-command
- entity:bundle-class
- entity:configuration
- entity:content
- form:config
- form:confirm
- form:simple
- misc:apache-virtual-host
- misc:nginx-virtual-host
- plugin:action
- plugin:block
- plugin:ckeditor
- plugin:condition
- plugin:constraint
- plugin:entity-reference-selection
- plugin:field:formatter
- plugin:field:type
- plugin:field:widget
- plugin:filter
- plugin:manager
- plugin:menu-link
- plugin:migrate:destination
- plugin:migrate:process
- plugin:migrate:source
- plugin:queue-worker
- plugin:rest-resource
- plugin:views:argument-default
- plugin:views:field
- plugin:views:style
- service:access-checker
- service:breadcrumb-builder
- service:cache-context
- service:custom
- service:event-subscriber
- service:logger
- service:middleware
- service:param-converter
- service:path-processor
- service:request-policy
- service:response-policy
- service:route-subscriber
- service:theme-negotiator
- service:twig-extension
- service:uninstall-validator
- test:browser
- test:kernel
- test:nightwatch
- test:unit
- test:webdriver
- theme
- theme:settings
- yml:breakpoints
- yml:links:action
- yml:links:contextual
- yml:links:menu
- yml:links:task
- yml:migration
- yml:module-libraries
- yml:permissions
- yml:routing
- yml:services
- yml:theme-libraries
"},{"location":"generators/composer/","title":"composer","text":"Generates a composer.json file
"},{"location":"generators/composer/#examples","title":"Examples","text":" drush generate composer
. Generates a composer.json file
"},{"location":"generators/composer/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/composer/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/composer/#aliases","title":"Aliases","text":""},{"location":"generators/controller/","title":"controller","text":"Generates a controller
"},{"location":"generators/controller/#examples","title":"Examples","text":" drush generate controller
. Generates a controller
"},{"location":"generators/controller/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/controller/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_alias-file/","title":"drush:alias-file","text":"Generates a Drush site alias file.
"},{"location":"generators/drush_alias-file/#examples","title":"Examples","text":" drush generate drush:alias-file
. Generates a Drush site alias file.
"},{"location":"generators/drush_alias-file/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_alias-file/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_alias-file/#aliases","title":"Aliases","text":""},{"location":"generators/drush_command-file/","title":"drush:command-file","text":"Generates a Drush command file.
"},{"location":"generators/drush_command-file/#examples","title":"Examples","text":" drush generate drush:command-file
. Generates a Drush command file.
"},{"location":"generators/drush_command-file/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_command-file/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_command-file/#aliases","title":"Aliases","text":""},{"location":"generators/drush_generator/","title":"drush:generator","text":"Generates Drush generator
"},{"location":"generators/drush_generator/#examples","title":"Examples","text":" drush generate drush:generator
. Generates Drush generator
"},{"location":"generators/drush_generator/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_generator/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_generator/#aliases","title":"Aliases","text":""},{"location":"generators/drush_symfony-command/","title":"drush:symfony-command","text":"Generates Symfony console command
"},{"location":"generators/drush_symfony-command/#examples","title":"Examples","text":" drush generate drush:symfony-command
. Generates Symfony console command
"},{"location":"generators/drush_symfony-command/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/drush_symfony-command/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/drush_symfony-command/#aliases","title":"Aliases","text":""},{"location":"generators/entity_bundle-class/","title":"entity:bundle-class","text":" 11.0+
Generate a bundle class for a content entity.
"},{"location":"generators/entity_bundle-class/#examples","title":"Examples","text":" drush generate entity:bundle-class
. Generate a bundle class for a content entity.
"},{"location":"generators/entity_bundle-class/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/entity_bundle-class/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/entity_bundle-class/#aliases","title":"Aliases","text":""},{"location":"generators/entity_configuration/","title":"entity:configuration","text":"Generates configuration entity
"},{"location":"generators/entity_configuration/#examples","title":"Examples","text":" drush generate entity:configuration
. Generates configuration entity
"},{"location":"generators/entity_configuration/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/entity_configuration/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/entity_configuration/#aliases","title":"Aliases","text":""},{"location":"generators/entity_content/","title":"entity:content","text":"Generates content entity
"},{"location":"generators/entity_content/#examples","title":"Examples","text":" drush generate entity:content
. Generates content entity
"},{"location":"generators/entity_content/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/entity_content/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/entity_content/#aliases","title":"Aliases","text":""},{"location":"generators/field/","title":"field","text":"Generates a field
"},{"location":"generators/field/#examples","title":"Examples","text":" drush generate field
. Generates a field
"},{"location":"generators/field/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/field/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_config/","title":"form:config","text":"Generates a configuration form
"},{"location":"generators/form_config/#examples","title":"Examples","text":" drush generate form:config
. Generates a configuration form
"},{"location":"generators/form_config/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/form_config/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_config/#aliases","title":"Aliases","text":""},{"location":"generators/form_confirm/","title":"form:confirm","text":"Generates a confirmation form
"},{"location":"generators/form_confirm/#examples","title":"Examples","text":" drush generate form:confirm
. Generates a confirmation form
"},{"location":"generators/form_confirm/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/form_confirm/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_confirm/#aliases","title":"Aliases","text":""},{"location":"generators/form_simple/","title":"form:simple","text":"Generates simple form
"},{"location":"generators/form_simple/#examples","title":"Examples","text":" drush generate form:simple
. Generates simple form
"},{"location":"generators/form_simple/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/form_simple/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/form_simple/#aliases","title":"Aliases","text":""},{"location":"generators/hook/","title":"hook","text":"Generates a hook
"},{"location":"generators/hook/#examples","title":"Examples","text":" drush generate hook
. Generates a hook
"},{"location":"generators/hook/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/hook/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/install-file/","title":"install-file","text":"Generates an install file
"},{"location":"generators/install-file/#examples","title":"Examples","text":" drush generate install-file
. Generates an install file
"},{"location":"generators/install-file/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/install-file/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/javascript/","title":"javascript","text":"Generates Drupal JavaScript file
"},{"location":"generators/javascript/#examples","title":"Examples","text":" drush generate javascript
. Generates Drupal JavaScript file
"},{"location":"generators/javascript/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/javascript/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/layout/","title":"layout","text":"Generates a layout
"},{"location":"generators/layout/#examples","title":"Examples","text":" drush generate layout
. Generates a layout
"},{"location":"generators/layout/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/layout/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/misc_apache-virtual-host/","title":"misc:apache-virtual-host","text":"Generates an Apache site configuration file
"},{"location":"generators/misc_apache-virtual-host/#examples","title":"Examples","text":" drush generate misc:apache-virtual-host
. Generates an Apache site configuration file
"},{"location":"generators/misc_apache-virtual-host/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/misc_apache-virtual-host/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/misc_apache-virtual-host/#aliases","title":"Aliases","text":""},{"location":"generators/misc_nginx-virtual-host/","title":"misc:nginx-virtual-host","text":"Generates an Nginx site configuration file
"},{"location":"generators/misc_nginx-virtual-host/#examples","title":"Examples","text":" drush generate misc:nginx-virtual-host
. Generates an Nginx site configuration file
"},{"location":"generators/misc_nginx-virtual-host/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/misc_nginx-virtual-host/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/misc_nginx-virtual-host/#aliases","title":"Aliases","text":""},{"location":"generators/module/","title":"module","text":"Generates Drupal module
"},{"location":"generators/module/#examples","title":"Examples","text":" drush generate module
. Generates Drupal module
"},{"location":"generators/module/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/module/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/phpstorm-meta/","title":"phpstorm-meta","text":"Generates PhpStorm metadata
"},{"location":"generators/phpstorm-meta/#examples","title":"Examples","text":" drush generate phpstorm-meta
. Generates PhpStorm metadata
"},{"location":"generators/phpstorm-meta/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/phpstorm-meta/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_action/","title":"plugin:action","text":"Generates action plugin
"},{"location":"generators/plugin_action/#examples","title":"Examples","text":" drush generate plugin:action
. Generates action plugin
"},{"location":"generators/plugin_action/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_action/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_action/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_block/","title":"plugin:block","text":"Generates block plugin
"},{"location":"generators/plugin_block/#examples","title":"Examples","text":" drush generate plugin:block
. Generates block plugin
"},{"location":"generators/plugin_block/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_block/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_block/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_ckeditor/","title":"plugin:ckeditor","text":"Generates CKEditor plugin
"},{"location":"generators/plugin_ckeditor/#examples","title":"Examples","text":" drush generate plugin:ckeditor
. Generates CKEditor plugin
"},{"location":"generators/plugin_ckeditor/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_ckeditor/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_ckeditor/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_condition/","title":"plugin:condition","text":"Generates condition plugin
"},{"location":"generators/plugin_condition/#examples","title":"Examples","text":" drush generate plugin:condition
. Generates condition plugin
"},{"location":"generators/plugin_condition/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_condition/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_condition/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_constraint/","title":"plugin:constraint","text":"Generates constraint plugin
"},{"location":"generators/plugin_constraint/#examples","title":"Examples","text":" drush generate plugin:constraint
. Generates constraint plugin
"},{"location":"generators/plugin_constraint/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_constraint/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_constraint/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_entity-reference-selection/","title":"plugin:entity-reference-selection","text":"Generates entity reference selection plugin
"},{"location":"generators/plugin_entity-reference-selection/#examples","title":"Examples","text":" drush generate plugin:entity-reference-selection
. Generates entity reference selection plugin
"},{"location":"generators/plugin_entity-reference-selection/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_entity-reference-selection/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_entity-reference-selection/#aliases","title":"Aliases","text":" - entity-reference-selection
"},{"location":"generators/plugin_field_formatter/","title":"plugin:field:formatter","text":"Generates field formatter plugin
"},{"location":"generators/plugin_field_formatter/#examples","title":"Examples","text":" drush generate plugin:field:formatter
. Generates field formatter plugin
"},{"location":"generators/plugin_field_formatter/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_field_formatter/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_field_formatter/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_field_type/","title":"plugin:field:type","text":"Generates field type plugin
"},{"location":"generators/plugin_field_type/#examples","title":"Examples","text":" drush generate plugin:field:type
. Generates field type plugin
"},{"location":"generators/plugin_field_type/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_field_type/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_field_type/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_field_widget/","title":"plugin:field:widget","text":"Generates field widget plugin
"},{"location":"generators/plugin_field_widget/#examples","title":"Examples","text":" drush generate plugin:field:widget
. Generates field widget plugin
"},{"location":"generators/plugin_field_widget/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_field_widget/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_field_widget/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_filter/","title":"plugin:filter","text":"Generates filter plugin
"},{"location":"generators/plugin_filter/#examples","title":"Examples","text":" drush generate plugin:filter
. Generates filter plugin
"},{"location":"generators/plugin_filter/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_filter/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_filter/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_manager/","title":"plugin:manager","text":"Generates plugin manager
"},{"location":"generators/plugin_manager/#examples","title":"Examples","text":" drush generate plugin:manager
. Generates plugin manager
"},{"location":"generators/plugin_manager/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_manager/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_menu-link/","title":"plugin:menu-link","text":"Generates menu-link plugin
"},{"location":"generators/plugin_menu-link/#examples","title":"Examples","text":" drush generate plugin:menu-link
. Generates menu-link plugin
"},{"location":"generators/plugin_menu-link/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_menu-link/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_menu-link/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_migrate_destination/","title":"plugin:migrate:destination","text":"Generates migrate destination plugin
"},{"location":"generators/plugin_migrate_destination/#examples","title":"Examples","text":" drush generate plugin:migrate:destination
. Generates migrate destination plugin
"},{"location":"generators/plugin_migrate_destination/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_migrate_destination/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_migrate_destination/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_migrate_process/","title":"plugin:migrate:process","text":"Generates migrate process plugin
"},{"location":"generators/plugin_migrate_process/#examples","title":"Examples","text":" drush generate plugin:migrate:process
. Generates migrate process plugin
"},{"location":"generators/plugin_migrate_process/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_migrate_process/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_migrate_process/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_migrate_source/","title":"plugin:migrate:source","text":"Generates migrate source plugin
"},{"location":"generators/plugin_migrate_source/#examples","title":"Examples","text":" drush generate plugin:migrate:source
. Generates migrate source plugin
"},{"location":"generators/plugin_migrate_source/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_migrate_source/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_migrate_source/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_queue-worker/","title":"plugin:queue-worker","text":"Generates queue worker plugin
"},{"location":"generators/plugin_queue-worker/#examples","title":"Examples","text":" drush generate plugin:queue-worker
. Generates queue worker plugin
"},{"location":"generators/plugin_queue-worker/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_queue-worker/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_queue-worker/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_rest-resource/","title":"plugin:rest-resource","text":"Generates rest resource plugin
"},{"location":"generators/plugin_rest-resource/#examples","title":"Examples","text":" drush generate plugin:rest-resource
. Generates rest resource plugin
"},{"location":"generators/plugin_rest-resource/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_rest-resource/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_rest-resource/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_views_argument-default/","title":"plugin:views:argument-default","text":"Generates views default argument plugin
"},{"location":"generators/plugin_views_argument-default/#examples","title":"Examples","text":" drush generate plugin:views:argument-default
. Generates views default argument plugin
"},{"location":"generators/plugin_views_argument-default/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_views_argument-default/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_views_argument-default/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_views_field/","title":"plugin:views:field","text":"Generates views field plugin
"},{"location":"generators/plugin_views_field/#examples","title":"Examples","text":" drush generate plugin:views:field
. Generates views field plugin
"},{"location":"generators/plugin_views_field/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_views_field/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_views_field/#aliases","title":"Aliases","text":""},{"location":"generators/plugin_views_style/","title":"plugin:views:style","text":"Generates views style plugin
"},{"location":"generators/plugin_views_style/#examples","title":"Examples","text":" drush generate plugin:views:style
. Generates views style plugin
"},{"location":"generators/plugin_views_style/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/plugin_views_style/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/plugin_views_style/#aliases","title":"Aliases","text":""},{"location":"generators/readme/","title":"readme","text":"Generates README file
"},{"location":"generators/readme/#examples","title":"Examples","text":" drush generate readme
. Generates README file
"},{"location":"generators/readme/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/readme/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/render-element/","title":"render-element","text":"Generates Drupal render element
"},{"location":"generators/render-element/#examples","title":"Examples","text":" drush generate render-element
. Generates Drupal render element
"},{"location":"generators/render-element/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/render-element/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service-provider/","title":"service-provider","text":"Generates a service provider
"},{"location":"generators/service-provider/#examples","title":"Examples","text":" drush generate service-provider
. Generates a service provider
"},{"location":"generators/service-provider/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service-provider/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_access-checker/","title":"service:access-checker","text":"Generates an access checker service
"},{"location":"generators/service_access-checker/#examples","title":"Examples","text":" drush generate service:access-checker
. Generates an access checker service
"},{"location":"generators/service_access-checker/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_access-checker/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_access-checker/#aliases","title":"Aliases","text":""},{"location":"generators/service_breadcrumb-builder/","title":"service:breadcrumb-builder","text":"Generates a breadcrumb builder service
"},{"location":"generators/service_breadcrumb-builder/#examples","title":"Examples","text":" drush generate service:breadcrumb-builder
. Generates a breadcrumb builder service
"},{"location":"generators/service_breadcrumb-builder/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_breadcrumb-builder/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_breadcrumb-builder/#aliases","title":"Aliases","text":""},{"location":"generators/service_cache-context/","title":"service:cache-context","text":"Generates a cache context service
"},{"location":"generators/service_cache-context/#examples","title":"Examples","text":" drush generate service:cache-context
. Generates a cache context service
"},{"location":"generators/service_cache-context/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_cache-context/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_cache-context/#aliases","title":"Aliases","text":""},{"location":"generators/service_custom/","title":"service:custom","text":"Generates a custom Drupal service
"},{"location":"generators/service_custom/#examples","title":"Examples","text":" drush generate service:custom
. Generates a custom Drupal service
"},{"location":"generators/service_custom/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_custom/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_custom/#aliases","title":"Aliases","text":""},{"location":"generators/service_event-subscriber/","title":"service:event-subscriber","text":"Generates an event subscriber
"},{"location":"generators/service_event-subscriber/#examples","title":"Examples","text":" drush generate service:event-subscriber
. Generates an event subscriber
"},{"location":"generators/service_event-subscriber/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_event-subscriber/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_event-subscriber/#aliases","title":"Aliases","text":""},{"location":"generators/service_logger/","title":"service:logger","text":"Generates a logger service
"},{"location":"generators/service_logger/#examples","title":"Examples","text":" drush generate service:logger
. Generates a logger service
"},{"location":"generators/service_logger/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_logger/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_logger/#aliases","title":"Aliases","text":""},{"location":"generators/service_middleware/","title":"service:middleware","text":"Generates a middleware
"},{"location":"generators/service_middleware/#examples","title":"Examples","text":" drush generate service:middleware
. Generates a middleware
"},{"location":"generators/service_middleware/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_middleware/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_middleware/#aliases","title":"Aliases","text":""},{"location":"generators/service_param-converter/","title":"service:param-converter","text":"Generates a param converter service
"},{"location":"generators/service_param-converter/#examples","title":"Examples","text":" drush generate service:param-converter
. Generates a param converter service
"},{"location":"generators/service_param-converter/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_param-converter/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_param-converter/#aliases","title":"Aliases","text":""},{"location":"generators/service_path-processor/","title":"service:path-processor","text":"Generates a path processor service
"},{"location":"generators/service_path-processor/#examples","title":"Examples","text":" drush generate service:path-processor
. Generates a path processor service
"},{"location":"generators/service_path-processor/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_path-processor/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_path-processor/#aliases","title":"Aliases","text":""},{"location":"generators/service_request-policy/","title":"service:request-policy","text":"Generates a request policy service
"},{"location":"generators/service_request-policy/#examples","title":"Examples","text":" drush generate service:request-policy
. Generates a request policy service
"},{"location":"generators/service_request-policy/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_request-policy/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_request-policy/#aliases","title":"Aliases","text":""},{"location":"generators/service_response-policy/","title":"service:response-policy","text":"Generates a response policy service
"},{"location":"generators/service_response-policy/#examples","title":"Examples","text":" drush generate service:response-policy
. Generates a response policy service
"},{"location":"generators/service_response-policy/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_response-policy/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_response-policy/#aliases","title":"Aliases","text":""},{"location":"generators/service_route-subscriber/","title":"service:route-subscriber","text":"Generates a route subscriber
"},{"location":"generators/service_route-subscriber/#examples","title":"Examples","text":" drush generate service:route-subscriber
. Generates a route subscriber
"},{"location":"generators/service_route-subscriber/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_route-subscriber/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_route-subscriber/#aliases","title":"Aliases","text":""},{"location":"generators/service_theme-negotiator/","title":"service:theme-negotiator","text":"Generates a theme negotiator
"},{"location":"generators/service_theme-negotiator/#examples","title":"Examples","text":" drush generate service:theme-negotiator
. Generates a theme negotiator
"},{"location":"generators/service_theme-negotiator/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_theme-negotiator/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_theme-negotiator/#aliases","title":"Aliases","text":""},{"location":"generators/service_twig-extension/","title":"service:twig-extension","text":"Generates Twig extension service
"},{"location":"generators/service_twig-extension/#examples","title":"Examples","text":" drush generate service:twig-extension
. Generates Twig extension service
"},{"location":"generators/service_twig-extension/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_twig-extension/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_twig-extension/#aliases","title":"Aliases","text":""},{"location":"generators/service_uninstall-validator/","title":"service:uninstall-validator","text":"Generates a uninstall validator service
"},{"location":"generators/service_uninstall-validator/#examples","title":"Examples","text":" drush generate service:uninstall-validator
. Generates a uninstall validator service
"},{"location":"generators/service_uninstall-validator/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/service_uninstall-validator/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/service_uninstall-validator/#aliases","title":"Aliases","text":""},{"location":"generators/single-directory-component/","title":"single-directory-component","text":"Generates Drupal SDC theme component
"},{"location":"generators/single-directory-component/#examples","title":"Examples","text":" drush generate single-directory-component
. Generates Drupal SDC theme component
"},{"location":"generators/single-directory-component/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/single-directory-component/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/single-directory-component/#aliases","title":"Aliases","text":""},{"location":"generators/test_browser/","title":"test:browser","text":"Generates a browser based test
"},{"location":"generators/test_browser/#examples","title":"Examples","text":" drush generate test:browser
. Generates a browser based test
"},{"location":"generators/test_browser/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_browser/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_browser/#aliases","title":"Aliases","text":""},{"location":"generators/test_kernel/","title":"test:kernel","text":"Generates a kernel based test
"},{"location":"generators/test_kernel/#examples","title":"Examples","text":" drush generate test:kernel
. Generates a kernel based test
"},{"location":"generators/test_kernel/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_kernel/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_kernel/#aliases","title":"Aliases","text":""},{"location":"generators/test_nightwatch/","title":"test:nightwatch","text":"Generates a nightwatch test
"},{"location":"generators/test_nightwatch/#examples","title":"Examples","text":" drush generate test:nightwatch
. Generates a nightwatch test
"},{"location":"generators/test_nightwatch/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_nightwatch/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_nightwatch/#aliases","title":"Aliases","text":""},{"location":"generators/test_unit/","title":"test:unit","text":"Generates a unit test
"},{"location":"generators/test_unit/#examples","title":"Examples","text":" drush generate test:unit
. Generates a unit test
"},{"location":"generators/test_unit/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_unit/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_unit/#aliases","title":"Aliases","text":""},{"location":"generators/test_webdriver/","title":"test:webdriver","text":"Generates a test that supports JavaScript
"},{"location":"generators/test_webdriver/#examples","title":"Examples","text":" drush generate test:webdriver
. Generates a test that supports JavaScript
"},{"location":"generators/test_webdriver/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/test_webdriver/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/test_webdriver/#aliases","title":"Aliases","text":""},{"location":"generators/theme/","title":"theme","text":"Generates Drupal theme
"},{"location":"generators/theme/#examples","title":"Examples","text":" drush generate theme
. Generates Drupal theme
"},{"location":"generators/theme/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/theme/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/theme_settings/","title":"theme:settings","text":"Generates Drupal theme-settings.php file
"},{"location":"generators/theme_settings/#examples","title":"Examples","text":" drush generate theme:settings
. Generates Drupal theme-settings.php file
"},{"location":"generators/theme_settings/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/theme_settings/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_breakpoints/","title":"yml:breakpoints","text":"Generates a breakpoints yml file
"},{"location":"generators/yml_breakpoints/#examples","title":"Examples","text":" drush generate yml:breakpoints
. Generates a breakpoints yml file
"},{"location":"generators/yml_breakpoints/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_breakpoints/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_breakpoints/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_action/","title":"yml:links:action","text":"Generates a links.action yml file
"},{"location":"generators/yml_links_action/#examples","title":"Examples","text":" drush generate yml:links:action
. Generates a links.action yml file
"},{"location":"generators/yml_links_action/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_action/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_action/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_contextual/","title":"yml:links:contextual","text":"Generates links.contextual yml file
"},{"location":"generators/yml_links_contextual/#examples","title":"Examples","text":" drush generate yml:links:contextual
. Generates links.contextual yml file
"},{"location":"generators/yml_links_contextual/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_contextual/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_contextual/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_menu/","title":"yml:links:menu","text":"Generates a links.menu yml file
"},{"location":"generators/yml_links_menu/#examples","title":"Examples","text":" drush generate yml:links:menu
. Generates a links.menu yml file
"},{"location":"generators/yml_links_menu/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_menu/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_menu/#aliases","title":"Aliases","text":""},{"location":"generators/yml_links_task/","title":"yml:links:task","text":"Generates a links.task yml file
"},{"location":"generators/yml_links_task/#examples","title":"Examples","text":" drush generate yml:links:task
. Generates a links.task yml file
"},{"location":"generators/yml_links_task/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_links_task/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_links_task/#aliases","title":"Aliases","text":""},{"location":"generators/yml_migration/","title":"yml:migration","text":"Generates a migration yml file
"},{"location":"generators/yml_migration/#examples","title":"Examples","text":" drush generate yml:migration
. Generates a migration yml file
"},{"location":"generators/yml_migration/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_migration/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_migration/#aliases","title":"Aliases","text":""},{"location":"generators/yml_module-libraries/","title":"yml:module-libraries","text":"Generates module libraries yml file
"},{"location":"generators/yml_module-libraries/#examples","title":"Examples","text":" drush generate yml:module-libraries
. Generates module libraries yml file
"},{"location":"generators/yml_module-libraries/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_module-libraries/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_module-libraries/#aliases","title":"Aliases","text":""},{"location":"generators/yml_permissions/","title":"yml:permissions","text":"Generates a permissions yml file
"},{"location":"generators/yml_permissions/#examples","title":"Examples","text":" drush generate yml:permissions
. Generates a permissions yml file
"},{"location":"generators/yml_permissions/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_permissions/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_permissions/#aliases","title":"Aliases","text":" - permissions
- permissions.yml
"},{"location":"generators/yml_routing/","title":"yml:routing","text":"Generates a routing yml file
"},{"location":"generators/yml_routing/#examples","title":"Examples","text":" drush generate yml:routing
. Generates a routing yml file
"},{"location":"generators/yml_routing/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_routing/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_routing/#aliases","title":"Aliases","text":""},{"location":"generators/yml_services/","title":"yml:services","text":"Generates a services yml file
"},{"location":"generators/yml_services/#examples","title":"Examples","text":" drush generate yml:services
. Generates a services yml file
"},{"location":"generators/yml_services/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_services/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_services/#aliases","title":"Aliases","text":""},{"location":"generators/yml_theme-libraries/","title":"yml:theme-libraries","text":"Generates theme libraries yml file
"},{"location":"generators/yml_theme-libraries/#examples","title":"Examples","text":" drush generate yml:theme-libraries
. Generates theme libraries yml file
"},{"location":"generators/yml_theme-libraries/#options","title":"Options","text":" - --answer=ANSWER. Answer to generator question.
- --destination=DESTINATION. Path to a base directory for file writing.
- --dry-run. Output the generated code but not save it to file system.
"},{"location":"generators/yml_theme-libraries/#topics","title":"Topics","text":" - Instructions on creating your own Drush Generators. (docs:generators)
"},{"location":"generators/yml_theme-libraries/#aliases","title":"Aliases","text":""}]}
\ No newline at end of file
diff --git a/12.x/site-aliases/index.html b/12.x/site-aliases/index.html
index 240c25e341..59093931e8 100644
--- a/12.x/site-aliases/index.html
+++ b/12.x/site-aliases/index.html
@@ -5392,22 +5392,17 @@