Simulate and test your Alexa Skill with the Alexa Skills Kit Command Line Interface (ASK CLI)

created April 25, 2018, last updated April 25, 2018.

.

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 :

  1. git clone https://github.com/gaiterjones/docker-amazon-ask-cli
  2. cd docker-amazon-ask-cli
  3. docker-compose build
  4. docker-compose up -d
  5. ./init.sh
    1. 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.
  6. Test skill with skill simulation
    1. ./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