
Security News
GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.
@chat-tools/tui
Advanced tools
Comprehensive Terminal User Interface (TUI) components library for building sophisticated terminal-based chat applications with AI integration, tool calling, and human-in-the-loop approval systems
A comprehensive Terminal User Interface (TUI) components library built with React and Ink for creating sophisticated terminal-based chat applications with AI integration, tool calling, and human-in-the-loop approval systems.
pnpm add @chat-tools/tui
# or
npm install @chat-tools/tui
# Run the interactive demo
pnpm demo
# Navigate with 1-8 keys to explore components
# Press 8 for live interactive demo with working commands
ChatViewDisplay messages with role-based styling and metadata support.
import { ChatView } from "@chat-tools/tui";
const messages = [
{
id: "1",
role: "user",
content: "Hello!",
timestamp: new Date(),
},
{
id: "2",
role: "assistant",
content: "Hi there! How can I help?",
timestamp: new Date(),
},
];
<ChatView messages={messages} loading={false} />;
MessageInputInteractive message input with placeholder support.
import { MessageInput } from "@chat-tools/tui";
<MessageInput
value={inputValue}
onChange={setInputValue}
onSubmit={handleSubmit}
placeholder="Type a message..."
/>;
CommandInputGeneric command system with configurable triggers and suggestions.
import { CommandInput } from "@chat-tools/tui";
const commands = [
{
name: "help",
description: "Show available commands",
handler: () => console.log("Help!"),
aliases: ["h"],
},
{
name: "exit",
description: "Exit the application",
handler: () => process.exit(0),
aliases: ["quit", "q"],
},
];
<CommandInput
trigger="/"
commands={commands}
onSubmit={handleMessage}
placeholder="Type / for commands..."
/>;
ToolMessageDisplay tool execution results with status indicators.
import { ToolMessage } from "@chat-tools/tui";
<ToolMessage
toolName="file-operations"
status="completed"
result="Successfully listed 5 files"
duration={245}
parameters={{ path: "/current/dir" }}
/>;
ToolConfirmationTool execution approval with risk assessment.
import { ToolConfirmation } from "@chat-tools/tui";
<ToolConfirmation
toolName="dangerous-command"
description="This will delete files"
riskLevel="high"
parameters={{ target: "/tmp/files" }}
onConfirm={handleConfirm}
onCancel={handleCancel}
allowEdit={true}
/>;
ApprovalPromptSimple approval prompt for user confirmation.
import { ApprovalPrompt } from "@chat-tools/tui";
<ApprovalPrompt
message="Execute this command?"
command="rm -rf /important"
onApprove={handleApprove}
onDeny={handleDeny}
/>;
SuggestionsDisplaySmart suggestions with categories and confidence scoring.
import { SuggestionsDisplay } from "@chat-tools/tui";
const suggestions = [
{
id: "1",
text: "git status",
description: "Check repository status",
category: "command",
confidence: 0.9,
},
];
<SuggestionsDisplay
suggestions={suggestions}
onSelect={handleSelect}
showCategories={true}
/>;
HistoryViewerBrowse command and message history with filtering.
import { HistoryViewer } from "@chat-tools/tui";
const history = [
{
id: "1",
timestamp: new Date(),
type: "command",
content: "git status",
status: "success",
},
];
<HistoryViewer items={history} onSelect={handleSelect} filterType="all" />;
Dialog & ConfirmDialogModal overlays for confirmations and information.
import { Dialog, ConfirmDialog } from '@chat-tools/tui';
<Dialog
title="Settings"
isOpen={showDialog}
onClose={closeDialog}
>
<Text>Dialog content here</Text>
</Dialog>
<ConfirmDialog
title="Confirm Action"
message="Are you sure you want to proceed?"
isOpen={showConfirm}
onConfirm={handleConfirm}
onCancel={handleCancel}
variant="warning"
/>
RadioButtonSelectRadio button selection with keyboard navigation.
import { RadioButtonSelect } from "@chat-tools/tui";
const options = [
{ value: "option1", label: "Option 1", description: "First option" },
{ value: "option2", label: "Option 2", description: "Second option" },
];
<RadioButtonSelect
options={options}
value={selectedValue}
onChange={setSelectedValue}
title="Choose an option"
/>;
ProgressBar & LoadingSpinnerProgress indication and loading states.
import { ProgressBar, LoadingSpinner } from '@chat-tools/tui';
<ProgressBar
current={45}
total={100}
label="Processing..."
variant="bar"
/>
<LoadingSpinner
text="Loading..."
variant="dots"
color="cyan"
/>
StatusBarConnection status and system information display.
import { StatusBar } from "@chat-tools/tui";
<StatusBar
status="connected"
connectionInfo="OpenAI GPT-4"
extensionInfo="Shell Extension"
messageCount={42}
/>;
TextBufferText display with highlighting and scrolling.
import { TextBuffer, TextBufferManager } from "@chat-tools/tui";
const buffer = new TextBufferManager(1000);
buffer.addLine("Log entry 1");
buffer.addLine("Log entry 2");
<TextBuffer
lines={buffer.getLines()}
showLineNumbers={true}
highlightPattern={/error/gi}
highlightColor="red"
/>;
MaxSizedBoxSize-constrained container with alignment options.
import { MaxSizedBox } from "@chat-tools/tui";
<MaxSizedBox
maxWidth={80}
maxHeight={20}
horizontalAlign="center"
verticalAlign="center"
>
<Text>Centered content</Text>
</MaxSizedBox>;
useKeypressEnhanced keyboard event handling with shortcuts.
import { useKeypress, useKeyboardShortcuts } from "@chat-tools/tui";
useKeypress((event) => {
if (event.key === "escape") {
handleEscape();
}
});
useKeyboardShortcuts({
help: { key: { key: "h", ctrl: true }, handler: showHelp },
quit: { key: { key: "q", ctrl: true }, handler: quit },
});
useCompletionSmart autocompletion with debouncing and filtering.
import { useCompletion, useCommandCompletion } from "@chat-tools/tui";
const commands = ["git status", "git commit", "git push"];
const completion = useCommandCompletion(query, commands, handleAccept, {
minQueryLength: 2,
debounceMs: 300,
});
useAtCommandProcessor@ command parsing and execution system.
import { useAtCommandProcessor } from "@chat-tools/tui";
const commands = [
{
command: "help",
description: "Show help",
handler: async (args) => console.log("Help:", args),
},
];
const processor = useAtCommandProcessor(commands, { prefix: "@" });
import { Layout, ChatView, CommandInput, StatusBar } from "@chat-tools/tui";
function AIChatApp() {
return (
<Layout>
<ChatView messages={messages} loading={isLoading} />
<CommandInput
trigger="/"
commands={chatCommands}
onSubmit={handleMessage}
/>
<StatusBar
status="connected"
connectionInfo="Claude 3.5 Sonnet"
messageCount={messages.length}
/>
</Layout>
);
}
import { ToolConfirmation, ToolMessage } from "@chat-tools/tui";
function ToolInterface() {
return (
<>
{showConfirmation && (
<ToolConfirmation
toolName="execute-command"
description="Run shell command"
riskLevel="medium"
parameters={{ command: "npm install" }}
onConfirm={executeTool}
onCancel={cancelTool}
/>
)}
<ToolMessage
toolName="file-operations"
status="completed"
result="Files processed successfully"
/>
</>
);
}
Components are designed to work together seamlessly:
import {
Layout,
ChatView,
CommandInput,
StatusBar,
Dialog,
} from "@chat-tools/tui";
function ComprehensiveApp() {
return (
<Layout>
<ChatView messages={messages} />
{showSettings && (
<Dialog title="Settings" isOpen onClose={closeSettings}>
<RadioButtonSelect
options={settingsOptions}
value={currentSetting}
onChange={updateSetting}
/>
</Dialog>
)}
<CommandInput trigger="/" commands={appCommands} onSubmit={handleInput} />
<StatusBar
status="connected"
connectionInfo="AI Assistant"
messageCount={messages.length}
/>
</Layout>
);
}
function MultiAgentChat() {
const agents = ["assistant", "coder", "reviewer"];
return (
<Layout>
<ChatView messages={messages} loading={isProcessing} />
<SuggestionsDisplay
suggestions={agentSuggestions}
onSelect={selectAgent}
title="Available Agents"
/>
<CommandInput
trigger="@"
commands={agentCommands}
onSubmit={handleAgentCommand}
/>
</Layout>
);
}
function DevTool() {
return (
<Layout>
<TextBuffer
lines={logLines}
showLineNumbers={true}
highlightPattern={/ERROR|WARN/gi}
highlightColor="red"
/>
<ProgressBar
current={buildProgress}
total={100}
label="Building project..."
/>
<CommandInput
trigger="/"
commands={devCommands}
onSubmit={executeDevCommand}
/>
</Layout>
);
}
All components are fully typed with TypeScript. See individual component files for detailed prop interfaces.
Components use Ink's styling system with consistent color schemes:
Standard keyboard shortcuts across components:
This library is part of the Chat Tools Framework. Components should:
MIT License - see LICENSE file for details.
Built with ❤️ for the terminal-native future of AI interactions
FAQs
Comprehensive Terminal User Interface (TUI) components library for building sophisticated terminal-based chat applications with AI integration, tool calling, and human-in-the-loop approval systems
We found that @chat-tools/tui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.