README
ยถ
๐๏ธ PEAKS - Beautiful Terminal Bandwidth Monitor

Split axis mode with upload below and download above the central axis

Overlay mode with both charts combined at the bottom, showing yellow overlap
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
- ๐ก Smart overlap detection - Yellow highlighting where upload and download overlap
๐ Installation
Prerequisites
- A terminal with Unicode and color support
Quick Install
Method 1: Using Go (Recommended)
# Install directly from GitHub
go install github.com/marcodenic/peaks@latest
# Run it
peaks
Method 2: Download Pre-built Binary
# Download and install using our install script
curl -sSL https://raw.githubusercontent.com/marcodenic/peaks/main/install.sh | bash
Method 3: Manual Download
- Go to Releases
- Download the binary for your platform
- Make it executable:
chmod +x peaks-* - Move to your PATH:
sudo mv peaks-* /usr/local/bin/peaks
Method 4: Build from Source
git clone https://github.com/marcodenic/peaks
cd peaks
go build -o peaks ./cmd/peaks
./peaks
Using Make
make build # Build for current platform
make build-all # Build for all platforms
make run # Run directly
Cross-Platform Builds
Build for all platforms:
make build-all
This creates binaries for:
- Linux:
peaks_unix - Windows:
peaks.exe - macOS:
peaks_darwin
๐ฎ Usage
Simply run the binary:
./peaks
Controls
- q / Ctrl+C - Quit
- p / Space - Pause/Resume monitoring
- r - Reset chart and statistics
- s - Toggle statusbar visibility
- m - Toggle between split axis and overlay display modes
๐ Project Structure
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
โโโ old/ # Legacy single-file implementation
โโโ 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
- Separation of Concerns - Each package has a single responsibility
- Performance First - Optimized rendering and minimal allocations
- Modularity - Clean interfaces between components
- 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
- Bubble Tea - Modern TUI framework
- Lipgloss - Styling and layout
- Bubbles - Common TUI components
- gopsutil - Cross-platform system monitoring
- Teacup - Additional TUI components
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- 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
-
Real-time Monitoring: Monitor network bandwidth with high-resolution split-axis braille charts
-
Beautiful TUI: Built with Bubble Tea and Lip Gloss for a modern terminal interface
-
Cross-platform: Works on Linux, macOS, and Windows
-
Split-Axis Charts: Clear separation with upload below and download above the axis line
-
Braille Charts: High-resolution area charts using Unicode braille characters
-
Color Coding:
- ๐ด Red for upload traffic
- ๐ข Green for download traffic
- ๐ก Yellow for overlapping traffic (overlay mode only)
-
Interactive Controls: Pause, reset, toggle stats, and more
-
Detailed Statistics: Track uptime, peaks, and totals
-
Responsive Design: Adapts to terminal size automatically
-
1-Minute History: Shows 60 seconds of bandwidth data at 500ms intervals
๐ Installation
Prerequisites
- Go 1.21 or higher
- A terminal with Unicode and color support
Build from Source
git clone https://github.com/marcodenic/peaks
cd peaks
go build -o peaks
./peaks
๐ฎ Controls
| Key | Action |
|---|---|
q / Ctrl+C |
Quit |
p / Space |
Pause/Resume monitoring |
r |
Reset chart and statistics |
s |
Toggle statusbar |
m |
Toggle display mode (split/overlay) |
๐ฅ๏ธ Screenshots
The tool offers two display modes:
Split Axis Mode (Default)
- Upload data displayed below the central horizontal axis (red)
- Download data displayed above the central horizontal axis (green)
- Clear separation between upload and download traffic
Overlay Mode
- Both upload and download charts displayed from the bottom axis
- Upload and download data overlaid on the same chart area
- Yellow highlighting where upload and download traffic overlap
- Press
mto toggle between modes
Both modes display:
- Real-time bandwidth rates in the footer
- Optional statusbar with uptime, peaks, and totals
- Live/paused status indicator
- Always-visible mini-help with essential commands
- Beautiful color-coded interface with clear traffic separation
๐ ๏ธ Technical Details
Built With
- Bubble Tea - The Elm Architecture for Go TUI apps
- Lip Gloss - Style definitions for terminal layouts
- Bubbles - Common UI components
- gopsutil - Cross-platform system information
Architecture
main.go- Main application and Bubble Tea modelbandwidth.go- Cross-platform bandwidth monitoringchart.go- Braille chart rendering with color overlaysui.go- Enhanced UI components and statistics
Chart Rendering
The tool uses Unicode braille characters (U+2800โU+28FF) for high-resolution terminal charts. Each character provides 8 dots in a 2ร4 matrix, allowing for detailed visualization of bandwidth patterns.
Color Mixing
When upload and download traffic overlap in the same chart position, the visualization intelligently blends colors to show yellow, indicating simultaneous activity.
๐จ Customization
The tool uses modern terminal colors and should work well with most terminal themes. Colors are automatically adapted based on your terminal's color support.
๐ Performance
- Updates at 2 FPS for smooth, easy-to-follow visualization
- Minimal CPU usage through efficient rendering
- Maintains 1 minute of history by default
- Automatic scaling based on observed peak values
๐ Troubleshooting
Braille Characters Not Displaying
- Ensure your terminal font supports Unicode braille characters
- Try fonts like: Cascadia Code, Fira Code, or DejaVu Sans Mono
- On Windows, use Windows Terminal or a modern terminal emulator
Colors Not Showing
- Verify your terminal supports ANSI colors
- Modern terminals (Terminal.app, iTerm2, Windows Terminal) should work fine
- Legacy terminals may show limited colors
Permission Issues
- The tool only reads network interface statistics
- No special permissions required on most systems
- If issues persist, try running as administrator/sudo
๐ค Contributing
We welcome contributions to Peaks! Please follow these guidelines:
Development Setup
-
Fork and Clone
git clone https://github.com/marcodenic/peaks cd peaks -
Install Dependencies
go mod tidy -
Build and Test
make build make test
Code Style
- Follow standard Go conventions
- Run
go fmtbefore committing - Add tests for new features
- Update documentation as needed
Submitting Changes
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Reporting Issues
Please use the GitHub issue tracker to report bugs or request features. Include:
- Your operating system and terminal
- Go version
- Steps to reproduce the issue
- Expected vs actual behavior
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- The amazing Charm team for the beautiful TUI libraries
- The Go community for excellent cross-platform system libraries
- Terminal art enthusiasts who pioneered braille-based visualization
Made with โค๏ธ and lots of โ
Directories
ยถ
| Path | Synopsis |
|---|---|
|
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 |