conduit-mobile 0.1.0
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/LICENSE +21 -0
- package/README.md +255 -0
- package/package.json +44 -0
- package/src/client/app.js +419 -0
- package/src/client/index.html +76 -0
- package/src/client/manifest.json +22 -0
- package/src/client/speech.js +39 -0
- package/src/client/style.css +320 -0
- package/src/server/auth.js +14 -0
- package/src/server/index.js +169 -0
- package/src/server/terminals.js +91 -0
- package/src/server/tunnel.js +131 -0
- package/src/server/wakelock.js +107 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CloneTerminal Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<br />
|
|
4
|
+
|
|
5
|
+
<img src="docs/images/logo.svg" alt="Conduit" width="80" />
|
|
6
|
+
|
|
7
|
+
# Conduit
|
|
8
|
+
|
|
9
|
+
**Run Claude Code from your phone.**
|
|
10
|
+
|
|
11
|
+
No app install. No third-party chat relay. Just your terminal, in your browser, wherever you are.
|
|
12
|
+
|
|
13
|
+
<br />
|
|
14
|
+
|
|
15
|
+
[](LICENSE)
|
|
16
|
+
[](https://nodejs.org)
|
|
17
|
+
[](CONTRIBUTING.md)
|
|
18
|
+
[](#)
|
|
19
|
+
|
|
20
|
+
<br />
|
|
21
|
+
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## What is this?
|
|
27
|
+
|
|
28
|
+
You're deep in a Claude Code session, away from your desk. Your phone is the only screen you have.
|
|
29
|
+
|
|
30
|
+
**Conduit** is a tiny Node.js server you run on your laptop. It manages your terminal sessions and serves a mobile-optimised web app. Your phone connects over an encrypted WebSocket tunnel — you see live terminal output, type your message, hit Send, and it lands straight in the terminal. Multiple sessions, tabbed. Special keys toolbar for navigating prompts. Speech input built in.
|
|
31
|
+
|
|
32
|
+
Close your laptop lid. Lock your screen. The server keeps running.
|
|
33
|
+
|
|
34
|
+
No WhatsApp. No Telegram. No API keys for a relay service. Just a URL and a token.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## How it works
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
┌──────────────────────────────────────────────────────────────────┐
|
|
42
|
+
│ Your Laptop │
|
|
43
|
+
│ │
|
|
44
|
+
│ node-pty ──► terminals.js ──► WebSocket server (port 3131) │
|
|
45
|
+
│ (Claude Code, bash, etc.) │ │
|
|
46
|
+
│ │ │
|
|
47
|
+
│ Cloudflare Tunnel │
|
|
48
|
+
│ │ │
|
|
49
|
+
└────────────────────────────────────────┼─────────────────────────┘
|
|
50
|
+
│ WSS / HTTPS
|
|
51
|
+
┌──────────▼───────────────┐
|
|
52
|
+
│ Your Phone │
|
|
53
|
+
│ │
|
|
54
|
+
│ ┌─────────────────────┐ │
|
|
55
|
+
│ │ [tab1] [tab2] [+] │ │
|
|
56
|
+
│ ├─────────────────────┤ │
|
|
57
|
+
│ │ │ │
|
|
58
|
+
│ │ xterm output [Copy] │
|
|
59
|
+
│ │ │ │
|
|
60
|
+
│ ├─────────────────────┤ │
|
|
61
|
+
│ │ Esc Tab ↑ ↓ ↵ ^C y n│ │
|
|
62
|
+
│ ├─────────────────────┤ │
|
|
63
|
+
│ │ 🎤 message [Send] │ │
|
|
64
|
+
│ └─────────────────────┘ │
|
|
65
|
+
└───────────────────────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
When you start Conduit, it:
|
|
69
|
+
1. Spins up a local server on port `3131`
|
|
70
|
+
2. Prevents your laptop from sleeping — including when the lid is closed
|
|
71
|
+
3. Starts a [Cloudflare quick tunnel](https://developers.cloudflare.com/cloudflared/get-started/) — a free, encrypted HTTPS URL, no account needed
|
|
72
|
+
4. Prints the URL as a QR code in your terminal
|
|
73
|
+
5. Waits for your phone to connect
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+
| | |
|
|
80
|
+
|---|---|
|
|
81
|
+
| **Multiple terminal sessions** | Open as many terminals as you need. Switch between them with tabs. Each session is a real PTY — Claude Code, bash, whatever you want to run. |
|
|
82
|
+
| **Chat-style input** | Compose your full message, press Send. It lands in the terminal with a newline. No accidental keystrokes. |
|
|
83
|
+
| **Special keys toolbar** | A scrollable row of keys — `Esc`, `Tab`, `↑`, `↓`, `←`, `→`, `↵`, `Ctrl+C`, `y`, `n` — for navigating interactive prompts without a keyboard. |
|
|
84
|
+
| **Select and copy** | Drag to select any terminal output. A **Copy** button floats into view and puts it on your clipboard. |
|
|
85
|
+
| **Speech input** | Tap 🎤 to open your keyboard's native mic, or hold for Web Speech API fallback. Transcript fills the input box. |
|
|
86
|
+
| **Keyboard-aware layout** | The terminal shrinks when your phone keyboard opens. The input bar stays pinned above it. Nothing scrolls out of view. |
|
|
87
|
+
| **Live terminal output** | Powered by [xterm.js](https://xtermjs.org/). Colour, cursor, scrollback — it looks and behaves like a real terminal. |
|
|
88
|
+
| **Scrollback history** | Reconnect mid-session and the last 500 output chunks are replayed so you're not starting blind. |
|
|
89
|
+
| **Sleep prevention** | The server keeps the laptop awake — including blocking lid-close sleep on Windows. Restored automatically when you stop the server. |
|
|
90
|
+
| **Encrypted remote access** | Cloudflare Tunnel wraps everything in TLS. Your laptop never opens a port to the internet. |
|
|
91
|
+
| **Token auth** | A fresh random token is generated every time the server starts. Nobody connects without it. |
|
|
92
|
+
| **PWA installable** | Add to your phone's home screen. Opens full-screen like a native app. |
|
|
93
|
+
| **No build step** | The client is plain HTML + JS served directly. No webpack, no bundler, no friction. |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Quickstart
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npx conduit
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
That's it. No install step, no config. On first run, `cloudflared` is downloaded automatically and cached in `~/.conduit/` for future runs.
|
|
104
|
+
|
|
105
|
+
Or if you prefer a global install:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm install -g conduit
|
|
109
|
+
conduit
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Your terminal will look like this:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
╔══════════════════════════════════════════╗
|
|
116
|
+
║ Conduit v0.1.0 ║
|
|
117
|
+
╚══════════════════════════════════════════╝
|
|
118
|
+
|
|
119
|
+
Sleep + lid-close prevented while server is running.
|
|
120
|
+
Local: http://localhost:3131
|
|
121
|
+
Token: 7f0d-7110-fd24
|
|
122
|
+
|
|
123
|
+
Remote: https://abc123.trycloudflare.com
|
|
124
|
+
|
|
125
|
+
┌─ Scan with phone ──────────────────────────┐
|
|
126
|
+
|
|
127
|
+
▄▄▄▄▄▄▄ ▄ ▄ ▄▄▄▄▄▄▄
|
|
128
|
+
█ ▄▄▄ █ ▀█▄ █ ▄▄▄ █
|
|
129
|
+
█ ███ █ ▄ ▀ █ ███ █
|
|
130
|
+
...
|
|
131
|
+
|
|
132
|
+
└────────────────────────────────────────────┘
|
|
133
|
+
|
|
134
|
+
Or open: https://abc123.trycloudflare.com?token=7f0d-7110-fd24
|
|
135
|
+
|
|
136
|
+
Press Ctrl+C to stop.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Open on your phone
|
|
140
|
+
|
|
141
|
+
- **Scan the QR code** — the token is embedded in the URL, you connect instantly
|
|
142
|
+
- Or copy-paste the full URL into your phone's browser
|
|
143
|
+
|
|
144
|
+
### Use it
|
|
145
|
+
|
|
146
|
+
| Action | How |
|
|
147
|
+
|---|---|
|
|
148
|
+
| New terminal | Tap **+** in the tab bar |
|
|
149
|
+
| Switch terminal | Tap a tab |
|
|
150
|
+
| Close a terminal | Tap **✕** on the tab |
|
|
151
|
+
| Send a command | Type in the box → **Send** |
|
|
152
|
+
| Multi-line input | Shift+Enter adds a newline |
|
|
153
|
+
| Navigate prompts (↑ ↓ ↵) | Use the **keys toolbar** between terminal and input |
|
|
154
|
+
| Answer y/n prompts | Tap **y** or **n** in the keys toolbar — includes Enter |
|
|
155
|
+
| Interrupt / cancel | Tap **Ctrl+C** in the keys toolbar |
|
|
156
|
+
| Copy terminal output | Drag to select → tap the **Copy** button that appears |
|
|
157
|
+
| Speech input | Tap **🎤** → keyboard opens with native mic button |
|
|
158
|
+
| Lock screen and walk away | **Win+L** — server keeps running |
|
|
159
|
+
| Close the laptop lid | Works — lid-close sleep is blocked while server is running |
|
|
160
|
+
| Stop the server | **Ctrl+C** — sleep settings restored automatically |
|
|
161
|
+
| Install as app | Browser menu → "Add to Home Screen" |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Sleep behaviour
|
|
166
|
+
|
|
167
|
+
Conduit keeps your laptop awake for as long as the server is running.
|
|
168
|
+
|
|
169
|
+
| Action | Result |
|
|
170
|
+
|---|---|
|
|
171
|
+
| Screen timeout | Screen still dims/turns off normally |
|
|
172
|
+
| Win+L / lock screen | ✅ Server keeps running |
|
|
173
|
+
| Close the laptop lid | ✅ Server keeps running (lid-close sleep is blocked) |
|
|
174
|
+
| Ctrl+C to stop | ✅ All sleep settings restored to what they were before |
|
|
175
|
+
|
|
176
|
+
This uses the OS wake lock API on each platform — `SetThreadExecutionState` on Windows, `caffeinate` on macOS, `systemd-inhibit` on Linux. Nothing is permanently changed; it all reverts the moment the server stops.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Security
|
|
181
|
+
|
|
182
|
+
- **Token per session** — a cryptographically random token is generated at startup. It expires when the server stops.
|
|
183
|
+
- **TLS everywhere** — Cloudflare Tunnel terminates TLS. Traffic between your phone and Cloudflare's edge, and between the edge and your machine, is encrypted.
|
|
184
|
+
- **No open inbound port** — `cloudflared` makes an outbound connection to Cloudflare. Your laptop's firewall doesn't need to change.
|
|
185
|
+
- **Nothing stored** — no tokens, no session data, no output is written to disk or sent anywhere beyond your machine.
|
|
186
|
+
- **Local-only fallback** — if `cloudflared` is not installed, the server only binds to your local network (same Wi-Fi required).
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Requirements
|
|
191
|
+
|
|
192
|
+
- **Node.js 18+**
|
|
193
|
+
- **A modern mobile browser** — Chrome for Android or Safari on iOS recommended
|
|
194
|
+
|
|
195
|
+
`cloudflared` is downloaded automatically on first run and cached in `~/.conduit/`. No manual install needed.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Personal setup guide
|
|
200
|
+
|
|
201
|
+
Step-by-step instructions covering cloudflared install, first run, lid-close setup, and tips:
|
|
202
|
+
|
|
203
|
+
→ **[docs/SETUP.md](docs/SETUP.md)**
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Development
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
npm run dev # starts with --watch, auto-reloads on file change
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for project structure and contribution guidelines.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Roadmap
|
|
218
|
+
|
|
219
|
+
- [x] Multiple terminal sessions with tabs
|
|
220
|
+
- [x] Chat-style input with Send button
|
|
221
|
+
- [x] Special keys toolbar (arrows, Esc, Ctrl+C, y/n)
|
|
222
|
+
- [x] Select and copy terminal output
|
|
223
|
+
- [x] Speech input via native keyboard mic
|
|
224
|
+
- [x] Keyboard-aware layout (input stays pinned above keyboard)
|
|
225
|
+
- [x] Cloudflare Tunnel auto-start + QR code
|
|
226
|
+
- [x] Scrollback history on reconnect
|
|
227
|
+
- [x] Sleep prevention — idle, lock screen, and lid close
|
|
228
|
+
- [x] PWA installable
|
|
229
|
+
- [ ] Session persistence across server restarts
|
|
230
|
+
- [ ] Named / renamed tabs
|
|
231
|
+
- [ ] Swipe gesture to switch tabs
|
|
232
|
+
- [ ] Haptic feedback on send
|
|
233
|
+
- [ ] Optional persistent token (config file)
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Contributing
|
|
238
|
+
|
|
239
|
+
Bug reports, feature requests, and pull requests are welcome.
|
|
240
|
+
|
|
241
|
+
→ [CONTRIBUTING.md](.github/CONTRIBUTING.md)
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
MIT — see [LICENSE](LICENSE).
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
<div align="center">
|
|
252
|
+
|
|
253
|
+
Built for developers who use [Claude Code](https://claude.ai/code) and need to stay in the flow away from their desk.
|
|
254
|
+
|
|
255
|
+
</div>
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "conduit-mobile",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Run Claude Code from your phone. A secure terminal bridge with mobile web UI.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/server/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"conduit-mobile": "src/server/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18.0.0"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"start": "node src/server/index.js",
|
|
20
|
+
"dev": "node --watch src/server/index.js"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"claude",
|
|
24
|
+
"claude-code",
|
|
25
|
+
"terminal",
|
|
26
|
+
"mobile",
|
|
27
|
+
"bridge",
|
|
28
|
+
"remote-terminal",
|
|
29
|
+
"xterm"
|
|
30
|
+
],
|
|
31
|
+
"author": "Arun <m.arunesh@gmail.com>",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/Arun3sh/conduit.git"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/Arun3sh/conduit#readme",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"express": "^4.19.2",
|
|
40
|
+
"node-pty": "^1.0.0",
|
|
41
|
+
"qrcode-terminal": "^0.12.0",
|
|
42
|
+
"ws": "^8.18.0"
|
|
43
|
+
}
|
|
44
|
+
}
|