Running Drupal API Scripts offline I want to run some maintenance scripts against a Drupal 7 system. These scripts will call the Drupal API to use things like EntityFieldQuery, node-&gt;save and so on. I could create a module called maintenance_scripts which has a forms interface to launch the scripts with and to display their output, but I'd rather just run a script from the command line. Is this possible?
It is not necessary to write an entire Drush command just to run some php code.  Use:

drush php-eval '$a = callSomeFunction(); print $a;'

or:

drush php-script /path/to/script.php

Drush will bootstrap your site and run your code.