Web Analytics

vigil-tui

⭐ 153 stars Simplified Chinese by GIN-SYSTEMS

VIGIL

实时终端功率监控 — CPU · GPU · 内存 · 网络 · 进程

CI Python Platform License


vigil-tui dashboard


概述

vigil 是一个高分辨率终端仪表盘,显示实时功率、温度、时钟频率、效率评分和电费成本,覆盖所有主要组件——全部在终端内,无需浏览器,无需后台服务,无需遥测。

它直接读取硬件传感器数据(hwmon、RAPL、LibreHardwareMonitor、NVML),在传感器不可用时优雅降级。每个面板实时更新,整个程序只需一个 vigil 命令即可运行。


功能

功率与温度

图表与可视化

进程智能

效率与成本

警报与日志

主题与用户体验

---

平台支持

| 平台 | CPU 功率 | CPU 温度 | GPU 功率 | GPU 温度 | |---|---|---|---|---| | Linux | hwmon · RAPL · 估算 | hwmon | NVML | NVML | | Windows 11 / 10 | LibreHardwareMonitor · 估算 | LHM | NVML | NVML | | macOS | 仅估算 | — | NVML(若存在) | NVML |

Windows — 精准 CPU 读数

vigil 通过 LibreHardwareMonitor (MPL-2.0) 的 WMI 接口读取真实 CPU 瓦数。没有它时,vigil 会自动回退到 CPU% × TDP 的估算。

> vigil 不包含或修改 LibreHardwareMonitor。它在运行时连接其 WMI 接口。LHM 必须单独运行。


Installation

Requirements: Python 3.11+

# Clone
git clone https://github.com/GIN-SYSTEMS/vigil-tui
cd vigil-tui

Linux / macOS

pip install .

Windows (includes WMI + pywin32 for LHM support)

pip install ".[windows]"

Run:

vigil           # launch dashboard
vigil --log     # launch + write JSONL tick log
vigil --help    # all options


快捷键绑定

| 键 | 操作 | |-----|--------| | * / ? | 切换帮助覆盖层 | | q / Ctrl+C | 退出 | | p | 暂停 / 恢复采样 | | r | 重置图表历史 | | + / - | 放大 / 缩小 Y 轴 | | b | 快照基线 — 再次按下清除 | | s | 保存 SVG 截图 | | t | 切换主题(深色 ↔ 浅色) | | c | 打开配置 / 设置向导 |


配置

首次启动会创建 ~/.config/vigil/config.toml

[hardware]
cpu_tdp_watts       = 65.0     # CPU TDP ceiling for estimation
gpu_tdp_watts       = 165.0    # GPU TDP ceiling
update_interval     = 1.0      # seconds between ticks
history_len         = 120      # chart ring-buffer depth

[cost] kwh_price = 2.0 # electricity price per kWh currency_symbol = "₺"

[alerts] webhook_url = "" # HTTP POST endpoint — empty = disabled cpu_temp_thresh = 90 # °C cpu_watt_thresh_pct = 90 # % of TDP

[ui] theme = "tactical" # "tactical" or "ghost"


How the power waterfall works

vigil starts
│
├─ Linux?
│   ├─ hwmon sysfs (k10temp / zenpower / amd_energy)   ← real sensor
│   ├─ RAPL powercap energy_uj delta                   ← kernel counter
│   └─ CPU% × TDP estimate                             ← always available
│
└─ Windows?
    ├─ LibreHardwareMonitor WMI (requires Admin + LHM) ← real sensor
    └─ CPU% × TDP estimate                             ← always available

GPU → NVML (pynvml) on all platforms if no NVIDIA GPU: panel shows "unavailable", no crash


Project Structure

vigil-tui/
├── src/vigil/
│   ├── app.py                   # Textual app, layout, tick loop
│   ├── config.py                # Static constants
│   ├── config_manager.py        # TOML config loader/writer
│   ├── session.py               # Cost tracking, webhooks, JSONL logging
│   ├── collectors/
│   │   ├── base.py              # Collector ABC + SensorReading
│   │   ├── cpu.py               # hwmon → RAPL → LHM → estimate
│   │   ├── gpu.py               # NVIDIA NVML
│   │   ├── ram.py               # RAM wattage model
│   │   ├── netdisk.py           # Network + disk I/O rates
│   │   └── system.py            # Orchestrator → SystemSnapshot
│   └── widgets/
│       ├── power_header.py      # Top bar: wordmark + gauge
│       ├── cpu_panel.py         # Left: CPU + per-core bars
│       ├── braille_chart.py     # Center: power history
│       ├── clock_chart.py       # Center: clock history
│       ├── process_table.py     # Center: process ranking
│       ├── gpu_panel.py         # Right: GPU metrics
│       ├── financial_widget.py  # Cost display
│       ├── netdisk_widget.py    # Network + disk rates
│       ├── status_bar.py        # Footer
│       ├── boot_screen.py       # Splash screen
│       ├── help_overlay.py      # Key bindings overlay
│       └── setup_wizard.py      # First-run wizard
├── .github/workflows/ci.yml
├── pyproject.toml
├── requirements.txt
└── LICENSE


依赖项

| 软件包 | 作用 | |---------|---------| | textual >= 0.80 | TUI 框架 | | psutil >= 5.9.8 | CPU%,进程列表,网络/磁盘 I/O | | pynvml >= 11.5.0 | NVIDIA GPU 指标 | | wmi >= 1.5.1 (Windows) | LHM WMI 桥接 | | pywin32 >= 306 (Windows) | Windows COM/WMI 支持 |


许可证

MIT — 免费使用、修改和分发。


GIN-SYSTEMS 构建

--- Tranlated By Open Ai Tx | Last indexed: 2026-07-17 ---