This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills. For more information on Webex Assistant Skills, please see the official Webex Assistant Skills Overview.
It is intended as an alternative to the official Webex Assistant SDK, as documented in the Webex Assistant Skills Guide, without the need for installing python and the required dependencies. Simply download the binaries from the releases tab to get started.
It is currently a work in progress, so expect things to change as more is learned about this new webex feature.
You should be famililar with the Getting Started documentation. This quickstart assumes you'll be using the simulator to test.
To get started, you will need:
- Your tenant enabled for skills;
You will only need the following if you wish to register your skill from the CLI instead of using the Webex Assistant Skills Developer Portal:
- Your personal access token to register the skill: get your token here from the Copy button in the Authorization section;
- Your base64 decoded developer ID: get your ID and base64 decode it here taking the last part after
ciscospark://us/PEOPLE/
You will only need the following if you wish to test your skill using the simulator:
- Your base64 decoded organisation ID (for the simulator): get your orgId and base64 decode it here taking the last part after
ciscospark://us/ORGANIZATION/
- A token with the
assistant
scope to run the skill. You can temporarily get this from here until there is proper tooling;
-
Create a folder and download the binaries from the releases page:
a.wxa-cli
- for generating the keys and the secret, along with registering your skill;
b.echo-skill-secure
- for the test skill;
c.echo-skill-secure-tester
for testing the skill locally; -
Generate a public/private key pair:
$ ./wxa-cli generate-keys
- Generate a secret:
$ ./wxa-cli generate-secret > secret.txt
- (Optional) Set your environment variables or put them in a .env file:
SKILL_PUBLIC_KEY=<YOUR PUBLIC KEY HERE>
SKILL_PRIVATE_KEY=<YOUR PRIVATE KEY HERE>
SKILL_SECRET=<YOUR SECRET HERE>
If you don't set these, by default the skill will look in the current directory for secret.txt
, private.pem
and public.pem
.
- Set up a tunnel to your machine using localtunnel or ngrok, e.g:
ngrok http 8080
Use the https
endpoint provided by ngrok in the next step.
- Create the Skill on the Skills Service using the details obtained earlier:
You can do this on the Webex Assistant Skills Developer Portal as documented in the Webex Assistant Skills Guide Developer Portal Guide or use the wxa-cli
command:
$ wxa-cli create-skill --name="Echo" --url="<YOUR_URL_FROM_STEP_5>" --contact="<YOUR_EMAIL>" -secret="$(cat secret.txt)" --public="$(cat public.pem)" --token="<YOUR_PERSONAL_ACCESS_TOKEN>" --developerid="<YOUR_DEVELOPER_ID>"
Replacing values in < >
with the relevant details from earlier. Note the use of cat
to provide the secret.txt and public.pem content into the command.
- Run the skill:
$ ./echo-skill-secure
- Test the skill locally:
$ ./echo-skill-secure-tester
- Test the skill with the simulator:
- Visit
https://assistant-web.intelligence.webex.com/
. - Enter the base64 decoded organisation ID and the assistant scoped token.
- Say or type
ask echo hello there
The simplest way is to download the binaries from the releases page.
If you have Go installed, you can install using the following commands:
$ go install github.com/darrenparkinson/wxa-skills-go/cmd/wxa-cli@latest
$ go install github.com/darrenparkinson/wxa-skills-go/examples/echo-skill-secure@latest
$ go install github.com/darrenparkinson/wxa-skills-go/examples/echo-skill-secure/cmd/echo-skill-secure-tester@latest
Again, if you have Go installed, you can also compile from source:
$ git clone https://github.com/darrenparkinson/wxa-skills-go
$ cd wxa-skills-go
$ go mod tidy
$ go build ./cmd/wxa-cli
$ go build ./examples/echo-skill-secure
$ go build ./examples/echo-skill-secure/echo-skill-secure-tester
$ ./wxa-cli --version