# MT::Bootstrap::CLI # # A subclass of MT::Bootstrap which allows for command-line MT::Apps. See # README for further details. # # Author: Jay Allen, Textura Design (http://jayallen.org) # Date: March 1st, 2007 # # Released under the Artistic License # # $Id$ This module is a simple drop-in module for Movable Type 3.3x and Movable Type Enterprise that enables creation of standard command-line apps that are also full fledged MT::App subclasses. Specifically, it routes around a bad assumption in MT::Bootstrap that causes command-line MT::Apps to run as if they were running under FastCGI. A bug has been filed so hopefully the lifespan of this module is short. Note that module is not required to run command line MT::Apps under Movable Type 3.2. ### INSTALLATION ### If you have or expect to have a number of plugins that provide command-line apps, installing the module into your extlib directory is a good idea because then all plugins will have access to it. 1) Create a directory in MT_DIR/extlib/MT named "Bootstrap" 2) Drop CLI.pm into that directory 3) Create a command-line script for your plugin (see EXAMPLES below) 4) Run! If you are a plugin developer and would like to include the distribution with your plugin, you can do so using the same setup as that shown in included "examples" folder. In this case, you would create extlib/MT/Bootstrap in the root of your plugin directory and put CLI.pm in there. ### USAGE ### When the command-line script that uses MT::Bootstrap::CLI is run, it will initialize the system just as MT::App::CMS or any other apps and you will be able to interact with MT from the shell. However, it will have access to command-line arguments. ### EXAMPLES ### The example included in this distribution, mt-shell, is nothing more than an MT::App which executes the arguments provided to it as a system command. ./plugins/mt-shell/tools/mt-shell-cli.pl ls -al The command above would give you a detailed listing of your current directory. While admittedly superfluous[1] (since it would be less typing and less processing power to simply execute the command without the script), it provides a very basic example of how you could create a full-fledged MT::App that you can interact with on the command-line. This is especially interesting if you are an MT developer since you can fully interact with MT as you would a command line script, making testing, debugging and development not only much faster but also far more enjoyable than clicking and waiting a hundred times in a web browser. [1] - But aptly named: MT-shell. Get it?!