UNPKG

askme-cli

Version:

askme-cli MCP server that collects user's next plan or confirmation through terminal window

32 lines 1.25 kB
#!/usr/bin/env node import { jsx as _jsx } from "react/jsx-runtime"; import { render } from 'ink'; import { AskMeApp } from './components/AskMeApp.js'; import { CustomStdin } from '../shared/utils/custom-stdin.js'; // Get message and socket path from command line arguments const message = process.argv[2] || "Please enter your next plan or confirmation:"; const socketPath = process.argv[3] || null; // Check if raw mode is supported const isRawModeSupported = !!(process.stdin.isTTY && typeof process.stdin.setRawMode === 'function'); if (isRawModeSupported) { render(_jsx(AskMeApp, { message: message, socketPath: socketPath })); } else { const customStdin = new CustomStdin(); render(_jsx(AskMeApp, { message: message, socketPath: socketPath }), { stdin: customStdin, stdout: process.stdout, stderr: process.stderr }); // Listen to real stdin input and forward to custom stdin process.stdin.setEncoding('utf8'); process.stdin.on('data', (data) => { customStdin.simulateKeypress(data); }); // Ensure stdin is in the correct mode if (process.stdin.setRawMode) { process.stdin.setRawMode(true); } process.stdin.resume(); } //# sourceMappingURL=ask-me-ui.js.map