Skip to content

About

Shared TypeScript terminal protocol, streaming, browser, Node, and Worker primitives.

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Latest commit

 

History

163 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@openclaw/libterminal

TypeScript primitives for terminal protocols, streaming, rendering, and WebSocket bridges across browsers, Node.js, and Cloudflare Workers.

Install

pnpm add @openclaw/libterminal

The Node.js adapters require Node.js ^22.18.0 || >=24.11.0. Install the optional PTY driver when using spawnLocalPty():

pnpm add node-pty

Exports

Import the entry point for your runtime. Browser and Worker entry points do not import Node.js built-ins. Subpaths below extend @openclaw/libterminal.

Entry point Provides
@openclaw/libterminal Shared terminal types and errors
/protocol Protocol v2 codecs and validation
/stream Bounded replay, fanout, and batching
/browser Ghostty WASM terminals and terminal hub client
/node Local PTYs, raw stdio, and Ghostty assets
/worker WebSocket bridging and control checks
/worker-assets Embedded Ghostty assets and HTTP responses
/testing Deterministic terminal test doubles

For example:

import { decodeTerminalFrame } from "@openclaw/libterminal/protocol";
import { BoundedReplayBuffer } from "@openclaw/libterminal/stream";

Streaming

Replay buffers, fanout subscriptions, and batch publishers copy incoming bytes. Queues are bounded. See streaming and byte ownership.

Browser

Create a read-only Ghostty terminal or connect a multiplexed terminal WebSocket. See browser integration for assets, cancellation, and color queries.

Node.js

Spawn a local PTY, attach stdio, or serve Ghostty assets. See Node.js integration for setup and teardown behavior.

Workers

Bridge authenticated WebSockets or serve embedded Ghostty assets. See Worker integration for control checks and asset routes.

Protocol

Wire-protocol versions and package versions are independent. See protocol compatibility and the protocol v2 specification.

Safety

Applications own authentication, authorization, public listeners, storage, and transcripts. The package does not log or persist terminal bytes. See the integration boundaries and security policy.

Development

Use the pinned pnpm version and a supported development runtime. See CONTRIBUTING.md for setup, validation, review, and release steps. The Ghostty validation guide explains browser e2e coverage and performance measurements.

About

Shared TypeScript terminal protocol, streaming, browser, Node, and Worker primitives.

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages