Quick Start Alexa Skills Kit Command Line Interface (ASK CLI)
The ASK Command Line Interface (ASK CLI) is a tool for you to manage your Alexa skills and related AWS Lambda functions. With ASK CLI, you have access to the Skill Management API, which allows you to manage Alexa skills programmatically from the command line.
To see a video demonstrating the use of ASK CLI, see ASK CLI Setup on YouTube.
- Step 1: Prerequisites for Using ASK CLI
- Step 2: Install and Initialize ASK CLI
- Step 3: Use ASK CLI Commands to Manage Your Skill
- Step 4: Test Your Skill
Step 1: Prerequisites for Using ASK CLI
- An Amazon developer account
Node.js 4.5 or greater and Node Package Manager (npm), which installs with Node.js. To check the version of node.js, open a command prompt and type the following:
$ node --version
To install or update your version of Node.js, refer to the Node.js downloads page.
If you plan to use AWS Lambda to host your skill’s business logic, you need an AWS account. Ensure that you have AWS credentials set up with the appropriate permissions on the computer to which you are installing ASK CLI, as described in Set Up Credentials for an Amazon Web Services (AWS) Account.
Step 2: Install and Initialize ASK CLI
To install ASK CLI:
Use npm to install ASK CLI. Run the npm global install command into the ask-cli folder:
$ npm install -g ask-cli
If you are using Linux, the installation may require
$ sudo npm install -g ask-cli
To initialize ASK CLI:
The first time you use ASK CLI, you must call the
init command to initialize the tool with your Amazon developer account credentials. For more information, see init command.
$ ask init
You will be prompted to select your profile and to log in to your AWS account. Once the initialization is complete, you can use ASK CLI to manage your skill.
Step 3: Use ASK CLI Commands to Manage Your Skill
These commands provide basic functionality for managing skills. To see all of the commands available in ASK CLI, refer to the ASK CLI Reference.
ask new: Using this command you can create a new “Hello World” Alexa skill project on your computer, with the necessary folders and files to deploy it with minimal changes. For more information, see new command.
ask deploy [--no-wait]: Using this command you can deploy a skill to your developer account. If you have your AWS credentials set up and skill configured to use AWS Lambda, this command will automatically deploy your code as well,. For more information, see deploy command.
ask clone [<-s|--skill-id <skill Id>]: Use this command to create a skill project locally by cloning an existing skill. This command will clone the entirety of your skill, including the skill manifest, interaction model, and skill service code (if your skill uses AWS Lambda). After cloning, you can make changes locally then deploy them easily using the
ask deploy command. For more information, see clone command.
Step 4: Test Your Skill
Before testing, enable your skill via the Alexa app. You can test your skill using ASK CLI commands such as invoke-skill and simulate-skill. You can also use the service simulator on the developer portal.