Skip to main content

Drupal Console is sunsetted

Sunset - Drupal Console

A couple of months ago Drupal Console was declared end of life

Launched at the same time as Drupal 8  back in 2016, Drupal Console was installed via composer. e.g.

composer  require-dev drupal/console:~1.0 --pr

Trying that with a stable Drupal 8 site you may run into problems. e.g.

Your requirements could not be resolved to an installable set of packages.

 Problem 1
   - drupal/console[1.0.0-alpha1, ..., 1.9.10] require composer/installers ~1.0 -> found composer/installers[v1.0.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.0).
   - drupal/console[1.0.0-beta4, ..., 1.0.0-beta5] require php ^5.6 || ^7.0 -> your php version (8.3.6) does not satisfy that requirement.
   - drupal/console[1.0.0-rc1, ..., 1.9.4] require php ^5.5.9 || ^7.0 -> your php version (8.3.6) does not satisfy that requirement.
   - Root composer.json requires drupal/console ~1.0 -> satisfiable by drupal/console[1.0.0-alpha1, ..., 1.9.10].

One issue appears to be the requirement for either PHP 5 or php 7. Since Drupal 10 was released in December 2022, php 8.1 has been a minimum requirement.

Drupal Console offered a Command line interface similar to those found with other php frameworks such as the console command in Symfony and Laravel's Artisan Console

With over 15 million downloads, support for 19 languages, and 200+ commands Drupal Console had many useful features. One useful command particular was especially useful for creating boilerplate code called generate.

One of the most useful features for developers is the ability to generate module scaffolding with a single command. By using generate:module, you can quickly build a new custom module, including files such as .info.yml, .module, and more. For instance drupal generate:controller can generate a controller file, removing the work of creating these files manually.

https://www.xandermar.com/drupal/web-development/cms-tools/2025/05/16/drupal-console.html

Aonther useful feature of Drupal console generate was for creating the boilerplate code for creating custom entities:

e.g. drupal generate:entity:content

https://www.alansaunders.co.uk/blog/creating-custom-content-entities-drupal-89

Old Kid on the Block

Many of the features of Drupal Console's generate command have now made their way to Drush. Drupal Shell predates Drupal Console.  Prior to Drupal 8 and the introduction of Composer, Drush was the recommended command line tool for installing and updating modules, not least as it was often quicker than using a web interface. However, it has evolved and since Drush 9 (Drupal 8) with the help of Chi-Tech's Drupal Code Generator Library, supports boilerplate code generation as well. 

e.g To generate a custom entity you can use the following command drush generate content-entity

Add new comment

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.