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:
arkon
2026-01-21 06:19:02 +01:00
co-authored by Claude Opus 4.5
parent b3dd0bcacb
commit 84dab25f38
15 changed files with 1906 additions and 2 deletions
+41
View File
@@ -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();
}