alwaysai
Version:
The alwaysAI command-line interface (CLI)
39 lines • 1.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const alwayscli_1 = require("@alwaysai/alwayscli");
const target_config_file_1 = require("../../util/target-config-file");
const app_installer_1 = require("../../app-installer");
exports.appShellCliLeaf = alwayscli_1.createLeaf({
name: 'shell',
description: 'Run a shell in the target environment',
action() {
const target = target_config_file_1.targetConfigFile.readSpawner();
const targetConfig = target_config_file_1.targetConfigFile.read();
switch (targetConfig.protocol) {
case 'docker:': {
target.runForegroundSync({
exe: '/bin/bash',
args: ['--rcfile', app_installer_1.ACTIVATE],
tty: true,
cwd: '.',
expose5000: true,
});
break;
}
case 'ssh+docker:': {
target.runForegroundSync({
exe: '/bin/bash',
args: ['--rcfile', app_installer_1.ACTIVATE],
tty: true,
cwd: '.',
expose5000: true,
});
break;
}
default: {
throw new Error('Unsupported protocol');
}
}
},
});
//# sourceMappingURL=shell.js.map