UNPKG

openai-cli-unofficial

Version:

A powerful OpenAI CLI Coding Agent built with TypeScript

42 lines 1.88 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HelpManager = void 0; const chalk_1 = __importDefault(require("chalk")); const boxen_1 = __importDefault(require("boxen")); class HelpManager { constructor(messages) { this.messages = messages; } showHelp(commands) { const help = this.messages.main.help; const smartInput = help.smartInput; const commandList = commands.map(cmd => `${chalk_1.default.cyan(cmd.name)} - ${chalk_1.default.gray(cmd.description)}`).join('\n'); const helpContent = chalk_1.default.bold(help.availableCommands + '\n\n') + commandList + '\n\n' + chalk_1.default.yellow(smartInput.title + '\n') + chalk_1.default.gray('• ' + smartInput.showMenu + '\n') + chalk_1.default.gray('• ' + smartInput.matchCommands + '\n') + chalk_1.default.gray('• ' + smartInput.directExecute + '\n') + chalk_1.default.gray('• ' + smartInput.fileSearch + '\n') + chalk_1.default.gray('• ' + smartInput.showFileSearch + '\n') + chalk_1.default.gray('• ' + smartInput.matchFileSearch + '\n') + chalk_1.default.gray('• ' + smartInput.navigation); const helpBox = (0, boxen_1.default)(helpContent, { padding: 1, margin: { top: 1, bottom: 1, left: 0, right: 0 }, borderStyle: 'round', borderColor: 'blue', title: help.title, titleAlignment: 'center' }); process.stdout.write(helpBox + '\n'); } updateLanguage(messages) { this.messages = messages; } } exports.HelpManager = HelpManager; //# sourceMappingURL=help.js.map