UNPKG

ask-cli-x

Version:

Alexa Skills Kit (ASK) Command Line Interfaces

52 lines (51 loc) 2.06 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 = __importDefault(require("commander")); 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 compile_1 = require("../lib/commands/compile"); const run_1 = require("../lib/commands/run"); const decompile_1 = require("../lib/commands/decompile"); [configure_1.createCommand, deploy_1.createCommand, new_1.createCommand, init_1.createCommand, dialog_1.createCommand, compile_1.createCommand, run_1.createCommand, decompile_1.createCommand].forEach((command) => command(commander_1.default)); commander_1.default .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", "compile", "decompile", "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 "askx" to check the user instructions.'); process.exit(1); }