UNPKG

4.7 kBMarkdownView Raw
1<p align="center">
2 <img src="https://m.media-amazon.com/images/G/01/mobile-apps/dex/avs/docs/ux/branding/mark1._TTH_.png">
3 <br/>
4 <h1 align="center">Alexa Skills Kit Command Line interface</h1>
5 <p align="center">
6 <a href="https://www.npmjs.com/package/ask-cli"><img src="https://badge.fury.io/js/ask-cli.svg"></a>
7 <a href="https://github.com/alexa/ask-cli/actions?query=workflow%3A%22Unit+Test%22"><img src="https://github.com/alexa/ask-cli/workflows/Unit%20Test/badge.svg?branch=master"></a>
8 </p>
9 <p align="center">
10 <a href="https://conventionalcommits.org"><img src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg"></a>
11 </p>
12</p>
13
14
15The Alexa Skills Kit Command Line Interface (ask-cli) is used to create, manage, and deploy Alexa skills from the command line. Please see the full documentation from [ASK CLI quick start guide](https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html).
16
17<p align="center">
18 <img align="center" src="https://ask-cli-static-content.s3-us-west-2.amazonaws.com/document-assets/v2-ask-cli-intro.gif" height="350" />
19</p>
20
21*Note:* To use ask-cli for `Alexa-Hosted skill`, please check our [instructions](https://github.com/alexa/ask-cli/blob/develop/docs/concepts/Alexa-Hosted-Skill-Commands.md) for the usage.
22
23### Getting Started
24
25**1. Install CLI**
26
27```
28$ npm install -g ask-cli
29```
30
31
32**2. Configure CLI profile**
33
34Before you can start using the ASK CLI, configure your ASK (and AWS) credentials:
35
36```
37$ ask configure
38```
39
40You’ll be prompted to sign into your Amazon developer account. If you choose to have your skill hosted by AWS, you’ll have the option of linking your AWS account as well.
41
42<p align="center">
43 <img align="center" src="https://ask-cli-static-content.s3-us-west-2.amazonaws.com/document-assets/v2-ask-cli-configure.gif" height="520" />
44</p>
45
46
47**3. Create new skill project**
48
49Create a new skill project and follow the prompts from the command:
50
51```
52$ ask new
53```
54
55You'll be asked to select a deployment method for your skill. Currently we support deployment via AWS CloudFormation (@ask-cli/cfn-deployer), deployment via AWS Lambda (@ask-cli/lambda-deployer), and deployment through Alexa-Hosted skill (@ask-cli/hosted-skill-deployer).
56
57<p align="center">
58 <img align="center" src="https://ask-cli-static-content.s3-us-west-2.amazonaws.com/document-assets/v2-ask-cli-new.gif" height="520" />
59</p>
60
61Your new skill project will provide a number of files and folders that make up the structure of an Alexa skill. Here is an overview on each of the files and folders that are created by default:
62
63| File/Folder | Description |
64| :-------------- | :----------- |
65| skill-package/ | Skill resources utilized by the ASK platform such as skill manifest, interaction models, and assets |
66| lambda/ | Contains the source code for your skill that utilizes the ASK SDK |
67| infrastructure/ | Contains your CloudFormation definitions for deploying your skill to AWS |
68| ask-resources config | Configuration for your Alexa skill project |
69
70See the [ASK SDKs documentation](https://developer.amazon.com/docs/sdk/alexa-skills-kit-sdks.html) to learn more about how to build an Alexa skill.
71
72
73**4. Deploy Alexa skill**
74
75In order for Alexa to communicate with your skill code, it will need to be deployed and hosted on the cloud using this command.
76
77```
78$ ask deploy
79```
80
81The deploy command performs the following steps:
82
831. `skill-package/` resources will be zipped and uploaded to the ASK platform via SMAPI's [Skill Package Service](https://developer.amazon.com/docs/smapi/skill-package-api-reference.html).
842. `lambda/` source files will be built and zipped for deployment to AWS. We currently support the build flows of npm for Nodejs, pip for Python and maven for Java developers.
853. `infrastructure/` definitions will be used to provision resources on AWS. The `lambda/`'s zip file from the previous step will be deployed to the provisioned AWS Lambda function. The gif below shows the deployment using `@ask-cli/cfn-deployer`, you can also try other deployers as they serve different purposes.
86
87<p align="center">
88 <img align="center" src="https://ask-cli-static-content.s3-us-west-2.amazonaws.com/document-assets/v2-ask-cli-deploy.gif" height="520" />
89</p>
90
91
92**5. Dialog with what you build**
93
94To test while developing your skill locally, or quickly showcase your skill ideas, or even build end-to-end testing, you can use CLI's dialog command.
95
96```
97$ ask dialog
98```
99
100<p align="center">
101 <img align="center" src="https://ask-cli-static-content.s3-us-west-2.amazonaws.com/document-assets/v2-ask-cli-dialog.gif" height="520" />
102</p>