@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.
- package/README.md +122 -67
- package/bin/nexuscrew.js +194 -470
- package/frontend/dist/assets/{index-BG1N7bSL.js → index-BsldfYnr.js} +1704 -1711
- package/frontend/dist/assets/index-DcQGg3dp.css +1 -0
- package/frontend/dist/index.html +3 -11
- package/lib/server/routes/hosts.js +22 -12
- package/lib/server/routes/launchers.js +12 -0
- package/lib/server/routes/models.js +16 -63
- package/lib/server/routes/runtime.js +10 -0
- package/lib/server/routes/send.js +97 -258
- package/lib/server/routes/sessions.js +13 -42
- package/lib/server/routes/status.js +18 -22
- package/lib/server/routes/tmux.js +88 -0
- package/lib/server/server.js +60 -81
- package/lib/services/engine-discovery.js +192 -445
- package/lib/services/log-watcher.js +22 -40
- package/lib/services/session-store.js +88 -62
- package/lib/services/tmux-manager.js +111 -173
- package/package.json +5 -9
- package/frontend/dist/apple-touch-icon.png +0 -0
- package/frontend/dist/assets/index-CiAtinNP.css +0 -1
- package/frontend/dist/favicon.svg +0 -20
- package/frontend/dist/icon-192.png +0 -0
- package/frontend/dist/icon-512.png +0 -0
- package/frontend/dist/site.webmanifest +0 -29
- package/lib/config/hosts.js +0 -67
- package/lib/config/manager.js +0 -379
- package/lib/config/models.js +0 -408
- package/lib/server/db/adapter.js +0 -274
- package/lib/server/db/drivers/sql-js.js +0 -75
- package/lib/server/db/migrate.js +0 -174
- package/lib/server/db/migrations/001_base_schema.sql +0 -70
- package/lib/server/middleware/auth.js +0 -134
- package/lib/server/middleware/rate-limit.js +0 -63
- package/lib/server/models/User.js +0 -128
- package/lib/server/routes/auth.js +0 -168
- package/lib/server/routes/keys.js +0 -28
- package/lib/server/routes/runtimes.js +0 -34
- package/lib/server/routes/speech.js +0 -46
- package/lib/server/routes/upload.js +0 -135
- package/lib/server/routes/wake-lock.js +0 -95
- package/lib/server/routes/workspaces.js +0 -101
- package/lib/server/services/attachment-manager.js +0 -57
- package/lib/server/services/context-bridge.js +0 -425
- package/lib/server/services/runtime-manager.js +0 -462
- package/lib/server/services/speech-manager.js +0 -76
- package/lib/server/services/summary-generator.js +0 -309
- package/lib/server/services/workspace-manager.js +0 -79
- package/lib/services/remote-pane-watcher.js +0 -155
- package/lib/setup/postinstall.js +0 -38
- package/lib/utils/paths.js +0 -124
- package/lib/utils/termux.js +0 -182
package/README.md
CHANGED
|
@@ -1,122 +1,177 @@
|
|
|
1
|
-
|
|
1
|
+
## Overview
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7
|
+
> **Status**: Beta — experimental, API may change
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
55
|
+
Then initialize:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
nexuscrew init
|
|
59
|
+
```
|
|
27
60
|
|
|
28
|
-
|
|
61
|
+
And start:
|
|
29
62
|
|
|
30
|
-
```
|
|
31
|
-
|
|
63
|
+
```bash
|
|
64
|
+
nexuscrew start
|
|
32
65
|
```
|
|
33
66
|
|
|
34
|
-
|
|
67
|
+
Open `http://localhost:41820` in your browser.
|
|
35
68
|
|
|
36
|
-
|
|
69
|
+
### Termux (Android)
|
|
37
70
|
|
|
38
71
|
```bash
|
|
39
|
-
pkg install
|
|
72
|
+
pkg install tmux nodejs
|
|
40
73
|
npm install -g @mmmbuto/nexuscrew
|
|
41
|
-
nexuscrew
|
|
74
|
+
nexuscrew init
|
|
75
|
+
nexuscrew start
|
|
42
76
|
```
|
|
43
77
|
|
|
44
|
-
|
|
78
|
+
---
|
|
45
79
|
|
|
46
|
-
|
|
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
|
-
|
|
82
|
+
You can store SSH host definitions for later work:
|
|
52
83
|
|
|
53
84
|
```bash
|
|
54
|
-
nexuscrew
|
|
55
|
-
nexuscrew
|
|
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
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
109
|
+
---
|
|
75
110
|
|
|
76
111
|
## Configuration
|
|
77
112
|
|
|
78
|
-
|
|
113
|
+
Config stored in `~/.nexuscrew/config.json`:
|
|
79
114
|
|
|
80
|
-
```
|
|
81
|
-
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"port": 41820,
|
|
118
|
+
"logDir": "~/.nexuscrew/logs",
|
|
119
|
+
"autoDiscovery": true,
|
|
120
|
+
"preferredShell": "",
|
|
121
|
+
"extraShellSources": []
|
|
122
|
+
}
|
|
82
123
|
```
|
|
83
124
|
|
|
84
|
-
|
|
125
|
+
Hosts stored in `~/.nexuscrew/hosts.json`:
|
|
85
126
|
|
|
86
|
-
```
|
|
87
|
-
|
|
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
|
-
|
|
134
|
+
---
|
|
91
135
|
|
|
92
|
-
|
|
93
|
-
- `tmuxSession`
|
|
94
|
-
- `hosts.default`
|
|
95
|
-
- `workspaces.default`
|
|
96
|
-
- `stt.provider`
|
|
97
|
-
- `termux.boot_start`
|
|
98
|
-
- `termux.service_enabled`
|
|
136
|
+
## Network
|
|
99
137
|
|
|
100
|
-
|
|
138
|
+
| Protocol | Default Port | Use Case |
|
|
139
|
+
|----------|--------------|----------|
|
|
140
|
+
| HTTP | `41820` | Local access |
|
|
101
141
|
|
|
102
|
-
|
|
142
|
+
---
|
|
103
143
|
|
|
104
|
-
|
|
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/
|
|
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
|
-
|
|
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
|
-
|
|
173
|
+
---
|
|
119
174
|
|
|
120
175
|
## License
|
|
121
176
|
|
|
122
|
-
MIT
|
|
177
|
+
MIT License. See [LICENSE](LICENSE).
|