# GoTTY — Share Your Terminal as a Web Application > GoTTY is a Go-based tool that turns your CLI into a shareable web application, letting users interact with your terminal through a browser. ## Install Save as a script file and run: # GoTTY — Share Your Terminal as a Web Application ## Quick Use ```bash go install github.com/yudai/gotty@latest gotty -w bash # Open http://localhost:8080 in your browser ``` ## Introduction GoTTY converts any command-line tool into a web application that runs in a browser. It is useful for sharing terminal sessions, building web-based dashboards around CLI tools, and providing remote access to interactive terminal programs without requiring SSH. ## What GoTTY Does - Runs any CLI command and exposes it as a web page via WebSocket - Supports read-only and read-write modes for interactive sessions - Provides TLS/SSL support for encrypted connections - Works with any terminal application including vim, top, and tmux - Includes client authentication via basic auth or custom credentials ## Architecture Overview GoTTY starts an HTTP server that serves a JavaScript-based terminal emulator (hterm) to the browser. When a client connects, GoTTY spawns the specified command and bridges the command's stdin/stdout/stderr to the browser over a WebSocket connection. Each browser tab gets its own process instance, and the server handles multiplexing across all connected clients. ## Self-Hosting & Configuration - Install via `go install` or download prebuilt binaries from GitHub releases - Configure with command-line flags or a `~/.gotty` config file - Set `-w` flag to enable write (interactive) mode for the browser user - Use `--tls` with certificate and key files for HTTPS connections - Restrict access with `--credential user:pass` for basic authentication ## Key Features - Zero-dependency single binary written in Go - Real terminal emulation in the browser via hterm - Customizable window title and terminal preferences - Support for reconnecting after network interruptions - Profile-based configuration for repeated use ## Comparison with Similar Tools - **ttyd** — C-based alternative with broader platform support and active maintenance - **Wetty** — Node.js SSH-over-HTTP terminal, heavier runtime dependency - **Shell In A Box** — Older C daemon, no WebSocket, less modern UX - **tmate** — Focuses on terminal sharing via unique URLs with tmux integration ## FAQ **Q: Is GoTTY secure for production use?** A: Use TLS and authentication flags when exposing GoTTY beyond localhost. Without them, anyone with network access can interact with your terminal. **Q: Can multiple users connect at the same time?** A: Yes. Each browser tab spawns its own process instance. They do not share state unless the underlying command supports it. **Q: Does GoTTY work with tmux or screen?** A: Yes. Pass `tmux` or `screen` as the command argument and users get a full multiplexed terminal session. **Q: What browsers are supported?** A: Any modern browser with JavaScript and WebSocket support, including Chrome, Firefox, Safari, and Edge. ## Sources - https://github.com/yudai/gotty - https://github.com/yudai/gotty#usage --- Source: https://tokrepo.com/en/workflows/asset-0b6ee0ca Author: Script Depot