Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module allows you to easily create Drush commands that run batch operations, displaying a clean progress bar in the command line interface. It helps monitor batch progress without cluttering the output with individual operation logs.

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
10 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Slowing

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