In the previous parts of this extended tutorial you learned about how a Skill works. Now, you’re going to learn how to deploy it so you can test it. From the command line enter:
ask deploy that’s it. Really, that’s it. You don’t have to do anything else. The lambda function, the skill intent model, and everything else is uploaded, configured, and deployed. Cool!
Now you might be asking, “Why should I do this from the command line when every other tutorial shows you how to do it from the web console?” First, it’s easier, right? Second, this is how stuff is done in production. If you want to do stuff in production it needs to be automated. Now, we’re not automated yet because we’re running a step from the command line, but it’s a short way from a manual command line execution to a step in an automated build process. If you learn how to do this from a web UI, that’s something totally different. There’s a huge gap between clicking around in a web UI and deploying in an automated fashion. This is why you need to know how to deploy this way. Remember, the goal is to learn how to do this in a real environment, not just as a toy experiment.]
Now take your skill for a test run. First we’ll do this from the command line. Here is a sample:
ask simulate --text 'Alexa open s.o.t.v.' --locale en-US
That tests the opening of the skill.
Let’s try the hello intent:
ask simulate --text 'Alexa ask s.o.t.v. hello' --locale en-US
Let’t try the intent with a slot [add command line for slot intent]
Now try the open skill and hello intent when we are in the skill [command line to open] [command line to say hello step]
If that worked for you then I tricked you. That shouldn’t work. The command line doesn’t keep state so a multi step interaction fails from the command line. So, let’s try that one from the web console. Yes I know I just gave a lecture on not using the GUI, but this is a test. And sometimes testing isn’t as clean as we would like it to be. I am wondering if there is some session ID that can be used as a command line argument to actually execute a multi-step intent from the command line. I haven’t seen it it a tutorial, but that doesn’t mean it doesn’t exist. I’ll do some digging, but if it doesn’t exist it should probably be a developer request.
[If that worked for you then I tricked you. It shouldn’t work. The command line doesn’t keep track of multi-step interactions, so that should fail from the command line. Let’s try this from the web console. Yeah, I know I just told you not to do anything from the GUI, but this is a test. And sometimes testing isn’t as clean as you’d like it to be. I am wondering if there is some sort of session ID that you can pass from the command line to actually execute a multi-step intent. I haven’t seen it in a tutorial but that doesn’t mean it doesn’t exist. I guess I’ll do some digging. But if it doesn’t exist it should probably be a developer request.]
What’s next. Next we’l do some calendar integration and give more than a canned response. You did learn how simple it was to deploy your intent. And how you can test from the command line a n GUI.