ai-or-die 0.1.52 → 0.1.59

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.
Files changed (72) hide show
  1. package/.gitattributes +3 -3
  2. package/LICENSE +22 -22
  3. package/README.md +228 -228
  4. package/bin/ai-or-die.js +175 -169
  5. package/bin/supervisor.js +121 -121
  6. package/package.json +61 -60
  7. package/sea-bootstrap.js +58 -58
  8. package/src/base-bridge.js +497 -497
  9. package/src/claude-bridge.js +48 -48
  10. package/src/codex-bridge.js +27 -27
  11. package/src/copilot-bridge.js +30 -30
  12. package/src/gemini-bridge.js +27 -27
  13. package/src/install-advisor.js +259 -259
  14. package/src/public/app-tunnel.js +402 -402
  15. package/src/public/app.js +4890 -4870
  16. package/src/public/auth.js +244 -244
  17. package/src/public/base.css +164 -164
  18. package/src/public/clipboard-handler.js +109 -109
  19. package/src/public/command-palette.js +406 -406
  20. package/src/public/components/banner-base.css +96 -96
  21. package/src/public/components/bottom-nav.css +66 -66
  22. package/src/public/components/buttons.css +270 -270
  23. package/src/public/components/cards.css +504 -504
  24. package/src/public/components/extra-keys.css +114 -114
  25. package/src/public/components/feedback.css +131 -131
  26. package/src/public/components/file-browser.css +592 -592
  27. package/src/public/components/input-overlay.css +168 -168
  28. package/src/public/components/menus.css +171 -171
  29. package/src/public/components/modals.css +822 -822
  30. package/src/public/components/notifications.css +85 -85
  31. package/src/public/components/tabs.css +659 -659
  32. package/src/public/components/terminal.css +280 -280
  33. package/src/public/components/voice-input.css +181 -181
  34. package/src/public/components/vscode-tunnel.css +333 -333
  35. package/src/public/extra-keys.js +287 -287
  36. package/src/public/feedback-manager.js +113 -113
  37. package/src/public/file-browser.js +1587 -1587
  38. package/src/public/file-editor.js +549 -549
  39. package/src/public/fonts.css +207 -207
  40. package/src/public/icon-generator.js +26 -26
  41. package/src/public/icons.js +55 -55
  42. package/src/public/image-handler.js +653 -653
  43. package/src/public/index.html +811 -811
  44. package/src/public/input-overlay.js +285 -285
  45. package/src/public/manifest.json +45 -45
  46. package/src/public/mobile.css +371 -371
  47. package/src/public/plan-detector.js +439 -439
  48. package/src/public/service-worker.js +196 -196
  49. package/src/public/session-manager.js +1391 -1391
  50. package/src/public/splits.js +704 -704
  51. package/src/public/style.css +207 -207
  52. package/src/public/tokens.css +386 -386
  53. package/src/public/vendor/marked.min.js +69 -69
  54. package/src/public/vendor/purify.min.js +3 -3
  55. package/src/public/voice-handler.js +889 -862
  56. package/src/public/voice-processor.js +20 -20
  57. package/src/public/vscode-tunnel.js +544 -544
  58. package/src/restart-manager.js +132 -132
  59. package/src/server.js +2783 -2750
  60. package/src/stt-engine.js +346 -346
  61. package/src/stt-worker.js +100 -100
  62. package/src/terminal-bridge.js +38 -38
  63. package/src/tunnel-manager.js +448 -448
  64. package/src/usage-analytics.js +493 -493
  65. package/src/usage-reader.js +894 -894
  66. package/src/utils/auth.js +141 -141
  67. package/src/utils/circular-buffer.js +80 -80
  68. package/src/utils/file-utils.js +219 -219
  69. package/src/utils/model-manager.js +274 -274
  70. package/src/utils/self-signed-cert.js +126 -0
  71. package/src/utils/session-store.js +221 -221
  72. package/src/vscode-tunnel.js +1082 -1082
