---
name: "Prophet::CLI"
section: "3pm"
platform: "linux"
package: "libprophet-perl"
version: "0.743-1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/Prophet::CLI"
---

# Prophet::CLI(3pm)

### \_record\_cmd

handles the subcommand for a particular type

### dispatcher\_class -\> Class

Returns class name of the dispatcher used to dispatch command lines. By default app\_class::CLI::Dispatcher is used if it can be loaded otherwise Prophet::CLI::Dispatcher. Override using:

```
    has '+dispatcher_class' => ( default => 'MyApp::Dispatcher' );
```

### run\_one\_command

Runs a command specified by commandline arguments given in an ARGV-like array of argumnents and key value pairs . To use in a commandline front-end, create a Prophet::CLI object and pass in your main app class as app\_class, then run this routine.

Example:

```
 my $cli = Prophet::CLI->new({ app_class => 'App::SD' });
 $cli->run_one_command(@ARGV);
```

### get\_script\_name

Return the name of the script that was run. This is the empty string if we're in a shell, otherwise the script name concatenated with a space character. This is so you can just use this for e.g. printing usage messages or help docs that might be run from either a shell or the command line.
