Tutorial: Set up the ASK CLI to Use Alexa Conversations Description Language
With the Alexa Skills Kit Command Line Interface (ASK CLI), you can use Alexa Conversations Description Language (ACDL) to build and deploy turn-by-turn Alexa Conversations skills. Alexa Conversations uses deep learning to create Alexa skills in which dialog flows naturally between Alexa and the user.
ask. However, command line messages might refer to
ask. For ACDL, always use
Before you install and configure the ASK CLI, you must meet the following prerequisites.
Establish the necessary accounts and permissions
- If you don't already have an Amazon developer account, go to the ASK developer console to open one.
- If you don't already have an Amazon Web Services (AWS) account, go to AWS to create an IAM user account.
Update your existing software
- Update to the latest version of Node.js (version 16.17 or higher).
- For version control, update to the latest version of Git (version 2.37 or higher).
- Update your Java development environment (version 8 or higher).
- Migrate to the latest version of the AWS Command Line Interface (AWS CLI) (version 2).
Make sure you have the latest version of VS Code (version 1.70 or higher).
a. Open VS Code, and then click Help.
b. Click the update-related option, which is either Check for Updates or Restart to Update.
Run the following command to uninstall the public version of the ASK CLI.
npm uninstall -g ask-cli
Complete the following steps to install and configure the ASK CLI. Then use ACDL to create Alexa Conversations skills on the command line.
- Install the ASK CLI
- Configure the ASK CLI
- (Optional) Install the ACDL syntax highlighter for VS Code
Step 1: Install the ASK CLI
In this step, you use
npm to install a beta version of the ASK CLI. The beta version supports Alexa Conversations.
To install the ASK CLI beta version from the command line
Open your terminal, and then run the following command.
npm install -g ask-cli-x
Step 2: Configure the ASK CLI
In this step, you configure the ASK CLI to link to your Amazon developer account. This configuration is necessary to verify your identity so you can access ASK CLI resources.
Configure the ASK CLI to recognize your developer account
To link the ASK CLI to your developer account, run the following command.
- Choose the default profile, or enter a name to create a new profile.
- To grant permission to link your AWS profile to the ASK CLI skill, select the checkbox.
- Sign in to the AWS Key Management Service (KMS) as an IAM user.
- Choose a symmetric access key (a single 256-bit secret encryption key).
(Optional) Step 3: Install the ACDL syntax highlighter for VS Code
In this step, you install the ASK Toolkit for Visual Studio (VS) Code. The toolkit provides a syntax highlighter and a dedicated VS Code workspace in which to create, test, and deploy Alexa skills. ACDL syntax highlighting is currently available only for VS Code.
To install the ACDL Toolkit for VS Code
Install the ASK Toolkit VS Code extension (version 2.10 or higher), or update it to the latest version.
a. Open VS Code and click Code > Preferences > Extensions.
b. Search for the Alexa Skills Kit (ASK) Toolkit extension.
c. Click the gear icon, and then click Install another version > 2.10.
d. Close and then reopen VS Code.
If you have trouble installing the ASK CLI, try the following suggestions.
When I try to install the ASK CLI, I get an error message 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
To make sure you have the latest
npmpackage (version 8.5 or higher), run the following command.
$ sudo npm i -g npm
package-lockfrom 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 firstname.lastname@example.org $ npm -v 8.5.1 $ rm package-lock.json $ npm i $ sudo npm i -g .
Issue: AWS error message
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.
If you receive an AWS error message, log in to your AWS account to configure the following settings.
- Make sure your skill is linked to an IAM user, not a root user.
- Make sure your access key ID and secret access key match the credentials you entered.
- Make sure your access keys aren't expired.
- Confirm that your user configuration includes the necessary policies and permissions.
Issue: Other error message
When I try to install the ASK CLI, I get an error message not listed in this document.
To make sure you didn't miss anything in the installation, review the general instructions for installing the ASK CLI.