Amazon Alexa

Alexa CLI(β版)をインストールして、スキル一覧を表示させてみた

いつ出るのかなーと言い続けていたものがついに出ました。 Quick Start Alexa Skills Kit Command-Line Interface とりあえずインストールとちょっと触ってみた程度ですが、速報兼 […]

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

いつ出るのかなーと言い続けていたものがついに出ました。

Quick Start Alexa Skills Kit Command-Line Interface

とりあえずインストールとちょっと触ってみた程度ですが、速報兼覚書として。

インストール

npmからダウンロードできますので、以下のようにしてDLします。

$  npm install -g ask-cli

askでヘルプが出ればOK

$ ask

  Usage: ask [options] [command]

  Command Line Interface for Alexa Skill Management API


  Options:

    -v, --version  output the version number of ask-cli
    -h, --help     output usage information


  Commands:

    init [options]       initialize the ask-cli with your Amazon developer account credentials
    deploy [options]     deploy a skill to your developer account
    new [options]        create a new skill project on your computer
    clone [options]      clone an existing skill project on your computer
    simulate [options]   simulate a user using your skill
    lambda               list of AWS Lambda commands
    api                  list of Alexa Skill Management API commands
    help [cmd]           display help for [cmd]

セットアップ

ask initでセットアップする必要があります。

$ ask init
? Please type in your new profile name:
 ask-test
-------------------- Initialize CLI --------------------
Setting up ask profile: [ask-test]
? Please choose one from the following AWS profiles for skill's Lambda function deployment.

  default 
❯ hide-dev 
  hide-fluct 

認証

amazonログイン画面がでました

権限を与えることを確認されます

要求される権限は以下です。

  • Alexaスキルの詳細を更新する権限
  • Alexaスキルのアカウントリンク設定を読み取る権限
  • Alexaスキルのインタラクションモデルを更新する権限
  • Alexaスキルのアカウントリンク設定を更新する権限
  • スキルを呼び出す機能
  • Alexaスキルのインタラクションモデルを読み取る権限

認証に成功しました。

スキル一覧を確認する

initが終わったので早速ツールを触ってみます。
--profileaws-cliの引数を渡す必要があるみたいでしたので、複数人で作業される場合は.envrcに環境変数として持たせるなどすると良さそうです。

$ ask api list-skills --profile hide-dev
{
  "skills": [
    {
      "lastUpdated": "2017-08-09T16:07:30.813Z",
      "nameByLocale": {
        "en-US": "Example Flash Briefing Skills"
      },
      "skillId": "amzn1.ask.skill.XXXXXXXXXXXXXXXX"
    },
    {
      "lastUpdated": "2017-08-09T16:30:13.525Z",
      "nameByLocale": {
        "en-US": "Example City Guide"
      },
      "skillId": "amzn1.ask.skill.XXXXXXXXXXXXXXXX"
    },
    {
      "lastUpdated": "2016-06-20T10:54:44.096Z",
      "nameByLocale": {
        "en-US": "AMIMOTO Ninja"
      },
      "skillId": "amzn1.echo-sdk-ams.app.XXXXXXX"
    },
  ]
}

ask apiでできること

各コマンドの使い方については、ask help [cmd]で確認できます。

$ ask help api

  Usage: ask-api 

  $ ask api [options] [command]

  The api command provides a number of subcommands that enable you to create and modify skills associated with your developer account. There are subcommands for creating and updating the skill, interaction model, and account linking information as well as starting the skill certification process.


  Options:

    -h, --help  output usage information


  Commands:

    get-model [options]                get an interaction model for skill
    head-model [options]               get the ETag associated with an interaction model
    update-model [options]             create/update the new interaction model for skill
    get-model-status [options]         get the model build status of an interaction model
    create-skill [options]             create a skill
    get-skill [options]                get a skill
    update-skill [options]             update the skill configuration details
    list-skills [options]              list skills for a vendor
    get-skill-status [options]         get the skill status for a skill
    list-vendors [options]             get the vendor ID(s) associated with your developer account
    create-account-linking [options]   create/update account linking configuration for a skill
    get-account-linking [options]      get account linking configuration for a skill
    submit [options]                   submit a skill for certification
    withdraw [options]                 withdraw a skill from the certification process
    simulate-skill [options]           simulate a skill
    get-simulation [options]           get simulation result
    invoke-skill [options]             invoke a skill

とりあえず今日はここまで。
JAWS-UG KOBE Alexa meetup #08ではもう少し突っ込んだ話もしたいなと思いますので、興味がある方はぜひ!

ブックマークや限定記事(予定)など

WP Kyotoサポーター募集中

WordPressやフロントエンドアプリのホスティング、Algolia・AWSなどのサービス利用料を支援する「WP Kyotoサポーター」を募集しています。
月額または年額の有料プランを契約すると、ブックマーク機能などのサポーター限定機能がご利用いただけます。

14日間のトライアルも用意しておりますので、「このサイトよく見るな」という方はぜひご検討ください。

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

Related Category posts