Learing How to Generate My Own Drupal Console Commands

Posted on Fri, 11/15/2019
1 minute read

For the past couple years I've been using Koality Theme Generator which is a fork of Mediacurrent's own Drupal theme generator. It has been totally great! and has made theming in Drupal for us much better. Our forked version is slightly more opinionated setting things up the way we always do it. The main issue we have ran into as we aren't using it daily but only when creating new sites or adding a new component to a site it gets really out of date between each use.

This week I was going through the pain of figuring out what I need to do to get it up to date and make some changes, it was daunting enough I started looking at other options. That's when I realized that Drupal Console a tool we use daily is a scaffolding tool.

Last night I started doing some reading on how to create a custom command, which lead me look at the built in theme generator and how it works. It's fairly complicated, but it's PHP and it works inside Drupal which I'm super familiar with. I think this will be a great step forward for our theme scaffolding tool and will be a good learning experience.