package/.gitattributes CHANGED
@@ -1,3 +1,3 @@
1
- # Force LF line endings for shell scripts (prevents CRLF corruption on Windows checkout)
2
- e2e/fixtures/fake-code.sh text eol=lf
3
- e2e/fixtures/fake-devtunnel.sh text eol=lf
1
+ # Force LF line endings for shell scripts (prevents CRLF corruption on Windows checkout)
2
+ e2e/fixtures/fake-code.sh text eol=lf
3
+ e2e/fixtures/fake-devtunnel.sh text eol=lf
package/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 ai-or-die 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.
22
-
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ai-or-die 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.
22
+
package/README.md CHANGED
@@ -1,228 +1,228 @@
1
- <p align="center">
2
- <h1 align="center">ai-or-die</h1>
3
- <p align="center">
4
- Universal AI coding terminal — Claude, Copilot, Gemini, Codex & raw terminal in one browser UI.
5
- </p>
6
- </p>
7
-
8
- <p align="center">
9
- <a href="https://github.com/animeshkundu/ai-or-die/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/animeshkundu/ai-or-die/ci.yml?branch=main&label=CI&style=flat-square" alt="CI"></a>
10
- <a href="https://www.npmjs.com/package/ai-or-die"><img src="https://img.shields.io/npm/v/ai-or-die?style=flat-square&color=cb3837" alt="npm version"></a>
11
- <a href="https://www.npmjs.com/package/ai-or-die"><img src="https://img.shields.io/npm/dm/ai-or-die?style=flat-square" alt="npm downloads"></a>
12
- <a href="https://github.com/animeshkundu/ai-or-die/blob/main/LICENSE"><img src="https://img.shields.io/github/license/animeshkundu/ai-or-die?style=flat-square" alt="License"></a>
13
- <img src="https://img.shields.io/node/v/ai-or-die?style=flat-square" alt="Node.js version">
14
- <a href="https://github.com/animeshkundu/ai-or-die/stargazers"><img src="https://img.shields.io/github/stars/animeshkundu/ai-or-die?style=flat-square" alt="GitHub stars"></a>
15
- </p>
16
-
17
- <p align="center">
18
- <a href="https://animesh.kundus.in/ai-or-die/">Website</a> &middot;
19
- <a href="https://www.npmjs.com/package/ai-or-die">npm</a> &middot;
20
- <a href="https://github.com/animeshkundu/ai-or-die/releases">Releases</a>
21
- </p>
22
-
23
- ---
24
-
25
- ```bash
26
- npx ai-or-die
27
- ```
28
-
29
- One command. Opens your browser. Every AI coding assistant you have installed, ready to go.
30
-
31
- ---
32
-
33
- ## Why ai-or-die?
34
-
35
- You have Claude Code, GitHub Copilot CLI, Gemini CLI, and OpenAI Codex all installed — but you can only use one terminal at a time. **ai-or-die** gives you a single browser-based workspace where you can run them all, side by side, in tabbed sessions with full terminal emulation.
36
-
37
- No config files. No Docker. No complex setup. Just `npx ai-or-die` and start coding.
38
-
39
- ## Features
40
-
41
- | Feature | Details |
42
- |---|---|
43
- | **Multi-tool** | Claude, Copilot, Gemini, Codex, Terminal — auto-detects what's installed |
44
- | **Multi-session** | Tabbed browser sessions — run different tools in parallel |
45
- | **Real-time** | xterm.js + WebSocket streaming with full 256-color terminal emulation |
46
- | **Secure by default** | Auto-generated auth token embedded in URL — one click to open |
47
- | **Remote access** | Dev Tunnels via `--tunnel` — auto-login, named tunnels per machine |
48
- | **Multi-device** | Same session accessible from phone, tablet, or another machine |
49
- | **Persistent sessions** | Sessions survive server restarts — output buffer saved to disk |
50
- | **Cross-platform** | Windows (ConPTY) + Linux — tested in CI on both |
51
- | **PWA** | Installable web app with offline-capable shell |
52
- | **Standalone binaries** | Pre-built binaries for Linux x64 and Windows x64 — no Node.js required |
53
- | **Voice input** | Speak instead of type — cloud (Chrome/Edge) or local (private, offline) |
54
-
55
- ## Voice Input
56
-
57
- Speak instead of type. Voice input supports two modes:
58
-
59
- - **Cloud mode** (Chrome/Edge) — uses the browser's built-in speech recognition. Instant, zero download. Always available on Chromium browsers.
60
- - **Local mode** (`--stt` flag) — runs Parakeet V3 speech-to-text on your machine via sherpa-onnx. Fully private, works offline.
61
-
62
- ### Enabling Local Mode
63
-
64
- ```bash
65
- ai-or-die --stt
66
- ```
67
-
68
- On first use, the ~670MB model downloads automatically (cached at `~/.ai-or-die/models/`). The app remains fully usable during download.
69
-
70
- ### Usage
71
-
72
- - Click the **mic button** in the toolbar, or press **Ctrl+Shift+M** to start/stop recording.
73
- - **Hold** Ctrl+Shift+M for push-to-talk (release to transcribe).
74
- - Press **Escape** to cancel a recording.
75
- - Transcribed text appears in the terminal input — review, edit, then press Enter.
76
-
77
- ### Configuration
78
-
79
- | Flag | Description |
80
- |------|-------------|
81
- | `--stt` | Enable local speech-to-text |
82
- | `--stt-endpoint <url>` | Use an external OpenAI-compatible STT endpoint |
83
- | `--stt-model-dir <path>` | Custom model storage directory |
84
- | `--stt-threads <number>` | CPU threads for inference (default: auto, max 4) |
85
-
86
- ## Quick Start
87
-
88
- ### Via npx (recommended)
89
-
90
- ```bash
91
- npx ai-or-die
92
- ```
93
-
94
- Requires **Node.js 22+**. Opens `http://localhost:7777` with a secure token in the URL.
95
-
96
- ### Global install
97
-
98
- ```bash
99
- npm install -g ai-or-die
100
- ai-or-die
101
- ```
102
-
103
- ### Standalone binary
104
-
105
- Download from [Releases](https://github.com/animeshkundu/ai-or-die/releases) — no Node.js needed.
106
-
107
- | Platform | Binary |
108
- |----------|--------|
109
- | Linux x64 | `ai-or-die-linux-x64` |
110
- | Windows x64 | `ai-or-die-windows-x64.exe` |
111
-
112
- ## Usage
113
-
114
- ```bash
115
- # Default — opens browser with secure token
116
- ai-or-die
117
-
118
- # Custom port
119
- ai-or-die --port 8080
120
-
121
- # Explicit auth token
122
- ai-or-die --auth my-secret-token
123
-
124
- # Remote access via Dev Tunnel
125
- ai-or-die --tunnel
126
-
127
- # HTTPS
128
- ai-or-die --https --cert cert.pem --key key.pem
129
-
130
- # Development mode (verbose logging)
131
- ai-or-die --dev
132
-
133
- # Custom tool display names
134
- ai-or-die --claude-alias "Sonnet" --gemini-alias "Gem"
135
-
136
- # Enable local voice-to-text (private, offline)
137
- ai-or-die --stt
138
- ```
139
-
140
- ## CLI Reference
141
-
142
- | Flag | Description | Default |
143
- |------|-------------|---------|
144
- | `-p, --port <number>` | Server port | `7777` |
145
- | `--auth <token>` | Set auth token | auto-generated |
146
- | `--disable-auth` | Disable authentication | `false` |
147
- | `--tunnel` | Enable Microsoft Dev Tunnel | `false` |
148
- | `--tunnel-allow-anonymous` | Allow anonymous tunnel access | `false` |
149
- | `--https` | Enable HTTPS | `false` |
150
- | `--cert <path>` | SSL certificate file | |
151
- | `--key <path>` | SSL private key file | |
152
- | `--dev` | Verbose logging | `false` |
153
- | `--no-open` | Don't auto-open browser | `false` |
154
- | `--plan <type>` | Subscription plan (`pro`, `max5`, `max20`) | `max20` |
155
- | `--stt` | Enable local speech-to-text | `false` |
156
- | `--stt-endpoint <url>` | External STT endpoint (OpenAI-compatible) | |
157
- | `--stt-model-dir <path>` | Custom model directory | `~/.ai-or-die/models/` |
158
- | `--stt-threads <number>` | CPU threads for STT inference | auto (max 4) |
159
-
160
- ## Supported Tools
161
-
162
- | Tool | Command | Install |
163
- |------|---------|---------|
164
- | Claude Code | `claude` | [claude.ai/code](https://claude.ai/code) |
165
- | GitHub Copilot | `copilot` | [github.com/features/copilot](https://github.com/features/copilot) |
166
- | Google Gemini | `gemini` | [github.com/google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli) |
167
- | OpenAI Codex | `codex` | [openai.com/codex](https://openai.com/codex) |
168
- | Terminal | bash / PowerShell | Always available |
169
-
170
- Tools that aren't installed appear as disabled in the UI. Install any of them at any time — ai-or-die detects them on startup.
171
-
172
- ## Dev Tunnels
173
-
174
- For secure remote access, ai-or-die integrates with [Microsoft Dev Tunnels](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/). Each machine gets a persistent named tunnel based on hostname.
175
-
176
- ```bash
177
- # Install devtunnel CLI (one-time)
178
- winget install Microsoft.devtunnel # Windows
179
- curl -sL https://aka.ms/DevTunnelCliInstall | bash # Linux
180
-
181
- # Start with tunnel (auto-login if needed)
182
- ai-or-die --tunnel
183
- ```
184
-
185
- When `--tunnel` is active, auth is disabled — the tunnel itself controls access.
186
-
187
- ## Architecture
188
-
189
- ```
190
- Browser (xterm.js)
191
- |
192
- | WebSocket
193
- v
194
- Express Server ──> Session Store (~/.ai-or-die/sessions.json)
195
- |
196
- | node-pty
197
- v
198
- Claude / Copilot / Gemini / Codex / bash
199
- ```
200
-
201
- - **Server** (`src/server.js`) — Express + WebSocket, session persistence, auth, rate limiting
202
- - **Bridges** (`src/*-bridge.js`) — Spawn CLI processes via node-pty, output buffering
203
- - **Client** (`src/public/`) — Vanilla JS + xterm.js, tabbed sessions, PWA
204
- - **Tunnel** (`src/tunnel-manager.js`) — devtunnel lifecycle, auto-login, auto-restart
205
-
206
- See [docs/](docs/) for [ADRs](docs/adrs/), [specs](docs/specs/), and [architecture diagrams](docs/architecture/).
207
-
208
- ## Development
209
-
210
- ```bash
211
- git clone https://github.com/animeshkundu/ai-or-die.git
212
- cd ai-or-die
213
- npm install
214
- npm run dev # start with verbose logging
215
- npm test # run tests
216
- npm run build:sea # build standalone binary
217
- ```
218
-
219
- ## Contributing
220
-
221
- 1. Check [ADRs](docs/adrs/) before proposing architectural changes
222
- 2. Update [specs](docs/specs/) when changing component behavior
223
- 3. Add tests for every feature and bug fix
224
- 4. Use [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `docs:`, `test:`, `chore:`)
225
-
226
- ## License
227
-
228
- [MIT](LICENSE) — Animesh Kundu
1
+ <p align="center">
2
+ <h1 align="center">ai-or-die</h1>
3
+ <p align="center">
4
+ Universal AI coding terminal — Claude, Copilot, Gemini, Codex & raw terminal in one browser UI.
5
+ </p>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://github.com/animeshkundu/ai-or-die/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/animeshkundu/ai-or-die/ci.yml?branch=main&label=CI&style=flat-square" alt="CI"></a>
10
+ <a href="https://www.npmjs.com/package/ai-or-die"><img src="https://img.shields.io/npm/v/ai-or-die?style=flat-square&color=cb3837" alt="npm version"></a>
11
+ <a href="https://www.npmjs.com/package/ai-or-die"><img src="https://img.shields.io/npm/dm/ai-or-die?style=flat-square" alt="npm downloads"></a>
12
+ <a href="https://github.com/animeshkundu/ai-or-die/blob/main/LICENSE"><img src="https://img.shields.io/github/license/animeshkundu/ai-or-die?style=flat-square" alt="License"></a>
13
+ <img src="https://img.shields.io/node/v/ai-or-die?style=flat-square" alt="Node.js version">
14
+ <a href="https://github.com/animeshkundu/ai-or-die/stargazers"><img src="https://img.shields.io/github/stars/animeshkundu/ai-or-die?style=flat-square" alt="GitHub stars"></a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <a href="https://animesh.kundus.in/ai-or-die/">Website</a> &middot;
19
+ <a href="https://www.npmjs.com/package/ai-or-die">npm</a> &middot;
20
+ <a href="https://github.com/animeshkundu/ai-or-die/releases">Releases</a>
21
+ </p>
22
+
23
+ ---
24
+
25
+ ```bash
26
+ npx ai-or-die
27
+ ```
28
+
29
+ One command. Opens your browser. Every AI coding assistant you have installed, ready to go.
30
+
31
+ ---
32
+
33
+ ## Why ai-or-die?
34
+
35
+ You have Claude Code, GitHub Copilot CLI, Gemini CLI, and OpenAI Codex all installed — but you can only use one terminal at a time. **ai-or-die** gives you a single browser-based workspace where you can run them all, side by side, in tabbed sessions with full terminal emulation.
36
+
37
+ No config files. No Docker. No complex setup. Just `npx ai-or-die` and start coding.
38
+
39
+ ## Features
40
+
41
+ | Feature | Details |
42
+ |---|---|
43
+ | **Multi-tool** | Claude, Copilot, Gemini, Codex, Terminal — auto-detects what's installed |
44
+ | **Multi-session** | Tabbed browser sessions — run different tools in parallel |
45
+ | **Real-time** | xterm.js + WebSocket streaming with full 256-color terminal emulation |
46
+ | **Secure by default** | Auto-generated auth token embedded in URL — one click to open |
47
+ | **Remote access** | Dev Tunnels via `--tunnel` — auto-login, named tunnels per machine |
48
+ | **Multi-device** | Same session accessible from phone, tablet, or another machine |
49
+ | **Persistent sessions** | Sessions survive server restarts — output buffer saved to disk |
50
+ | **Cross-platform** | Windows (ConPTY) + Linux — tested in CI on both |
51
+ | **PWA** | Installable web app with offline-capable shell |
52
+ | **Standalone binaries** | Pre-built binaries for Linux x64 and Windows x64 — no Node.js required |
53
+ | **Voice input** | Speak instead of type — cloud (Chrome/Edge) or local (private, offline) |
54
+
55
+ ## Voice Input
56
+
57
+ Speak instead of type. Voice input supports two modes:
58
+
59
+ - **Cloud mode** (Chrome/Edge) — uses the browser's built-in speech recognition. Instant, zero download. Always available on Chromium browsers.
60
+ - **Local mode** (`--stt` flag) — runs Parakeet V3 speech-to-text on your machine via sherpa-onnx. Fully private, works offline.
61
+
62
+ ### Enabling Local Mode
63
+
64
+ ```bash
65
+ ai-or-die --stt
66
+ ```
67
+
68
+ On first use, the ~670MB model downloads automatically (cached at `~/.ai-or-die/models/`). The app remains fully usable during download.
69
+
70
+ ### Usage
71
+
72
+ - Click the **mic button** in the toolbar, or press **Ctrl+Shift+M** to start/stop recording.
73
+ - **Hold** Ctrl+Shift+M for push-to-talk (release to transcribe).
74
+ - Press **Escape** to cancel a recording.
75
+ - Transcribed text appears in the terminal input — review, edit, then press Enter.
76
+
77
+ ### Configuration
78
+
79
+ | Flag | Description |
80
+ |------|-------------|
81
+ | `--stt` | Enable local speech-to-text |
82
+ | `--stt-endpoint <url>` | Use an external OpenAI-compatible STT endpoint |
83
+ | `--stt-model-dir <path>` | Custom model storage directory |
84
+ | `--stt-threads <number>` | CPU threads for inference (default: auto, max 4) |
85
+
86
+ ## Quick Start
87
+
88
+ ### Via npx (recommended)
89
+
90
+ ```bash
91
+ npx ai-or-die
92
+ ```
93
+
94
+ Requires **Node.js 22+**. Opens `http://localhost:7777` with a secure token in the URL.
95
+
96
+ ### Global install
97
+
98
+ ```bash
99
+ npm install -g ai-or-die
100
+ ai-or-die
101
+ ```
102
+
103
+ ### Standalone binary
104
+
105
+ Download from [Releases](https://github.com/animeshkundu/ai-or-die/releases) — no Node.js needed.
106
+
107
+ | Platform | Binary |
108
+ |----------|--------|
109
+ | Linux x64 | `ai-or-die-linux-x64` |
110
+ | Windows x64 | `ai-or-die-windows-x64.exe` |
111
+
112
+ ## Usage
113
+
114
+ ```bash
115
+ # Default — opens browser with secure token
116
+ ai-or-die
117
+
118
+ # Custom port
119
+ ai-or-die --port 8080
120
+
121
+ # Explicit auth token
122
+ ai-or-die --auth my-secret-token
123
+
124
+ # Remote access via Dev Tunnel
125
+ ai-or-die --tunnel
126
+
127
+ # HTTPS
128
+ ai-or-die --https --cert cert.pem --key key.pem
129
+
130
+ # Development mode (verbose logging)
131
+ ai-or-die --dev
132
+
133
+ # Custom tool display names
134
+ ai-or-die --claude-alias "Sonnet" --gemini-alias "Gem"
135
+
136
+ # Enable local voice-to-text (private, offline)
137
+ ai-or-die --stt
138
+ ```
139
+
140
+ ## CLI Reference
141
+
142
+ | Flag | Description | Default |
143
+ |------|-------------|---------|
144
+ | `-p, --port <number>` | Server port | `7777` |
145
+ | `--auth <token>` | Set auth token | auto-generated |
146
+ | `--disable-auth` | Disable authentication | `false` |
147
+ | `--tunnel` | Enable Microsoft Dev Tunnel | `false` |
148
+ | `--tunnel-allow-anonymous` | Allow anonymous tunnel access | `false` |
149
+ | `--https` | Enable HTTPS | `false` |
150
+ | `--cert <path>` | SSL certificate file | |
151
+ | `--key <path>` | SSL private key file | |
152
+ | `--dev` | Verbose logging | `false` |
153
+ | `--no-open` | Don't auto-open browser | `false` |
154
+ | `--plan <type>` | Subscription plan (`pro`, `max5`, `max20`) | `max20` |
155
+ | `--stt` | Enable local speech-to-text | `false` |
156
+ | `--stt-endpoint <url>` | External STT endpoint (OpenAI-compatible) | |
157
+ | `--stt-model-dir <path>` | Custom model directory | `~/.ai-or-die/models/` |
158
+ | `--stt-threads <number>` | CPU threads for STT inference | auto (max 4) |
159
+
160
+ ## Supported Tools
161
+
162
+ | Tool | Command | Install |
163
+ |------|---------|---------|
164
+ | Claude Code | `claude` | [claude.ai/code](https://claude.ai/code) |
165
+ | GitHub Copilot | `copilot` | [github.com/features/copilot](https://github.com/features/copilot) |
166
+ | Google Gemini | `gemini` | [github.com/google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli) |
167
+ | OpenAI Codex | `codex` | [openai.com/codex](https://openai.com/codex) |
168
+ | Terminal | bash / PowerShell | Always available |
169
+
170
+ Tools that aren't installed appear as disabled in the UI. Install any of them at any time — ai-or-die detects them on startup.
171
+
172
+ ## Dev Tunnels
173
+
174
+ For secure remote access, ai-or-die integrates with [Microsoft Dev Tunnels](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/). Each machine gets a persistent named tunnel based on hostname.
175
+
176
+ ```bash
177
+ # Install devtunnel CLI (one-time)
178
+ winget install Microsoft.devtunnel # Windows
179
+ curl -sL https://aka.ms/DevTunnelCliInstall | bash # Linux
180
+
181
+ # Start with tunnel (auto-login if needed)
182
+ ai-or-die --tunnel
183
+ ```
184
+
185
+ When `--tunnel` is active, auth is disabled — the tunnel itself controls access.
186
+
187
+ ## Architecture
188
+
189
+ ```
190
+ Browser (xterm.js)
191
+ |
192
+ | WebSocket
193
+ v
194
+ Express Server ──> Session Store (~/.ai-or-die/sessions.json)
195
+ |
196
+ | node-pty
197
+ v
198
+ Claude / Copilot / Gemini / Codex / bash
199
+ ```
200
+
201
+ - **Server** (`src/server.js`) — Express + WebSocket, session persistence, auth, rate limiting
202
+ - **Bridges** (`src/*-bridge.js`) — Spawn CLI processes via node-pty, output buffering
203
+ - **Client** (`src/public/`) — Vanilla JS + xterm.js, tabbed sessions, PWA
204
+ - **Tunnel** (`src/tunnel-manager.js`) — devtunnel lifecycle, auto-login, auto-restart
205
+
206
+ See [docs/](docs/) for [ADRs](docs/adrs/), [specs](docs/specs/), and [architecture diagrams](docs/architecture/).
207
+
208
+ ## Development
209
+
210
+ ```bash
211
+ git clone https://github.com/animeshkundu/ai-or-die.git
212
+ cd ai-or-die
213
+ npm install
214
+ npm run dev # start with verbose logging
215
+ npm test # run tests
216
+ npm run build:sea # build standalone binary
217
+ ```
218
+
219
+ ## Contributing
220
+
221
+ 1. Check [ADRs](docs/adrs/) before proposing architectural changes
222
+ 2. Update [specs](docs/specs/) when changing component behavior
223
+ 3. Add tests for every feature and bug fix
224
+ 4. Use [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `docs:`, `test:`, `chore:`)
225
+
226
+ ## License
227
+
228
+ [MIT](LICENSE) — Animesh Kundu