Import an Alexa-Hosted Skill from a Public Git Repository


When you create an Alexa-hosted skill, Alexa provisions and manages resources on AWS for you. The service also stores code that you can develop by using the online code editor or offline tools such as the Alexa Skills Kit Command Line Interface (ASK CLI) or Visual Studio Code. For an overview of hosted skills, see About Alexa-hosted Skills.

You can create a new Alexa-hosted skill by importing a skill project from a public Git repository as described in this documentation. By importing your skill from a public Git project, you can start your skill from a wide variety of open source templates shared by the skill building community on platforms such as GitHub, GitLab, and Bitbucket.

You can also create an Alexa-hosted skill in the following alternate ways:

Prerequisites and requirements

The following are the prerequisites and requirements for importing an Alexa-hosted skill from a public Git project:

  • The size of the Git project archive must not exceed 50MB.
  • The Git project must use the Node.js or Python programming language.
  • The Git project must contain the language that you select as the default language when you create the skill.
  • The skill code in the Git project must contain the voice interaction model and response code.
  • The project files must have the correct structure. For details, see supported project structure.
  • The code files that contain your handlers must be named index.js (for Node.js) or lambda_function.py (for Python).

Import an Alexa-hosted skill from a public Git project

To import an Alexa-hosted skill from a public Git repository

  1. Open the Alexa developer console and log in.
  2. Click Create Skill. The Create a new skill page appears.
  3. For Skill name, type a name.
  4. For Default language, choose a language.
  5. For Choose a model to add to your skill, select Custom.
  6. For Choose a method to host your skill's backend resources, select Alexa-Hosted (Node.js) or Alexa-Hosted (Python).
  7. Click Create Skill. The Choose a template to add to your skill page appears.
  8. Click Import skill. The Import skill dialog appears.
  9. Enter the .git link to the Git repository that contains the skill that you want to import.
  10. Click Continue. The message Creating your Alexa-hosted skill appears. If Alexa validates that the Git repository contains an Alexa skill that it can import, Alexa creates your Alexa-hosted skill.

Post-import tasks

After you import your Alexa-hosted skill, you might have some additional tasks to perform, such as the following:

Supported project structure

The project that you import to create an Alexa-hosted skill must have a particular structure. There are two options for the project structure. You can use the skill package format, or you can use the ASK CLI v1 format. Choose a project structure that corresponds to your preferred programming language.

Skill package format (Node.js)

SkillName
└── lambda
│   ├── index.js
│   └── package.json
|
└── skill-package
    └── assets
    |   └── images
    |       ├── en-US_largeIcon.png
    |       ├── en-US_smallIcon.png
    |       ├── isp1
    |       │   ├── en-US_largeIcon.png
    |       │   └── en-US_smallIcon.png
    |       └── isp2
    |           ├── en-US_largeIcon.png
    |           └── en-US_smallIcon.png
    |
    └── interactionModels
    |   └── custom
    |       └── en-US.json
    |
    └── isps
    |   ├── isps.json
    |   ├── isp1.json
    |   └── exampleDirectory
    |       └── isp2.json
    |
    └── skill.json

Skill package format (Python)

SkillName
└── lambda
│   ├── lambda_function.py
│   └── requirements.txt
|
└── skill-package
    └── assets
    |   └── images
    |       ├── en-US_largeIcon.png
    |       ├── en-US_smallIcon.png
    |       ├── isp1
    |       │   ├── en-US_largeIcon.png
    |       │   └── en-US_smallIcon.png
    |       └── isp2
    |           ├── en-US_largeIcon.png
    |           └── en-US_smallIcon.png
    |
    └── interactionModels
    |   └── custom
    |       └── en-US.json
    |
    └── isps
    |   ├── isps.json
    |   ├── isp1.json
    |   └── exampleDirectory
    |       └── isp2.json
    |
    └── skill.json

ASK CLI v1 format (Node.js)

SkillName
├── .ask/config
├── skill.json
└── isps/
|
└── lambda/
│   ├── index.js
│   └── package.json
|
└── models
    └── xx-YY.json

ASK CLI v1 format (Python)

SkillName
├── .ask/config
├── skill.json
└── isps/
|
└── lambda/
│   ├── lambda_function.py
│   └── requirements.txt
|
└── models
    └── xx-YY.json

Was this page helpful?

Last updated: Sep 10, 2024