clsh  by my-claude-utils

Remote terminal and AI agent access from any device

Created 3 months ago
499 stars

Top 61.7% on SourcePulse

GitHubView on GitHub
Project Summary

Provides real-time terminal access from any device, including phones and tablets, by streaming a genuine PTY session from a user's machine. It targets developers and power users who need to manage servers or run commands remotely without the limitations of SSH or simulated terminals, offering a seamless, pocket-sized command-line experience.

How It Works

The project leverages node-pty to create and manage real pseudo-terminals (PTYs) on the host machine, supporting up to 8 concurrent sessions. These sessions are streamed via WebSockets to a React-based frontend rendered by xterm.js, which handles full terminal interactivity and color. Connectivity is established through a 3-tier tunneling system (ngrok, SSH via localhost.run, or local Wi-Fi) to expose the agent securely. For session persistence, tmux control mode (-CC) is automatically utilized, allowing sessions to survive agent restarts.

Quick Start & Requirements

  • Primary install/run: npx clsh-dev
  • Prerequisites: Node.js 20+ and macOS or Linux. tmux is recommended for session persistence. ngrok requires separate installation for a permanent URL.
  • Links: Live Demo, Getting Started, How It Works, Contributing.

Highlighted Details

  • Real PTY Streaming: Offers true terminal emulation, not a simulation, with full support for shells, colors, and interactive tools like vim and tmux.
  • Mobile-Optimized Keyboard: Features a custom keyboard with sticky modifiers, key repeat, and a context strip for enhanced terminal use on mobile devices, alongside 6 distinct visual skins.
  • Session Persistence: Automatically wraps sessions in tmux control mode to ensure they survive server restarts, preserving scrollback history.
  • Flexible Tunneling: Supports ngrok (for static URLs), SSH (localhost.run for zero-signup), and local Wi-Fi fallback, ensuring connectivity in various environments.
  • PWA Support: Can be installed as a Progressive Web App for a fullscreen, native-app-like experience without browser chrome.
  • Robust Security: Implements multi-layered security including one-time bootstrap tokens, JWT, scrypt password hashing, WebAuthn biometrics, HTTPS enforcement, and rate limiting.

Maintenance & Community

The project provides contribution guidelines (CONTRIBUTING.md) and a security disclosure policy (SECURITY.md). Specific details on active maintainers, sponsorships, or community channels like Discord/Slack are not detailed in the README.

Licensing & Compatibility

  • License: MIT.
  • Compatibility: The MIT license is permissive, generally allowing for commercial use and integration into closed-source projects.

Limitations & Caveats

Session persistence requires tmux to be installed. macOS lid-close behavior may interrupt network connections unless pmset -c tcpkeepalive 1 is configured. Features like remote cloud machines and team sharing are on the roadmap and not yet implemented. Native iOS/Android applications are also planned for the future.

Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
9 stars in the last 30 days

Explore Similar Projects

Starred by Patrick Kidger Patrick Kidger(Core Contributor to JAX ecosystem), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
7 more.

vibetunnel by amantus-ai

0.1%
5k
Turn any browser into your terminal
Created 1 year ago
Updated 17 hours ago
Feedback? Help us improve.