peaks

module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT

README ยถ

๐Ÿ”๏ธ PEAKS - Beautiful Terminal Bandwidth Monitor

PEAKS Screenshot 1PEAKS Screenshot 2PEAKS Screenshot 3PEAKS Screenshot 4PEAKS Compact Mode

A modern, real-time bandwidth monitoring tool for your terminal with high-resolution braille charts and beautiful UI.

Features

  • ๐Ÿš€ Real-time monitoring - Live bandwidth tracking with smooth updates
  • ๐Ÿ“Š Beautiful charts - High-resolution braille-based charts with dual display modes
  • ๐ŸŽจ Modern UI - Clean, colorful interface built with Charm TUI components
  • ๐Ÿ“ˆ Detailed statistics - Peak values, totals, and uptime tracking
  • โšก Performance optimized - Efficient rendering and minimal CPU usage
  • ๐Ÿ”ง Interactive controls - Pause, reset, and toggle features
  • ๐ŸŒ Cross-platform - Works on Linux, macOS, and Windows
  • ๐ŸŽฏ Dual display modes - Switch between split axis and overlay modes
  • ๐Ÿ“ˆ Advanced scaling modes - Linear, logarithmic, and square root scaling for better data visualization
  • ๐ŸŒˆ Gradient coloring - Height-based color gradients
  • โฑ๏ธ Flexible time scales - Adjustable history from 1 to 60 minutes
  • ๐Ÿ“ Compact mode - Minimal 2-line header display for always-on monitoring

๐ŸŽฎ Usage

Full-Screen Mode

Simply run the binary for the full interactive experience:

./peaks
Compact Mode

Run as a persistent header display at the top of your terminal:

./peaks --compact

Compact mode creates a minimal 2-line bandwidth chart at the top of your terminal, allowing you to continue using your shell while monitoring network activity in real-time. The chart automatically fills the full terminal width and resizes dynamically.

Compact Mode Options:

./peaks --compact                    # Basic 2-line compact mode
./peaks --compact --overlay          # Use overlay mode (both graphs from bottom)
./peaks --compact --time 5           # Show 5 minutes of history
./peaks --compact --size 3           # Use 3 lines instead of 2

Available flags:

  • --compact - Enable compact mode
  • --overlay - Use overlay display mode
  • --time N - Set time window (1, 5, 10, 30, or 60 minutes)
  • --size N - Set chart height in lines (default: 2)

To stop compact mode, use Ctrl+C or find and kill the background process:

pkill peaks
Controls
Key Action
q / Esc / Ctrl+C Quit
p / Space Pause/Resume monitoring
r Reset chart and statistics
s Toggle statusbar visibility
m Toggle between split axis and overlay modes
l Cycle through scaling modes (Linear โ†’ Log โ†’ โˆš)
t Cycle time scale (1/3/5/10/15/30/60 minutes)
Display Modes
  • Split Axis Mode (default) - Upload below, download above the central axis
  • Overlay Mode - Both charts overlaid from bottom with yellow overlap indication
Scaling Modes
  • Linear - Traditional linear scaling where chart height is proportional to bandwidth
  • Logarithmic (default) - Compresses large spikes while preserving detail for smaller values
  • Square Root - Middle ground between linear and logarithmic scaling
Time Scales

Choose from 1, 3, 5, 10, 15, 30, or 60 minutes of history display. The tool always maintains up to 60 minutes of data internally.

๏ฟฝ Installation

Prerequisites
  • A terminal with Unicode and color support
go install github.com/marcodenic/peaks/cmd/peaks@latest
Manual Download
  1. Go to Releases
  2. Download the binary for your platform
  3. Make it executable: chmod +x peaks-*
  4. Move to your PATH: sudo mv peaks-* /usr/local/bin/peaks
Using Install Script
# Download and install using our install script
curl -sSL https://raw.githubusercontent.com/marcodenic/peaks/main/install.sh | bash
Build from Source
git clone https://github.com/marcodenic/peaks
cd peaks
go build -o peaks ./cmd/peaks
./peaks

The project has been refactored into a clean, modular structure:

peaks/
โ”œโ”€โ”€ cmd/peaks/           # Main application entry point
โ”‚   โ””โ”€โ”€ main.go         # Application setup and UI orchestration
โ”œโ”€โ”€ internal/           # Internal packages (not importable externally)
โ”‚   โ”œโ”€โ”€ chart/          # Chart rendering functionality
โ”‚   โ”‚   โ””โ”€โ”€ braille.go  # Braille chart implementation
โ”‚   โ”œโ”€โ”€ monitor/        # Bandwidth monitoring
โ”‚   โ”‚   โ””โ”€โ”€ bandwidth.go # Cross-platform bandwidth monitoring
โ”‚   โ””โ”€โ”€ ui/             # UI components and utilities
โ”‚       โ””โ”€โ”€ components.go # UI components, stats, and formatters
โ”œโ”€โ”€ go.mod              # Go module definition
โ”œโ”€โ”€ go.sum              # Go module checksums
โ”œโ”€โ”€ Makefile            # Build automation
โ””โ”€โ”€ README.md           # This file
Package Overview
  • cmd/peaks - Main application entry point, handles UI orchestration and program flow
  • internal/chart - Braille chart rendering with optimized performance
  • internal/monitor - Cross-platform bandwidth monitoring using gopsutil
  • internal/ui - UI components, statistics tracking, and formatting utilities

๐Ÿ› ๏ธ Development

Requirements
  • Go 1.21 or later
  • Compatible terminal with Unicode support for braille characters
Building
# Development build
go build -o peaks ./cmd/peaks

# Production build with optimizations
go build -ldflags="-s -w" -o peaks ./cmd/peaks

# Cross-compilation
GOOS=linux GOARCH=amd64 go build -o peaks_linux ./cmd/peaks
GOOS=windows GOARCH=amd64 go build -o peaks.exe ./cmd/peaks
GOOS=darwin GOARCH=amd64 go build -o peaks_darwin ./cmd/peaks
Running Tests
go test ./...
Code Quality
go fmt ./...           # Format code
go vet ./...           # Vet code
golangci-lint run      # Run linter (requires golangci-lint)

๐Ÿ—๏ธ Architecture

Design Principles
  1. Separation of Concerns - Each package has a single responsibility
  2. Performance First - Optimized rendering and minimal allocations
  3. Modularity - Clean interfaces between components
  4. Testability - Testable components with clear dependencies
Key Components
  • BandwidthMonitor - Handles cross-platform network statistics collection
  • BrailleChart - Renders high-resolution charts using Unicode braille characters
  • UI Components - Provides statistics tracking and formatting utilities
  • Main Application - Orchestrates all components using Bubble Tea framework

๐Ÿ“ฆ Dependencies

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with the amazing Charm TUI ecosystem
  • Inspired by classic terminal monitoring tools
  • Thanks to the Go community for excellent cross-platform libraries

Made with โค๏ธ and lots of โ˜•

Directories ยถ

Path Synopsis
cmd
peaks command
Package main implements Peaks, a beautiful terminal-based bandwidth monitoring tool.
Package main implements Peaks, a beautiful terminal-based bandwidth monitoring tool.
internal
chart
Package chart provides braille chart rendering functionality
Package chart provides braille chart rendering functionality
monitor
Package monitor provides cross-platform bandwidth monitoring functionality
Package monitor provides cross-platform bandwidth monitoring functionality
ui
Package ui provides UI components and formatting utilities
Package ui provides UI components and formatting utilities

Jump to

Keyboard shortcuts

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