Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Latest commit

 

History

History
executable file
·
65 lines (36 loc) · 3.9 KB

File metadata and controls

executable file
·
65 lines (36 loc) · 3.9 KB

<< Home | Lab 1 | Lab 2 >>

Lab Guide 1 - SMAPI and ASK CLI

What you will do in this lab

Work with Alexa Skills Kit Commandline Interface (ask-cli) tool to set up a Custom Alexa skill with the Skill Management API (SMAPI).

What you will get at the end of this lab

You have learned how to set up a new skill with ask-cli in an automated fashion.

Instructions

1.1.) Initialize ask-cli

If you never used ask-cli before, you need to initialize it and authorize this tool for your Amazon developer account

$ ask configure

and select Create new Profile. Skip the input of a profile name by hitting Enter. Also, skip AWS credential for ask-cli as we don't need it. A browser window opens. Follow the login procedure by using your Amazon developer account credentials and grant this tool permission to create and update Alexa skills.

Side note: We won't deploy the skill backend (Lambda function) which you can find in the ./js-folder. It is already hosted for you in another AWS account and your skill will just point to it and use it. That is why we skipped authorization for AWS in the initialization step. See the homework instructions below in case you would like to deploy the code as part of the skill creation / update procedure via ask-cli.

1.2.) Familiarize with the skill

Navigate to the folder where you cloned this Github repo.

The skill.json file contains metadata used to create the skill. It also has a reference to an existing Lambda function as the skill backend is already implemented and hosted for you. If you're interested in the source code you can look into the js-folder

The ./models/en-US.json in this repo contains the interaction model of the skill. Leave it as is. It is all set for you. However, it's worth having a quick look into it in order to understand what the skill expects its users to say.

1.3.) Deploy the skill

Now that you got a basic idea of what this skill will look like you can deploy it to your Amazon developer account with one single command. Run the below from within the root folder of this repo on your local drive.

$ ask deploy

This execution may take 2-3 minutes to complete. Ignore the [Warning]: Lambda deployment skipped, since AWS credentialsfor profile: [default] is missing. you will get at the end.

Once the deployment is finished double-check if the skill has been created in your Amazon developer account by running the following command.

$ ask api list-skills

Do you see a skill entry called Number guessing game? Great!

Just in case you got some time ...

Already done? You can dive deeper into ask-cli here and try out a few other commands if you like. You could also dig into the skill code to learn how it is implemented.

Homework

When you were initializing ask-cli in the first step of this lab you skipped authorizing with your AWS credentials. You didn't need it at this point as you were creating a skill using an already existing Lambda function. At home you might want to upload and host the code of this skill in your own AWS account.

  1. Follow the ask-cli quickstart guide and give this tool access to your AWS account.

  2. Next, you should go to the skill.json file in order to change the endpoint configuration which is part of the apis element node. Replace the uri parameter beneath endpoint with "sourceDir": "./js/." and ask deploy your skill again. For more information go to ask-cli reference in the developer documentation.

<< Home | Lab 1 | Lab 2 >>