wrongtop

module
v0.0.0-...-9759625 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: MIT

README

WrongTop

WrongTop is a cross-platform terminal system monitor for macOS, Linux and Windows. It watches CPU, memory, processes, disks, network, Docker containers, temperatures, fans and GPUs in a tabbed TUI with live braille charts — inspired by htop, btop and glances, built with Go, Bubble Tea v2 and gopsutil.

Features

  • Single-screen overview (btop-style): the dashboard packs every major panel into one connected border frame — shared dividers, resolved junctions, per-panel colored titles — with host identity, CPU, memory/swap/zram, network, disks, GPUs and the busiest processes in a responsive grid
  • Gradient meters — bars sweep the palette ramp across their length (CPU, memory, swap, zram, disks, GPUs, battery), btop-style, and process CPU% is colored along the same ramp
  • Dashboard panels — host (OS, kernel, uptime, load average, logged-in users, temperatures, battery, fan speeds), total CPU with a scrolling braille graph, per-core usage bars and frequency, RAM/swap/zram bars with history, network down/up graphs with auto-scale ceilings labeled in the corners and glances-style mixed meters per interface (green share = download, blue share = upload), per-mount usage bars with aggregate I/O rates, and a top-process panel
  • Sensors — CPU temperatures and fan RPMs on every platform it can get them: on macOS (arm64) WrongTop reads the AppleSMC directly via IOKit — real P-core temperatures that neither btop nor glances show on a Mac — plus battery state through IOPowerSources; Linux uses hwmon; Windows tries ACPI thermal zones and WMI
  • GPU monitoring — utilization, VRAM and temperature through NVIDIA's NVML driver library, loaded at runtime (no cgo, no helper process); the panel appears only when a GPU exists
  • Alerts with history (glances-style): active warnings surface as chips on the tab bar's right zone — visible on every tab, never reflowing the grid; critical chips pulse and long events carry their duration — and a (or clicking the zone) opens a timestamped session history with severities and durations
  • Live status bar — threshold-colored cpu/mem chips, network throughput, temperature and battery at the bottom, btop-style; chips and hints degrade gracefully on narrow terminals so the line never wraps
  • Process table — sortable, live-filterable list with PID, name, CPU%, MEM%, RSS, user, thread count, nice value and htop-style state letter; tree view with collapse/expand; a full signal menu (TERM, KILL, INT, HUP, QUIT, STOP, CONT); per-process detail box with the full command line
  • Docker — container list with live CPU, memory, network and block I/O rates (computed from the lifetime counters), a CPU ACTIVITY meter column, health-aware status coloring, start / stop / restart; follow-mode log viewer with scrollback and severity coloring. The daemon is optional: the tab shows a notice and retries until it appears
  • Disks — filesystem usage bars plus per-device read/write rates, IOPS, busy time and an ACTIVITY sparkline per device
  • Network — per-interface throughput and totals, sorted by current activity, with per-interface ACTIVITY sparklines and a DROP/s column
  • Sensors tab — one panel per hardware group: rolling temperature graphs per sensor, fan speeds with activity sparklines, and battery state with charge history
  • Connections tab — the live TCP table sorted traffic-first (established, then listeners), per-state coloring, and process names resolved from the process table where the platform allows (macOS does; Linux reads the kernel tables without the expensive PID scan)
  • Themes — ten built-in palettes (tokyo-night is the default, everforest-dark and kanagawa among them) plus user-defined theme files loaded from ~/.config/wrongtop/themes/*.yml; T cycles themes live without losing state
  • Soft modern UI — chips, active tabs and alert chips blend their background toward the palette, every panel carries a border readout (title with icon on the left, the live value flush right — uptime on HOST, 45.2% · 55°C on CPU, R/W rates on DISKS…), nerd_fonts: true swaps the glyphs for nerd-font icons and powerline separators, and border: rounded | square | thick | double switches the panel corners btop-style
  • Live configR hot-reloads the YAML (theme, refresh, thresholds, layout, key bindings); p cycles dashboard density presets
  • Remote monitoringwrongtop serve streams snapshots to wrongtop connect clients over a token-authenticated, read-only protocol; wrongtop dump prints JSON lines for scripts
  • Zero-config — runs fine without a config file; YAML overrides are optional
  • Full mouse support — click to select rows and tabs, wheel to scroll — and alt-screen rendering, responsive from narrow terminals to full-screen grids

Installation

Requires Go 1.26+.

go install github.com/wrongstack/wrongtop/cmd/wrongtop@latest

Or build from source:

git clone https://github.com/wrongstack/wrongtop
cd wrongtop
make build   # or: go build -o wrongtop ./cmd/wrongtop

Building on macOS with CGO enabled (CGO_ENABLED=1, the default) links IOKit and unlocks AppleSMC temperatures, fan speeds and battery readings. A CGO_ENABLED=0 build works everywhere but skips those sensors.

Release binaries (macOS/Linux/Windows × amd64/arm64), a Homebrew tap and checksums are produced by goreleaser on every v* tag; darwin builds link IOKit, the rest stay cgo-free.

Usage

wrongtop                        # start the monitor
wrongtop -c config.yaml         # use a specific config file
wrongtop serve                  # stream snapshots to connect clients
wrongtop connect host:port      # watch a remote machine
wrongtop dump --count 5         # JSON snapshots to stdout
wrongtop version                # print the version
wrongtop config-sample          # print an annotated sample config

The config file can also be set with the WRONGTOP_CONFIG environment variable; otherwise ~/.config/wrongtop/config.yaml is used if present.

Remote monitoring

One machine runs the headless server; any number of clients watch it:

# on the machine to monitor — require a token, never run it open
WRONGTOP_TOKEN=choose-a-secret wrongtop serve --listen :61234

# from anywhere that can reach the port
WRONGTOP_TOKEN=choose-a-secret wrongtop connect server:61234

# scripts get the same data as JSON lines
WRONGTOP_TOKEN=choose-a-secret wrongtop connect …   # interactive
wrongtop dump --count 60                            # local JSON lines

The protocol is read-only by construction: clients authenticate with a constant-time token check and then only receive snapshot frames. Remote views disable the Docker tab, process signaling and command-line lookups — there is nothing to execute on the server.

Keybindings

Global (work on every tab):

Key Action
1N jump to tab (the status bar shows the live range)
tab / shift+tab next / previous tab
T cycle color theme (built-ins and user themes)
R reload the config file
a alert history overlay
? / esc toggle / dismiss overlays
q / ctrl+c quit
mouse click tabs and rows, wheel to scroll

Processes tab:

Key Action
/ mouse wheel move selection
/ filter — matches name, user, or PID prefix for all-digit queries (config: keys.filter)
s cycle sort key: cpu → mem → pid → name → user
S reverse sort order
t toggle the process tree (left/right collapse/expand subtrees)
enter open the process detail box (full command line, nice, threads, …)
k signal menu preset to SIGTERM (config: keys.kill)
K signal menu preset to SIGKILL — the uppercase variant of the kill key
pick the signal in the menu
y send the selected signal · n/esc cancel

WrongTop refuses to signal its own process.

Dashboard tab:

Key Action
p cycle density: full → compact → minimal

Docker tab:

Key Action
enter follow container logs (esc to go back, wheel scrolls)
s / t / r start / stop / restart container

Disks tab:

Key Action
switch between the filesystem and I/O tables

Configuration

WrongTop works with no configuration. To customize, run wrongtop config-sample and start from the annotated output.

theme: tokyo-night       # 10 built-ins, or a file in ~/.config/wrongtop/themes
refresh: 1s               # sample interval, clamped to 250ms–10s
layout: full              # full | compact | minimal (p cycles it live)
nerd_fonts: false         # true: icon glyphs + powerline separators in tabs, panels and the status bar
border: rounded           # rounded | square | thick | double panel corners

modules:                  # optional tabs
  processes: true         # show the process table
  docker: true            # show the Docker tab
  sensors: true           # show the SENSORS tab (temps, fans, battery)
  connections: true       # show the CONNECTIONS tab (live TCP table)

thresholds:               # percent where values turn warning / critical
  cpu_warn: 70
  cpu_crit: 90
  mem_warn: 80
  mem_crit: 95
  temp_warn: 60           # CPU temperature °C (shown when the platform reports it)
  temp_crit: 80

keys:                     # processes-tab overrides (single letters)
  kill: k                 # opens the signal menu; uppercase presets SIGKILL
  filter: /

read_only: false          # true disables process signaling (also set on remote views)

Missing fields fall back to the defaults shown; a missing file is not an error.

Custom themes

Drop a YAML file into ~/.config/wrongtop/themes/ — the file name becomes the theme name (or set name:), any omitted color inherits the default palette:

# ~/.config/wrongtop/themes/ocean.yml
bg: "#0b1e2d"
fg: "#cfe3f5"
red: "#ff6b6b"
green: "#5fd39a"
yellow: "#f5d76e"
blue: "#5aa9e6"
purple: "#b58cd9"
cyan: "#6ed3e7"
orange: "#f0932b"
gray: "#5d7a94"

theme: ocean picks it up, and it joins the T cycle. Files that fail to parse are skipped.

Project layout

Package Purpose
cmd/wrongtop CLI entry point (cobra): run, serve, connect, dump, config-sample
internal/app Bubble Tea root model: tab bar, global keys, overlays, alert history, status bar
internal/collector gopsutil polling into JSON-ready Snapshot values (darwin: bulk sysctl + cgo AppleSMC/IOPowerSources; linux: hwmon fans, zram, utmp; windows: WMI battery/thermal; NVML for GPUs; slow-metric caches)
internal/config YAML config loading, defaults and clamping
internal/dockerclient moby SDK wrapper: concurrent container stats, actions, log streaming
internal/format byte-count, rate and uptime formatting helpers
internal/procs process filter/sort, tree builder, signal menu and delivery
internal/remote token-authenticated snapshot streaming protocol (serve/connect plumbing)
internal/theme built-in + user palettes and derived lipgloss styles
internal/ui tab contract, scroll-proof table click mapping, titled borders
internal/ui/canvas braille time-series graphs and fraction bars
internal/ui/dashboard the overview tab: btop-style grid of host/CPU/memory/network/disk/GPU/process panels
internal/ui/processes the process table tab: flat/tree, filters, signal menu, detail box
internal/ui/docker the containers tab
internal/ui/disks the filesystems and I/O tab
internal/ui/network the per-interface traffic tab

Development

make build   # build
make test    # run tests (-race)
make vet     # static checks
make cross   # all platform targets into dist/

Embed a version string at build time:

go build -ldflags "-X github.com/wrongstack/wrongtop/cmd/wrongtop.version=$(git describe --tags --always)" -o wrongtop ./cmd/wrongtop

Roadmap

  • Dashboard: host, CPU, memory, swap, zram, sensors, fans, battery, GPUs
  • Processes: filter, sort, tree view, detail box, signal menu
  • Disks: filesystems and I/O rates
  • Network: per-interface traffic
  • Docker: containers, stats, actions, log streaming
  • Remote monitoring: serve / connect / dump
  • Container support beyond Docker (Podman, k8s)
  • Exporters (InfluxDB, Prometheus) and web dashboard

License

MIT — see LICENSE.

Directories

Path Synopsis
cmd
wrongtop command
Command wrongtop is a cross-platform terminal system monitor for macOS, Linux and Windows.
Command wrongtop is a cross-platform terminal system monitor for macOS, Linux and Windows.
internal
app
Package app wires the wrongtop root model: global keys, tab routing and the outer layout (tab bar + content + status bar).
Package app wires the wrongtop root model: global keys, tab routing and the outer layout (tab bar + content + status bar).
collector
GPU polling shared across platforms: the cache cadence lives here and the probe is platform-specific (NVML everywhere except darwin).
GPU polling shared across platforms: the cache cadence lives here and the probe is platform-specific (NVML everywhere except darwin).
config
Package config loads and represents the wrongtop user configuration.
Package config loads and represents the wrongtop user configuration.
dockerclient
Package dockerclient wraps the Docker Engine SDK for wrongtop: one call to list containers with live stats, lifecycle actions and log streaming.
Package dockerclient wraps the Docker Engine SDK for wrongtop: one call to list containers with live stats, lifecycle actions and log streaming.
format
Package format provides small formatting helpers shared across the UI.
Package format provides small formatting helpers shared across the UI.
procs
Package procs implements process-table helpers (filter, sort) and process actions (terminate, force kill).
Package procs implements process-table helpers (filter, sort) and process actions (terminate, force kill).
remote
Package remote implements wrongtop's read-only remote monitoring protocol: a token-authenticated TCP handshake followed by a stream of length-prefixed JSON collector snapshots.
Package remote implements wrongtop's read-only remote monitoring protocol: a token-authenticated TCP handshake followed by a stream of length-prefixed JSON collector snapshots.
theme
Package theme holds the color palettes and lipgloss styles used across wrongtop: ten built-in palettes plus user-defined palettes loaded from ~/.config/wrongtop/themes/*.yml.
Package theme holds the color palettes and lipgloss styles used across wrongtop: ten built-in palettes plus user-defined palettes loaded from ~/.config/wrongtop/themes/*.yml.
ui
Package ui defines the shared tab contract and helpers used by all wrongtop tabs.
Package ui defines the shared tab contract and helpers used by all wrongtop tabs.
ui/canvas
Package canvas draws time-series graphs with braille characters, btop-style: 4 dot rows and 2 dot columns packed per terminal cell.
Package canvas draws time-series graphs with braille characters, btop-style: 4 dot rows and 2 dot columns packed per terminal cell.
ui/conns
Package conns renders the connections tab: the live TCP table, live traffic first, with per-state coloring and best-effort process names.
Package conns renders the connections tab: the live TCP table, live traffic first, with per-state coloring and best-effort process names.
ui/dashboard
Package dashboard renders the wrongtop overview tab: a btop-style single-screen grid of host, CPU, memory, network, disk and top-process panels.
Package dashboard renders the wrongtop overview tab: a btop-style single-screen grid of host, CPU, memory, network, disk and top-process panels.
ui/disks
Package disks renders the disks tab: filesystem usage and per-device I/O rates.
Package disks renders the disks tab: filesystem usage and per-device I/O rates.
ui/docker
Package docker renders the Docker tab: container list with live stats, lifecycle actions and a follow-mode log viewer.
Package docker renders the Docker tab: container list with live stats, lifecycle actions and a follow-mode log viewer.
ui/network
Package network renders the network tab: per-interface traffic rates and totals.
Package network renders the network tab: per-interface traffic rates and totals.
ui/processes
Package processes renders the process table tab: sortable, filterable, flat or tree view, with a signal picker behind a confirmation prompt.
Package processes renders the process table tab: sortable, filterable, flat or tree view, with a signal picker behind a confirmation prompt.
ui/sensors
Package sensors renders the sensors tab: rolling temperature graphs, fan speeds and battery state — everything the platform reports about its own hardware.
Package sensors renders the sensors tab: rolling temperature graphs, fan speeds and battery state — everything the platform reports about its own hardware.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL