question

KralikX avatar image
KralikX asked

How to clone existing Alexa skill to ASK project?

I have got several skills which I have created/edited in Alexa console so far. Now I am trying to version them and automate deployment with ASK CLI.

I tried command:

ask api get-skill --skill-id amzn1.ask.skill.a6a1080c-9b4d-49df-b521-86b30f5ab22d –-stage development

which I believed would download skill JSON files locally, but no matter what I try I am getting error:

	Please input required parameter: skill-id.

Is there a preferred way how to clone existing alexa skill from console to local ASK-managed project?

Thanks in advance for any tips!

Richard.

how-toask clialexa for business
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anand@Amazon avatar image
Anand@Amazon answered

Hello there,

Try to use clone command in ASK CLI to clone projects in in your local system.

It creates a new local skill project by cloning an existing skill from its development stage. You cannot clone a skill from its live stage. When you clone a skill that includes in-skill purchases, the in-skill purchases will be cloned as well.

$ ask clone -s <skill ID> -p <profile> --debug

If ask clone is run without options, then a list of skills (sorted by LastModified) will be displayed, and the user can select the skill from the list to clone.

Note: If there is an existing skill project directory with the same name as the skill being cloned, the directory will be overwritten.

For more details please check this link.

7 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

There doesn't seem to be any "ask clone" feature in the ask CLI anymore. Can you advise?

0 Likes 0 ·

If you are using cli v2, which, I guess you do, because it removed 'clone', you can follow steps in this thread to copy the skill, or downgrade cli to v1.

0 Likes 0 ·

Yes @thingamagig . In new ASK CLI v2 there is no "ask clone" command.

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.

Check this link for more details.

0 Likes 0 ·

I don't understand. I have the lastest ask cli and I've tried that before. If you do "ask init" and then put in the skill code, it'll create a directory structure with ask-resources.json, infrastructure/, lambda/ and skill-package/ but there's nothing in the lambda/ or skill-package/ directories when it finishes. And infrastructure/ and ask-resources.json have nothing useful. That is, I don't see my skill "stuff" anywhere after doing this.

If you do the "ask init --hosted-skill-id SKILLID" I just get [Error]:{"message":"Resource not found."}.

Gonna need more information.

Maybe I should just copy the JSON from the console and start from there?

0 Likes 0 ·
Show more comments
KralikX avatar image
KralikX answered

Thanks for help Anand! I missed `ask clone` command in the docs. With the help of it I found out that ASK CLI doesn't see the skill I see in the console, that means I've probably got IAM/credentials problem somewhere else.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Vlad avatar image
Vlad answered

Got the same question, but unrelated to versioning. If I developed a skill using the Console, and now I'd like to add purchase/products options to it (which seems to be doable only via ASK CLI) - how do I "check out" and deploy back to the same skill ID? If I use "clone" option, then during deploy it tries to create a new version of the skill with a different skillId, which is not what I'm looking for.

2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello Vlad,

Whenever you clone any project to your system it will generate .ask file including lambda and model. In this folder there is a config file which has all details like skill ID. If you don't want to create a new skill and want to update in the same existing skill id then the same existing skill id you can provide in that config file.

3 Likes 3 ·
Vlad avatar image Vlad Anand@Amazon ♦ ·

Thanks! You guys should probably mention it somewhere in the docs

1 Like 1 ·
Ron Wang avatar image
Ron Wang answered

Hey guys, please check our FAQ section for the explanation and replacement of the "clone" command. Thanks!


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

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.