mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 00:49:41 +02:00
feat(tui): add terminal user interface with Ink
Add a full TUI for Claudeman using Ink (React for CLI): - StartScreen: Shows existing sessions from screens.json - TabBar: Session tabs with status indicators - TerminalView: PTY output display with scrolling - StatusBar: Session info and keyboard shortcuts - HelpOverlay: Full keyboard shortcut reference Features: - Session discovery from ~/.claudeman/screens.json - Tab navigation (Ctrl+Tab, Ctrl+1-9) - Create new sessions (connects to web API) - Kill sessions via screen commands - Keyboard-driven navigation Usage: claudeman tui Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @fileoverview TUI entry point for Claudeman
|
||||
*
|
||||
* Renders the terminal user interface using Ink (React for CLI).
|
||||
* This provides a full-screen TUI similar to the web interface,
|
||||
* with tabs for sessions and real-time terminal output.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { render } from 'ink';
|
||||
import { App } from './App.js';
|
||||
|
||||
/**
|
||||
* Checks if the terminal supports raw mode (required for TUI)
|
||||
*/
|
||||
function isRawModeSupported(): boolean {
|
||||
return Boolean(
|
||||
process.stdin.isTTY &&
|
||||
typeof process.stdin.setRawMode === 'function'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the TUI application
|
||||
* @returns Promise that resolves when the app exits
|
||||
*/
|
||||
export async function startTUI(): Promise<void> {
|
||||
// Check if we're in an interactive terminal
|
||||
if (!isRawModeSupported()) {
|
||||
console.error('Error: TUI requires an interactive terminal with TTY support.');
|
||||
console.error('Make sure you are running this command in a real terminal, not piped.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Clear the terminal for full-screen experience
|
||||
process.stdout.write('\x1b[2J\x1b[H');
|
||||
|
||||
const { waitUntilExit } = render(<App />);
|
||||
|
||||
await waitUntilExit();
|
||||
}
|
||||
Reference in New Issue
Block a user