Drush's Final Act

I propose a new Drupal core initiative which aims to rapidly introduce a full featured CLI. I see two initial steps:

  1. Reroll, discuss, and merge CLI entry point in Drupal Core. This wonderful MR by dpi brings a minimal Symfony Console application into Drupal. It introduces a drupal application whose inital commands are those which currently ship with core - InstallCommand, RecipeCommand, etc. It also provides way for extensions and vendor packages to add commands.
  2. Add a dependency on Drush and bring in as many commands as the product managers deem appropriate. I opened a demo MR which targets the above MR. Note how simple it is to bring in a Drush command - a tagged service in core.services.yml is all it takes. Drush recently converted all its commands to vanilla Console format so that makes it trivial to incorporate them into drupal.

Followups

  1. Incorporate the more exotic commands which bootstrap Drupal or execute subcommands. Those are updatedb, config:import, deploy:*, sql:*, etc. I think these commands should be rewritten for Drupal core.
  2. Start copying commands from Drush to Drupal core so they can be maintained using the core process. My reasoning for not doing this from the start is that this adds a lot of code review and tests. I think it is vital for Drupal from a competitive perspective to get to a full featured CLI quickly. Initially keeping the commands in Drush helps this goal.

Generous Review

We’ve had a few attempts at a CLI in Drupal core over the years. These attempts stalled due to debates about command name or bootstrap details or numerous other bikeshed details. Let’s please not to do that again. Drupal is fighting to stay relevant. It is not helpful to hold up the whole feature on trivial details. Please review generously and if you call for a change, create/update an MR as well.

Drush’s Final Act

My end goal here is the death of Drush. It has served an incredibly long and useful life. Its death will be its most impactful and generous act.

Along the way, we may lose some niceties like Drush config and Site aliases. Platforms already have solutions for replacements aliases such as Lagoon (Amazee), Terminus (Pantheon), acli (Acquia), etc. Others should check out Pssh or Fabric or our a Drush-centric solution ash by @jonpugh

Until the death is complete, it is trivial to run Drush commands along with Drupal commands. Sites will have years to convert their scripts to use drupal instead. Drush support will continue through this transition.