@ismail-elkorchi/terminal-ui
Build typed prompts and full-screen terminal applications from the same component, layout, input, accessibility, and testing foundations.
terminal-ui is ESM-only, has no runtime dependencies, and supports Node =24, current Deno and Bun, and memory-backed tests.
The 0.1.x line is a development release. Public declarations are marked stable, beta, or experimental in the generated API reference. Terminal graphics remain experimental pending physical-terminal compatibility evidence.
Install
Node:
npm install @ismail-elkorchi/terminal-uiBun:
bun add @ismail-elkorchi/terminal-uiDeno:
deno add jsr:@ismail-elkorchi/terminal-uiUse the root entrypoint for ordinary applications. Focused entrypoints such as /prompts, /testing, /theme, and /component keep specialized APIs discoverable without requiring private imports.
Run a Prompt
import { input, runPrompt } from '@ismail-elkorchi/terminal-ui/prompts';
const result = await runPrompt(input({
label: 'Project name',
required: true
}));
if (result.status === 'submitted') {
console.log(result.value);
} else {
console.error(`Prompt ${result.reason}`);
}Cancellation, validation failure, timeout, non-TTY denial, and host failure are typed results rather than ordinary control-flow exceptions.
Build a TUI
Applications own state. Components render that state and emit typed messages; update() is the only place that changes it.
import {
button,
column,
defineTui,
runTui,
text
} from '@ismail-elkorchi/terminal-ui';
interface State {
readonly count: number;
}