Very simple but working drush extension?
This is valid for Drush >= 4

&lt;?php
/**
 * @file EXAMPLE.drush.inc
 * Provides a simple drush extension example
 */

function EXAMPLE_drush_command() {
  return array('COMMANDNAME' =&gt;
    array(
      'description' =&gt; 'My example command',
      'bootstrap' =&gt; DRUSH_BOOTSTRAP_DRUSH,
    ),
  );
}

function drush_COMMANDNAME_validate() {
  // Return
  // drush_set_error('MACHINE_NAME_OF_FAIL', dt('Command failed because [reason]'));
  // on error.
}

function drush_COMMANDNAME() {
  echo 'Extension working!';
}