|
14 | 14 |
|
15 | 15 | </div> |
16 | 16 |
|
17 | | -TermBeam lets you access your terminal from a phone, tablet, or any browser — no SSH, no port forwarding, no config files. Run one command and scan the QR code. |
18 | | - |
19 | | -I built this because I kept needing to run quick commands on my dev machine while away from my desk, and SSH on a phone is painful. TermBeam gives you a real terminal with a touch-optimized UI — key bar, swipe scroll, pinch zoom — that actually works on small screens. You get multi-session tabs with split view, terminal search, a command palette, 12 themes, and secure remote access out of the box. |
| 17 | +TermBeam lets you access your terminal from a phone, tablet, or any browser — no SSH, no port forwarding, no configuration needed. Run one command and scan the QR code. |
20 | 18 |
|
21 | 19 | [Full documentation](https://dorlugasigal.github.io/TermBeam/) · [Website](https://termbeam.pages.dev) |
22 | 20 |
|
@@ -47,95 +45,79 @@ termbeam |
47 | 45 |
|
48 | 46 | Scan the QR code printed in your terminal, or open the URL on any device. |
49 | 47 |
|
50 | | -> **First time?** Run `termbeam -i` for a guided setup wizard that walks you through password, port, and access mode. |
51 | | -
|
52 | | -### Secure by default |
53 | | - |
54 | | -TermBeam starts with a tunnel and auto-generated password out of the box — just run `termbeam` and scan the QR code. |
55 | | - |
56 | 48 | ```bash |
57 | 49 | termbeam # tunnel + auto-password (default) |
58 | | -termbeam --password mysecret # use a specific password |
59 | | -termbeam --no-tunnel # LAN-only (no tunnel) |
60 | | -termbeam --no-password # disable password protection |
| 50 | +termbeam --password mysecret # custom password |
| 51 | +termbeam --no-tunnel # LAN only |
61 | 52 | termbeam -i # interactive setup wizard |
62 | 53 | ``` |
63 | 54 |
|
64 | | -## Remote Access |
| 55 | +## Features |
65 | 56 |
|
66 | | -```bash |
67 | | -# Tunnel is on by default |
68 | | -termbeam |
| 57 | +### Mobile-First |
69 | 58 |
|
70 | | -# Persisted tunnel (stable URL you can bookmark, reused across restarts, 30-day expiry) |
71 | | -termbeam --persisted-tunnel |
| 59 | +- **No SSH client needed** — just open a browser on any device |
| 60 | +- **Touch-optimized key bar** with arrows, Tab, Ctrl, Esc, copy, paste, and more |
| 61 | +- **Swipe scrolling**, pinch zoom, and text selection overlay for copy-paste |
| 62 | +- **iPhone PWA safe-area support** for a native-app feel |
72 | 63 |
|
73 | | -# LAN-only (no tunnel) |
74 | | -termbeam --no-tunnel |
75 | | -``` |
| 64 | +### Multi-Session |
76 | 65 |
|
77 | | -If the [Dev Tunnels CLI](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/get-started) is not installed, TermBeam will offer to install it for you automatically. You can also install it manually: |
| 66 | +- **Tabbed terminals** with drag-to-reorder and live tab previews on hover/long-press |
| 67 | +- **Split view** — two sessions side-by-side (auto-rotates horizontal/vertical) |
| 68 | +- **Session colors and activity indicators** for at-a-glance status |
| 69 | +- **Folder browser** for picking working directory, optional initial command per session |
78 | 70 |
|
79 | | -- **Windows:** `winget install Microsoft.devtunnel` |
80 | | -- **macOS:** `brew install --cask devtunnel` |
81 | | -- **Linux:** `curl -sL https://aka.ms/DevTunnelCliInstall | bash` |
| 71 | +### Productivity |
82 | 72 |
|
83 | | -Persisted tunnels save a tunnel ID to `~/.termbeam/tunnel.json` so the URL stays the same between sessions. |
| 73 | +- **Terminal search** with regex, match count, and prev/next navigation |
| 74 | +- **Command palette** (Ctrl+K / Cmd+K) for quick access to all actions |
| 75 | +- **Completion notifications** — browser alerts when background commands finish |
| 76 | +- **12 color themes** with adjustable font size |
| 77 | +- **Port preview** — reverse-proxy a local web server through TermBeam |
| 78 | +- **Image paste** from clipboard |
84 | 79 |
|
85 | | -## CLI Reference |
| 80 | +### Secure by Default |
86 | 81 |
|
87 | | -```bash |
88 | | -termbeam [shell] [args...] # start with a specific shell (default: auto-detect) |
89 | | -termbeam --port 8080 # custom port (default: 3456) |
90 | | -termbeam --host 0.0.0.0 # allow LAN access (default: 127.0.0.1) |
91 | | -termbeam --lan # shortcut for --host 0.0.0.0 |
92 | | -termbeam -i # interactive setup wizard |
93 | | -termbeam resume [name] # reconnect to a running session from another terminal |
94 | | -termbeam list # list active sessions on the running server |
95 | | -termbeam service install # interactive PM2 service setup wizard |
96 | | -termbeam service uninstall # stop & remove PM2 service |
97 | | -termbeam service status # show PM2 service status |
98 | | -termbeam service logs # tail PM2 service logs |
99 | | -termbeam service restart # restart PM2 service |
| 82 | +- **Auto-generated password** with rate limiting and httpOnly cookies |
| 83 | +- **QR code auto-login** with single-use share tokens (5-min expiry) |
| 84 | +- **DevTunnel integration** for secure remote access — ephemeral or persisted URLs |
| 85 | +- **Security headers** (X-Frame-Options, CSP, nosniff) on all responses; only detected shells allowed |
| 86 | + |
| 87 | +## How It Works |
| 88 | + |
| 89 | +TermBeam starts a lightweight web server that spawns a PTY (pseudo-terminal) with your shell, serves a mobile-optimized [xterm.js](https://xtermjs.org/) UI via Express, and bridges the two over WebSocket. Multiple clients can view the same session simultaneously, and sessions persist when all clients disconnect. |
| 90 | + |
| 91 | +```mermaid |
| 92 | +flowchart LR |
| 93 | + A["Phone / Browser"] <-->|WebSocket| B["TermBeam Server"] |
| 94 | + B <-->|PTY| C["Shell (zsh/bash)"] |
| 95 | + B -->|Express| D["Web UI (xterm.js)"] |
| 96 | + B -.->|Optional| E["DevTunnel"] |
100 | 97 | ``` |
101 | 98 |
|
102 | | -| Flag | Description | Default | |
103 | | -| --------------------- | ---------------------------------------------------- | -------------- | |
104 | | -| `--password <pw>` | Set access password (also accepts `--password=<pw>`) | Auto-generated | |
105 | | -| `--no-password` | Disable password (cannot combine with `--public`) | — | |
106 | | -| `--generate-password` | Auto-generate a secure password | On | |
107 | | -| `--tunnel` | Create an ephemeral devtunnel URL (private) | On | |
108 | | -| `--no-tunnel` | Disable tunnel (LAN-only) | — | |
109 | | -| `--persisted-tunnel` | Create a reusable devtunnel URL | Off | |
110 | | -| `--public` | Allow public tunnel access | Off | |
111 | | -| `--port <port>` | Server port | `3456` | |
112 | | -| `--host <addr>` | Bind address | `127.0.0.1` | |
113 | | -| `--lan` | Bind to all interfaces (LAN access) | Off | |
114 | | -| `--log-level <level>` | Log verbosity (error/warn/info/debug) | `info` | |
115 | | -| `-i, --interactive` | Interactive setup wizard (guided configuration) | Off | |
116 | | -| `--force` | Stop existing server before starting a new one | Off | |
117 | | -| `-h, --help` | Show help | — | |
118 | | -| `-v, --version` | Show version | — | |
119 | | - |
120 | | -| Subcommand | Description | |
121 | | -| ------------------- | ------------------------------------------------- | |
122 | | -| `resume [name]` | Attach to a running session from another terminal | |
123 | | -| `list` | List active sessions on the running server | |
124 | | -| `service install` | Interactive PM2 service setup | |
125 | | -| `service uninstall` | Stop & remove from PM2 | |
126 | | -| `service status` | Show PM2 service status | |
127 | | -| `service logs` | Tail PM2 service logs | |
128 | | -| `service restart` | Restart PM2 service | |
129 | | - |
130 | | -Environment variables: `PORT`, `TERMBEAM_PASSWORD`, `TERMBEAM_CWD`, `TERMBEAM_LOG_LEVEL`, `SHELL` (Unix fallback), `COMSPEC` (Windows fallback). See [Configuration docs](https://dorlugasigal.github.io/TermBeam/configuration/). |
| 99 | +## CLI Highlights |
131 | 100 |
|
132 | | -## Security |
| 101 | +| Flag | Description | Default | |
| 102 | +| --------------------- | ----------------------------------------------- | -------------- | |
| 103 | +| `--password <pw>` | Set access password | Auto-generated | |
| 104 | +| `--no-password` | Disable password protection | — | |
| 105 | +| `--tunnel` | Create an ephemeral devtunnel URL | On | |
| 106 | +| `--no-tunnel` | Disable tunnel (LAN-only) | — | |
| 107 | +| `--persisted-tunnel` | Reusable devtunnel URL (stable across restarts) | Off | |
| 108 | +| `--port <port>` | Server port | `3456` | |
| 109 | +| `--host <addr>` | Bind address | `127.0.0.1` | |
| 110 | +| `--lan` | Bind to all interfaces (LAN access) | Off | |
| 111 | +| `-i, --interactive` | Interactive setup wizard | Off | |
| 112 | +| `--log-level <level>` | Log verbosity (error/warn/info/debug) | `info` | |
| 113 | + |
| 114 | +For all flags, subcommands, and environment variables, see the [Configuration docs](https://dorlugasigal.github.io/TermBeam/configuration/). |
133 | 115 |
|
134 | | -TermBeam auto-generates a password and creates a tunnel by default, so your terminal is protected out of the box. By default, the server binds to `127.0.0.1` (localhost only). Use `--lan` or `--host 0.0.0.0` to allow LAN access, or `--no-tunnel` to disable the tunnel. |
| 116 | +## Security |
135 | 117 |
|
136 | | -Auth uses secure httpOnly cookies with 24-hour expiry, login is rate-limited to 5 attempts per minute, and security headers (X-Frame-Options, X-Content-Type-Options, etc.) are set on all responses. Each QR code contains a single-use share token (5-minute expiry) for password-free login. API clients that can't use cookies can authenticate with an `Authorization: Bearer <password>` header. |
| 118 | +TermBeam auto-generates a password and creates a secure tunnel by default, binding to `127.0.0.1` (localhost only). Auth uses httpOnly cookies with 24-hour expiry, login is rate-limited to 5 attempts per minute, QR codes contain single-use share tokens (5-min expiry), and security headers (X-Frame-Options, CSP, nosniff) are set on all responses. |
137 | 119 |
|
138 | | -For the full threat model, safe usage guidance, and a quick safety checklist, see [SECURITY.md](SECURITY.md). For detailed security feature documentation, see the [Security Guide](https://dorlugasigal.github.io/TermBeam/security/). |
| 120 | +For the full threat model and safety checklist, see [SECURITY.md](SECURITY.md). For detailed security documentation, see the [Security Guide](https://dorlugasigal.github.io/TermBeam/security/). |
139 | 121 |
|
140 | 122 | ## Contributing |
141 | 123 |
|
|
0 commit comments