@mmmbuto/nexuscrew 0.2.1 → 0.2.2

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 (52) hide show
  1. package/README.md +122 -67
  2. package/bin/nexuscrew.js +194 -470
  3. package/frontend/dist/assets/{index-BG1N7bSL.js → index-BsldfYnr.js} +1704 -1711
  4. package/frontend/dist/assets/index-DcQGg3dp.css +1 -0
  5. package/frontend/dist/index.html +3 -11
  6. package/lib/server/routes/hosts.js +22 -12
  7. package/lib/server/routes/launchers.js +12 -0
  8. package/lib/server/routes/models.js +16 -63
  9. package/lib/server/routes/runtime.js +10 -0
  10. package/lib/server/routes/send.js +97 -258
  11. package/lib/server/routes/sessions.js +13 -42
  12. package/lib/server/routes/status.js +18 -22
  13. package/lib/server/routes/tmux.js +88 -0
  14. package/lib/server/server.js +60 -81
  15. package/lib/services/engine-discovery.js +192 -445
  16. package/lib/services/log-watcher.js +22 -40
  17. package/lib/services/session-store.js +88 -62
  18. package/lib/services/tmux-manager.js +111 -173
  19. package/package.json +5 -9
  20. package/frontend/dist/apple-touch-icon.png +0 -0
  21. package/frontend/dist/assets/index-CiAtinNP.css +0 -1
  22. package/frontend/dist/favicon.svg +0 -20
  23. package/frontend/dist/icon-192.png +0 -0
  24. package/frontend/dist/icon-512.png +0 -0
  25. package/frontend/dist/site.webmanifest +0 -29
  26. package/lib/config/hosts.js +0 -67
  27. package/lib/config/manager.js +0 -379
  28. package/lib/config/models.js +0 -408
  29. package/lib/server/db/adapter.js +0 -274
  30. package/lib/server/db/drivers/sql-js.js +0 -75
  31. package/lib/server/db/migrate.js +0 -174
  32. package/lib/server/db/migrations/001_base_schema.sql +0 -70
  33. package/lib/server/middleware/auth.js +0 -134
  34. package/lib/server/middleware/rate-limit.js +0 -63
  35. package/lib/server/models/User.js +0 -128
  36. package/lib/server/routes/auth.js +0 -168
  37. package/lib/server/routes/keys.js +0 -28
  38. package/lib/server/routes/runtimes.js +0 -34
  39. package/lib/server/routes/speech.js +0 -46
  40. package/lib/server/routes/upload.js +0 -135
  41. package/lib/server/routes/wake-lock.js +0 -95
  42. package/lib/server/routes/workspaces.js +0 -101
  43. package/lib/server/services/attachment-manager.js +0 -57
  44. package/lib/server/services/context-bridge.js +0 -425
  45. package/lib/server/services/runtime-manager.js +0 -462
  46. package/lib/server/services/speech-manager.js +0 -76
  47. package/lib/server/services/summary-generator.js +0 -309
  48. package/lib/server/services/workspace-manager.js +0 -79
  49. package/lib/services/remote-pane-watcher.js +0 -155
  50. package/lib/setup/postinstall.js +0 -38
  51. package/lib/utils/paths.js +0 -124
  52. package/lib/utils/termux.js +0 -182
package/README.md CHANGED
@@ -1,122 +1,177 @@
1
- # NexusCrew
1
+ ## Overview
2
2
 
3
- Mobile-first `tmux` cockpit for local and remote AI CLI sessions.
3
+ NexusCrew is a **tmux-based** AI cockpit that orchestrates Claude Code, Codex CLI, Gemini CLI, and Qwen Code through persistent tmux sessions.
4
4
 
