Set up the ASK CLI to Use the Alexa Conversations Description Language

To install and configure the Alexa Skills Kit Command-Line Interface (ASK CLI), complete the following steps. Then use the skill tutorial to create an Alexa Conversations skill with the Alexa Conversations Description Language (ACDL).

Prerequisites

Before you install and configure the ASK CLI, you must meet the following prerequisites.

Establish the necessary accounts and permissions

  • An Amazon developer account. If you don't already have one, go to the ASK Developer Console to create an account.
  • An AWS account to host your skill on AWS Lambda. If you don't already have one, go to AWS to create an IAM user account.

Update your existing software

Uninstall the public version of the ASK CLI (if necessary)

  • From the command line, run the following command.

    npm uninstall -g ask-cli
    

Install and configure the ASK CLI

Complete the following steps to install and configure the ASK CLI to create skills for Alexa Conversations.

  1. Install the ASK CLI.
  2. Configure the ASK CLI.
  3. (Optional) Install the ACDL syntax highlighter for VS Code.

Step 1: Install the ASK CLI

From the command line, use npm to install a beta version of the ASK CLI that supports Alexa Conversations.

npm install -g ask-cli-x

Step 2: Configure the ASK CLI

To link the ASK CLI with your Amazon developer account and your AWS account, run the following command.

askx configure

Configure the ASK CLI

  • Choose the default profile or enter a name to create a new profile.
  • Grant permission to link your AWS profile to your ASK CLI skill.

    – Sign in to the AWS Key Management Service (KMS) as an IAM user.

    – Choose a symmetric access key. This is a single 256-bit secret encryption key.

To troubleshoot configuration issues, see the ASK CLI quick-start page. When you've finished configuring the CLI, you're ready to create an Alexa Conversations skill.

(Optional) Step 3: Install the ACDL syntax highlighter for VS Code

If you use Visual Studio (VS) Code and want to use the ACDL syntax highlighter, follow the instructions here. ACDL syntax highlighting is currently available only for VS Code.

Install the ACDL syntax highlighter for VS Code

  • Make sure you have the latest version of VS Code:

    – Open VS Code and click Help.

    – Click the update-related option, which might be Check for Updates or Restart to Update.

  • Install the ASK Toolkit VS Code extension (version 2.10 or higher).

  • If you've already the extension installed, update it to the latest version.

    – Open VS Code and click Code > Preferences > Extensions.

    – Search for the Alexa Skills Kit (ASK) toolkit extension.

    – Click the gear icon, and then click Install another version > 2.10.

You can test syntax highlighting by creating a new ACDL file or by opening an ACDL project file.

Troubleshooting the ASK CLI installation

If you have trouble installing the ASK CLI, try the following suggestions.

Issue: ENOENT error

Symptoms
When I try to install the ASK CLI, I get an error similar to the following.

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /Users/username/.nvm/versions/node/v17.4.0/lib/node_modules/.staging/ask-cli-e209bd51/node_modules/@babel/generator/node_modules/source-map
npm ERR! dest /Users/username/.nvm/versions/node/v17.4.0/lib/node_modules/.staging/source-map-4818842b
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/username/.nvm/versions/node/v17.4.0/lib/node_modules/.staging/ask-cli-e209bd51/node_modules/@babel/generator/node_modules/source-map' -> '/Users/username/.nvm/versions/node/v17.4.0/lib/node_modules/.staging/source-map-4818842b'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/username/.npm/_logs/2022-02-09T04_38_12_058Z-debug.log

Try this
To make sure you have the latest npm package (version 8.5 or higher), run the following command.

  $ sudo npm i -g npm

To remove package-lock from your JSON file, run the following commands.

  $ rm package-lock.json
  $ npm i
  $ sudo npm i -g .

To switch to the last working version of npm, run the following commands.

  $ sudo npm i -g npm@8.5.1
  $ npm -v 8.5.1
  $ rm package-lock.json
  $ npm i
  $ sudo npm i -g .

Issue: AWS error message

Symptoms
When I try to install the ASK CLI, I get an AWS error message, such as a notice that my account couldn't be linked.

Try this
If you receive an AWS error message, log in to your AWS account to check your settings.

Issue: Other error message

Symptoms
When I try to install the ASK CLI, I get an error not listed previously.

Try this
To make sure you didn't miss anything in the installation, review the general instructions for installing the ASK CLI.