Writing Command Line Tools for Drupal 8 Modules

moshe weitzman

The Drush and Drupal Console maintainers have launched a new collaborative effort to unify the way that command line tools should be written for Drupal 8 modules. This session will walk through the process of writing a scripting interface for your Drupal 8 modules code using an object-oriented API built on top of Symfony Console components. Once your command is finished and working, it can be used from either Drupal Console or Drush.

Going beyond the implementation of the CLI tool, this session will also provide guidance on best practices for decoupled module development. Breaking functionality into loosely coupled components facilitates the implementation of the command line interfaces and web services, and will additionally keep your code more maintainable, and easier to read and understand.

The presenters will also describe the latest progress and future plans for collaborative efforts between the teams to use common implementations for some of the more complex common functions, such as site installation, configuration management, and bootstrapping, and what you can do to help make the future of commandline tools easier for everyone to manage.

Session Track

Coding and Development

Experience Level


Drupal Version

When & Where

Tuesday, 10 May, 2016 - 13:00 to 14:00
265-266 [FFW]