The Alexa Skills Kit Command Line Interface (ASK CLI) is a tool that helps us programmatically manage our Alexa Skills from the command line. There’s a lot of stuff we can do with the ASK CLI. We will only look at a few commands that we can use in the Skill development process for now.

The setup is done for you within this course.

Installing ASK CLI

If we have npm and Node installed on your system, we can run the following command to set up ASK CLI:

npm install -g ask-cli

ASK CLI syntax

Here’s what the structure of ASK CLI commands look like:

ask [options]
ask [command] [options]
ask [command] [subcommand] [options]

Important commands

Let’s look at a few important commands. We will have the opportunity to use some of these in the next section when we build the next project.

Creating a new project

The ask init command helps us initialize a new project by setting up the project with sensible defaults. Here’s what the command looks like:

ask init [--hosted-skill-id <hosted-skill-id>]
         [--profile | -p <profile>]
         [--debug]

Testing your locally

The ask run command helps us test Skills locally without needing to deploy the app. It routes requests to our local computer instead of the lambda function. Here’s what it looks like:

ask run [--debug-port <debug-port>]
        [--wait-for-attach]
        [--watch]
        [--region <region>]
        [--profile | -p <profile>]
        [--debug]
        [--help]

Deploy your Skill

We can deploy the interaction model and Skill’s lambda function using the ask deploy command. Here’s what it looks like:

ask deploy [--profile | -p <profile>]
           [--target | -t <target>]
           [--ignore-hash]
           [--debug]
           [--help | -h]

Simulate multi-turn conversations

We can simulate conversations between Alexa and the user using the ask dialog command. Here’s what it looks like:

ask dialog [--skill-id | -s <skill-id>]
           [--locale | -l <locale>]
           [--stage | -g <stage>]
           [--replay | -r <file-path>]

More commands

There are many more commands that can help us develop our Skill locally instead of using the developer console. You can refer to the documentation for more commands.

Alexa Skills Toolkit extension for VS Code

If you use VS Code as your code editor, you can even install the Alexa Skills Toolkit extension , which is another way to debug Skills locally.

Get hands-on with 1000+ tech skills courses.