UNPKG

ask-cli

Version:

Alexa Skills Kit (ASK) Command Line Interfaces

49 lines (48 loc) 1.87 kB
#!/usr/bin/env node "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const semver_1 = __importDefault(require("semver")); if (!semver_1.default.gte(process.version, "8.3.0")) { console.log("Version of node.js doesn't meet minimum requirement."); console.log("Please ensure system has node.js version 8.3.0 or higher."); process.exit(1); } const commander_1 = require("commander"); const commander = new commander_1.Command(); const configure_1 = require("../lib/commands/configure"); const deploy_1 = require("../lib/commands/deploy"); const new_1 = require("../lib/commands/new"); const init_1 = require("../lib/commands/init"); const dialog_1 = require("../lib/commands/dialog"); const run_1 = require("../lib/commands/run"); [configure_1.createCommand, deploy_1.createCommand, new_1.createCommand, init_1.createCommand, dialog_1.createCommand, run_1.createCommand].forEach((command) => command(commander)); commander .description("Command Line Interface for Alexa Skill Kit") .command("smapi", "list of Alexa Skill Management API commands") .command("skill", "increase the productivity when managing skill metadata") .command("util", "tooling functions when using ask-cli to manage Alexa Skill") .version(require("../package.json").version) .parse(process.argv); const ALLOWED_ASK_ARGV_2 = [ "configure", "deploy", "new", "init", "dialog", "smapi", "skill", "util", "help", "-v", "--version", "-h", "--help", "run", ]; if (process.argv[2] && ALLOWED_ASK_ARGV_2.indexOf(process.argv[2]) === -1) { console.log('Command not recognized. Please run "ask" to check the user instructions.'); process.exit(1); }