UNPKG

1.26 kBJavaScriptView Raw
1#!/usr/bin/env node
2/* eslint-disable global-require */
3
4if (!require('semver').gte(process.version, '8.3.0')) {
5 console.log('Version of node.js doesn\'t meet minimum requirement.');
6 console.log('Please ensure system has node.js version 8.3.0 or higher.');
7 process.exit(1);
8}
9
10require('module-alias/register');
11const commander = require('commander');
12
13require('@src/commands/configure').createCommand(commander);
14require('@src/commands/deploy').createCommand(commander);
15require('@src/commands/new').createCommand(commander);
16require('@src/commands/init').createCommand(commander);
17require('@src/commands/dialog').createCommand(commander);
18
19commander
20 .description('Command Line Interface for Alexa Skill Kit')
21 .command('smapi', 'list of Alexa Skill Management API commands')
22 .command('util', 'tooling functions when using ask-cli to manage Alexa Skill')
23 .version(require('../package.json').version)
24 .parse(process.argv);
25
26const ALLOWED_ASK_ARGV_2 = ['configure', 'deploy', 'new', 'init', 'dialog', 'smapi', 'util', 'help', '-v', '--version', '-h', '--help'];
27if (process.argv[2] && ALLOWED_ASK_ARGV_2.indexOf(process.argv[2]) === -1) {
28 console.log('Command not recognized. Please run "ask" to check the user instructions.');
29}