5
- NexusCrew is built for `Termux` and smartphone-first workflows, but also runs on Linux and macOS. It keeps CLI sessions alive inside `tmux`, exposes them through a web UI, and lets you switch between local and SSH hosts without reopening everything by hand.
5
+ This is a **study project** exploring an alternative approach to AI CLI orchestration, based on experience with [NexusCLI](https://www.npmjs.com/package/@mmmbuto/nexuscli). Instead of managing PTY processes in-memory, NexusCrew delegates session lifecycle to **tmux** so sessions survive server restarts and can be accessed directly from the terminal.
6
6
 
7
- ## Highlights
7
+ > **Status**: Beta — experimental, API may change
8
8
 
9
- - Persistent `tmux` sessions for Claude, Codex, Gemini and Qwen
10
- - Local + SSH host switching from one mobile-first UI
11
- - Remote streaming via `tmux capture-pane`
12
- - File and image attachments, including remote SSH staging
13
- - Local STT with `whisper.cpp`, browser fallback, system TTS
14
- - Dark/light theme
15
- - Installable web app shell with mobile icon/manifest
16
- - Termux-oriented CLI with setup, start, status and host management
9
+ > **Disclaimer**: This project is experimental. The automation pipeline is fast enough that it may be generated, tested, and published before I finish thinking about it. Expect incomplete features, mistakes, and breaking changes.
10
+
11
+ ---
12
+
13
+ ## Why tmux?
14
+
15
+ | Problem | NexusCLI (PTY) | NexusCrew (tmux) |
16
+ |---------|---------------|-------------------|
17
+ | Server crash | All sessions die | Sessions survive |
18
+ | Direct access | Web UI only | Web UI + `tmux attach` |
19
+ | Remote machines | Not supported | Experimental host registry |
20
+ | Native deps | node-pty required | SQLite native addon |
21
+ | Session recovery | Manual | Automatic |
22
+
23
+ ---
24
+
25
+ ## Features
26
+
27
+ - **Persistent sessions** — standalone tmux sessions survive server restarts
28
+ - **Multi-engine** — Claude Code, Codex CLI, Gemini CLI, Qwen Code
29
+ - **Auto-discovery** — detects installed CLIs plus live shell aliases/functions and generic shell config fallbacks
30
+ - **Explicit tmux creation** — create a new tmux session only from a detected runnable launcher
31
+ - **Unified web UI** — attach chat to real active tmux sessions
32
+ - **SSE streaming** — real-time output from tmux sessions
33
+ - **Cross-platform** — Linux, macOS, Termux (Android)
34
+
35
+ ---
36
+
37
+ ## Engine Discovery
38
+
39
+ NexusCrew automatically detects:
40
+
41
+ 1. **PATH binaries** — `claude`, `codex`, `gemini`, `qwen` when present in the runtime PATH
42
+ 2. **Live shell wrappers** — aliases/functions available in the current login shell
43
+ 3. **Shell-file fallbacks** — wrappers detected from `.zshrc`, `.bashrc`, `.profile`, and optional extra shell sources
44
+
45
+ Launchers detected only from shell files are shown as detected metadata but are not treated as runnable until they are verified in the active shell context.
46
+
47
+ ---
17
48
 
18
49
  ## Install
19
50
 
20
51
  ```bash
21
52
  npm install -g @mmmbuto/nexuscrew
22
- nexuscrew setup
23
- nexuscrew start
24
53
  ```
25
54
 
26
- `nexuscrew start` runs the server in background, waits for health, and can open the browser for you.
55
+ Then initialize:
56
+
57
+ ```bash
58
+ nexuscrew init
59
+ ```
27
60
 
28
- Default URL:
61
+ And start:
29
62
 
30
- ```text
31
- http://localhost:41820
63
+ ```bash
64
+ nexuscrew start
32
65
  ```
33
66
 
34
- ## Termux
67
+ Open `http://localhost:41820` in your browser.
35
68
 
36
- Recommended base packages:
69
+ ### Termux (Android)
37
70
 
38
71
  ```bash
39
- pkg install nodejs tmux openssh termux-services
72
+ pkg install tmux nodejs
40
73
  npm install -g @mmmbuto/nexuscrew
41
- nexuscrew setup
74
+ nexuscrew init
75
+ nexuscrew start
42
76
  ```
43
77
 
44
- The setup wizard can also:
78
+ ---
45
79
 
46
- - prepare `Termux:Boot`
47
- - create and enable the native `runit` service via `termux-services`
48
- - configure SSH hosts
49
- - prepare local STT checks for `whisper.cpp`
80
+ ## Hosts Registry
50
81
 
51
- ## Core Commands
82
+ You can store SSH host definitions for later work:
52
83
 
53
84
  ```bash
54
- nexuscrew setup
55
- nexuscrew start
56
- nexuscrew stop
57
- nexuscrew status
58
- nexuscrew attach
59
- nexuscrew sessions
60
- nexuscrew hosts list
61
- nexuscrew hosts add --name mybox --host example.com --user dag
62
- nexuscrew stt doctor
85
+ nexuscrew hosts add --name vps1 --host example.com --user user
86
+ nexuscrew hosts add --name vps2 --host 192.168.1.10 --user admin --port 2222
63
87
  ```
64
88
 
65
- ## How It Works
89
+ Host storage and connectivity tests are available, but the current UI and default session flow are local tmux-first. Treat remote execution as experimental until it is revalidated end-to-end.
66
90
 
67
- ```text
68
- Browser/WebView <-> Express API <-> tmux session/windows <-> AI CLI processes
69
- |
70
- +-> local machine
71
- +-> SSH hosts
72
- ```
91
+ ---
92
+
93
+ ## Commands
94
+
95
+ | Command | Description |
96
+ |---------|-------------|
97
+ | `nexuscrew init` | First-time setup (config, hosts, tmux check) |
98
+ | `nexuscrew start` | Start server |
99
+ | `nexuscrew stop` | Stop server |
100
+ | `nexuscrew status` | Server + tmux + hosts status |
101
+ | `nexuscrew engines` | Discover available AI CLIs and aliases |
102
+ | `nexuscrew sessions` | List tmux sessions |
103
+ | `nexuscrew attach` | Attach to tmux session directly |
104
+ | `nexuscrew config` | View/edit configuration |
105
+ | `nexuscrew hosts list` | List configured hosts |
106
+ | `nexuscrew hosts add` | Add remote SSH host |
107
+ | `nexuscrew hosts remove` | Remove a host |
73
108
 
74
- Each conversation runs in its own `tmux` window. Local sessions stream from log watchers; remote sessions stream from incremental pane capture.
109
+ ---
75
110
 
76
111
  ## Configuration
77
112
 
78
- Main config:
113
+ Config stored in `~/.nexuscrew/config.json`:
79
114
 
80
- ```text
81
- ~/.nexuscrew/config.json
115
+ ```json
116
+ {
117
+ "port": 41820,
118
+ "logDir": "~/.nexuscrew/logs",
119
+ "autoDiscovery": true,
120
+ "preferredShell": "",
121
+ "extraShellSources": []
122
+ }
82
123
  ```
83
124
 
84
- Host registry:
125
+ Hosts stored in `~/.nexuscrew/hosts.json`:
85
126
 
86
- ```text
87
- ~/.nexuscrew/hosts.json
127
+ ```json
128
+ [
129
+ { "name": "local", "type": "local", "default": true },
130
+ { "name": "vps1", "type": "ssh", "host": "example.com", "user": "user", "port": "22" }
131
+ ]
88
132
  ```
89
133
 
90
- Important defaults include:
134
+ ---
91
135
 
92
- - `server.port`
93
- - `tmuxSession`
94
- - `hosts.default`
95
- - `workspaces.default`
96
- - `stt.provider`
97
- - `termux.boot_start`
98
- - `termux.service_enabled`
136
+ ## Network
99
137
 
100
- ## Authentication
138
+ | Protocol | Default Port | Use Case |
139
+ |----------|--------------|----------|
140
+ | HTTP | `41820` | Local access |
101
141
 
102
- Localhost use is optimized for local device workflows.
142
+ ---
103
143
 
104
- For remote or network exposure, review and configure authentication before relying on the instance outside localhost. Do not expose an unreviewed dev setup directly to the public internet.
144
+ ## Architecture
145
+
146
+ ```
147
+ Browser ←SSE→ Express Server ←tmux→ active tmux sessions
148
+ ├─ session: claude-work
149
+ ├─ session: codex-debug
150
+ └─ session: qwen-sandbox
151
+ ```
152
+
153
+ Each AI session = one standalone tmux session. Output is piped to log files, parsed by the watcher, and streamed to the UI via SSE.
154
+
155
+ ---
105
156
 
106
157
  ## Development
107
158
 
108
159
  ```bash
109
- git clone https://github.com/DioNanos/nexuscrew
160
+ git clone https://github.com/dionanos/nexuscrew
110
161
  cd nexuscrew
111
162
  npm install
112
- npm run build
163
+ cd frontend && npm install && npm run build && cd ..
113
164
  npm run dev
114
165
  ```
115
166
 
116
- ## Related
167
+ ---
168
+
169
+ ## Relation to NexusCLI
170
+
171
+ NexusCrew is a **study branch** inspired by [NexusCLI](https://www.npmjs.com/package/@mmmbuto/nexuscli). It shares the same web UI direction but replaces PTY-based process management with tmux-based persistent sessions. The goal is to explore whether tmux provides a simpler, more robust foundation for local AI CLI orchestration and crash recovery.
117
172
 
118
- - [NexusCLI](https://www.npmjs.com/package/@mmmbuto/nexuscli) - PTY-based sibling project
173
+ ---
119
174
 
120
175
  ## License
121
176
 
122
- MIT
177
+ MIT License. See [LICENSE](LICENSE).