Skip to content

shuymn/kastty

Repository files navigation

kastty

A browser-based terminal sharing tool. kastty runs a PTY on your machine, streams it to a local web UI powered by ghostty-web, and lets you view or interact with the session from your browser.

The name combines "cast" and "tty", with a nod to 「彁(ka)」— a ghost kanji that echoes the ghostty-web lineage.

Features

  • Browser-based terminal -- renders a full terminal in the browser using ghostty-web
  • Localhost-only -- binds to 127.0.0.1 with token-based authentication
  • Readonly mode -- share your terminal without allowing input
  • Replay buffer -- new connections receive recent terminal history
  • Bundled fonts -- ships with M PLUS 1 Code and Nerd Fonts Symbols for consistent CJK and icon rendering across environments
  • Font customization -- adjustable font size and family
  • Tab title sync -- browser tab title follows terminal OSC title updates, with state emoji
  • Single dependency runtime -- runs entirely on Bun

Install

Note

kastty supports macOS and Linux only. Windows is not supported.

Homebrew

brew install shuymn/tap/kastty

Usage

kastty [options] [-- command [args...]]

When no command is specified, kastty launches your default shell ($SHELL).

Options

Option Default Description
--port <n> 0 (auto) Port to listen on
--readonly false Start in readonly mode
--font-family <name> - Terminal font family
--scrollback <lines> 50000 Requested terminal scrollback lines in browser (approximate)
--replay-buffer-bytes <n> auto (from --scrollback) Replay buffer size for reconnect restore
--open / --no-open true Auto-open browser
-h, --help - Show CLI help

--scrollback is applied as an internal capacity limit in ghostty-web, so the visible line count varies by output width and escape sequences.

Examples

# Start an interactive shell session
kastty

# Share a readonly session on port 8080
kastty --readonly --port 8080

# Run a specific command with a custom font
kastty --font-family "Fira Code" -- htop

# Pass flags to the target command
kastty -- htop -d 10

# Increase local scrollback and reconnect replay history
kastty --scrollback 200000 --replay-buffer-bytes 33554432

# Start without opening the browser
kastty --no-open

Contributing

Requirements

Setup

bun install

Build

Build a single executable:

bun run build

This produces a kastty binary in the project root.

Development

# Lint
bun run lint

# Format
bun run fmt

# Type check
bun run typecheck

# Run tests
bun test

# All checks
bun run check

License

MIT

About

A browser-based terminal sharing tool powered by ghostty-web and Bun

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages