This trigger provides your flogo application the ability to run as a CLI app, that is, accept input via the CLI & run once till completion and return the results to stdout.
flogo install github.com/project-flogo/trigger/cli
Name | Type | Description |
---|---|---|
singleCmd | bool | Indicates that this CLI runs only one command/handler |
usage | string | The usage details of the CLI |
long | string | The description of the CLI |
Name | Type | Description |
---|---|---|
flags | array | List of flags |
usage | string | The usage details of the command |
short | string | A short description of the command |
long | string | The description of the command |
Name | Type | Description |
---|---|---|
args | array | An array of the command line arguments |
flags | map | A map of the command line flags |
Name | Type | Description |
---|---|---|
data | any | The data that the command outputs |
There is simple support for defining flags for a command. You can specify either a boolean or string flag.
Flags are defined using the following format: flagName||defaultValue||description
Note: if a flag has a default value of true or false it is considered a boolean flag
"triggers": [
{
"id": "cli",
"ref": "#cli",
"name": "simple",
"description": "Simple CLI Utility",
"settings": {
"singleCmd": true
},
"handlers": [
{
"name": "commandName",
"settings": {
"usage": "[flags] [args]",
"short": "short command description",
"long": "the long command descriptoin",
"flags": [
"flag1||||string flag",
"flag2||false||boolan flag"
]
},
"action": {
"ref": "#flow",
"settings": {
"flowURI": "res://flow:commandName"
},
"input": {
"flags": "=$.flags",
"args": "=$.args"
}
}
}
]
}
]
Note: Each CLI command maps to a handler, so in order to set your command a name, you must set the name of the handler.
Triggers are configured via the triggers section of your application. The following are some example configuration of the CLI Trigger.
An example can be found here.
An example can be found here.