Drupal is a registered trademark of Dries Buytaert

The Drush Batch Bar module is for easily build Drush commands with batch operations and a clean Symfony progress bar output for the CLI.

The goal is to easily monitor the progress of batches triggered via Drush commands, just like you would in the Back Office, without cluttering the output by logging each operation.

This module also makes it easy to run batches through Drush commands.

Installation

Drush Batch Bar is installed in the usual way. See Installing contributed modules.

Prerequisites

This module requires PHP 8.4 or higher. As a result, it is compatible with Drupal core versions ^10.4 or ^11.1, which support PHP 8.4.
By extension, you'll also need Drush 12 or Drush 13, depending on your Drupal version.

How to use:

Create a Drush command as you normally would, and in the command method, instantiate a new DrushBatchCommands() and execute it.

$batch = new DrushBatchCommands(
  operations: $batch_operations,
  title: 'Title of your batch',
  finished: [
    DrushBatchBar::class,
    'finished',
  ]
);

$batch->execute();

You can override the finished parameter with your own custom method if needed.

If necessary, you can also create your own Batch class by extending DrushBatchBar.

In it, you can define your custom operations, the process method (where you can call parent::initProcess($context);), and the finish method.

Example

You can see implementation examples in the drush_batch_bar_example module.

You can also enable this module and run the commands to see the outputs.

Similar Project

Drush Batch Progressbar
This module will show progress bar on batch execution from drush.
Differences:
  • Not compatible with Drush >=12
  • Not compatible with Drupal >=10.2
  • Multiline progressbar
  • Batch native logger

Activity

Total releases
3
First release
Jul 2025
Latest release
5 months ago
Release cadence
25 days
Stability
33% stable

Release Timeline

Releases

Version Type Release date
1.0.0 Stable Sep 7, 2025
1.0.0-beta2 Pre-release Jul 19, 2025
1.0.0-beta1 Pre-release Jul 19, 2025