beeline-cli
Version:
A terminal wallet for the Hive blockchain - type, sign, rule the chain
54 lines • 2.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@oclif/core");
const crypto_js_1 = require("../utils/crypto.js");
const TerminalUI_js_1 = require("../ui/TerminalUI.js");
const neon_js_1 = require("../utils/neon.js");
class UI extends core_1.Command {
async run() {
const { flags } = await this.parse(UI);
const theme = await (0, neon_js_1.getTheme)();
try {
// Initialize KeyManager
const keyManager = new crypto_js_1.KeyManager();
await keyManager.initialize();
// Clear screen and show loading message
console.clear();
console.log(theme.chalk.glow(`${neon_js_1.neonSymbols.diamond} Starting Beeline Terminal UI...`));
// Create and initialize the terminal UI
const ui = new TerminalUI_js_1.TerminalUI(keyManager, {
mock: flags.mock,
node: flags.node
});
await ui.initialize();
ui.run();
}
catch (error) {
console.clear();
console.log(theme.chalk.error(`${neon_js_1.neonSymbols.cross} Failed to start UI: ${error instanceof Error ? error.message : 'Unknown error'}`));
console.log('');
console.log(theme.chalk.info('You can still use individual commands:'));
console.log(theme.chalk.highlight('beeline balance --help'));
console.log(theme.chalk.highlight('beeline transfer --help'));
console.log(theme.chalk.highlight('beeline accounts --help'));
}
}
}
UI.description = 'Launch the visual terminal interface for Beeline wallet';
UI.examples = [
'$ beeline ui',
'$ beeline ui --mock'
];
UI.flags = {
mock: core_1.Flags.boolean({
char: 'm',
description: 'use mock data for testing',
default: false
}),
node: core_1.Flags.string({
char: 'n',
description: 'RPC node to use',
})
};
exports.default = UI;
//# sourceMappingURL=ui.js.map