ai-or-die 0.1.7 → 0.1.9

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.
@@ -11,19 +11,22 @@ concurrency:
11
11
  jobs:
12
12
  release:
13
13
  name: Tag, Release, and Publish
14
- # Skip if the push was an automated version bump
15
14
  if: "!startsWith(github.event.head_commit.message, 'chore: bump version')"
16
15
  runs-on: ubuntu-latest
17
16
  permissions:
18
17
  contents: write
18
+ packages: write
19
19
  id-token: write
20
+ outputs:
21
+ version: ${{ steps.version.outputs.version }}
22
+ released: ${{ steps.version.outputs.released }}
20
23
  steps:
21
24
  - name: Checkout
22
25
  uses: actions/checkout@v4
23
26
  with:
24
27
  token: ${{ secrets.GITHUB_TOKEN }}
25
28
 
26
- - name: Setup Node.js
29
+ - name: Setup Node.js (npm registry)
27
30
  uses: actions/setup-node@v4
28
31
  with:
29
32
  node-version: '22'
@@ -54,11 +57,10 @@ jobs:
54
57
  git commit -m "chore: bump version to ${NEW}"
55
58
  git push
56
59
  echo "version=${NEW}" >> $GITHUB_OUTPUT
57
- echo "bumped=true" >> $GITHUB_OUTPUT
58
60
  else
59
61
  echo "version=${CURRENT}" >> $GITHUB_OUTPUT
60
- echo "bumped=false" >> $GITHUB_OUTPUT
61
62
  fi
63
+ echo "released=true" >> $GITHUB_OUTPUT
62
64
 
63
65
  - name: Create GitHub Release
64
66
  uses: softprops/action-gh-release@v2
@@ -78,3 +80,73 @@ jobs:
78
80
  run: npm publish --access public --provenance
79
81
  env:
80
82
  NODE_AUTH_TOKEN: ""
83
+
84
+ - name: Publish to GitHub Packages
85
+ continue-on-error: true
86
+ run: |
87
+ node -e "
88
+ const pkg = require('./package.json');
89
+ pkg.name = '@animeshkundu/ai-or-die';
90
+ require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
91
+ "
92
+ npm publish --registry https://npm.pkg.github.com --access public
93
+ git checkout -- package.json
94
+ env:
95
+ NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96
+
97
+ build-binaries:
98
+ name: Build ${{ matrix.artifact }}
99
+ needs: release
100
+ if: needs.release.outputs.released == 'true'
101
+ runs-on: ${{ matrix.os }}
102
+ permissions:
103
+ contents: write
104
+ strategy:
105
+ matrix:
106
+ include:
107
+ - os: ubuntu-latest
108
+ platform: linux
109
+ artifact: ai-or-die-linux-x64
110
+ - os: windows-latest
111
+ platform: win32
112
+ artifact: ai-or-die-windows-x64.exe
113
+ steps:
114
+ - uses: actions/checkout@v4
115
+ with:
116
+ ref: v${{ needs.release.outputs.version }}
117
+
118
+ - uses: actions/setup-node@v4
119
+ with:
120
+ node-version: '22'
121
+
122
+ - run: npm ci
123
+
124
+ - name: Build SEA binary
125
+ run: node scripts/build-sea.js
126
+
127
+ - name: Rename artifact
128
+ shell: bash
129
+ run: |
130
+ if [ "${{ matrix.platform }}" = "win32" ]; then
131
+ mv dist/ai-or-die.exe "dist/${{ matrix.artifact }}"
132
+ else
133
+ mv dist/ai-or-die "dist/${{ matrix.artifact }}"
134
+ chmod +x "dist/${{ matrix.artifact }}"
135
+ fi
136
+
137
+ - name: Smoke test
138
+ shell: bash
139
+ run: |
140
+ if [ "${{ matrix.platform }}" = "win32" ]; then
141
+ ./dist/${{ matrix.artifact }} --help || true
142
+ else
143
+ ./dist/${{ matrix.artifact }} --help || true
144
+ fi
145
+
146
+ - name: Upload to GitHub Release
147
+ uses: softprops/action-gh-release@v2
148
+ with:
149
+ tag_name: v${{ needs.release.outputs.version }}
150
+ files: dist/${{ matrix.artifact }}
151
+ env:
152
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/README.md CHANGED
@@ -1,165 +1,189 @@
1
- # ai-or-die
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
+ ---
2
24
 
