Here's a concise, professional technical briefing for the vigil-tui repository, written in the style of a senior AI engineer consultant report.


Technical Briefing: vigil-tui Real-time terminal power monitor — CPU · GPU · RAM wattage dashboard Consultant-grade assessment | 26 Python files | 132 functions | 0 test files


Overview

vigil-tui is a terminal-based dashboard written in Python that visualizes live wattage, thermals, clock speeds, efficiency scores, and electricity cost for CPU, GPU, and RAM. It queries hardware sensors directly (hwmon, RAPL, LibreHardwareMonitor, NVML) and renders a Braille-charted dashboard with per-component efficiency and cost tracking. The codebase is structured as a single-package TUI application with a pyproject.toml/requirements.txt pip-based setup.

Clone: git clone https://github.com/moses-y/vigil-tui


Code Health & Issues

All findings below are deterministic, produced by static analysis of the repository's source. They are not opinions.

SeverityCountIssueFiles
HIGH3No test suite — 26 source files with zero test coverageRepository-wide
HIGH1Dependencies declared without a lockfile — pyproject.toml has no lock fileRoot
HIGH1CI workflow discards exit codes of critical steps — .github/workflows/ci.yml line 39CI
MEDIUM3Duplicated code blocks — 6-line blocks repeated across cpu_panel.py and gpu_panel.pyWidgets
MEDIUM8Broad except clauses swallows errors indiscriminately — cpu.py, gpu.py, netdisk.pyCollectors
MEDIUM3Deep nesting (max depth 6) — system.py, braille_chart.py, setup_wizard.pyCollectors/Widgets
LOW1No timeout-minutes set on CI workflow jobsCI

Fix priority: Add a test suite, commit a lockfile, and fix the CI exit-code discard. The duplicated blocks and broad exception handling are low-effort DRY/refactoring wins.


Entry Points & Control Flow

Execution starts at src/vigil/__main__.py:13main(), which launches TerminalInfoApp (defined in app.py). The primary rendering loop is driven by _tick (app.py:288), which reaches 47 functions and is called by nothing else in the repo — it is the root of the update cycle.

Key internal edges (from the call graph of 107 resolved edges):

  • readSensorReading x8
  • collectsafe_read x3
  • _tickupdate_display x2 → update_data x2
  • composeBrailleChart x2
  • push_update_legend x2

The function with the widest blast radius is _tick, which fans out to every panel update. collect (in collectors) and compose (in app) are the next most connected.


What the Code Touches Outside Itself

  • 7 functions read/write files (config, logs, snapshots, screenshots)
  • 1 function reads/writes a database (session tick log)
  • 1 function makes an outbound network call (webhook alerts on threshold breach)
  • Shortest out-of-process path: _tick → collect → read_temp [filesystem via self._tpath.read_text().strip]

No background service or telemetry is sent unless a webhook is configured.


File Responsibilities (by routed volume)

FileFunctionsClassesRoutes ThroughExternal Effects
src/vigil/collectors/cpu.py1752 other filesreads files, reads database
src/vigil/app.py2131 other filecalls into 17 functions
src/vigil/session.py1623 other filesreads/writes files, outbound network
src/vigil/collectors/system.py662 other files
src/vigil/widgets/cpu_panel.py813 other filescalls into 2
src/vigil/collectors/base.py221 other filereads files
src/vigil/widgets/gpu_panel.py612 other filescalls into 2
src/vigil/widgets/status_bar.py812 other files
src/vigil/collectors/netdisk.py231 other filecalls into 3
src/vigil/config_manager.py111 other filereads/writes files
src/vigil/widgets/process_table.py611 other filecalls into 1
src/vigil/widgets/braille_chart.py611 other file
src/vigil/widgets/setup_wizard.pydeep nesting detected

Platform Support (per README)

  • Linux: CPU via hwmon/RAML/estimate; GPU via NVML
  • Windows: CPU via LibreHardwareMonitor WMI (must run as Admin); GPU via NVML
  • macOS: CPU estimate only; GPU via NVML if present

Installation (from README + config files)

git clone https://github.com/GIN-SYSTEMS/vigil-tui
cd vigil-tui
pip install .                          # Linux/macOS
pip install ".[windows]"               # Windows (WMI + pywin32)
vigil                                  # launch
vigil --log                            # launch + JSONL tick log

Configuration: config_manager.py loads AppConfig from the config file (path inferred from pyproject.toml/requirements.txt). No environment variables are required at runtime; TDP and kWh price are set via the first-run setup wizard (setup_wizard.py).


Summary

The repository delivers a functional, well-scoped TUI dashboard with real hardware integration. The technical debt is concentrated in three areas: zero test coverage, missing dependency lockfile, and CI exit-code suppression. The duplicated panels and broad exception handlers are straightforward refactors. For a client seeking a single-binary terminal power monitor with hardware sensor fallbacks, this is viable today, but any production deployment should address the HIGH-severity SDLC gaps before shipping.


End of briefing.