Ten things you need to know about Drupal Console

Ten things you need to know about Drupal Console

default avatar
Thought byRay Saltini
April 03, 2015
FFW Blog - illustration

We know there are at least ten things everyone awaiting Drupal 8 should know about the Drupal Console project. So here they are.

Have some different questions about Drupal Console? Tweet them to us at @ffwagency @jmolivas or me @raysaltini

1 - Why is FFW supporting the Drupal Console project and who is @jmolivas?

We believe in open source and we believe in the Drupal community. We also believe in helping our enterprise clients achieve outstanding results from their investment in Drupal adoption. Drupal 8 should have a toolset that is specifically developed around its technology stack to get the most out of its incredible potential. We believe the Drupal Console project is a key part of that toolset that will help the entire community achieve outstanding results.

Jesus Manuel Olivas, @jmolivas, is the Drupal Console project lead. In May 2014 we hired him as our Drupal 8 Solutions Engineer to work full time on the Drupal Console as its lead contributor. He spends most of his time maintaining and expanding the project, writing and speaking about it, and gathering input from community members on how it can be used to help individuals and organizations adopt Drupal 8. He's also trained more than a hundred developers in our Introduction to Symfony2/Getting Ready for Drupal 8 series at the last three Drupalcons in Bogota, Amsterdam and Austin. We're offering the training again at Drupalcon LA.

2 - What exactly is the Drupal Console?

The Drupal Console is, at this time, a suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.

Similar tools include:

  • Module Builder: (Generates Drupal 6, 7, or 8 module scaffolding)
  • Drupal Module Upgrader: (Converts modules from Drupal 7 to Drupal 8; generates static help file with links to relevant change records)
  • Drupal 8 Tools: (Drupal code generator written in bash)
  • Drush (Interact with Drupal installation via CLI, create aliases, create custom commands)

3 - What makes Drupal Console unique?

From the ground up Drupal Console is using the modern PHP practices introduced into Drupal 8, including object-oriented PHP. The Drupal Console isn't a Drupal module, but was built with the Symfony Console Component and other libraries, such as Twig, to generate PHP, YAML, and other file types used in Drupal 8 module development. It is a tool designed for anyone using or planning to use Drupal 8. At the moment, it is used via a CLI, but there are plans to make it accessible through the Drupal administrative interface. Drupal Console works with Drupal 8, and because of the nature of its code base and use of modern PHP, will not be ported to work with Drupal 6 or 7, but instead plans to support Drupal versions from 8 onward.

4 - How does Drupal Console differ from Drupal Module Upgrader?

Drupal Module Upgrader takes a Drupal 7 module and attempts to port it to Drupal 8. While it generates files like Drupal Console does, Drupal Console generates module scaffolding and code based on a series of interactive prompts, instead of analyzing an existing module and converting it to work in Drupal 8.

5 - How does Drupal Console compare to Drush?

There are many similarities between these two tools, but the main difference is how it was built, using an object-oriented architecture and Symfony components. Read more about how the tools are similar in these two blog posts:

6 - What kinds of things can you do with Drupal Console?

Drupal Console provides a number of commands for creating module scaffolding and boilerplate code. For any command, you will be asked a series of questions about what you want. In the case of module scaffolding, files are created and inside these files, classes—complete with namespacing and use statements—are created for you with the naming convention you specified in the command's prompts.

Go to this post for a full list of all the things you can do with the Drupal Console.

7 - Who is the intended audience for the Drupal Console?

Any developer who will be responsible for writing custom code in Drupal 8. Any organization that will benefit from its vast potential.

And because Drupal Console generates boilerplate code—working example code—for the many different types of entities and objects in Drupal 8 core, this tool can be particularly useful for anyone looking to learn or teach Drupal 8 development. The goal of the project is to make a tool for people developing in and learning Drupal 8 that is relatively easy to use.

As such, the following groups in particular could find this tool advantageous to add to their learning Drupal 8 toolkit:

  • Enterprises and other organizations to reduce development time and reduce custom development risk factors.
  • Drupal 8 module maintainers and developers to speed up development and testing.
  • Drupal trainers and consultants providing Drupal 8 developer training.
  • All new Drupal Developers.

As mentioned, there are plans to include a non-CLI interface, to make the tool even more accessible to all site administrators of Drupal 8.

8 - Is it ready now? Who can I ask about it?

Yes. You can send your questions to us here at FFW or send questions or comments through Twitter at the following accounts: @drupalconsole@jmolivas, @raysaltini, or @ffwagency.

You can download and learn how to set up the project at drupalconsole.com.

9 - What kind of help does the project need?

  • Install, provide feedback, create issues and ask for new features
  • Contribute to development
  • Contribute to documentation
  • Provide translations
  • Provide module integration (like Webprofiler)
  • Spread the word and love about it by mentioning @drupalconsole & #drupalconsole on Twitter

10 - What features are planned for development?

  • Verbose code output for learning and leveraging docblocks
  • Complete config:import, site:status, and few a few other commands.
  • Import/export content between Drupal installations
  • Site aliases
  • Generate dummy content, probably using PHP Faker library or Default Content project.
  • Add a GUI for Drupal Console as an alternative to the CLI. This could be especially useful for site builders wanting to generate dummy content or issue site commands without needing to use the command line. It could also be used for code generation in the form of a downloadable compressed file.

Additional Resources Mentioned in this Podcast

Project links

Libraries or projects

Blog posts

Bonus!

Check out this Drupal Podcast in Spanish, hosted by Jesus Manuel Olivas and David Flores, two of the maintainers of Drupal Console.

FFW Drupal 8 Solutions Engineer Jesus Manuel Olivas (@jmolivas) provided a wealth of information and resources for this post. Thanks also goes out to drupalize.me and Amber Matz for their great podcast about the Drupal Console project. We've reused much of their podcast notes for this post. We're grateful for their support. Please be sure to listen to the podcast!

Editied by Ray Saltini, FFW Drupal Evangelist