LoginSignup
4
1

More than 5 years have passed since last update.

[JAWS-UG CLI] Alexa Skills Kit Command Line Interface (ASK CLI)のセットアップ

Last updated at Posted at 2017-10-11

Alexa Skills Kit Command Line Interface (ASK CLI)をセットアップします。

オリジナル手順:https://developer.amazon.com/ja/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html#step-2-install-and-initialize-ask-cli

前提条件

1. nodeのインストール (nodebrewを使う場合)

コマンド
curl -L git.io/nodebrew | perl - setup
結果
Fetching nodebrew...
Installed nodebrew in $HOME/.nodebrew

========================================
Export a path to nodebrew:

export PATH=$HOME/.nodebrew/current/bin:$PATH
========================================

~/.bashrcにPATHを追記します。

.bashrcに追記
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bashrc
コマンド
. ~/.bashrc 
コマンド
which nodebrew
結果(例)
/Users/taro/.nodebrew/current/bin/nodebrew

nodeをバイナリでインストールします。(v6.10.0の例)

コマンド
nodebrew install-binary v6.10.0
コマンド
nodebrew use v6.10.0
node -v
結果(例)
v6.10.0

自動的にnpmもインストールされているはずです。

コマンド
which npm
結果(例)
/Users/taro/.nodebrew/current/bin/npm
コマンド
npm -v
結果(例)
3.10.10

2. ASK CLIのインストール

コマンド
npm install -g ask-cli
コマンド
which ask
結果(例)
<HOMEディレクトリ>/.nodebrew/current/bin/ask

3. ASKの初期化

コマンド
ask init --no-browser
出力
There is no AWS credentials setup yet, do you want to continue the initialization? (Default: False)
入力
Y
出力
Paste the following url to your browser:
<URL>

? Please enter your Authorization Code:
  • をコピーしてブラウザのURL欄に貼り付けます。
  • "OK"(ボタン)をクリックします。
  • Authorization Codeが表示されるので、黒い枠の中のテキストをコピーします。
  • 上記でターミナルに表示されている"Please enter your Authorization Code:"の後ろにペーストし、エンターキーを押します。
出力
Tokens fetched and recorded in ask-cli config.
Vendor ID set as XXXXXXXXXXXX

Profile [default] initialized successfully.

4. 事後確認

コマンド
ask init -l
結果(例)
Profile              Associated AWS Profile
  [default]                 <プロファイル名>

~/.ask/cli_configに認証情報が保存されています。

完了

4
1
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
4
1