Your Alexa Dashboards Settings

Programmatically Manage and Test Your Skills

Alexa Skill Management API and Alexa Skills Kit Command-line Interface

Developers can programmatically manage and test their skills with the Alexa Skill Management API (SMAPI) and the Alexa Skills Kit Command-line Interface (ASK CLI). The Alexa Skill Management API is a set of API operations that allows you to programmatically manage and test Alexa skills and related resources such as interaction models. The Alexa Skills Kit Command-line Interface is a command-line application that lets users create, update, test, and submit Alexa skills for publishing by calling SMAPI under the hood.

Skill builders can use the ASK CLI and tool builders can use SMAPI to programmatically manage and test Alexa skills and related resources such as interaction models. These features are available in beta on the Amazon Developer Portal supporting the US English, UK English, and German languages.

Blog: Announcing SMAPI and ASK CLI

SMAPI documentation

ASK CLI documentation

 

Frequently Asked Questions
  1. What is the Alexa Skill Management API?
    The Alexa Skill Management API (SMAPI) is a set of API operations that allows developers to programmatically manage and test Alexa skills and related resources such as skill Manifest, account linking and interaction models.
     

  2. What is the Alexa Skills Kit Command Line Interface?
    The Alexa Skills Kit Command Line Interface (ASK CLI) is a command-line application that lets users create, update, test and submit Alexa skills for publishing, by calling SMAPI under the hood. In addition to the low-level API commands like create-skill or update-model, the CLI also offers more integrated, high-level commands such as “ask new”, which creates a sample skill project, and “ask deploy”, which deploys the entirety of your skill by calling multiple APIs.
     

  3. Who should use SMAPI, and who should use ASK CLI?
    Developers who want to create tools or services that skill developers can use to design, build, test, and manage skills will program their tools to call the API directly. Developers who want to automate management or testing of their own skills should use the ASK CLI instead of calling the raw HTTP API.
     

Alexa Skills Management API (SMAPI)

  1. How do I use the Alexa Skill Management API?
    If you are building your own tool or service that needs to call SMAPI on behalf of the user (developer), you need to create a Login with Amazon client profile and implement OAuth integration with the Login with Amazon service. This allows your tool or service to manage Alexa skills on behalf of the user without getting long term credentials such as account username and password. Please check out the Calling the Alexa Skill Management API as a Login with Amazon Client section of the documentation.
     

  2. Is the API production-ready? What about backwards compatibility?
    The API is built to support production workloads, but the design is currently in beta. This means that there may be some changes to the API to improve its design and quality. Backwards-compatible changes will continue to be added to the beta (v0) version of the API. When the v1 version of the API launches, it may include changes that are not backwards-compatible with the v0 version.
     

Alexa Skills Kit Command Line Interface (ASK CLI)

  1. Why should I use the ASK CLI?
    For developers used to operating in the command line, ASK CLI offers a fast way to create, test, update, share and submit skill and lambda interactively. You can also use it in scripts to abbreviate workflows involving skill management or automating testing use cases. In addition, you can use it in a CI/CD pipeline to continuously deliver skill updates to the development stage.
     

  2. What are the prerequisites to using the CLI?
    You first need to create an Amazon developer account at https://developer.amazon.com/. If you want to use AWS Lambda to host your skill’s code, you also need to create an AWS account at https://aws.amazon.com/. You can reuse your existing Amazon retail account to sign up to both. Once you have an AWS account, you can follow the instructions here to set up your credentials: https://aws.amazon.com/blogs/security/a-new-and-standardized-way-to-manage-credentials-in-the-aws-sdks/. To install the CLI, you need a Node.js runtime (v4.3 or above) and NPM.
     

  3. How do I install the ASK CLI?
    The CLI written in Node.js and available as an NPM package. Users can install the CLI by typing into the command line.

    $ npm install -g ask-cli

     

  4. How do I set up the CLI?
    Once installed, you need to run the

    $ ask init

     

    command. This will open a browser window where you will log in with your Amazon account email and password. This will create the default user profile for you. This profile will be used in conjunction with the AWS credentials you set up earlier to execute the commands. After the initial login, the CLI is able to maintain the authentication state, so the user does not have to log in again, except when he/she needs to work in a different account.
     

  5. I’m working only in the command line, so the browser window can’t be opened. What do I do?
    You can do

    $ ask init --no-browser

     

    and the CLI will walk you through initialization using a browser on a different device.
     

  6. How do I get started on a new skill with the CLI?
    You can use the

    $ ask new --skill-name mynewskill 

     

    command to create a new skill project. This will create a “hello-world” skill in a new directory. Now, you can do
     

    $ cd mynewskill
    $ ask deploy

     

    This will call multiple APIs across SMAPI and AWS to create a working skill in development stage. Once the “deploy” command finishes running, you should be able to do “ask api get-build-status --skill-id {skill_id} --locale {locale}” to get the build status of your interaction model. Once the build is complete, your skill should be invokable from any Alexa-enabled device registered to your Amazon developer account.
     

  7. What exactly happens during the first deployment?
    First, an Alexa skill in development stage is created. Then, the skill’s interaction model is updated. Next, the skill’s AWS Lambda function is created; this involves creating an AWS IAM role with AWS Lambda basic execution role policy and then creating the Lambda function that will host your skill’s code, attached to the previously created IAM role. The Lambda function is configured to become callable by ASK. Then, the Alexa skill is updated to point to the newly created Lambda endpoint.
     

  8. What happens in subsequent deployments?
    Since all the resources have already been created, subsequent deployments will simply update the existing resources. If the interaction model is updated, it will trigger a model build, and the developer will have to wait until the model build is complete.