使い方
TUI
端末で sudo varwatch --tui を実行します。
| キー | 動作 |
|---|---|
Space / Enter | 選択中の watcher を ON/OFF |
/ | ログのキーワードフィルタ |
f / Esc | フィルタ解除 |
p | プリセットを切替 (logs → caches → temp) |
e | 全ログを CSV エクスポート |
s | 設定を保存 |
n | 通知テスト |
q / Ctrl-C | 終了 |
Web UI
varwatch --web で http://localhost:8080 を開きます。以下のパネルを備えています。
- Watchers — 各エンジンの Start / Stop(状態は TUI と共有)
- Presets — logs / caches / temp をワンタップで適用(
POST /api/presets/:id/apply) - Alerts — 発火履歴と件数バッジ
- Performance — イベント/s・ヒープ・CPU のミニグラフ、512 MiB 超で警告
- Dashboard / Tree / Diffs — 24h 集計、パス階層ヒートマップ、テキスト差分(緑: 追加 / 赤: 削除)
- Search — SQLite への時系列・キーワード検索と CSV / JSON エクスポート
- Logs — WebSocket によるリアルタイムログ
表記言語はヘッダーのボタンで 日本語 / English を即時切替できます(選択は localStorage に保存)。
REST API
$ curl 'http://localhost:8080/api/logs?since=2026-09-23T00:00:00%2B09:00&q=Created&limit=50' # 検索
$ curl 'http://localhost:8080/api/alerts' # アラート履歴
$ curl -o logs.csv 'http://localhost:8080/api/export?format=csv&source=fswatch' # エクスポート
$ curl 'http://localhost:8080/api/stats?hours=24' # 統計
$ curl 'http://localhost:8080/api/tree?hours=24' # ツリー
$ curl 'http://localhost:8080/api/diffs?limit=50' # 差分
$ curl 'http://localhost:8080/api/presets' && curl -X POST 'http://localhost:8080/api/presets/logs/apply'
$ curl 'http://localhost:8080/api/perf' # パフォーマンス
$ curl 'http://localhost:8080/api/config' # 言語などの設定 Live Demo
Netlify 上で公開しているモックデモを試せます。
▶ Live Demo を試す