Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsMay 17, 2026·3 min de lecture

ttyd — Share Your Terminal over the Web

ttyd is a lightweight tool that turns a terminal session into a web application, allowing browser-based access to any command-line program.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Needs Confirmation · 66/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
ttyd Overview
Commande CLI universelle
npx tokrepo install 134a2cb4-51c9-11f1-9bc6-00163e2b0d79

Introduction

ttyd exposes a terminal session as a web page, letting anyone with a browser interact with a command-line program running on a remote machine. It is useful for sharing shells, running interactive tools in kiosk mode, or building browser-based terminal interfaces.

What ttyd Does

  • Serves any terminal program (bash, htop, vim, etc.) via a web browser
  • Uses WebSocket for low-latency bidirectional communication
  • Supports multiple concurrent client connections
  • Provides read-only mode for safe observation without input
  • Works with SSL/TLS for encrypted sessions

Architecture Overview

ttyd is written in C and uses libwebsockets for the WebSocket server and xterm.js for the browser-side terminal emulator. When a client connects, ttyd spawns a new pseudo-terminal (pty) running the specified command and bridges I/O between the pty and the WebSocket. The binary is small and has minimal runtime dependencies.

Self-Hosting & Configuration

  • Install via Homebrew, apt, or download a static binary from Releases
  • Run ttyd <command> to start the server on port 7681
  • Use -p to change the listening port and -i to bind to a specific interface
  • Enable TLS with --ssl-cert and --ssl-key for production deployments
  • Add basic authentication with -c username:password

Key Features

  • Sub-megabyte static binary that compiles on Linux, macOS, and FreeBSD
  • Full terminal emulation in the browser via xterm.js, including 256-color and Unicode
  • Read-only mode (-R) for safe live-streaming of terminal output
  • Client-side URL arguments to set terminal size, font, and theme
  • Can run behind a reverse proxy (Nginx, Caddy) with WebSocket pass-through

Comparison with Similar Tools

  • sshx — collaborative terminal sharing with multiplayer cursors; ttyd is a simpler one-command web terminal
  • Gotty — similar concept but unmaintained since 2017; ttyd is actively developed
  • Wetty — Node.js-based web terminal tied to SSH; ttyd is a lightweight C binary serving any command
  • Shellinabox — legacy web terminal; ttyd offers modern xterm.js rendering and WebSocket transport

FAQ

Q: Can multiple users connect at the same time? A: Yes. Each connection gets its own pty by default. Use --once to limit to a single session.

Q: Is it safe to expose ttyd to the internet? A: Use TLS and authentication at minimum. For public use, place it behind a reverse proxy with additional access controls.

Q: Does it support copy and paste? A: Yes. The xterm.js frontend supports clipboard integration in modern browsers.

Q: Can I customize the web UI appearance? A: Yes. Pass xterm.js options via URL query parameters or use a custom index.html with --base-path.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires