useTerminal

Real-time terminal.
In your app.

WebSocket-powered terminal with PTY support, signal handling, and streaming output.

Try Demo

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

sessionIdrequired
string

Terminal session ID

onOutput
(data: string) => void

Output callback

onError
(error: Error) => void

Error callback

onDisconnect
() => void

Disconnect callback

Returns

isConnectedboolean

Connection status

outputstring

Terminal output buffer

sendInput(data: string) => void

Send input

resize(cols, rows) => void

Resize terminal

signal(signal: string) => void

Send signal

clear() => void

Clear output