ghosttown

Web Terminal + tmux Sessions

A web-based terminal emulator powered by Ghostty's VT100 parser via WebAssembly. Run commands in isolated tmux sessions and access them through your browser.

Installation

Install ghosttown globally via npm:

Install
$npm install -g @seflless/ghosttown

Quick Start

Start a web server that connects to a terminal session in your browser:

Starts the web server on port 8080. Open http://localhost:8080 in your browser.

Start Server
$ghosttown

Web Server

Start a web-based terminal server with WebSocket PTY support.

Start the server on the default port (8080)

Default Port
$ghosttown

Start the server on a custom port

Custom Port
$ghosttown -p 3000

Set the port via environment variable

Environment Variable
$PORT=3000 ghosttown

tmux Sessions

Run commands in managed tmux sessions. Sessions are named ghosttown-1, ghosttown-2, etc.

Run a command in a new tmux session

Run Command
$ghosttown vim

Run a command with arguments (use quotes)

Run with Arguments
$ghosttown "npm run dev"

List all active ghosttown tmux sessions

List Sessions
$ghosttown list

Attach to a specific session

Attach to Session
$ghosttown attach ghosttown-1

Detach from the current session

Detach from Session
$ghosttown detach

Kill a specific session

Kill Session
$ghosttown -k ghosttown-1

Kill the current session (when inside one)

Kill Current Session
$ghosttown -k

Type 'exit' in the terminal to end the shell and kill the session

Exit & Kill Session
$exit

CLI Aliases

For convenience, you can use shorter aliases:

$ghosttown
$gt
$ght

All three commands are equivalent and can be used interchangeably.

Help

View the full help documentation:

Help
$ghosttown --help

Requirements

tmux

The tmux session features require tmux to be installed on your system.

macOS (Homebrew)
$brew install tmux
macOS (MacPorts)
$sudo port install tmux
Debian/Ubuntu
$sudo apt install tmux
Fedora
$sudo dnf install tmux
Arch Linux
$sudo pacman -S tmux