new Cli(argv, cwd, stdin, stdout)
Parameters:
Name | Type | Description |
---|---|---|
argv |
Array | Cli command arguments |
cwd |
string | Current working directory path |
stdin |
Stream | Input stream |
stdout |
Stream | Output stream |
Members
-
argv :Array
-
Cli command arguments
Type:
- Array
-
configPath :string
-
Midgar config path
Type:
- string
-
cwd :String
-
Current working directory
Type:
- String
-
mid :Midgar
-
Midgar instance
Type:
-
packagePath
-
Package.json of Midgar app
-
program :commander.Command
-
Commander instance
Type:
- commander.Command
-
stdin :Stream
-
Input stream
Type:
- Stream
-
stdout :Stream
-
Output stream
Type:
- Stream
Methods
-
addCommand(command)
-
Add a command to the program
Parameters:
Name Type Description command
Command Command Object -
addCommands(commands)
-
Add commands to commander program
Parameters:
Name Type Description commands
Array Array of comamnd Object -
<async> init()
-
Get the config path, init midgard and load plugins commands
-
<async> loadPluginsCommands()
-
Get all plugins cli files and add commands
-
run()
-
Parse argv and run command Wait for action result promise
Returns:
- Type
- Any