Alexa Development Environment
There are many options and tools available when developing for Alexa, but where do you get started? This post will walk you through setting an Alexa development environment. Like many things in software development, there are many (almost infinite) ways you can set things up. Think of this as a good place to start.
The instructions here are for getting setup on a Mac, but should be easily adapted for Linux, or with a little more work windows. Alternatively, for an in depth guide for a Windows environment try Setting up a Local Alexa Skill Development Environment
This post assumes you have a few things already setup on your Mac. Below is a list with links to instructions incase you don’t:
Start with Node.js
Node.js is required for the Alexa command line tools, and it is also the language we will use for an example skill.
We strongly encourage you to use NVM to install and manage node.js versions, but id does add an extra layer of complexity when getting started (you can always add it later).
brew install nvm
~/.bash_profile and add
Now open a new terminal and install node.js
Node.js 8.10 is the latest version supported by AWS Lambda, and so the version we will use.
Without NVM (use a single version of Node.js on your machine)
Alexa development requires a developer account with Amazon and a place to host your skill code. Because Amazon will give you AWS credits to support hosting your code (see AWS Promotional Credits), AWS is the best place to host your first skills. Even if you already have an AWS account, using an account per skill is a good idea for managing costs. For managing multiple AWS accounts see AWS Organizations.
Amazon Developer Account
- Click the
Create your Amazon Developer accountbutton
- Fill out the registration with your information
- Read the agreement and agree to in
- Select monetization options. no to both for Alexa skills, you can change it later
- Click on
Alexa Skills Kittab to start working on your skill
AWS Account For Hosting
You will need to enter a credit card, and valid phone that you can be reached on while setting up the account
Go to https://aws.amazon.com/free/
Create a Free Account
- Enter registration information
- Select a
Personalaccount unless you have your business info available (tax ID, etc)
- Fill out the account registration
- Read the Terms - AWS Customer Agreement
- Fill in credit card information
- Enter phone number for account conformation callback
- Verify your account by automated call
- Click on the
Freeplan button. Unless you want to by a support plan
Sign into Console
- Sign in with the email and password you used to register
ASK CLI installation
Installing the ASK CLI is strait forward, but linking it to an AWS account is a little more complicated if you don’t know where to start. You will need to:
- Create a new Security Policy
- Create a new User and assign Security Policy
- Install the ASK CLI
- Setting up a Local AWS Profile
- Associate the User to the ASK CLI
Create a new Security Policy
Go to https://developer.amazon.com/docs/smapi/set-up-credentials-for-an-amazon-web-services-account.html
and copy the JSON for creating a policy. It should look like this
- Open the IAM Identity and Access Management Console. Sign in with your AWS account that you will use to create AWS Lambda functions for your Alexa skills (the one you created).
- Click on the
- Paste the JSON above into the window replacing what is there
Review Policy, name it
AskCliAccess(or a name of your choice)
Create a new User and assign Security Policy
- Click on
- Name your user
ask-cli(or a name of your choice)
AWS Management Console access
- Make sure
Require password resetis not selected
Attach existing policies directly
- Find the policy you created (search for
AskCliAccess) and select it
- Verify the details and click
Download .csvto save the credentials (
~/Downloads/credentials.csv), you will not be able to access them again
Install the ASK CLI
Open a terminal and install
npm install -g ask-cli
Setting up a Local AWS Profile
ask init --aws-setup
name the profile to use (default) then enter the
AWS Access Key ID and
AWS Secret Access Key from the
credentials.csv you downloaded.
Associate the User to the ASK CLI
choose the profile to use (default) and when the browser opens log in with the Amazon Developer account you created (not the AWS account), then click
Install a code editor
This is a highly personal choice, and you can pretty much use what ever you want, however if you don’t have a preference try Visual Studio Code, it is free, open source, and works well for developing Alexa skills. Other good options that we have used are:
VS Code CLI
If you choose to use VS Code, then it is worth it to set up the ability to launch
code from the terminal.
Go to https://code.visualstudio.com/docs/setup/mac for the official instructions.
Visual Studio Code
- Open the Command Palette (
⇧⌘P) and type
shell commandto find the Shell Command: Install ‘code’ command in PATH command.
- Restart the terminal for the new $PATH value to take effect. You’ll be able to type ‘code .’ in any folder to start editing files in that folder.
Create a Skill
Open a terminal and create/change to a directory for your skill
Enter a name for your skill (My Skill), then open you code editor
code My\ Skill
The skill is created from a template that Amazon provides called
skill.jsoncontains the meta data for your skill
modelscontains the voice model for your skill
lambda/customcontains the code for the Lambda that powers your skill
Once you have your skill to a point where you are ready to deploy it, you can do so
Other Tools And Resources
- Forums – http://alexa.design/forums
- Slack channel – http://www.alexaslack.com/
- Office hours – http://alexa.design/officehours
- Twitch – https://www.twitch.tv/amazonalexa
Amazon offers skill publishers AWS credits to help cover hosting costs, but you have to sign up. Don’t miss out on this great opportunity, sign up here:
AWS Promotional Credits
Amazon pays publishers of top skills. Every month you can earn money for engaging skills. If your skill is in one of the categories listed and has great user engagement, you will get paid. Sign up here:
Alexa Developer rewards
BeSpoken Tools provide developers with a set of tools to test and monitor Alexa skills.
A Framework for Voice App Development. Build multimodal apps for Amazon Alexa and Google Assistant.
Create Alexa skills without coding!