useTerminal
Real-time terminal.
In your app.
WebSocket-powered terminal with PTY support, signal handling, and streaming output.
Simple API.
Powerful results.
One hook gives you everything: output streaming, input handling, connection status, and signal control.
Terminal.tsx
Loading code...
cmdop-terminal
$git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
$_
Everything you need.
Built for real-world terminal applications.
Real-time Streaming
WebSocket-powered output streaming. See results as they happen.
Full Input Support
Send commands, handle special keys, and control the PTY.
Signal Control
Send SIGINT, SIGTERM, and other signals to manage processes.
API Reference
Options
sessionIdrequiredstringTerminal session ID
onOutput(data: string) => voidOutput callback
onError(error: Error) => voidError callback
onDisconnect() => voidDisconnect callback
Returns
isConnectedbooleanConnection status
outputstringTerminal output buffer
sendInput(data: string) => voidSend input
resize(cols, rows) => voidResize terminal
signal(signal: string) => voidSend signal
clear() => voidClear output