UNPKG

botpress

Version:

The world's first CMS for bots. Easily create, manage and extend chatbots.

73 lines (39 loc) 3.68 kB
'use strict'; var _commander = require('commander'); var _commander2 = _interopRequireDefault(_commander); var _init = require('./init'); var _init2 = _interopRequireDefault(_init); var _start = require('./start'); var _start2 = _interopRequireDefault(_start); var _create = require('./create'); var _create2 = _interopRequireDefault(_create); var _update = require('./update'); var _update2 = _interopRequireDefault(_update); var _migrate = require('./migrate'); var _migrate2 = _interopRequireDefault(_migrate); var _list = require('./list'); var _list2 = _interopRequireDefault(_list); var _auth = require('./auth'); var _ghostSync = require('./ghost-sync'); var _ghostSync2 = _interopRequireDefault(_ghostSync); var _cloudPair = require('./cloudPair'); var _cloudPair2 = _interopRequireDefault(_cloudPair); var _util = require('../util'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _commander2.default.command('init [dirName]').description('Create a new bot in new directory (or in current directory if not provided)').option('-y, --yes', 'Say yes to every prompt and use default values').action(_init2.default); const defaultWatchExt = '.js,.jsx,.json,.yml'; const defaultBotpressCloudEndpoint = 'https://botpress.cloud'; _commander2.default.command('start [path]').alias('s').description('Starts running a bot').option('-w, --watch', 'Watch bot for changes, and restart automatically').option('--watchExt <extensions>', `When watching, which file extensions to watch. Default: "${defaultWatchExt}"`, defaultWatchExt).option('--watchDir <dir>', `When watching, what to watch. Can be repeated. Default: Directory of botfile.js`, _util.collectArgs, []).option('--watchIgnore <file|dir>', `When watching, what to ignore. Can be repeated. Default: dataDir, watchExt from botfile.js, and node_modules`, _util.collectArgs, []).option('-i, --inspect', 'Inspect bot with "debugger"').action(_start2.default); _commander2.default.command('list').alias('ls').description('List installed modules').action(_list2.default); _commander2.default.command('create').alias('c').description('Create a new module for development or distribution').action(_create2.default); _commander2.default.command('update [version]').alias('up').description('Updates your bot and all the modules to a specific version').action(_update2.default); _commander2.default.command('migrate <fromVersion>').description('Migrates the current bot from version X').action(_migrate2.default); _commander2.default.command('login <bot-server-url>').description('Login to the given bot instance. Provide the full base URL for the bot, like https://mybot.herokuapp.com.').action(_auth.login); _commander2.default.command('logout [bot-server-url]').description('Forget saved auth for the given bot instance, or all recorded auth tokens (if bot URL is not specified)').action(_auth.logout); _commander2.default.command('ghost-sync <bot-server-url>').description('Pull the ghost content from the remote bot instance and apply it locally.').action(_ghostSync2.default); _commander2.default.command('cloud-pair <api-token>').description('Pairs your local bot with the Botpress Cloud (supercharges your bot)').option('--endpoint <endpoint-url>', `Change the Botpress Cloud server endpoint. Default: "${defaultBotpressCloudEndpoint}"`, defaultBotpressCloudEndpoint).action(_cloudPair2.default); _commander2.default.version((0, _util.getBotpressVersion)()).description('Easily create, manage and extend chatbots.').parse(process.argv); if (!_commander2.default.args.length) { _commander2.default.help(); } //# sourceMappingURL=index.js.map