ghostterm 2.1.1 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,17 +1,58 @@
1
- # GhostTerm — Control Claude Code from Your Phone
1
+ <p align="center">
2
+ <img src="https://ghostterm.pages.dev/img/banner.png" alt="GhostTerm" width="400">
3
+ </p>
2
4
 
3
- > **v2.0: Complete P2P Rewrite** — No more relay servers. Your terminal data never leaves your devices.
5
+ <h1 align="center">GhostTerm</h1>
6
+ <p align="center"><strong>Control Claude Code from Your Phone</strong></p>
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/ghostterm"><img src="https://img.shields.io/npm/v/ghostterm.svg" alt="npm version"></a>
9
+ <a href="https://ghostterm.pages.dev"><img src="https://img.shields.io/badge/mobile-ghostterm.pages.dev-8b5cf6" alt="Mobile App"></a>
10
+ </p>
4
11
 
5
- GhostTerm lets you control your PC terminal from your phone over a **direct peer-to-peer WebRTC connection**. Built for Claude Code users who need to approve prompts, monitor output, and manage sessions on the go.
12
+ > **v2.0: Complete P2P Rewrite** Your terminal data never touches any server. Direct encrypted connection between your phone and PC.
13
+
14
+ GhostTerm is a mobile companion for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) that gives you **full terminal access from your phone** over a direct peer-to-peer connection.
6
15
 
7
16
  ## Why GhostTerm?
8
17
 
9
- **Zero Trust Architecture** Unlike traditional remote terminal tools that route your data through a server, GhostTerm establishes a direct encrypted tunnel between your phone and PC. The signaling server only helps with the initial handshake it never sees your terminal data.
18
+ ### Run Claude Code in Dangerous ModeFrom Your Phone
19
+
20
+ ```bash
21
+ claude --dangerously-skip-permissions
22
+ ```
23
+
24
+ The official Claude Code mobile app doesn't support `--dangerously-skip-permissions`. GhostTerm gives you **full terminal access**, so you can launch Claude in fully autonomous mode and let it work while you're away from your desk. One tap to start, one tap to stop.
25
+
26
+ ### Not Just Claude — Full Terminal Access
27
+
28
+ GhostTerm isn't limited to Claude Code. It's a complete remote terminal. Run **any command** — `git`, `npm`, `python`, `vim`, `docker`, anything your terminal can do. The official app only gives you Claude.
29
+
30
+ ### 4 Terminals at Once
31
+
32
+ Run up to **4 concurrent terminal sessions** with ghost cell tabs. Have Claude Code running in one, a dev server in another, git in the third. Switch between them instantly. The official app gives you one.
33
+
34
+ ### See Everything at a Glance — Pixel Office
35
+
36
+ A unique animated workspace shows all your terminal sessions as pixel ghosts. See which ones are busy, idle, or waiting for input — **without switching tabs**. Know exactly what's happening on your PC from a single screen.
37
+
38
+ ### Encrypted Direct Connection
39
+
40
+ The remote control link between your phone and PC is a **direct WebRTC connection with DTLS encryption**. Your keystrokes and terminal output travel straight between devices — they never pass through GhostTerm's servers or any third party.
41
+
42
+ - **How it works**: Phone ↔ PC direct (the signaling server only helps with pairing, then gets out of the way)
43
+ - **What's encrypted**: Everything you see and type in the remote terminal session
10
44
 
11
- - **End-to-end encrypted** (WebRTC DTLS) not even we can read your data
12
- - **Direct P2P** — sub-millisecond latency, no relay bottleneck
13
- - **Google Sign-In auto-pair** same account on phone + PC, connects instantly
14
- - **No API keys, no SSH, no Tailscale** — just `npx ghostterm` and go
45
+ ### Send Files from Phone to PC
46
+
47
+ Take a photo, pick a file, and send it straight to your PC terminal. Then tap paste to insert the file path. Perfect for sharing screenshots of bugs, uploading configs, or sending reference images to Claude.
48
+
49
+ ### One-Tap Controls
50
+
51
+ Purpose-built buttons for Claude Code workflows:
52
+ - **y / n** — approve or deny permission prompts instantly
53
+ - **claude** — launch Claude Code with one tap
54
+ - **Stop** — send Ctrl+C immediately
55
+ - **Arrow keys, Tab, Escape** — all one tap, no keyboard fumbling
15
56
 
16
57
  ## Quick Start
17
58
 
