Netrunner CLI π
A high-performance, cyberpunk-styled network diagnostics and speed testing tool built in Rust.
Preview
π Speed Test

π Statistics Dashboard

π Test History

β¨ Features
π― Core Capabilities
-
π High-Speed Testing - Optimized for gigabit+ connections (up to 10 Gbps)
- 50 parallel connections for maximum throughput
- Large 500MB chunk downloads to minimize overhead
- 2-second warmup period for connection establishment
- Progressive speed sampling with intelligent averaging
-
π Smart Server Selection - Robust geolocation-based discovery
- Automatic IP-based location detection with 5 geolocation services
- Sequential failover: ipapi.co β ip-api.com β ipinfo.io β freegeoip.app β ipwhois.app
- Smart fallback to Kansas City, USA if all services fail
- Fetches real servers from Speedtest.net API
- Falls back to LibreSpeed and regional hubs
- Haversine formula for accurate distance calculation
- Quality score algorithm: latency + distance + geographic weight
- Tests up to 15 servers concurrently, selects best 3
- Clean output with silent failover (debug mode available)
-
π Comprehensive Metrics
- Download/Upload speeds (Mbps)
- Ping latency (ms)
- Jitter measurement
- Packet loss detection
- Connection quality assessment (Excellent β Poor)
-
π Live Animated Bandwidth Monitors
- Real-time animated graphs during speed tests
- Dynamic updates every 200ms with smooth animation
- Graph grows from left to right as test progresses
- Shows live current speed and peak speed
- Filled area visualization with Unicode blocks (8 lines Γ 80 chars)
- Separate animated monitors for download (15s) and upload (12s)
- Smooth in-place rendering using ANSI escape codes
- Engaging, professional visual feedback
-
π Historical Tracking
- Automatic 30-day test history retention
- Powered by sled embedded database
- Interactive full-screen statistics dashboard with pie charts
- Serialized with postcard for compact, fast binary storage
- View trends and statistics over time
- Query past results with
--historyflag - Automatic cleanup of old records
-
π Network Diagnostics
- Public IP detection
- ISP information
- DNS server analysis
- Network interface details
- Traceroute functionality
- Connection quality scoring
-
π¨ Stunning Visuals
- Animated intro with color-cycling borders
- Cyberpunk-themed UI with neon colors
- Smooth progress bars and gauges
- Real-time speed updates during tests
- Beautiful ASCII art logo
- π Statistics Dashboard β full-screen TUI with four live tui-piechart pie charts:
- Download speed distribution (Ultra / Fast / Moderate / Slow)
- Upload speed distribution
- Ping / latency distribution (< 20 ms β > 100 ms)
- Connection quality breakdown (Excellent β Failed)
- Summary panel with avg / max / min for all metrics
- Scrollable results table of the last 20 tests
π» Technical Excellence
- Zero-Copy Performance - Optimized for minimal overhead
- Async/Await - Powered by Tokio for efficient I/O
- Cross-Platform - Works on Linux, macOS, and Windows
- Embedded Database - No external dependencies for history storage
- Clean Architecture - Well-structured, maintainable codebase
- Comprehensive Tests - 90+ unit and integration tests
- Robust Error Handling - Graceful degradation with multiple fallbacks
- Data Validation - Comprehensive validation for all geolocation responses
π₯ Installation
From Crates.io (Recommended)
From Source
Binary Releases
Download pre-built binaries from the Releases page.
π Quick Start
Run with Animated Intro
Experience the full cyberpunk intro with animated borders and color-cycling effects!
Run Speed Test
# Full speed test with automatic server selection and live bandwidth monitor
# Speed test with JSON output (no bandwidth monitor)
# Speed test without animations (headless mode, no bandwidth monitor)
Live Animated Bandwidth Monitors
During speed tests, Netrunner displays live animated bandwidth monitors that update in real-time:
Download Speed Monitor (15 seconds):
β¨β¨β¨ DOWNLOAD SPEED BANDWIDTH MONITOR β©β©β©
104.2 Mbps
Peak: 120.0 Mbps
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββ
ββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Upload Speed Monitor (12 seconds):
β¨β¨β¨ UPLOAD SPEED BANDWIDTH MONITOR β©β©β©
45.8 Mbps
Peak: 52.3 Mbps
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββ
ββββββββββββββββββ
ββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Animation Features:
- Appears automatically at test start with empty graph
- Updates dynamically every 200ms throughout the test
- Graph fills from left to right showing speed progression
- Current speed and peak speed update in real-time
- Smooth animation using ANSI escape codes (no flicker)
- Single chart per test (no duplicates or stacking)
- Only appears when animations enabled (hidden in JSON/headless mode)
View Test History & Statistics Dashboard
# Open the interactive statistics TUI (pie charts + results table)
# Or use the shorthand
The --history flag launches a full-screen statistics dashboard powered by
tui-piechart:

