Collaboration Efforts Between Drupal Console and Drush

April 13, 2016

The Drupal Console team has reviewed a proposal from a Drush co-maintainer, detailed in the blog post "Modern Command Line Tools for Drupal." The team supports collaborating on shared libraries that can benefit any Drupal CLI project. However, it does not endorse creating a new "Drupalism" or a unique method for writing commands based on symfony/console.

The Case Against a New Standard

standards xkcdImage source

Establishing a new standard is unnecessary when a well-defined and widely accepted one already exists. The symfony/console component documentation provides clear guidance on Creating a basic Command, explaining how to create command classes.

Drupal Console adheres to this standard, which has been tested for years and is broadly supported by the Symfony and PHP communities. Numerous CLI tools utilize the symfony/console component, including:

For a comprehensive list of projects using symfony/console components, visit the official site.

By adopting Symfony standards, the project can fully participate in the broader PHP community, build connections, and encourage Symfony developers to contribute to Drupal. This approach helps reduce the isolation of the Drupal ecosystem and allows new developers with symfony/console experience to contribute more easily to Drupal CLI projects.

Conversely, creating a new "Drupal" method for writing commands, as proposed, would likely have the opposite effect by further isolating the community. This path also introduces a new learning curve and technical debt, including the burden of maintaining a separate standard.

It is more beneficial to embrace and collaborate with existing communities, leveraging the "learn once, apply everywhere" principle.

Clarification on Annotations

The use of annotations has been a topic of discussion for some time, as documented in the issue and the related pull request .

The Drupal Console team's proposal was to use annotations specifically for defining Drupal-only features, not for creating an entirely new command structure.

A Proposal for Drush and Drupal Console Collaboration

A previous collaborative effort was made in the pull request Unfortunately, this did not gain significant traction and has not been merged. The Drush team subsequently opted to work on a different pull request,

Regarding shared efforts and collaboration, the Drupal Console project is working to decouple its features into distinct components. The advantages of extracting code into libraries include:

  • Isolating features to make packages small and easier to maintain.
  • Reusing components between different Drupal CLI projects to avoid code duplication.
  • Providing functionality in packages outside of Drupal Console Core and Contrib modules.
  • Proposing improved features for upstream inclusion in the symfony/console component.

In conclusion, the Drupal Console team remains open to collaborating with the Drush team. There is a strong conviction that using the standards defined by the Symfony community is the best path forward. This approach helps to reduce the isolation of the Drupal community while aligning with the modern PHP practices introduced in Drupal 8.

Related articles:

Thanks to the contributors who helped review and refine this article.