Last updated April 8, 2014. Created on March 8, 2013.
Edited by krisp1, pamatt, Cellar Door, osopolar. Log in to edit this page.

The Omega 4.x base theme comes with built-in Drush integration to extend the core commands of Drush itself for various Omega 4.x and theming related tasks.

Prerequisites

The following guide assumes that you already have Drush installed and running. If Drush is not installed in your system pleas read Specific instructions for installing Drush on different platforms.

In previous versions, the Omega theme Drush integration was provided by a module (Omega Tools). However, the maintainers of Drush recently added command discovery for themes which now allows us to ship the Drush integration directly with the Omega theme instead of maintaining a separate module. Omega Tools has consequently been deprecated and will no longer be maintained for the 4.x version of Omega.

Please do not install Omega Tools when running Omega 4.x. It might overlap/collide with the Drush integration provided by the theme.

Getting started

Once you have Drush installed and working you can download Omega 4.x by navigating into your Drupal directory and issues the following command.

drush dl omega

This will automatically download and place Omega 4.x in sites/all/themes/omega.

Drush has an internal cache that you may have to clear in order to make use of the Omega related commands. The following command clears the internal Drush cache.

drush cc drush

Now, you can list the available commands.

drush help

Or, in order to just show the commands provided by Omega:

drush help --filter=omega

If you can see Omega related commands in the list, you are done. You are now ready to generate your first Omega sub-theme.

Troubleshooting

If you don't see the Omega related commands, please check your Drush installation and make sure that you are using the latest version.

drush version

If you have the latest version of Drush installed and are still unable to access the Omega related commands, please check your server's PHP version:

php --version

Upgrading to a version of PHP greater than 5.3.3 on your server may help resolve this issue.
For those with centOS / RHEL servers, these instructions may prove helpful for upgrading your version of PHP.

Available commands

  • omega-export (oexp)
    Exports the theme settings of a given theme from the database to the .info file.
  • omega-guard (ogrd)
    Runs guard for the given theme including Compass and LiveReload by default.
  • omega-revert (orev)
    Reverts the theme settings of a given theme by deleting them from the database.
  • omega-subtheme (osub)
    Creates a Omega subtheme.
  • omega-wizard (owiz)
    Guides you through a wizard for generating a subtheme.

When generating a new sub-theme it is recommended that you use the "omega-wizard" (owiz) command. It guides you through the process and internally invokes the "omega-subtheme" (osub) command when finished with gathering the necessary information and therefore is much more convenient.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

dman’s picture

I found that drush (8.x-6.x 2013-06-17) wasn't detecting drush routines stored in the theme directory. In order to get the list of Omega commands (if I were in the drupalroot) I had to go

  drush  --include=sites/all/themes/omega/includes cc all
  drush  --include=sites/all/themes/omega/includes help | grep omega

And include the --include line each time I wanted to use drush this way.

Updated to todays 8.x-6.x 2013-07-19
Drush Version : 6.0-dev
... still the same.

mmcintosh’s picture

I found that is no longer the case with drush version

Drush Version : 7.0-dev

Sept, 01 2013

FYI

codyzhao’s picture

if you can't run the command on drupal root, try do it on the site folder (e.g. sites/yoursite).

stuzog’s picture

I've tried all the instructions above from the drupal installation root, but get "The specified command category omega does not exist." so I cannot create a subtheme with drush 5.9 MAMP 3.0 OS X 10.9.2

rajmataj’s picture

Try first cleaning your Drush cache:

drush cc drush

Kyle Skrinak’s picture

Running drush omega-wizard with drush version 4.5 rendered the following error:

escapeshellarg() expects parameter 1 to be string, array given drush.inc:1387                    [warning]
escapeshellarg() expects parameter 1 to be string, array given drush.inc:1387                    [warning]
The drush command 'make' could not be found.                                                       [error]

Updating to drush version 5.9 allowed me to run the wizard without error.

Kyle Skrinak’s picture

If you're like me, your bias is to read through everything you can find online and then start on a new paradigm. I'm now discovering the subtheme/sass/readme.mkd file that is answering a whole bunch of questions I was having as I started to wade into my new theme. Note that you must elect to install the readme when running the omega-wizard subtheme function. Well worth the extra hard disk space.

Well done, omega team!

Katukasz’s picture

When I filter for the commands, they all show up okay but whenever I try to run one this message shows up "The drush command 'omega-wizard' could not be found." even though a few lines up it says that I can use this command. I tried clearing the cache and everything. Any idea how to fix this?

korgik’s picture

Had the same problem because I've placed my themes in profile folder, it works good If I move them back to sites/all/themes/