Controls inside the dashboard:
| Key | Action |
|---|---|
Tab / β |
Cycle to the next chart |
β |
Cycle to the previous chart |
β / k |
Scroll results table up |
β / j |
Scroll results table down |
q / Esc |
Quit |
Network Diagnostics
# Run full network diagnostics
# Get detailed diagnostics output
Full Network Analysis
# Run both speed test and diagnostics
π Command Reference
Commands
Available Commands
speed- Run a comprehensive internet speed testdiag- Run network diagnostics to analyze your connectionfull- Run both speed test and diagnosticshelp- Display help information
Options
| Flag | Long Form | Description |
|---|---|---|
-H |
--history |
View test history (last 30 days) |
-s <URL> |
--server <URL> |
Custom test server URL |
-z <MB> |
--size <MB> |
Test file size in MB (default: 100) |
-t <SEC> |
--timeout <SEC> |
Timeout in seconds (default: 30) |
-j |
--json |
Output results in JSON format |
-n |
--no-animation |
Disable animations (headless mode) |
-d <LEVEL> |
--detail <LEVEL> |
Detail level: basic, standard, detailed, debug |
-m <COUNT> |
--max-servers <N> |
Maximum servers to test (default: 3) |
-h |
--help |
Display help information |
-V |
--version |
Display version information |
Examples
# Run speed test with custom server
# Run diagnostics with debug output
# Get JSON output for scripting
# Run headless mode (CI/CD)
# Test against 5 servers
# View your connection history
π Understanding Your Results
Connection Quality Ratings
Netrunner provides a comprehensive assessment based on multiple metrics:
| Quality | Download | Upload | Ping | Jitter | Packet Loss |
|---|---|---|---|---|---|
| βββββ Excellent | β₯100 Mbps | β₯20 Mbps | <20 ms | <5 ms | <0.1% |
| ββββ Good | β₯50 Mbps | β₯10 Mbps | <50 ms | <15 ms | <1% |
| βββ Average | β₯25 Mbps | β₯5 Mbps | <100 ms | <25 ms | <2.5% |
| ββ Poor | β₯10 Mbps | β₯2 Mbps | <150 ms | <40 ms | <5% |
| β Very Poor | <10 Mbps | <2 Mbps | β₯150 ms | β₯40 ms | β₯5% |
Metric Explanations
- Download Speed: How fast you can receive data (streaming, downloading)
- Upload Speed: How fast you can send data (video calls, cloud backups)
- Ping (Latency): Time for data to reach the server and back (gaming, real-time apps)
- Jitter: Variation in ping times (video calls, online gaming stability)
- Packet Loss: Percentage of data packets that don't arrive (connection reliability)
ποΈ Architecture
High-Speed Testing Strategy
Netrunner is optimized for modern high-speed connections:
- Parallel Connections: Uses 50 simultaneous connections to maximize throughput
- Large Chunks: Downloads 500MB chunks to minimize protocol overhead
- Warmup Period: 2-second warmup establishes connections before measurement
- Progressive Sampling: Continuously samples speed and averages for accuracy
- Smart Exclusion: Excludes warmup period from final calculations
Server Selection Algorithm
-
Geolocation: Detects your location via IP using 5 services with sequential failover
- Primary: ipapi.co (HTTP/HTTPS)
- Secondary: ip-api.com (with status validation)
- Tertiary: ipinfo.io (loc field parsing)
- Quaternary: freegeoip.app
- Final: ipwhois.app (with success field check)
- Fallback: Kansas City, USA (39.0997Β°N, 94.5786Β°W)
-
Data Validation: Every response is validated for:
- Valid HTTP status (2xx)
- No API error messages
- Non-empty country/city names
- Valid coordinates (lat: -90 to 90, lon: -180 to 180)
- No zero coordinates (rejects 0,0 as invalid)
-
Server Discovery: Dynamic multi-source approach
- Speedtest.net API servers (up to 10 nearby)
- Continent-based CDN servers
- Country-specific servers
- Global CDN fallbacks (Cloudflare, Google)
-
Distance Calculation: Haversine formula for accurate geographic distance
distance = 2r Γ arcsin(β(sinΒ²(Ξlat/2) + cos(lat1) Γ cos(lat2) Γ sinΒ²(Ξlon/2))) where r = 6371 km (Earth's radius) -
Quality Scoring: Intelligent server ranking
quality_score = (10000 Γ geographic_weight) / (latency_penalty + distance_penalty) where: latency_penalty = max(latency_ms, 1.0) distance_penalty = max(distance_km / 100.0, 1.0) geographic_weight = 0.3 to 1.0 (regional > continental > global) -
Server Testing: Concurrent performance evaluation
- Tests up to 15 servers in parallel
- Measures actual latency for each
- Sorts by quality score (higher = better)
- Selects top 3 servers for speed testing
-
Output: Clean, professional display
- Shows only successful geolocation by default
- Silent failover to next service on errors
- Debug mode available:
NETRUNNER_DEBUG=1
History Storage
- Database: Embedded sled database (no external dependencies)
- Retention: Automatic 30-day retention with daily cleanup
- Location:
~/.netrunner_cli/history.db - Format: Compact binary storage via postcard (replaces bincode)
- Queries: Fast indexed lookups by timestamp
- Visualisation: Full-screen TUI dashboard via tui-piechart
π¨ Visual Features
Animated Intro
Experience the cyberpunk aesthetic with:
- Color-cycling borders around the logo
- Smooth fade-in effects
- 6-color palette (cyan, magenta, yellow, neon green)
- Box drawing characters for retro terminal vibes
- 60 FPS animation for smooth visuals
Live Animated Bandwidth Monitors
Real-time animated bandwidth visualization:
- Dynamic Animation - Graph grows and updates live during test execution
- Download Speed Monitor - 15-second test with real-time animated graph
- Upload Speed Monitor - 12-second test with real-time animated graph
- 200ms Update Rate - Smooth, responsive animation
- Instant Feedback - See current and peak speeds update live
- Growing Visualization - Chart fills left-to-right as test progresses
- Professional Appearance - Filled area chart with Unicode blocks
- ANSI-Based Rendering - Smooth in-place updates without flicker
- Single Chart Per Test - Clean, uncluttered output
- Automatic Scaling - Graph adjusts to measured speed range
Progress Indicators
- Real-time speed updates during downloads/uploads
- Animated progress bars with percentage
- Color-coded quality indicators
- Gauge widgets for visual metric display
π§ Configuration
Environment Variables
# Set custom history database path
# Disable colors (for CI/CD)
# Enable debug mode (show geolocation service failures)
Debug Mode: When NETRUNNER_DEBUG=1 is set, the application shows trace logs for failed geolocation services. This is useful for troubleshooting network issues or API rate limits.
Normal Output:
π Detecting your location...
π Location: Berlin, Germany (via ipinfo.io)
π ISP: Deutsche Telekom
Debug Output:
π Detecting your location...
[TRACE] ipapi.co geolocation failed: HTTP error: 429 Too Many Requests
[TRACE] ip-api.com geolocation failed: timeout
π Location: Berlin, Germany (via ipinfo.io)
π ISP: Deutsche Telekom
History Database
Location: ~/.netrunner_cli/history.db
You can manually inspect or backup this database using sled tools.
π Examples
Basic Speed Test
# Run a simple speed test
# Output:
# π Detecting your location...
# π Location: San Francisco, United States (via ipapi.co)
# π ISP: Comcast Cable Communications
#
# π Building server pool...
# β 12 servers in pool
#
# β‘ Testing server performance...
# β 3 servers selected for testing
# 1. US West Coast Hub - 8.2 ms (15 km)
# 2. LibreSpeed Los Angeles - 12.5 ms (560 km)
# 3. US Central - 28.3 ms (2800 km)
#
# [Download/Upload speed tests with animated graphs]
#
# β Download: 487.3 Mbps
# β Upload: 125.8 Mbps
# β Ping: 8.2 ms
# β Quality: Excellent
Speed Test with JSON Output
# Get machine-readable results
# Output:
# {
# "timestamp": "2024-01-15T10:30:00Z",
# "download_mbps": 487.3,
# "upload_mbps": 125.8,
# "ping_ms": 8.2,
# "jitter_ms": 1.5,
# "packet_loss_percent": 0.0,
# "server_location": "San Francisco, USA",
# "quality": "Excellent",
# "isp": "Comcast Cable Communications"
# }
Debug Mode for Troubleshooting
# Enable debug mode to see geolocation service failures
NETRUNNER_DEBUG=1
# Output shows trace logs:
# π Detecting your location...
# [TRACE] ipapi.co geolocation failed: HTTP error: 429 Too Many Requests
# [TRACE] ip-api.com geolocation failed: connection timeout
# π Location: Berlin, Germany (via ipinfo.io)
View Historical Results & Statistics Dashboard
# Open the interactive statistics TUI
# Output:
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# β Speed Test History β
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
#
# Recent Tests (Last 7 Days):
# ββββββββββββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ
# β Date β Download β Upload β Ping β Quality β
# ββββββββββββββββββββββΌβββββββββββΌβββββββββββΌβββββββββββΌβββββββββββ€
# β 2024-01-15 10:30 β 487.3 β 125.8 β 8.2 ms β Excellentβ
# β 2024-01-14 15:20 β 492.1 β 127.3 β 7.9 ms β Excellentβ
# β 2024-01-13 09:45 β 478.5 β 123.1 β 9.1 ms β Excellentβ
# ββββββββββββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ
Network Diagnostics
# Run comprehensive network diagnostics
# Output includes:
# - Public IP address
# - ISP information
# - DNS servers
# - Network interfaces
# - Traceroute to common destinations
# - Connection quality assessment
Full Network Analysis
# Combine speed test with diagnostics
# Performs:
# 1. Network diagnostics
# 2. Speed test
# 3. Historical comparison
# 4. Quality assessment with recommendations
Custom Server URL
# Test against specific server
# Useful for testing:
# - Internal network speeds
# - Specific CDN endpoints
# - Custom speed test servers
Disable Animations
# Run without animations (faster, CI/CD friendly)
# Or use environment variable
NO_COLOR=1
Compare Current vs Historical Average
# View statistics
# Output:
# Statistics (Last 30 Days):
# ββββββββββββββββββββββββββββββββββββββββ
# Average Download: 485.2 Mbps
# Average Upload: 125.1 Mbps
# Average Ping: 8.5 ms
# Tests Performed: 47
# Best Quality: Excellent (89% of tests)
π§ͺ Development
Building from Source
# Clone the repository
# Build in debug mode
# Build in release mode (optimized)
# Run tests
# Run with logging
RUST_LOG=debug
Running Tests
# Run all tests
# Run specific test module
# Run with output
# Run integration tests
Project Structure
netrunner_cli/
βββ src/
β βββ main.rs # CLI entry point
β βββ lib.rs # Library exports
β βββ modules/
β βββ speed_test.rs # Speed testing implementation
β βββ history.rs # History storage with sled + postcard
β βββ diagnostics.rs # Network diagnostics
β βββ intro.rs # Animated intro screen
β βββ logo.rs # ASCII logo rendering
β βββ stats_ui.rs # Statistics dashboard (tui-piechart)
β βββ ui.rs # UI components and gauges
β βββ types.rs # Shared types and traits
βββ examples/
β βββ basic_speed_test.rs # Programmatic speed test
β βββ continuous_monitoring.rs # Continuous monitoring loop
β βββ custom_configuration.rs # Custom server/config usage
β βββ history_management.rs # History CRUD operations
β βββ logo_demo.rs # Logo rendering demo
β βββ statistics_dashboard.rs # Interactive statistics TUI β new
β βββ vhs/
β βββ speed-test.tape # VHS tape β speed-test.gif
β βββ speed-test-history.tape # VHS tape β history.gif
β βββ statistics-dashboard.tape # VHS tape β statistics-dashboard.gif β new
β βββ target/ # Generated GIFs (Git LFS)
β βββ speed-test.gif
β βββ history.gif
β βββ statistics-dashboard.gif
βββ tests/ # Integration tests
βββ Cargo.toml # Project dependencies
π€ Contributing
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Write tests for new features
- Follow Rust idioms and best practices
- Update documentation for API changes
- Run
cargo fmtandcargo clippybefore committing - Ensure all tests pass with
cargo test
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Ratatui - Terminal UI framework
- Tokio - Async runtime
- Sled - Embedded database
- Reqwest - HTTP client
- Colored - Terminal colors
π Changelog
See CHANGELOG.md for detailed version history.
π Bug Reports
Found a bug? Please open an issue with:
- Your OS and terminal emulator
- Steps to reproduce
- Expected vs actual behavior
- Relevant logs (run with
RUST_LOG=debug)
π‘ Feature Requests
Have an idea? Open an issue with the enhancement label!
π Project Stats
- Language: Rust π¦
- Tests: 45+ passing
- Dependencies: Carefully curated, security-focused
- Performance: Optimized for gigabit+ speeds
- Maintenance: Actively maintained
Built with β€οΈ and Rust by Sorin Irimies
Jack in, trace the net, and measure your connection with style. π