@@ -22,58 +63,24 @@ npx ghostterm
22
63
  1. Run the command above on your PC (requires [Node.js 18+](https://nodejs.org))
23
64
  2. First time: browser opens for Google sign-in (one-time, remembered after)
24
65
  3. Open **[ghostterm.pages.dev](https://ghostterm.pages.dev)** on your phone
25
- 4. Sign in with the same Google account → **auto-connects, no codes needed**
26
-
27
- ## Features
28
-
29
- | Feature | Description |
30
- |---------|------------|
31
- | **4 Concurrent Terminals** | Manage multiple Claude Code sessions with ghost cell tabs |
32
- | **One-Tap y/n** | Approve or deny Claude Code permission prompts instantly |
33
- | **Pixel Office** | Animated ghost workspace — see all terminals at a glance |
34
- | **File Upload** | Send screenshots and files from phone to PC |
35
- | **Dangerous Mode** | Launch Claude Code with `--dangerously-skip-permissions` |
36
- | **Auto-Reconnect** | Seamless recovery when connection drops |
37
- | **PWA Support** | Add to home screen for native app experience |
38
-
39
- ## What's New in v2.0
40
-
41
- GhostTerm v2.0 is a **ground-up rewrite** replacing the relay architecture with peer-to-peer WebRTC:
66
+ 4. Sign in with the same Google account → **auto-connects, no pairing codes**
42
67
 
43
- - **Before (v1):** Phone → Relay Server → PC (server sees all terminal data)
44
- - **After (v2):** Phone ↔ PC directly (server only helps with pairing)
45
-
46
- This means:
47
- - Your terminal data is **never stored or transmitted through any server**
48
- - Latency drops from ~100ms (relay round-trip) to **<5ms** (direct P2P)
49
- - Server costs are near-zero (signaling only, no data relay)
50
- - Works even if the signaling server goes down (existing connections persist)
51
-
52
- ## Security Model
68
+ ## Security
53
69
 
54
70
  ```
55
- Phone ──── WebRTC DataChannel (DTLS 1.3 encrypted) ────── PC
71
+ Phone ──── WebRTC DataChannel (DTLS encrypted) ────── PC
56
72
 
57
73
  (pairing only)
58
74
 
59
75
  Signaling Server
60
- (exchanges SDP/ICE, never sees terminal data)
76
+ (exchanges connection info, never sees terminal data)
61
77
  ```
62
78
 
63
- - **DTLS encryption**: All terminal data encrypted end-to-end
64
- - **No data at rest**: Signaling server stores nothing
65
- - **One-time pair codes**: 6-digit codes expire in 5 minutes
66
- - **Brute force protection**: 3 wrong codes = 60s lockout
67
- - **Google OAuth**: Verified identity for auto-pairing
68
-
69
- ## How It Works
70
-
71
- 1. Your PC connects to a lightweight signaling server and registers with your Google account
72
- 2. Your phone opens the web app and signs in with the same Google account
73
- 3. The signaling server matches the accounts and facilitates a WebRTC handshake
74
- 4. A direct peer-to-peer connection is established between your phone and PC
75
- 5. All terminal I/O flows directly over the encrypted P2P channel
76
- 6. The signaling server is no longer involved
79
+ - **DTLS encryption** on all terminal data end-to-end, no exceptions
80
+ - **No data at rest** the signaling server stores nothing
81
+ - **Google OAuth** verified identity for secure auto-pairing
82
+ - **Brute force protection** 3 wrong codes = 60s lockout
83
+ - **Private beta** access controlled by email whitelist
77
84
 
78
85
  ## Options
79
86
 
@@ -87,17 +94,11 @@ npx ghostterm [options]
87
94
 
88
95
  ## Requirements
89
96
 
90
- - **Node.js 18+** (for the PC companion)
91
- - **Modern browser** (for the phone Safari, Chrome, Firefox)
92
- - **Google account** (for auto-pairing; or use 6-digit code without login)
93
-
94
- ## Privacy
95
-
96
- - No analytics or tracking on the terminal data path
97
- - Google Sign-In is used solely for pairing — we don't access your Google data
98
- - The signaling server is open-source and can be self-hosted
99
- - All WebRTC connections use DTLS encryption by default
97
+ - **Node.js 18+** on your PC
98
+ - **Modern browser** on your phone (Safari, Chrome, Firefox)
99
+ - **Google account** for auto-pairing
100
100
 
101
- ## License
101
+ ## Links
102
102
 
103
- MIT
103
+ - **Mobile App**: [ghostterm.pages.dev](https://ghostterm.pages.dev)
104
+ - **npm**: [npmjs.com/package/ghostterm](https://www.npmjs.com/package/ghostterm)
@@ -284,8 +284,15 @@ class PtyManager extends EventEmitter {
284
284
  _handleFileUpload(msg, responses) {
285
285
  const fs = require('fs');
286
286
  const tmpDir = os.tmpdir();
287
- const filename = msg.filename || `upload_${Date.now()}${msg.ext || ''}`;
287
+ // Sanitize filename: strip path traversal, only allow safe chars
288
+ const rawName = msg.filename || `upload_${Date.now()}${msg.ext || ''}`;
289
+ const filename = path.basename(rawName).replace(/[^a-zA-Z0-9._\-]/g, '_');
288
290
  const filepath = path.join(tmpDir, filename);
291
+ // Verify resolved path is still inside tmpDir
292
+ if (!path.resolve(filepath).startsWith(path.resolve(tmpDir))) {
293
+ responses.push({ type: 'error', message: 'Invalid filename' });
294
+ return;
295
+ }
289
296
 
290
297
  try {
291
298
  const data = Buffer.from(msg.data, 'base64');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostterm",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Control your PC terminal from your phone — direct P2P, no server in between",
5
5
  "bin": {
6
6
  "ghostterm": "bin/ghostterm-p2p.js"
@@ -21,10 +21,7 @@
21
21
  "node": ">=18.0.0"
22
22
  },
23
23
  "license": "MIT",
24
- "repository": {
25
- "type": "git",
26
- "url": "git+https://github.com/anthropic/ghostterm-p2p.git"
27
- },
24
+ "homepage": "https://ghostterm.pages.dev",
28
25
  "keywords": [
29
26
  "terminal",
30
27
  "remote",