The new Alexa Skills Kit Developer Console is fab and a lot of things have changed since I developed my first skill in 2016, one of the changes is skill testing which you can now do quite easily with the Alexa Skills Kit Command Line Interface (ASK CLI)
If you are building skills with my PHP code here are a few notes on using the ASK CLI to do simple skill invocation tests using a Docker compose ASK CLI nodejs container.
Assuming you are familiar with using Docker and docker-compose here are the steps to testing your skill from the command line :
- git clone https://github.com/gaiterjones/docker-amazon-ask-cli
- cd docker-amazon-ask-cli
- docker-compose build
- docker-compose up -d
- ./init.sh
- Initialise ask with your amazon developer credentials, you will be prompted to create a default profile and then to paste an authorisation url into your browser. The url will take you to an Amazon authorisation page where you need to login with your developer login. You will then receive an authorisation code which you can paste into the init window to create your cli-config credentials file.
- Test skill with skill simulation
- ./ask.sh amzn1.ask.skill.123 “ask my skill to do something” where amzn1.ask.skill.123 is the id of your skill and “ask my skill to do something” is the invocation term you want to test with your skill – i.e. what you would ask Alexa to do to open and use your skill.
Check out ask.sh for the ASK CLI syntax being used. You can use this directly from the container with docker exec -it dockeramazonaskcli_nodejs_1 /bin/bash
The credentials will be saved in cli-config when the container is stopped.
You can do a whole lot more with the ASK CLI, check out the documentation here https://developer.amazon.com/docs/smapi/ask-cli-command-reference.html
Comments