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 more information about hosted skills, see Build a Skill End-to-end Using an Alexa-hosted Skill.
In addition to starting your Alexa-hosted skill from a template provided in the developer console, you can also import an Alexa-hosted skill from a public Git project. That means that 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.
- Prerequisites and requirements
- Import an Alexa-hosted skill from a public Git project
- Post-import tasks
- Supported project structure
- Related topics
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 more information, 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
- Open the Alexa developer console and log in.
- Click Create Skill. The Create a new skill page appears.
- For Skill name, type a name.
- For Default language, choose a language.
- For Choose a model to add to your skill, select Custom.
- For Choose a method to host your skill's backend resources, select Alexa-Hosted (Node.js) or Alexa-Hosted (Python).
- Click Create Skill. The Choose a template to add to your skill page appears.
- Click Import skill. The Import skill dialog appears.
- Enter the .git link to the Git repository that contains the skill that you want to import.
- 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.
After you import your Alexa-hosted skill, you might have some additional tasks to perform, such as the following:
- If your skill includes dependent services that are not supported by Alexa-hosted Skills, such as DynamoDB, SageMaker, or Amazon Translate, you must use your personal AWS resources in your skill. For more information, see Use Personal AWS Resources with Your Alexa-hosted Skill.
- If your skill requires account linking, you must configure it. For more information, see Understand Account Linking for Alexa Skills.
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)
SkillPackageName ├── 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 │ └── isp2.json └── skill.json
Skill package format (Python)
SkillPackageName ├── 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)
├── .ask/config ├── skill.json ├── isps/ ├── lambda/ │ ├── index.js │ └── package.json ├── models │ └── xx-YY.json
ASK CLI v1 format (Python)
├── .ask/config ├── skill.json ├── isps/ ├── lambda/ │ ├── lambda_function.py │ └── requirements.txt ├── models │ └── xx-YY.json