marmonitor 0.1.7 → 0.2.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/README.ko.md +248 -0
- package/README.md +41 -5
- package/bin/daemon.js +2 -0
- package/bin/postinstall.cjs +47 -1
- package/bin/preuninstall.cjs +14 -0
- package/dist/banner/index.js +15 -7
- package/dist/cli.js +281 -107
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +2 -0
- package/dist/output/badge-themes.d.ts +19 -0
- package/dist/output/badge-themes.js +52 -0
- package/dist/output/index.d.ts +5 -2
- package/dist/output/index.js +69 -22
- package/dist/output/utils.d.ts +22 -8
- package/dist/output/utils.js +83 -48
- package/dist/scanner/claude.d.ts +8 -1
- package/dist/scanner/claude.js +156 -19
- package/dist/scanner/codex-sqlite.d.ts +11 -0
- package/dist/scanner/codex-sqlite.js +50 -0
- package/dist/scanner/codex.d.ts +1 -1
- package/dist/scanner/codex.js +42 -2
- package/dist/scanner/concurrency.d.ts +5 -0
- package/dist/scanner/concurrency.js +22 -0
- package/dist/scanner/daemon-entry.d.ts +5 -0
- package/dist/scanner/daemon-entry.js +27 -0
- package/dist/scanner/daemon-loop.d.ts +13 -0
- package/dist/scanner/daemon-loop.js +77 -0
- package/dist/scanner/daemon-utils.d.ts +9 -0
- package/dist/scanner/daemon-utils.js +56 -0
- package/dist/scanner/index.js +51 -10
- package/dist/scanner/perf.d.ts +8 -0
- package/dist/scanner/perf.js +26 -0
- package/dist/scanner/session-registry.d.ts +31 -0
- package/dist/scanner/session-registry.js +99 -0
- package/dist/scanner/session-tier.d.ts +6 -0
- package/dist/scanner/session-tier.js +22 -0
- package/dist/tmux/index.js +11 -0
- package/dist/tmux/jump-anchor.d.ts +25 -0
- package/dist/tmux/jump-anchor.js +100 -0
- package/dist/tmux/setup.d.ts +4 -0
- package/dist/tmux/setup.js +41 -1
- package/dist/tmux/status-click.d.ts +9 -0
- package/dist/tmux/status-click.js +19 -0
- package/package.json +1 -1
package/README.ko.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="docs/banner-ansi.png" alt="marmonitor" width="640">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Claude Code, Codex, Gemini를 위한 tmux 상태바 모니터 — AI 코딩 세션을 실시간으로 추적하세요</strong>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/marmonitor"><img src="https://img.shields.io/npm/v/marmonitor" alt="npm version"></a>
|
|
11
|
+
<a href="https://github.com/mjjo16/marmonitor/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/marmonitor" alt="license"></a>
|
|
12
|
+
<img src="https://img.shields.io/node/v/marmonitor" alt="node version">
|
|
13
|
+
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue" alt="platform">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="README.md">English</a> | <b>한국어</b>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 왜 marmonitor인가?
|
|
23
|
+
|
|
24
|
+
tmux에서 여러 AI 코딩 에이전트를 동시에 실행하는 것은 이제 일상이 되었습니다 — Claude Code가 백엔드를 리팩토링하고, Codex가 다른 패널에서 테스트를 작성하고, Gemini가 문서를 검토합니다. 하지만 세션이 늘어날수록 같은 문제에 부딪힙니다:
|
|
25
|
+
|
|
26
|
+
- 패널로 전환했더니 에이전트가 10분째 `allow` 승인을 기다리고 있었다
|
|
27
|
+
- 방금 작업하던 Codex 세션이 어느 윈도우에 있는지 기억나지 않는다
|
|
28
|
+
- 여러 세션에서 토큰을 얼마나 소모했는지 알 수 없다
|
|
29
|
+
|
|
30
|
+
**이를 위한 대시보드가 없습니다.** 패널을 하나하나 돌아가며 직접 확인해야 합니다.
|
|
31
|
+
|
|
32
|
+
**marmonitor**가 이 문제를 해결합니다. tmux.conf에 한 줄만 추가하면, 상태바가 머신에서 실행 중인 모든 AI 세션의 실시간 컨트롤 패널이 됩니다.
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<img src="docs/use_sample.png" alt="marmonitor tmux 상태바" width="640">
|
|
36
|
+
<br>
|
|
37
|
+
<em>에이전트 수, 단계 뱃지, 번호가 매겨진 어텐션 필 — 모두 tmux 상태바에 표시됩니다</em>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
### 주요 기능
|
|
41
|
+
|
|
42
|
+
**tmux 상태바** — 터미널 하단에 항상 표시:
|
|
43
|
+
- 에이전트 수 (`Cl 12`, `Cx 2`, `Gm 1`) — 실행 중인 세션 수
|
|
44
|
+
- 단계 알림 (`⏳ 1`, `🤔 2`, `🔧 1`) — 주의가 필요한 세션
|
|
45
|
+
- 번호 필 (`1 ⏳Cl my-project allow`, `2 •Cx api-server 6m`) — `Option+1~5`로 세션 바로 이동
|
|
46
|
+
|
|
47
|
+
**어텐션 우선순위** — 입력이 필요한 세션이 먼저 표시:
|
|
48
|
+
- ⏳ `permission` (승인 대기)이 항상 #1 — 승인이 필요합니다
|
|
49
|
+
- 🤔 `thinking` (AI 응답 중)이 #2 — 곧 결과가 나옵니다
|
|
50
|
+
- 이후 최근 활성 세션 순으로 정렬
|
|
51
|
+
|
|
52
|
+
**빠른 이동** — `Option+1`을 누르면 #1 어텐션 세션의 tmux 패널로 바로 이동합니다. 윈도우를 뒤질 필요가 없습니다.
|
|
53
|
+
|
|
54
|
+
**전체 상태 확인** — `marmonitor status`로 모든 정보 확인:
|
|
55
|
+
|
|
56
|
+
<p align="center">
|
|
57
|
+
<img src="docs/use_status_sample.png" alt="marmonitor status 출력" width="640">
|
|
58
|
+
<br>
|
|
59
|
+
<em>모든 세션의 상태, 토큰, 단계, CPU/MEM, 워커 프로세스 트리</em>
|
|
60
|
+
</p>
|
|
61
|
+
|
|
62
|
+
**계측 불필요** — API 키, 에이전트 플러그인, 코드 변경 없이 사용 가능합니다. marmonitor는 외부에서 로컬 프로세스 정보와 세션 파일을 읽습니다. 시작하려면 두 개의 명령어만 실행하세요: `npm install -g marmonitor` 그리고 `marmonitor setup tmux`.
|
|
63
|
+
|
|
64
|
+
> **tmux + AI 멀티세션 워크플로우를 위해 만들었습니다.** 매일 5개 이상의 AI 코딩 세션을 다양한 프로젝트에서 실행한다면, marmonitor는 컨텍스트 전환을 추측에서 상태바 한 번 확인으로 바꿔줍니다.
|
|
65
|
+
|
|
66
|
+
## 지원 에이전트
|
|
67
|
+
|
|
68
|
+
| 에이전트 | 탐지 방식 | 세션 정보 | 단계 추적 |
|
|
69
|
+
|---------|----------|----------|----------|
|
|
70
|
+
| **Claude Code** | 네이티브 바이너리 | 토큰, 타임스탬프, 모델 | thinking, tool, permission, done |
|
|
71
|
+
| **Codex** | 바이너리 + cmd 폴백 | 토큰, 타임스탬프, 모델 | thinking, tool, done |
|
|
72
|
+
| **Gemini** | cmd 폴백 | 토큰, 타임스탬프, 모델 | thinking, tool, done |
|
|
73
|
+
|
|
74
|
+
## 설치
|
|
75
|
+
|
|
76
|
+
### 1. marmonitor 설치
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install -g marmonitor
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2. tmux 연동 설정
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
marmonitor setup tmux
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
[marmonitor-tmux](https://github.com/mjjo16/marmonitor-tmux) 플러그인을 `~/.tmux.conf`에 추가합니다. tmux 안에서 `prefix + I`을 눌러 활성화하세요.
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary>직접 ~/.tmux.conf에 추가하기</summary>
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
set -g @plugin 'mjjo16/marmonitor-tmux'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
[tpm](https://github.com/tmux-plugins/tpm)이 필요합니다.
|
|
98
|
+
</details>
|
|
99
|
+
|
|
100
|
+
<details>
|
|
101
|
+
<summary>수동 설치 (tpm 없이)</summary>
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git clone https://github.com/mjjo16/marmonitor-tmux ~/.tmux/plugins/marmonitor-tmux
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`~/.tmux.conf`에 추가:
|
|
108
|
+
```bash
|
|
109
|
+
run-shell ~/.tmux/plugins/marmonitor-tmux/marmonitor.tmux
|
|
110
|
+
```
|
|
111
|
+
</details>
|
|
112
|
+
|
|
113
|
+
<details>
|
|
114
|
+
<summary>소스에서 설치 (개발용)</summary>
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
git clone https://github.com/mjjo16/marmonitor.git
|
|
118
|
+
cd marmonitor
|
|
119
|
+
npm install && npm run build
|
|
120
|
+
npm link
|
|
121
|
+
```
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
## 빠른 시작
|
|
125
|
+
|
|
126
|
+
설치가 완료되면 tmux 상태바에 AI 세션 뱃지가 자동으로 표시됩니다. 추가로 제공되는 기능:
|
|
127
|
+
|
|
128
|
+
| 단축키 | 동작 |
|
|
129
|
+
|--------|------|
|
|
130
|
+
| `prefix + a` | 어텐션 팝업 — 검토할 세션 선택 |
|
|
131
|
+
| `prefix + j` | 점프 팝업 — 이동할 세션 선택 |
|
|
132
|
+
| `prefix + m` | 독 — 컴팩트 모니터 패널 |
|
|
133
|
+
| `Option+1~5` | 어텐션 세션 #1~5로 바로 이동 |
|
|
134
|
+
|
|
135
|
+
CLI 명령어:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
marmonitor status # 전체 세션 목록
|
|
139
|
+
marmonitor attention # 입력이 필요한 세션 확인
|
|
140
|
+
marmonitor watch # 실시간 전체 화면 모니터
|
|
141
|
+
marmonitor help # 모든 명령어 및 옵션
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 단계 아이콘
|
|
145
|
+
|
|
146
|
+
| 아이콘 | 단계 | 의미 |
|
|
147
|
+
|--------|------|------|
|
|
148
|
+
| ⏳ | `permission` | AI가 도구 승인을 요청 중 — **사용자 입력 필요** |
|
|
149
|
+
| 🤔 | `thinking` | AI가 응답을 생성 중 |
|
|
150
|
+
| 🔧 | `tool` | 승인된 도구 실행 중 |
|
|
151
|
+
| ✅ | `done` | 응답 완료, 다음 지시 대기 중 |
|
|
152
|
+
|
|
153
|
+
## 상태 레이블
|
|
154
|
+
|
|
155
|
+
| 레이블 | 의미 |
|
|
156
|
+
|--------|------|
|
|
157
|
+
| `[Active]` | CPU 활동 감지됨 |
|
|
158
|
+
| `[Idle]` | 프로세스 활성 상태이나 최근 활동 없음 |
|
|
159
|
+
| `[Stalled]` | 장기간 활동 없음 |
|
|
160
|
+
| `[Dead]` | 세션 파일은 있지만 프로세스가 종료됨 |
|
|
161
|
+
| `[Unmatched]` | AI 프로세스는 발견되었지만 매칭되는 세션 없음 |
|
|
162
|
+
|
|
163
|
+
## tmux 플러그인
|
|
164
|
+
|
|
165
|
+
[marmonitor-tmux](https://github.com/mjjo16/marmonitor-tmux) 플러그인이 tmux 설정을 자동으로 처리합니다:
|
|
166
|
+
|
|
167
|
+
- 에이전트 뱃지와 어텐션 필이 포함된 2번째 상태 라인
|
|
168
|
+
- 팝업, 점프, 독 키 바인딩
|
|
169
|
+
- Option+1~5 다이렉트 점프
|
|
170
|
+
|
|
171
|
+
모든 설정은 `@marmonitor-*` 옵션을 통해 커스터마이징 가능합니다. 자세한 내용은 [플러그인 README](https://github.com/mjjo16/marmonitor-tmux)를 참조하세요.
|
|
172
|
+
|
|
173
|
+
## 설정
|
|
174
|
+
|
|
175
|
+
설정 파일은 다음 순서로 탐색됩니다 (먼저 발견되는 것이 적용):
|
|
176
|
+
|
|
177
|
+
1. `$XDG_CONFIG_HOME/marmonitor/settings.json`
|
|
178
|
+
2. `~/.config/marmonitor/settings.json`
|
|
179
|
+
3. `~/.marmonitor.json`
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# 현재 설정 파일 경로 및 값 확인
|
|
183
|
+
marmonitor settings-path
|
|
184
|
+
marmonitor settings-show
|
|
185
|
+
|
|
186
|
+
# 기본 설정 파일 생성
|
|
187
|
+
marmonitor settings-init --stdout
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 설정 예시
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"display": {
|
|
195
|
+
"attentionLimit": 10,
|
|
196
|
+
"statuslineAttentionLimit": 5
|
|
197
|
+
},
|
|
198
|
+
"status": {
|
|
199
|
+
"stalledAfterMin": 20,
|
|
200
|
+
"phaseDecay": {
|
|
201
|
+
"thinking": 20,
|
|
202
|
+
"tool": 30,
|
|
203
|
+
"permission": 0,
|
|
204
|
+
"done": 5
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"integration": {
|
|
208
|
+
"tmux": {
|
|
209
|
+
"keys": {
|
|
210
|
+
"attentionPopup": "a",
|
|
211
|
+
"jumpPopup": "j",
|
|
212
|
+
"dockToggle": "m",
|
|
213
|
+
"directJump": ["M-1", "M-2", "M-3", "M-4", "M-5"]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## 제거
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
marmonitor uninstall-integration # tmux 설정 제거 + 상태바 복원
|
|
224
|
+
npm uninstall -g marmonitor # CLI 제거
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## 안전성
|
|
228
|
+
|
|
229
|
+
- **기본적으로 읽기 전용** — 관찰만 하며, 세션을 수정하지 않습니다
|
|
230
|
+
- **네트워크 미사용** — 외부 연결 없이 모든 데이터가 로컬에 유지됩니다
|
|
231
|
+
- **보수적인 기본값** — 모든 연동 기능은 옵트인 방식입니다
|
|
232
|
+
- **tmux 우선** — WezTerm/iTerm2 네이티브 지원은 현재 일시 중단 상태입니다
|
|
233
|
+
|
|
234
|
+
## 기여하기
|
|
235
|
+
|
|
236
|
+
설정, 커밋 규칙, PR 가이드라인은 [CONTRIBUTING.md](CONTRIBUTING.md)를 참조하세요. 아키텍처 세부사항은 [ARCHITECTURE.md](ARCHITECTURE.md)를 확인하세요.
|
|
237
|
+
|
|
238
|
+
## 알려진 제한사항
|
|
239
|
+
|
|
240
|
+
- 패널 점프 기능은 tmux가 필요합니다
|
|
241
|
+
- WezTerm / iTerm2 네이티브 바 지원은 현재 일시 중단 상태이며, tmux가 지원되는 표면입니다
|
|
242
|
+
- Gemini 권한 감지는 Ink TUI 아키텍처로 인해 제한적입니다
|
|
243
|
+
- 단계 감지는 휴리스틱 기반으로, 에이전트별 정확도가 다를 수 있습니다
|
|
244
|
+
- macOS 우선 개발이며, Linux 지원은 미테스트 상태입니다
|
|
245
|
+
|
|
246
|
+
## 라이선스
|
|
247
|
+
|
|
248
|
+
[MIT](LICENSE) — MJ JO
|
package/README.md
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
<img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue" alt="platform">
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
+
<p align="center">
|
|
17
|
+
<b>English</b> | <a href="README.ko.md">한국어</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
16
20
|
---
|
|
17
21
|
|
|
18
22
|
## Why marmonitor?
|
|
@@ -55,7 +59,7 @@ Running multiple AI coding agents in tmux is now the norm — Claude Code refact
|
|
|
55
59
|
<em>All sessions with status, tokens, phase, CPU/MEM, and worker process tree</em>
|
|
56
60
|
</p>
|
|
57
61
|
|
|
58
|
-
**Zero
|
|
62
|
+
**Zero instrumentation** — no API keys, no agent plugins, no code changes. marmonitor reads local process info and session files from the outside. Two commands to get started: `npm install -g marmonitor` then `marmonitor setup tmux`.
|
|
59
63
|
|
|
60
64
|
> **Built for the tmux + AI multi-session workflow.** If you run 5+ AI coding sessions daily across different projects, marmonitor turns context-switching from guesswork into a glance at your status bar.
|
|
61
65
|
|
|
@@ -75,16 +79,31 @@ Running multiple AI coding agents in tmux is now the norm — Claude Code refact
|
|
|
75
79
|
npm install -g marmonitor
|
|
76
80
|
```
|
|
77
81
|
|
|
78
|
-
### 2.
|
|
82
|
+
### 2. Set up tmux integration
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
marmonitor setup tmux
|
|
86
|
+
```
|
|
79
87
|
|
|
80
|
-
|
|
88
|
+
This adds the [marmonitor-tmux](https://github.com/mjjo16/marmonitor-tmux) plugin to your `~/.tmux.conf`. Then press `prefix + I` inside tmux to activate.
|
|
89
|
+
|
|
90
|
+
After upgrading `marmonitor`, run:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
marmonitor update-integration
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This checks whether your tmux integration also needs a TPM/plugin update.
|
|
97
|
+
|
|
98
|
+
<details>
|
|
99
|
+
<summary>Or add manually to ~/.tmux.conf</summary>
|
|
81
100
|
|
|
82
101
|
```bash
|
|
83
|
-
# Add to ~/.tmux.conf
|
|
84
102
|
set -g @plugin 'mjjo16/marmonitor-tmux'
|
|
85
103
|
```
|
|
86
104
|
|
|
87
|
-
|
|
105
|
+
Requires [tpm](https://github.com/tmux-plugins/tpm).
|
|
106
|
+
</details>
|
|
88
107
|
|
|
89
108
|
<details>
|
|
90
109
|
<summary>Manual install (without tpm)</summary>
|
|
@@ -159,6 +178,15 @@ The [marmonitor-tmux](https://github.com/mjjo16/marmonitor-tmux) plugin handles
|
|
|
159
178
|
|
|
160
179
|
All settings are customizable via `@marmonitor-*` options. See the [plugin README](https://github.com/mjjo16/marmonitor-tmux) for details.
|
|
161
180
|
|
|
181
|
+
### Badge styles
|
|
182
|
+
|
|
183
|
+
tmux badges and terminal text output can share one style via `integration.tmux.badgeStyle`.
|
|
184
|
+
|
|
185
|
+
- `basic` — default colored pills
|
|
186
|
+
- `basic-mono` — monochrome pills with Powerline borders
|
|
187
|
+
- `text` — plain colored text, no filled background
|
|
188
|
+
- `text-mono` — grayscale text only
|
|
189
|
+
|
|
162
190
|
## Configuration
|
|
163
191
|
|
|
164
192
|
Config is loaded from (first found wins):
|
|
@@ -195,6 +223,7 @@ marmonitor settings-init --stdout
|
|
|
195
223
|
},
|
|
196
224
|
"integration": {
|
|
197
225
|
"tmux": {
|
|
226
|
+
"badgeStyle": "basic",
|
|
198
227
|
"keys": {
|
|
199
228
|
"attentionPopup": "a",
|
|
200
229
|
"jumpPopup": "j",
|
|
@@ -206,6 +235,13 @@ marmonitor settings-init --stdout
|
|
|
206
235
|
}
|
|
207
236
|
```
|
|
208
237
|
|
|
238
|
+
## Uninstall
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
marmonitor uninstall-integration # Remove tmux settings + restore status bar
|
|
242
|
+
npm uninstall -g marmonitor # Remove CLI
|
|
243
|
+
```
|
|
244
|
+
|
|
209
245
|
## Safety
|
|
210
246
|
|
|
211
247
|
- **Read-only by default** — observes only, never modifies your sessions
|
package/bin/daemon.js
ADDED
package/bin/postinstall.cjs
CHANGED
|
@@ -8,13 +8,57 @@
|
|
|
8
8
|
* Using stderr to ensure the message is always visible.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
const path = require("path");
|
|
13
|
+
const os = require("os");
|
|
14
|
+
const { execFileSync } = require("child_process");
|
|
15
|
+
|
|
16
|
+
// Restart daemon if it was running (picks up new version)
|
|
17
|
+
const pidPath = path.join(os.tmpdir(), "marmonitor", "daemon.pid");
|
|
18
|
+
let daemonWasRunning = false;
|
|
19
|
+
try {
|
|
20
|
+
const pid = parseInt(fs.readFileSync(pidPath, "utf-8").trim(), 10);
|
|
21
|
+
if (!isNaN(pid)) {
|
|
22
|
+
process.kill(pid, "SIGTERM");
|
|
23
|
+
daemonWasRunning = true;
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
// not running
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (daemonWasRunning) {
|
|
30
|
+
try {
|
|
31
|
+
const { fork } = require("child_process");
|
|
32
|
+
const daemonScript = path.join(__dirname, "..", "dist", "scanner", "daemon-entry.js");
|
|
33
|
+
// Only restart if the compiled entry exists (dist may not exist in dev)
|
|
34
|
+
if (fs.existsSync(daemonScript)) {
|
|
35
|
+
const child = fork(path.join(__dirname, "daemon.js"), [], { detached: true, stdio: "ignore" });
|
|
36
|
+
child.unref();
|
|
37
|
+
process.stderr.write(` marmonitor: daemon restarted (PID: ${child.pid})\n`);
|
|
38
|
+
}
|
|
39
|
+
} catch {
|
|
40
|
+
process.stderr.write(" marmonitor: daemon restart failed — run: marmonitor start\n");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
execFileSync(process.execPath, [path.join(__dirname, "marmonitor.js"), "update-integration", "--quiet"], {
|
|
46
|
+
stdio: "ignore",
|
|
47
|
+
});
|
|
48
|
+
} catch {
|
|
49
|
+
// best-effort only — npm install should not fail if tmux/plugin state cannot be checked
|
|
50
|
+
}
|
|
51
|
+
|
|
11
52
|
const msg = `
|
|
12
53
|
✓ marmonitor v${require("../package.json").version} installed
|
|
13
54
|
Monitor Claude Code, Codex & Gemini sessions from your tmux status bar.
|
|
14
55
|
|
|
15
|
-
|
|
56
|
+
Quick start:
|
|
57
|
+
$ marmonitor start Start background daemon
|
|
16
58
|
$ marmonitor setup tmux Add tmux plugin to ~/.tmux.conf
|
|
17
59
|
Then press prefix+I in tmux to activate.
|
|
60
|
+
$ marmonitor update-integration
|
|
61
|
+
Check whether the tmux plugin also needs sync
|
|
18
62
|
|
|
19
63
|
Commands:
|
|
20
64
|
$ marmonitor status Show all AI sessions
|
|
@@ -22,8 +66,10 @@ const msg = `
|
|
|
22
66
|
$ marmonitor help All commands and shortcuts
|
|
23
67
|
|
|
24
68
|
Uninstall:
|
|
69
|
+
$ marmonitor stop
|
|
25
70
|
$ marmonitor uninstall-integration
|
|
26
71
|
$ npm uninstall -g marmonitor
|
|
27
72
|
`;
|
|
28
73
|
|
|
29
74
|
process.stderr.write(msg + "\n");
|
|
75
|
+
process.exit(0);
|
package/bin/preuninstall.cjs
CHANGED
|
@@ -13,6 +13,20 @@ try {
|
|
|
13
13
|
const path = require("path");
|
|
14
14
|
const os = require("os");
|
|
15
15
|
|
|
16
|
+
// Stop daemon if running
|
|
17
|
+
const pidPath = path.join(os.tmpdir(), "marmonitor", "daemon.pid");
|
|
18
|
+
try {
|
|
19
|
+
const pid = parseInt(fs.readFileSync(pidPath, "utf-8").trim(), 10);
|
|
20
|
+
if (!isNaN(pid)) {
|
|
21
|
+
process.kill(pid, "SIGTERM");
|
|
22
|
+
fs.unlinkSync(pidPath);
|
|
23
|
+
console.log(" marmonitor: daemon stopped");
|
|
24
|
+
}
|
|
25
|
+
} catch {
|
|
26
|
+
// daemon not running or already stopped
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Remove tmux plugin line
|
|
16
30
|
const PLUGIN_LINE = "set -g @plugin 'mjjo16/marmonitor-tmux'";
|
|
17
31
|
const confPath = path.join(os.homedir(), ".tmux.conf");
|
|
18
32
|
|
package/dist/banner/index.js
CHANGED
|
@@ -177,20 +177,28 @@ function renderBestEffortImage(width, assetPath, env = process.env) {
|
|
|
177
177
|
export function renderInstallInfo() {
|
|
178
178
|
return [
|
|
179
179
|
`marmonitor v${VERSION}`,
|
|
180
|
-
"Standing guard over your AI sessions",
|
|
180
|
+
"Standing guard over your AI coding sessions",
|
|
181
181
|
"",
|
|
182
|
-
"
|
|
182
|
+
"Setup:",
|
|
183
|
+
" $ marmonitor setup tmux - Add tmux plugin to ~/.tmux.conf",
|
|
184
|
+
" Then press prefix+I in tmux to activate.",
|
|
185
|
+
" $ marmonitor update-integration",
|
|
186
|
+
" - Check whether the tmux plugin also needs sync",
|
|
187
|
+
"",
|
|
188
|
+
"Commands:",
|
|
183
189
|
" $ marmonitor status - Show active AI sessions",
|
|
184
|
-
" $ marmonitor attention -
|
|
190
|
+
" $ marmonitor attention - Sessions needing your input",
|
|
185
191
|
" $ marmonitor watch - Live full-screen monitor",
|
|
186
|
-
" $ marmonitor
|
|
187
|
-
" $ marmonitor --statusline - tmux statusbar widget",
|
|
188
|
-
" $ marmonitor help - Commands, shortcuts, integration tips",
|
|
192
|
+
" $ marmonitor help - All commands and shortcuts",
|
|
189
193
|
"",
|
|
190
|
-
"tmux
|
|
194
|
+
"tmux shortcuts (after setup):",
|
|
191
195
|
" Prefix+a attention popup | Prefix+j jump popup | Prefix+m dock",
|
|
192
196
|
" Option+1..5 direct jump to top attention sessions",
|
|
193
197
|
"",
|
|
198
|
+
"Uninstall:",
|
|
199
|
+
" $ marmonitor uninstall-integration",
|
|
200
|
+
" $ npm uninstall -g marmonitor",
|
|
201
|
+
"",
|
|
194
202
|
"Docs: https://github.com/mjjo16/marmonitor",
|
|
195
203
|
].join("\n");
|
|
196
204
|
}
|