Drush command can't find Drupal module function
It sounds like your site is not being selected.  Try calling your command with your cwd in the same folder as your settings.php file (e.g. cd sites/default); that should work.  You may also create an alias for your site, and call your command from any directory via drush @site mycommand