3
- Universal AI coding terminal — Claude, Copilot, Gemini & more in your browser.
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
+ ---
4
32
 
5
- ai-or-die is a web-based terminal aggregator that provides browser access to multiple AI CLI tools through a unified interface. Launch Claude, GitHub Copilot, Google Gemini, OpenAI Codex, or a raw terminal session — all from one place, with multi-session support and real-time streaming.
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.
6
38
 
7
39
  ## Features
8
40
 
9
- - **Multi-tool support** Claude, Copilot, Gemini, Codex, and raw terminal in one interface
10
- - **Dynamic tool detection** — automatically discovers which tools are installed
11
- - **Real-time streaming** full terminal emulation via xterm.js with 256-color support
12
- - **Multi-session** run multiple sessions in browser tabs, switch between them
13
- - **Multi-device** same session accessible from different browsers/devices
14
- - **Session persistence** — sessions survive server restarts
15
- - **Authentication** — token-based auth enabled by default
16
- - **Dev Tunnels** secure remote access via Microsoft Dev Tunnels
17
- - **Cross-platform** — works on Linux and Windows (ConPTY)
18
- - **PWA** — installable as a Progressive Web App
19
- - **Mobile-friendly** responsive design with touch-optimized controls
20
-
21
- ## Requirements
22
-
23
- - Node.js >= 22
24
- - At least one supported CLI tool installed:
25
- - [Claude Code](https://claude.ai/code) — `claude`
26
- - [GitHub Copilot CLI](https://github.com/features/copilot/cli) — `copilot`
27
- - [Google Gemini CLI](https://github.com/google-gemini/gemini-cli) — `gemini`
28
- - [OpenAI Codex](https://openai.com/codex) — `codex`
29
- - Terminal is always available (bash/PowerShell)
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 |
30
53
 
31
54
  ## Quick Start
32
55
 
56
+ ### Via npx (recommended)
57
+
33
58
  ```bash
34
- # Run without installing
35
59
  npx ai-or-die
60
+ ```
61
+
62
+ Requires **Node.js 22+**. Opens `http://localhost:7777` with a secure token in the URL.
36
63
 
37
- # Or install globally
64
+ ### Global install
65
+
66
+ ```bash
38
67
  npm install -g ai-or-die
39
68
  ai-or-die
40
69
  ```
41
70
 
71
+ ### Standalone binary
72
+
73
+ Download from [Releases](https://github.com/animeshkundu/ai-or-die/releases) — no Node.js needed.
74
+
75
+ | Platform | Binary |
76
+ |----------|--------|
77
+ | Linux x64 | `ai-or-die-linux-x64` |
78
+ | Windows x64 | `ai-or-die-windows-x64.exe` |
79
+
42
80
  ## Usage
43
81
 
44
82
  ```bash
45
- # Start with default settings
83
+ # Default — opens browser with secure token
46
84
  ai-or-die
47
85
 
48
86
  # Custom port
49
87
  ai-or-die --port 8080
50
88
 
51
- # With specific auth token
52
- ai-or-die --auth your-secret-token
89
+ # Explicit auth token
90
+ ai-or-die --auth my-secret-token
53
91
 
54
- # Development mode (extra logging)
55
- ai-or-die --dev
92
+ # Remote access via Dev Tunnel
93
+ ai-or-die --tunnel
56
94
 
57
- # HTTPS mode
95
+ # HTTPS
58
96
  ai-or-die --https --cert cert.pem --key key.pem
59
97
 
60
- # Remote access via Dev Tunnels
61
- ai-or-die --tunnel --tunnel-allow-anonymous
62
-
63
- # Custom tool aliases
64
- ai-or-die --claude-alias "AI" --copilot-alias "CP" --gemini-alias "Gem"
98
+ # Development mode (verbose logging)
99
+ ai-or-die --dev
65
100
 
66
- # Disable auth (not recommended for production)
67
- ai-or-die --disable-auth
101
+ # Custom tool display names
102
+ ai-or-die --claude-alias "Sonnet" --gemini-alias "Gem"
68
103
  ```
69
104
 
70
- ## CLI Options
105
+ ## CLI Reference
71
106
 
72
107
  | Flag | Description | Default |
73
108
  |------|-------------|---------|
74
109
  | `-p, --port <number>` | Server port | `7777` |
75
- | `--no-open` | Don't auto-open browser | |
76
110
  | `--auth <token>` | Set auth token | auto-generated |
77
- | `--disable-auth` | Disable authentication | |
78
- | `--https` | Enable HTTPS | |
111
+ | `--disable-auth` | Disable authentication | `false` |
112
+ | `--tunnel` | Enable Microsoft Dev Tunnel | `false` |
113
+ | `--tunnel-allow-anonymous` | Allow anonymous tunnel access | `false` |
114
+ | `--https` | Enable HTTPS | `false` |
79
115
  | `--cert <path>` | SSL certificate file | |
80
116
  | `--key <path>` | SSL private key file | |
81
- | `--dev` | Development mode | |
82
- | `--plan <type>` | Subscription plan (pro, max5, max20) | `max20` |
83
- | `--tunnel` | Enable Dev Tunnel | |
84
- | `--tunnel-allow-anonymous` | Allow anonymous tunnel access | |
85
- | `--claude-alias <name>` | Display name for Claude | `Claude` |
86
- | `--codex-alias <name>` | Display name for Codex | `Codex` |
87
- | `--copilot-alias <name>` | Display name for Copilot | `Copilot` |
88
- | `--gemini-alias <name>` | Display name for Gemini | `Gemini` |
89
- | `--terminal-alias <name>` | Display name for Terminal | `Terminal` |
90
-
91
- ## Dev Tunnels Setup
117
+ | `--dev` | Verbose logging | `false` |
118
+ | `--no-open` | Don't auto-open browser | `false` |
119
+ | `--plan <type>` | Subscription plan (`pro`, `max5`, `max20`) | `max20` |
92
120
 
93
- For remote access, ai-or-die uses [Microsoft Dev Tunnels](https://learn.microsoft.com/en-us/azure/developer/dev-tunnels/):
121
+ ## Supported Tools
94
122
 
95
- ```bash
96
- # Install devtunnel CLI
97
- # Windows:
98
- winget install Microsoft.devtunnel
123
+ | Tool | Command | Install |
124
+ |------|---------|---------|
125
+ | Claude Code | `claude` | [claude.ai/code](https://claude.ai/code) |
126
+ | GitHub Copilot | `copilot` | [github.com/features/copilot](https://github.com/features/copilot) |
127
+ | Google Gemini | `gemini` | [github.com/google-gemini/gemini-cli](https://github.com/google-gemini/gemini-cli) |
128
+ | OpenAI Codex | `codex` | [openai.com/codex](https://openai.com/codex) |
129
+ | Terminal | bash / PowerShell | Always available |
99
130
 
100
- # Linux:
101
- curl -sL https://aka.ms/DevTunnelCliInstall | bash
131
+ 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.
102
132
 
103
- # First-time login (one-time)
104
- devtunnel user login
133
+ ## Dev Tunnels
105
134
 
106
- # Then start ai-or-die with tunnel
107
- ai-or-die --tunnel --tunnel-allow-anonymous
108
- ```
135
+ 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.
109
136
 
110
- ## Supported Tools
137
+ ```bash
138
+ # Install devtunnel CLI (one-time)
139
+ winget install Microsoft.devtunnel # Windows
140
+ curl -sL https://aka.ms/DevTunnelCliInstall | bash # Linux
111
141
 
112
- | Tool | Command | Install |
113
- |------|---------|---------|
114
- | Claude | `claude` | [claude.ai/code](https://claude.ai/code) |
115
- | Copilot | `copilot` | `npm install -g @github/copilot` or `winget install GitHub.Copilot` |
116
- | Gemini | `gemini` | `npm install -g @google/gemini-cli` |
117
- | Codex | `codex` | [openai.com/codex](https://openai.com/codex) |
118
- | Terminal | bash/PowerShell | Always available |
142
+ # Start with tunnel (auto-login if needed)
143
+ ai-or-die --tunnel
144
+ ```
119
145
 
120
- Tools that aren't installed appear as disabled in the UI. Install them at any time — ai-or-die detects them on next startup.
146
+ When `--tunnel` is active, auth is disabled the tunnel itself controls access.
121
147
 
122
148
  ## Architecture
123
149
 
124
- See [docs/](docs/README.md) for full technical documentation:
150
+ ```
151
+ Browser (xterm.js)
152
+ |
153
+ | WebSocket
154
+ v
155
+ Express Server ──> Session Store (~/.ai-or-die/sessions.json)
156
+ |
157
+ | node-pty
158
+ v
159
+ Claude / Copilot / Gemini / Codex / bash
160
+ ```
125
161
 
126
- - [System Overview](docs/architecture/overview.md)
127
- - [WebSocket Protocol](docs/architecture/websocket-protocol.md)
128
- - [Bridge Pattern](docs/architecture/bridge-pattern.md)
129
- - [Architecture Decision Records](docs/adrs/)
162
+ - **Server** (`src/server.js`) — Express + WebSocket, session persistence, auth, rate limiting
163
+ - **Bridges** (`src/*-bridge.js`) — Spawn CLI processes via node-pty, output buffering
164
+ - **Client** (`src/public/`) — Vanilla JS + xterm.js, tabbed sessions, PWA
165
+ - **Tunnel** (`src/tunnel-manager.js`) — devtunnel lifecycle, auto-login, auto-restart
166
+
167
+ See [docs/](docs/) for [ADRs](docs/adrs/), [specs](docs/specs/), and [architecture diagrams](docs/architecture/).
130
168
 
131
169
  ## Development
132
170
 
133
171
  ```bash
134
- # Clone and install
135
172
  git clone https://github.com/animeshkundu/ai-or-die.git
136
173
  cd ai-or-die
137
174
  npm install
138
-
139
- # Run in dev mode
140
- npm run dev
141
-
142
- # Run tests
143
- npm test
175
+ npm run dev # start with verbose logging
176
+ npm test # run tests
177
+ npm run build:sea # build standalone binary
144
178
  ```
145
179
 
146
- ## API
147
-
148
- ### REST Endpoints
149
-
150
- | Method | Endpoint | Description |
151
- |--------|----------|-------------|
152
- | `GET` | `/api/health` | Server health check |
153
- | `GET` | `/api/config` | Server config + tool availability |
154
- | `GET` | `/api/sessions/list` | List all sessions |
155
- | `POST` | `/api/sessions/create` | Create a new session |
156
- | `DELETE` | `/api/sessions/:id` | Delete a session |
157
- | `GET` | `/api/folders` | Browse directories |
158
-
159
- ### WebSocket
180
+ ## Contributing
160
181
 
161
- Connect to `ws://localhost:7777?token=<auth-token>` for real-time communication. See [WebSocket Protocol docs](docs/architecture/websocket-protocol.md) for the full message reference.
182
+ 1. Check [ADRs](docs/adrs/) before proposing architectural changes
183
+ 2. Update [specs](docs/specs/) when changing component behavior
184
+ 3. Add tests for every feature and bug fix
185
+ 4. Use [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `docs:`, `test:`, `chore:`)
162
186
 
163
187
  ## License
164
188
 
165
- MIT
189
+ [MIT](LICENSE) — Animesh Kundu
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-or-die",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Universal AI coding terminal — Claude, Copilot, Gemini & more in your browser",
5
5
  "main": "src/server.js",
6
6
  "bin": {