PHPackages                             jigarius/drall - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. jigarius/drall

ActiveLibrary[CLI &amp; Console](/categories/cli)

jigarius/drall
==============

Drall is a command-line utility to run drush on multi-site Drupal installations.

v4.2.0(3mo ago)36112.1k↓44.3%5[2 issues](https://github.com/jigarius/drall/issues)GPL-3.0-onlyPHPPHP &gt;= 8.2CI passing

Since Mar 1Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/jigarius/drall)[ Packagist](https://packagist.org/packages/jigarius/drall)[ Docs](https://github.com/jigarius/drall)[ RSS](/packages/jigarius-drall/feed)WikiDiscussions 5.x Synced 1w ago

READMEChangelog (10)Dependencies (24)Versions (32)Used By (0)

Drall
=====

[](#drall)

Drall is a tool that helps run [drush](https://www.drush.org/) commands on multi-site Drupal installations.

> One command to *drush* them all. — [Jigarius](https://jigarius.com/about)

A big thanks and shout-out to [Symetris](https://symetris.ca/) for sponsoring the initial development of Drall.

Preview
-------

[](#preview)

[![A preview of using Drall](misc/demo.gif)](misc/demo.gif)

Installation
------------

[](#installation)

Drall is listed on [Packagist.org](https://packagist.org/packages/jigarius/drall). Thus, it can easily be installed using `composer` as follows:

```
composer require jigarius/drall

```

Placeholders
------------

[](#placeholders)

Drall's functioning depends on its *Placeholders*. Here's how Drall works under the hood:

1. Receive a command, say, `drall exec -- COMMAND`.
2. Ensure there is a `@@placeholder` in `COMMAND`.
3. Run `COMMAND` after replacing `@@placeholder` with site-specific values.
4. Display the result.

Drall supports the following placeholders:

### @@dir

[](#dir)

This placeholder is replaced with the name of the site's directory under Drupal's `sites` directory. These are the values of the `$sites` array usually defined in `sites.php`.

```
# @@dir is replaced with "ralph" and "leo".
$sites['raphael.com'] = 'ralph';
$sites['leonardo.com'] = 'leo';
```

**Note:** In older versions of Drall, this was called `@@uri`.

### @@key

[](#key)

This placeholder is replaced with keys of the `$sites` array.

```
# @@key is replaced with "raphael.com", "raphael.local" and "leonardo.com".
$sites['raphael.com'] = 'ralph';
$sites['raphael.local'] = 'ralph';
$sites['leonardo.com'] = 'leo';
```

### @@ukey

[](#ukey)

This placeholder is replaced with unique keys of the `$sites` array. If a site has multiple keys, the last one is used as its unique key.

```
# @@key is replaced with "raphael.local" and "leonardo.local".
$sites['raphael.com'] = 'ralph';
$sites['raphael.local'] = 'ralph';
$sites['leonardo.com'] = 'leo';
$sites['leonardo.local'] = 'leo';
```

### @@site

[](#site)

This placeholder is replaced with the first part of the site's alias.

```
# @@site is replaced with "@ralph" and "@leo".
@ralph.local
@leo.local
```

**Note:** This placeholder only works for sites with Drush aliases.

Commands
--------

[](#commands)

To see a list of commands offered by Drall, run `drall list`. If you feel lost, run `drall help` or continue reading this documentation.

### exec

[](#exec)

With `exec` you can execute drush as well as non-drush commands on multiple sites in your Drupal installation.

In Drall 2.x there were 2 exec commands. These are now unified into a single command just like version 1.x.

- `drall exec:drush ...` is now `drall exec -- drush ...`
- `drall exec:shell ...` is now `drall exec -- ...`

#### Interrupting a command

[](#interrupting-a-command)

When the [PCNTL](https://www.php.net/manual/en/book.pcntl.php) is available, `drall exec` detects a signal to interrupt (usually `ctrl + c`) and then stops after processing the sites that are currently being processed. This prevents the current command from terminating abruptly. However, if a second interrupt signal is received, then Drall stops immediately.

In the absence of PCNTL, sending a signal to interrupt will make Drall stop immediately, i.e. it won't wait for the currently running commands to finish. In such situations, running `drall stop` stops all `drall exec` commands. This command should be treated as Plan B and the use of PCNTL is recommended.

#### Drush with @@dir

[](#drush-with-dir)

In this method, the `--uri` option is sent to `drush`.

```
drall exec -- drush --uri=@@dir core:status
```

If it is a Drush command and no valid `@@placeholder` are present, then `--uri=@@dir` is automatically added after each occurrence of `drush`.

```
# Raw drush command (no placeholders)
drall exec -- drush core:status
# Command that is executed (placeholders injected)
drall exec -- drush --uri=@@dir core:status
```

##### Example

[](#example)

```
drall exec -- drush core:status
```

#### Drush with @@site

[](#drush-with-site)

In this method, a site alias is sent to `drush`.

```
drall exec -- drush @@site.local core:status
```

##### Example

[](#example-1)

```
drall exec -- drush @@site.local core:status
```

#### Non-drush commands

[](#non-drush-commands)

You can run non-Drush commands the same was as you run Drush commands. Just make sure that the command has valid placeholders.

**Important:** You can only use any one of the possible placeholders, e.g. if you use `@@dir` and you cannot mix it with `@@site`.

##### Example: Shell command

[](#example-shell-command)

```
drall exec -- cat web/sites/@@uri/settings.local.php
```

##### Example: Multiple commands

[](#example-multiple-commands)

```
drall exec "drush @@site.dev updb -y && drush @@site.dev cim -y && drush @@site.dev cr"
```

#### Options

[](#options)

For the `drall exec` command, all Drall options must be set right after `drall exec`. Additionally, `--` must be used before the command to be executed. Following are some examples of running `drush` with options.

```
# Drall is --verbose
drall exec --verbose -- drush core:status
# Drush is verbose
drall exec -- drush --verbose core:status
# Both Drall and Drush are --verbose
drall exec --verbose -- drush --verbose core:status
```

In summary, the syntax is as follows:

```
drall exec [DRALL-OPTIONS] -- drush [DRUSH-OPTIONS]
```

Besides the global options, the `exec` command supports the following options.

#### --continue-on-failure

[](#--continue-on-failure)

By default, Drall stops as soon as any item fails. Use this option to continue processing remaining items even if one or more items fail.

```
drall exec --continue-on-failure -- drush deploy
```

Drall still exits with a non-zero exit code if any item failed.

#### --interval

[](#--interval)

This option makes Drall wait for `n` seconds after processing each item.

```
drall exec --interval=3 -- drush core:rebuild
```

Such an interval cannot be used when using a multiple workers.

#### --workers

[](#--workers)

Say you have 100 sites in a Drupal installation. By default, Drall runs commands on these sites one after the other. To speed up the execution, you can ask Drall to execute multiple commands in parallel. You can specify the number of workers with the `--workers=n` option, where `n` is the number of processes you want to run in parallel.

Please keep in mind that the performance of the workers depends on your resources available on the computer executing the command. If you have low memory, and you run Drall with 4 workers, performance might suffer. Also, some operations need to be executed sequentially to avoid competition and conflict between the Drall workers.

##### Example: Parallel execution

[](#example-parallel-execution)

The command below launches 3 instances of Drall to run `core:rebuild` command.

```
drall exec --workers=3 -- drush core:rebuild
```

When a worker runs out of work, it terminates automatically.

#### --batch-file

[](#--batch-file)

When specified, Drall tracks the current task in the specified JSON file. This allows long tasks to be resumed after they're interrupted.

The batch file only remembers the items that were finished. It doesn't remember anything related to the command being executed or other Drall options. Thus, you can resume the batch with new options or even with a completely new command!

You can use the `FileBatch` class to read the JSON batch file and do fun things like generate reports.

##### Example: Resumable batches

[](#example-resumable-batches)

For example, you're running `drush updatedb` on a hundred websites and for some reason, you need to stop the command and resume it after a few minutes.

```
# When the command is run for the first time, the batch file is created.
drall exec --batch-file=~/drall.deploy.json -- drush updatedb -y
# When the command is run for the second time, the batch file is detected
# and the batch can be resumed.
drall exec --batch-file=~/drall.deploy.json -- "drush updatedb -y && drush core:rebuild"
```

#### --no-progress

[](#--no-progress)

By default, Drall displays a progress bar that indicates how many sites have been processed and how many are remaining. In verbose mode, this progress indicator also displays the time elapsed.

However, the progress display that can mess with some terminals or scripts which don't handle backspace characters. For these environments, the progress bar can be disabled using the `--no-progress` option.

##### Example: Hide progress bar

[](#example-hide-progress-bar)

```
drall exec --no-progress -- drush core:rebuild
```

#### --dry-run

[](#--dry-run)

This option allows you to see what commands will be executed without actually executing them.

##### Example: Dry run

[](#example-dry-run)

```
drall exec --dry-run --group=bluish -- drush core:status
```

### site:directories

[](#sitedirectories)

Get a list of all available site directory names in the Drupal installation. All `sites/*` directories containing a `settings.php` file are treated as individual sites.

#### Example: Usage

[](#example-usage)

```
drall site:directories
```

The output can then be iterated with scripts.

#### Example: Iterating

[](#example-iterating)

```
for site in $(drall site:directories)
do
  echo "Current site: $site";
done;
```

### site:keys

[](#sitekeys)

Get a list of all keys in `$sites`. Usually, these are site URIs.

#### Example: Usage

[](#example-usage-1)

```
drall site:keys
```

The output can then be iterated with scripts.

#### Example: Iterating

[](#example-iterating-1)

```
for site in $(drall site:keys)
do
  echo "Current site: $site";
done;
```

### site:aliases

[](#sitealiases)

Get a list of site aliases.

#### Example: Usage

[](#example-usage-2)

```
drall site:aliases
```

The output can then be iterated with scripts.

#### Example: Iterating

[](#example-iterating-2)

```
for site in $(drall site:aliases)
do
  echo "Current site: $site";
done;
```

Global options
--------------

[](#global-options)

This section covers some options that are supported by all `drall` commands.

### --group

[](#--group)

Specify the target site group. See the section *site groups* for more information on site groups.

```
drall exec --group=GROUP -- drush core:status --field=site
```

If `--group` is not set, then the Drall uses the environment variable `DRALL_GROUP`, if it is set.

### --filter

[](#--filter)

Filter placeholder values with an expression. This is helpful for running commands on specific sites.

```
# Run only on the "leo" site.
drall exec --filter=leo -- drush core:status
# Run only on "leo" and "ralph" sites.
drall exec --filter="leo||ralph" -- drush core:status
```

For more on using filter expressions, refer to the documentation on [consolidation/filter-via-dot-access-data](https://github.com/consolidation/filter-via-dot-access-data).

### --offset

[](#--offset)

An integer indicating the number of items to skip from the beginning. If a negative integer is provided it is treated as `n - o`, where `n` is the total number of items and `o` is the offset.

```
# Skip the first 2 items.
drall exec --offset=2 -- drush core:status
# Start at the 2nd item from the end.
drall exec --offset=-2 -- drush core:status
```

### --limit

[](#--limit)

An integer indicating the number of items to process.

```
# Stop after the first 2 items.
drall exec --limit=2 -- drush core:status
# Skip the first 2 items and process 3 items thereafter. Thus, only items
# 3, 4, 5 are processed.
drall exec --offset=2 --limit=3 -- drush core:status
```

### --silent

[](#--silent)

Display no output.

### --quiet

[](#--quiet)

Display very less output.

### --verbose

[](#--verbose)

Display verbose output.

### --debug

[](#--debug)

Display very verbose output.

Auto-detect sites
-----------------

[](#auto-detect-sites)

Drall uses `sites.php` to determine site hostnames and site directories. However, some Drupal multi-site installations do not have a `sites.php`because the content of the `DRUPAL/sites` directory changes very frequently, thereby making it difficult to maintain such a `sites.php`.

In such cases, it is suggested that you create a `DRUPAL/sites/sites.php`based on [misc/example.sites.php](misc/example.sites.php) so that Drall can detect the sites in your Drupal installation. Additionally, in this file you can alter the `$sites` variable based on your requirements.

Site groups
-----------

[](#site-groups)

Drall allows you to group your sites so that you can run commands on these groups using the `--group` option.

### Drall groups with site aliases

[](#drall-groups-with-site-aliases)

In a site alias definition file, you can assign site aliases to one or more groups like this:

```
# File: tnmt.site.yml
local:
  root: /opt/drupal/web
  uri: https://tmnt.com/
  # ...
  drall:
    groups:
      - cartoon
      - action
```

This puts the alias `@tnmt.local` in the `cartoon` and `action` groups.

### Drall groups with sites.\*.php

[](#drall-groups-with-sitesphp)

If your project doesn't use site aliases, you can still group your sites using one or more `sites.GROUP.php` files like this:

```
# File: sites.bluish.php
$sites['donnie.drall.local'] = 'donnie';
$sites['leo.drall.local'] = 'leo';
```

This puts the sites `donnie` and `leo` in a group named `bluish`.

Development
-----------

[](#development)

Here's how you can set up a local dev environment.

- Clone the `https://github.com/jigarius/drall` repository.
    - Use a branch as per your needs.
- Run `docker compose up -d`.
- Run `docker compose start`.
- Run `make ssh` to launch a shell in the Drupal container.
- Run `make provision`.
- Run `drall --version` to test the setup.
- Run `make lint` to run linter.
- Run `make test` to run tests.

You should now be able to `make ssh` and then run `drall`. A multi-site Drupal installation should be present at `/opt/drupal`. Oh! And Drall should be present at `/opt/drall`.

### Hosts

[](#hosts)

To access the dev sites in your browser, add the following line to your hosts file. It is usually located at `/etc/hosts`. This is completely optional, so do this only if you need it.

```
127.0.0.1 tmnt.drall.local donnie.drall.local leo.drall.local mikey.drall.local ralph.drall.local

```

The sites should then be available at:

- [tmnt.drall.local](http://tmnt.drall.local/)
- [donnie.drall.local](http://donnie.drall.local/)
- [leo.drall.local](http://leo.drall.local/)
- [mikey.drall.local](http://mikey.drall.local/)
- [ralph.drall.local](http://ralph.drall.local/)

Acknowledgements
----------------

[](#acknowledgements)

- Thanks, [Symetris](https://symetris.ca/) for funding the initial development.
- Thanks, [Jigarius](https://jigarius.com/about) (that's me) for spending evenings and weekends to make this tool possible.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance83

Actively maintained with recent releases

Popularity43

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~62 days

Recently: every ~6 days

Total

25

Last Release

70d ago

Major Versions

1.1.0-rc1 → 2.0.0-rc12022-03-27

1.x-dev → 2.0.02023-04-04

2.x-dev → 3.0.0-alpha12023-05-14

3.x-dev → v4.0.0-alpha12024-12-28

4.x-dev → 5.x-dev2026-03-31

PHP version history (5 changes)0.5.0PHP &gt;= 7.4

2.1.0PHP ^8

3.0.0-alpha1PHP &gt;= 8.1

v4.0.0-alpha1PHP &gt;= 8.3

v4.2.0PHP &gt;= 8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f87453d7bf90e5e9171782240b2b3d84f33f5b343183d9f4abd9ce4ece6fb0a?d=identicon)[jigarius](/maintainers/jigarius)

---

Top Contributors

[![jigarius](https://avatars.githubusercontent.com/u/4286033?v=4)](https://github.com/jigarius "jigarius (311 commits)")

---

Tags

clidrupaldrushphpsymfony-consoleclidrupalDrushdrall

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jigarius-drall/health.svg)

```
[![Health](https://phpackages.com/badges/jigarius-drall/health.svg)](https://phpackages.com/packages/jigarius-drall)
```

###  Alternatives

[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M17](/packages/pantheon-systems-terminus)[drush/drush

Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.

2.4k59.5M766](/packages/drush-drush)[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B13.1k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k348.7M10.3k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k260.6M359](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.1k18.5M386](/packages/wp-cli-wp-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
