Netrunner CLI ๐
A high-performance, cyberpunk-styled network diagnostics and speed testing tool built in Rust.
"JACK IN AND TRACE THE NET" - Professional network diagnostics with cyberpunk aesthetics
โจ 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 - Dynamic geolocation-based discovery
- Automatic detection of your location via IP geolocation
- Fetches real servers from Speedtest.net API
- Falls back to LibreSpeed and regional hubs
- Calculates actual distances and sorts by proximity
-
๐ Comprehensive Metrics
- Download/Upload speeds (Mbps)
- Ping latency (ms)
- Jitter measurement
- Packet loss detection
- Connection quality assessment (Excellent โ Poor)
-
๐ Historical Tracking
- Automatic 30-day test history retention
- Powered by sled embedded database
- 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
๐ป 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 - 45+ unit and integration tests
๐ฅ 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
# Speed test with JSON output
# Speed test without animations (headless mode)
View Test History
# View last 30 days of test results
# Or use the shorthand
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
- API Query: Fetches nearby servers from Speedtest.net
- Distance Calculation: Uses Haversine formula for accurate distance
- Sorting: Orders servers by proximity
- Fallback: Uses LibreSpeed and regional hubs if API fails
- Multi-Test: Tests top N servers for best results
History Storage
- Database: Embedded sled database (no external dependencies)
- Retention: Automatic 30-day retention with daily cleanup
- Location:
~/.netrunner_cli/history.db - Format: Efficient binary storage with MessagePack serialization
- Queries: Fast indexed lookups by timestamp
๐จ 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
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)
History Database
Location: ~/.netrunner_cli/history.db
You can manually inspect or backup this database using sled tools.
๐งช 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
โ โโโ diagnostics.rs # Network diagnostics
โ โโโ intro.rs # Animated intro screen
โ โโโ logo.rs # ASCII logo rendering
โ โโโ ui.rs # UI components and gauges
โ โโโ types.rs # Shared types and traits
โโโ tests/ # Integration tests
โโโ examples/ # Example usage
โโโ 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. ๐