Update package dependencies to include 'ink' and 'ink-text-input' for enhanced terminal UI capabilities. Add new script 'start:ink' for launching the ink-based CLI interface. Clean up example.js by removing unnecessary whitespace for improved readability.

This commit is contained in:
sebseb7
2025-08-12 01:40:32 +02:00
parent 91d28779d6
commit edf0d3cffb
5 changed files with 671 additions and 4 deletions

23
cli-ink.js Normal file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env node
import 'dotenv/config';
import React from 'react';
import { render } from 'ink';
import InkApp from './src/ui/InkApp.js';
const { unmount } = render(React.createElement(InkApp));
// ESC to exit
if (process.stdin.isTTY) {
try { process.stdin.setRawMode(true); } catch { }
const onData = (data) => {
const str = typeof data === 'string' ? data : String(data);
if (str === '\u001b' || (str.length && str.charCodeAt(0) === 27)) {
unmount();
try { process.stdin.setRawMode(false); } catch { }
process.exit(0);
}
};
process.stdin.on('data', onData);
}