LoginSignup
3
0

More than 5 years have passed since last update.

ASK CLI で自前のテンプレートからスキルを作成できるようにする

Last updated at Posted at 2018-09-24

ASK CLIコマンドのask new --template <template-name>オプションを使うと、https://github.com/alexa にあるスキルテンプレートを使ってスキルの作成を開始することができる。ただし、--template <template-name>で指定できるのは、  https://s3.amazonaws.com/ask-cli/templates.json にリストされている https://github.com/alexa にアップされている英語のスキルのみ。

これを自作のスキルテンプレートからスキルの開発を開始できるようにしたい。

まず自前のスキルテンプレートをGiuHub.com上に置く。次に、独自のスキルテンプレートリストをS3に置くことで、自前のテンプレートからスキルを開発できるようにする。

以下の手順で行う。

1. テンプレートリストのサンプルをダウンロードする

 https://s3.amazonaws.com/ask-cli/templates.json

2. 中身を自分のGitHubリポジトリをポイントするように編集する

jp-templates.json
{
    "Fact": {
        "gitUrl": "https://github.com/toshimin/skill-sample-nodejs-fact.git"
    },
    "Trivia": {
        "gitUrl": "https://github.com/toshimin/skill-sample-nodejs-trivia.git"
    },
    "Quiz Game": {
        "gitUrl": "https://github.com/toshimin/skill-sample-nodejs-quiz-game.git"
    },
    "Foodie": {
        "gitUrl": "https://github.com/toshimin/skill-sample-nodejs-the-foodie.git"
    }
}

3. jp-templates.json をS3などにアップロードして公開する

4. ask コマンドでスキルを作成する

$ ask new --template Fact --url https://s3-ap-northeast-1.amazonaws.com/alexaskillsassets/jp-templates.json

これで自前で作ったテンプレートがGitHubから落ちてくる。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0