Alexa CLI Commands

Learn how to build and deploy Alexa projects using the Jovo CLI.

Introduction

The Alexa CLI plugin allows you to interact with the Alexa Developer Console using the Jovo CLI.

To use the Alexa CLI, add it as plugin to your jovo.project.js file. Learn more about Alexa project configuration here.

const { ProjectConfig } = require('@jovotech/cli');
const { AlexaCli } = require('@jovotech/platform-alexa');
// ...

const project = new ProjectConfig({
  // ...
  plugins: [
    new AlexaCli(),
    // ...
  ],
});

The Alexa CLI plugin uses the official ASK (Alexa Skills Kit) CLI provided by Amazon for deployment. For the deployment to work, you need to at least set up a default ASK profile using the ASK CLI. Follow the official Alexa docs to install and configure ASK CLI.

The Alexa CLI plugin hooks into the following commands:

  • build: Create Alexa project files based on the project config and models folder
  • deploy: Deploy project files to the Alexa Developer Console
  • get: Synchronize your local project files with the Alexa Developer Console

build

The Alexa CLI plugin hooks into the build command and creates a platform.alexa folder inside the build directory in the root of your Jovo project. Learn more about the build command here.

$ jovo build:platform alexa

It uses the Alexa jovo.project.js configuration and files in the models folder to create Alexa-specific project files that are ready for deployment.

The folder then contains an ask-resources.json file and a skill-package folder as explained in the official Alexa docs.

The Alexa CLI plugin adds the following flags to the build command:

Flag Description Examples
--ask-profile Add the specified ASK profile to the ask-states.json file. Learn more about ASK profile configuration here. --ask-profile default

deploy

The Alexa CLI plugin hooks into the deploy:platform command to deploy the Alexa project files (which were previously generated using the build command) to the Alexa Developer Console. Learn more about the deploy:platform command here.

$ jovo deploy:platform alexa

After successful deployment, you can open the Alexa Developer Console and see the changes there.

The Alexa CLI plugin adds the following flags to the deploy:platform command:

Flag Description Examples
--ask-profile Deploy to using the specified ASK profile. Learn more about ASK profile configuration here. --ask-profile default

get

The Alexa CLI plugin hooks into the get:platform command to synchronize the files in your build directory with the project data from the Alexa Developer Console. Learn more about the get:platform command here.

$ jovo get:platform alexa

This is helpful if you've made any updates to the Skill's configuration (for example updating interfaces) that you now want to add to the jovo.project.js file using the files configuration.

The Alexa CLI plugin adds the following flags to the get:platform command:

Flag Description Examples
--ask-profile Retrieve data using the specified ASK profile. Learn more about ASK profile configuration here. --ask-profile default