Scripts2026年7月5日·1 分钟阅读

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.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
GoTTY Overview
直接安装命令
npx -y tokrepo@latest install 0b6ee0ca-784d-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

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

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产