beeline-cli
Version:
A terminal wallet for the Hive blockchain - type, sign, rule the chain
45 lines • 2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const simple_plugins_js_1 = require("../utils/simple-plugins.js");
const neon_js_1 = require("../utils/neon.js");
// This is a dynamic command that proxies to plugin commands
class PluginProxy extends core_1.Command {
async run() {
const { argv } = await this.parse(PluginProxy);
const theme = await (0, neon_js_1.getTheme)();
if (argv.length === 0) {
console.log(theme.chalk.error(`${neon_js_1.neonSymbols.cross} No command specified`));
return;
}
const commandName = argv[0];
const args = argv.slice(1);
const flags = {}; // Simple implementation - no flag parsing for now
try {
const pluginManager = (0, simple_plugins_js_1.getPluginManager)();
await pluginManager.initialize();
const commands = pluginManager.getCommands();
if (!commands.has(commandName)) {
console.log(theme.chalk.error(`${neon_js_1.neonSymbols.cross} Unknown command: ${commandName}`));
console.log('');
console.log('Available plugin commands:');
for (const [name, cmd] of commands.entries()) {
console.log(` ${theme.chalk.highlight(name)} - ${cmd.description}`);
}
return;
}
await pluginManager.executeCommand(commandName, args, flags);
}
catch (error) {
console.log(theme.chalk.error(`${neon_js_1.neonSymbols.cross} Command failed: ${error instanceof Error ? error.message : 'Unknown error'}`));
}
}
}
PluginProxy.description = 'Execute plugin commands';
PluginProxy.hidden = true; // Hide from help
PluginProxy.flags = {
help: core_1.Flags.help({ char: 'h' })
};
PluginProxy.strict = false; // Allow arbitrary args
exports.default = PluginProxy;
//# sourceMappingURL=plugin-proxy.js.map