Is the Drush backend API a web-accessible API? How does one install it? I've successfully configured Drush 4.5 to work agains my Drupal 6 site from the command line using site aliases.  I am doing things like sql-sync and rsync successfully from the command line.  What I'd like to do now is expose these functions over the web, through an API.  The Drush documentation leads me to believe I can do this, however it is somewhat lacking in details on how to accomplish this, or indeed whether it's even part of the intended design.

There is a very high chance that I have completely misunderstood the documentation and have assumed a CLI-only API was designed to be available through the web.  However, the backend.inc file talks about a REST API accessible over HTTP and is ambiguous about what this API actually does.


  This is nearly a RESTful API. @see htp://en.wikipedia.org/wiki/REST
  Instead of "http://[server]/[apipath]/[command]?[arg1]=[value1],[arg2]=[value2]"
  it will call "[apipath] [command] --[arg1]=[value1] --[arg2]=[value2] --backend"


It's not clear to me what this actually means, because it says "instead of" the web call, but then goes on to describe how GET and POST arguments differ and how they are passed in from a web call.


  If the Drush API is meant to be called over the web, e.g. http://server.com/drush/drush.php/drupal-directory?argv1=@staging how do I enable this, given that Drush is in a separate PHP source tree?  Do I symlink to it from my Drupal directory?  Do I copy or symlink an include file and expect Drupal to pick it up?
As the previous respondents said, drush is a cli tool.  If you would like to invoke Drupal functions via web services, try the services module.  If you would like to manage multiple Drupal sites via a web ui, try aegir.

If you would like to call drush functions remotely from php:

$values = drush_invoke_process('@alias', 'drush-command', $args_array, $options_array);


See examples/example.aliases.drushrc.php for examples on how to make an alias record.  Instead of '@alias', you can also pass in an array containing the site record definition, or you can use username@myserver.com/path/to/drupal#mysite.com.  See the source code comments in drush for an explanation of drush_invoke_process, and the contents of the $values array.