All Projects → cameronhunter → generator-alexa-skill

cameronhunter / generator-alexa-skill

Licence: MIT license
A Yeoman generator for scaffolding an ES2015 Alexa Skill for AWS Lambda

Programming Languages

javascript
184084 projects - #8 most used programming language

generator-alexa-skill

Build Status NPM Version License

A Yeoman generator for scaffolding an Alexa Skill for AWS Lambda using alexa-lambda-skill.

Installation

npm install -g yo generator-alexa-skill

Generating a new Alexa Skill

yo alexa-skill

This creates a brand new Alexa Skill, add your logic into src/index.js and tests into test/index-test.js. The template is a HelloWorld skill:

import Response from 'alexa-response';
import { Skill, Launch, Intent } from 'alexa-annotations';

@Skill
export default class HelloWorld {

  @Launch
  launch() {
    return Response.say('HelloWorld launched!');
  }

  @Intent('hello')
  hello({ name = 'world' }) {
    return Response.say(`Hello ${name}`).card({ title: 'HelloWorld', content: `Hello ${name}` });
  }

  @Intent('AMAZON.HelpIntent')
  help() {
    return Response.ask('I say hello to people. Who should I say hello to?').reprompt('Who should I say hello to?');
  }

  @Intent('AMAZON.CancelIntent', 'AMAZON.StopIntent')
  stop() {
    return Response.say('Goodbye');
  }

}

Also see model/UTTERANCES for phrases that users may say to interact with this skill and the schema of user intents in model/schema.json that are used to build the interaction model for your skill.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].