Skip to content

htop-go (Unix)

A minimal htop clone in Go for Unix systems (Linux, macOS).

Features

  • Real-time CPU and memory usage display
  • Process list with sorting (CPU%, Mem%, PID, Name)
  • TUI built with tview
  • System metrics via gopsutil

Build

bash
make build

Run

bash
./bin/htop-go

Keyboard Shortcuts

KeyAction
q / EscQuit
cSort by CPU%
mSort by Mem%
pSort by PID
nSort by Name

Architecture

htop/unix/go/
├── cmd/htop-go/main.go       # Entry point
├── internal/
│   ├── metrics/               # System & process metrics
│   │   ├── system.go
│   │   └── processes.go
│   └── ui/                    # TUI components
│       └── ui.go
├── go.mod
└── Makefile

Comparison with Rust Version

FeatureGo (this)Rust (htop/unix/rust)
TUI Frameworktviewratatui
Sparkline History
Process Kill
Search Filter
Adjustable Refresh

This Go implementation focuses on simplicity and demonstrates idiomatic Go patterns for TUI applications.

License

MIT OR Apache-2.0