如果有一种方法可以使用 ASK CLI v2 中包含的 lambda 函数在本地计算机中克隆现有的 Alexa Skill

IF there´s a way of cloning an existing Alexa Skill in a local machine with the lambda functions included with ASK CLI v2

我想用处理它逻辑的 lambda 在本地机器上克隆我现有的 Alexa 技能,在 ASK CLI v1 中我使用了“克隆”命令并且运行良好但现在在 ASK CLI V2 中我没有看不到这个命令,我无法使用 ASK INIT 克隆我的 Alexa 技能。

在 ASK CLI V2 中是否有类似“克隆”的命令?谢谢。

对于Alexa-hosted技能你应该运行:

ask init --hosted-skill-id YOUR_SKILL_ID

根据文档:

ask init [--hosted-skill-id <hosted-skill-id>]
         [--profile | -p <profile>]
         [--debug]

--hosted-skill-id Optional. Specifying the Skill ID of an Alexa-hosted skill starts a workflow to clone the skill to the current directory.

您可以在 documentation 中找到更多有趣的标志。

当您使用自己的 lambda 时,根据 ASK CLI v1 to v2 Migration guide

To migrate skill code hosted on AWS Lambda to a local machine, export the skill code from AWS Lambda. After the skill code has been downloaded, run ask init within the project directory to download Alexa Skill Package resources and set up the project for deployment using the ASK CLI.

对于 Alexa 托管技能,@slawciu 的说明完全正确。

对于Non-hosted技能,请查看ask-cli中的FAQ部分:https://github.com/alexa/ask-cli/blob/develop/docs/FAQ.md#q-since-v2-ask-cli-removes-ask-clone-command-what-should-i-do-to-download-my-skill-project

总而言之,您需要:

 0. $ mkdir {folderName} ; cd {folderName}
 1. $ ask smapi export-package --skill-id {skillID}. 
    // this download skill-package folder to your local
 2. download your lambda source code into the folder.
 3. $ ask init
    //setup your skill project with a wizard command

完成这些步骤后,您可以通过 运行 ask deploy 部署您的项目。