So I am trying to automate theme creation using drush. There is no documentation on how to fill the --answers argument there https://drushcommands.com/drush-9x/core/generate/

I have tried:

drush generate theme --answers='{"Theme name":"test", "Theme machine name":"test", "Base theme":"Classy"}'

to no avail:(


Finally found it:

drush generate theme --directory themes/custom --answers '{"name": "test", "machine_name": "test", "base_theme": "Classy"}'

in the absence of documentation, you'll find the needed json keys in the sources of drush code generator:


in the "interact" method


You just need a space after --answers instead of =

drush generate theme --answers '{"Theme name": "test", "Theme machine name": "test", "Base theme": "Classy"}'

Different command, but same structure as shown here: https://cog-tools.readthedocs.io/en/latest/#command-line-options

  • you are right about the space instead of the = but the keys are not good with that command => see my answer – Thony May 2 '20 at 12:15
  • 1
    @thony Glad you got it working! Sorry I was focused on the syntax and didn't realize you were looking for the available arguments to. :) – JeremyM4n May 2 '20 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.