$ show amantus-ai/vibetunnel
VibeTunnel is a production-grade, cross-platform remote terminal access platform. It allows users to connect to terminal sessions from a browser, macOS native app, or iOS app. The Node.js/TypeScript server manages PTY sessions via a custom forked node-pty, supports session recording in asciinema format, and integrates with multiple tunneling services (Tailscale, ngrok, Cloudflare, Pinggy, Pangolin) for remote access. A Rust forwarder handles terminal title sanitisation, and the CLI wrapper (`vt`) enables transparent session creation. Authentication supports PAM, SSH keys, JWT, Tailscale identity, and local bypass. The macOS app (SwiftUI) provides menu bar control, system permission management, Git worktree follow-mode, and Sparkle-based updates. The web frontend (Lit + Tailwind CSS) offers a full terminal UI with quick keys, file browser, and push notifications. The project demonstrates strong engineering with extensive test coverage (unit, integration, Playwright e2e) across all platforms, though multi-platform duplication and vendored native dependencies introduce some maintenance overhead.
The LLM identified 5 files worth highlighting for reuse:
Abstract base class for tunnel services (Cloudflare, Pinggy, ngrok). Defines a consistent lifecycle with start/stop/status/restart methods, subprocess spawning with stdio capture, and event emission. Isolates the tunnel-specific logic behind hooks, making it straightforward to add new tunnel providers without duplicating process management code.
Standalone error deduplication utility that throttles repeated log messages by error key within a configurable TTL. Supports summary intervals, cache cleanup, and custom log functions. Imports no internal modules, making it directly portable to any Node.js project needing to prevent log spam.
A Swift enum representing arbitrary JSON values (string, number, bool, null, array, object). Provides safe decoding/encoding with Codable, subscript access for nested dictionaries, and pretty-printing. Has no dependency on internal VibeTunnel types, making it a drop-in JSON representation for any Swift project.
Defines the WebSocket v3 binary framing protocol for terminal I/O. Includes magic number validation, version checking, message type enum (stdout, resize, event, etc.), and serialization/deserialization helpers. Self-contained and could be extracted as a shared library for any real-time terminal streaming application.
Implements a length-prefixed binary message protocol for Unix socket IPC between the Node.js server and the macOS app. Features message parser/builder with magic number, version, sequence ID, and type-value payload. Robust against partial reads and supports streaming. Reusable for any IPC requiring reliable framing.