My useful ASK CLI command combinations

The post is lists of my useful ASK CLI combination commands, to help to develop your Alexa Skill easier. Deplo […]

広告ここから
広告ここまで

目次

    The post is lists of my useful ASK CLI combination commands, to help to develop your Alexa Skill easier.

    Deploy and enable test mode

    Sometimes, your skill that deployed by ASK CLI is not enabled test mode. So you can run the following command to enable test mode certainly.

    #!/bin/sh
    ask deploy
    ask api enable-skill -s $(cat .ask/config | jq -r .deploy_settings.default.skill_id)

    Or you can run one-liner script like this.

    $ ask deploy && ask api enable-skill -s $(cat .ask/config | jq -r .deploy_settings.default.skill_id)

    Simulate your skill

    You can test your Alexa skill byask simuration. But the command has many properties…

    So, you can combinate ASK CLI and jq to run your simulation easily.

    $ ask simulate -s $(cat .ask/config | jq -r .deploy_settings.default.skill_id) -l en-US -t "open $(cat models/en-US.json | jq -r .interactionModel.languageModel.invocationName)"

    The example for en-USlocation. If you want to simulate another language, please change the filename and -loptions.

    Describe AWS Lambda log

    You can get the AWS Lambda logs by ask lambda log command.And you can easy to get it by following command.

    $ ask lambda log -f $(cat .ask/config | jq -r .deploy_settings.default.resources.lambda[0].functionName)

    Request certificate

    Of course, you can request the certificate by CLI easier.

    $ ask api submit -s $(cat .ask/config | jq -r .deploy_settings.default.skill_id)

    Pick the failed validation message

    You can check your skill before request the certificate byask validate command. But the command returns all result of the validation.

    If you want to check just failed item, you should use the jqcommand like the following command.

    $ ask validate -l en-US | jq '.result.validations[] | select(.status == "FAILED")'
    ✓ Validation created for validation id: xxxxx-xxxx-xxxx
    ◟ Waiting for validation response{
      "locale": "en-US",
      "title": "The example phrases that you choose to present to users in the Alexa app must be selected from your sample utterances. For example: "Alexa, ask {your invocation name} to {sample utterance present in your intent}."Please see <a href="https://developer.amazon.com/docs/custom-skills/understanding-how-users-invoke-custom-skills.html#cert-utterances-support-invocation">our documentation</a> for more information on ensuring your sample utterances support invocation phrases. Please also see <a href="https://developer.amazon.com/blogs/alexa/post/74d0ed59-ad4f-470a-abcf-d37c10a1dfd6/crafting-great-example-phrases-that-meet-certification-requirements"> our blogpost</a> for more guidance on creating example phrases.",
      "status": "FAILED",
      "importance": "REQUIRED"
    }
    {
      "locale": "en-US",
      "title": "The example phrases that you chose to present to users in the companion app currently use unsupported launch phrasing.rnPlease refer to <a href="https://developer.amazon.com/docs/custom-skills/understanding-how-users-invoke-custom-skills.html#cert-invoke-specific-request>Understanding how users invoke custom skills</a> for more information on supported launch phrasing.",
      "status": "FAILED",
      "importance": "REQUIRED"
    }
    

    When your skill is ready for the certification, the command will return nothing.

    $ ask validate -l en-US | jq '.result.validations[] | select(.status == "FAILED")'
    ✓ Validation created for validation id: 81ebcd48-5560-4d08-a274-48ec638256c7
    ◟ Waiting for validation response

    広告ここから
    広告ここまで

    Random posts

    Home
    Search
    Bookmark