This documentation covers getting your first two bots created using the CLI
Our CLI is available directly on NPM. https://www.npmjs.com/package/@servisbot/servisbot-cli
npm install -g @servisbot/servisbot-cli
The installation should run with no errors. You can validate your installation by running the CLI.
sb-cli
If installation was successful, the help documentation for the CLI will be displayed.
You can review a full set of the commands available to the CLI in our CLI Commands Documentation
You can update the CLI at any time using the NPM update command.
npm update -g @servisbot/servisbot-cli
You will have to set your ServisBOT region before logging in.
sb-cli region set <region>
Example Regions
Log into your organization with the CLI
To log in, replace
sb-cli login <organization>
Then provide email & password. Congrats! Your CLI is all set up and you can now build bots.
Create a bot using a pre-existing bot template
Each bot template will contain at least one worker, and possibly some BaaS dependencies
You can see a list of templates using the CLI tool
sb-cli blueprint list
Use the CLI to to create a password reset for your Bot
sb-cli blueprint build-interactive PasswordReset
You will be asked some questions to help configure your bot
Starting Build Blueprint Interactively command
? What value would you like to set for botName {{ YOUR_BOT_NAME }}
? What value would you like to set for botDescription getting started bot
? What value would you like to set for botPersona default-bot
press Enter and wait for your bot URL to show
e.g. https://messenger.servisbot.com/preview.html?endpoint={{YOUR_ORG}}-{{YOUR_BOT_NAME}}
Your bot will now be available for testing. You can either go to the preview URL provided by the CLI, or view the bot using the portal.
It is simple to add additional utterances to kick off the bot.
You can retrieve worker details by using describe
command, and using the Worker Id you received from bot describe
command.
sb-cli worker describe <worker id> --quiet > my-bot-worker.json
UserIntents
Business Slot"userIntents": [
{
"name": "passwordReset",
"utterances": [
"I need to reset my password"
],
"description": "Intent for a user to reset their password"
}
utterances
array e.g.
"utterances": [
"I need to reset my password",
"I would like to reset my password"
],
my-bot-worker.json
definition file
sb-cli worker update my-bot-worker.json
sb-cli bot sync {{YOUR_BOT_NAME}}
Open the messenger again or click Reset
in the currently opened one, and type in the I had an accident
message, your bot should reply with the modified message.
Setup and Test Bot
Create a bot using a pre-existing bot template
sb-cli blueprint build-interactive classic-flow