Is there a way to make a script where I can do stuff like `$this->EE->db` (i.e. using Expression Engine's classes, for example to access the database), but that can be run in the command line?

I tried searching for it, but the docs don't seem to contain this information (please [correct me if I'm wrong](http://agentdir.com/development/)). I'm using EE 2.4 (the link above should point to 2.4 docs).