botbuilder-command-line
botbuilder-command-line makes really easy the creation of command line tools for your BotBuilder bot.
Features:
- Nice DSL for creating command line dialogs
- Arguments and options parsing
- Configurable authentication for command
Install
yarn add botbuilder-command-line
This library was only tested in Slack. It should work in other channels too.
Usage
const UniversalBot = const CommandLineLibrary = const bot = connector const lib = "operations" isAuthorized: async { return userid === processenvSUPER_USER_ID } lib lib bot
We have created a new CommandLineLibrary with the name operations. operations
will be the name to use when invoking a command. The operations
CommandLineLibrary will only be triggered if a recognizer emits the operations
intent. This means you will need to create a custom recognizer in your bot and emit the operations
intent yourself.
This will look like this probably:
bot
We are going to move this logic inside the library to make the library experience more friendly.
After adding the previous recognizer you can now invoke the command like this:
operations list-active-dialogs
or
operations destroy-dialog --id 10
Todo
- Implement recognizer inside library
- Add boolean flags
Contact
- Martín Ferández martin@suttna.com
- Santiago Doldán santiago@suttna.com