speedtest
Command-line interface for testing internet bandwidth using speedtest.net, written in Rust. Providing better performance, lower memory usage, and cross-platform compatibility.
Features
- 🚀 Fast and Efficient: Written in Rust for maximum performance
- 🌍 Cross-Platform: Supports Linux, Windows, macOS, FreeBSD, and NetBSD
- 📊 Multiple Output Formats: JSON, CSV, and simple text output
- 🔒 Secure: HTTPS support for all communications
- 🎯 Server Selection: Manual server selection or automatic best server detection
- 📈 Accurate Measurements: Multi-threaded download and upload testing
- 💾 Low Memory Footprint: Efficient memory usage even during large transfers
- 🎨 Colorful Output: Beautiful, colored terminal output
- 🐛 Debug Mode: Detailed debugging with
--debugflag for troubleshooting
Installation
From Pre-built Binaries
Download the latest release for your platform from the releases page.
Linux (x86_64)
Windows (x86_64)
Download speedtest-windows-x86_64.exe and add it to your PATH.
macOS (x86_64)
macOS (Apple Silicon / ARM64)
From Source
Requires Rust 1.70 or later.
From Crates.io
Usage
Basic Usage
Run a complete speed test:
Advanced Options
# Show simple output
# Output as JSON
# Output as CSV
# Skip download test
# Skip upload test
# Use a single connection (like a file transfer)
# List available servers
# Use a specific server
# Exclude specific servers
# Use HTTPS
# Set timeout (default: 10 seconds)
# Bind to specific source IP
# Display values in bytes instead of bits
# Print CSV header
# Custom CSV delimiter
# Enable debug output
Output Examples
Simple Output
Testing from Example ISP (203.0.113.1)...
Hosted by Example Server (City, Country) [10.00 km]: 15.234 ms
Download: 95.23 Mbit/s
Upload: 45.67 Mbit/s
JSON Output
CSV Output
12345,Example Server,City,2025-02-08T12:34:56.789Z,10.00,15.234,95230000.00,45670000.00,,203.0.113.1
Supported Platforms
| Platform | Architecture | Status |
|---|---|---|
| Linux | x86_64 | ✅ Tested |
| Linux | x86_64 (musl) | ✅ Tested |
| Linux | aarch64 | ✅ Tested |
| Linux | armv7 | ✅ Tested |
| Linux | i686 | ✅ Tested |
| Windows | x86_64 | ✅ Tested |
| Windows | i686 | ✅ Tested |
| Windows | aarch64 | ✅ Built |
| macOS | x86_64 | ✅ Tested |
| macOS | aarch64 (M1/M2) | ✅ Tested |
| FreeBSD | x86_64 | ✅ Built |
| NetBSD | x86_64 | ✅ Built |
Performance Comparison
Compared to the original Python speedtest-cli:
- Startup Time: ~50ms vs ~200ms (4x faster)
- Memory Usage: ~5MB vs ~30MB (6x less)
- CPU Usage: ~20% vs ~40% (50% less)
- Binary Size: ~3MB vs N/A (no Python runtime needed)
Development
Building
Running Tests
Testing on All Platforms
See TESTING.md for comprehensive testing guide covering:
- Windows, Linux, macOS testing
- Cross-compilation
- Docker testing
- CI/CD testing locally
- Performance testing
Quick platform test:
# Windows
# Linux/macOS
Running with Debug Output
# Show detailed debugging information
# Or for development with cargo
Linting
Formatting
Architecture
The project is organized into several modules:
- error: Error types and Result type aliases
- models: Data structures for configuration and results
- http: HTTP client wrapper with timeout and compression support
- utils: Utility functions for distance calculation and string manipulation
- speedtest: Core speedtest logic for download/upload testing
- main: CLI argument parsing and execution
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
👤 Author
Acknowledgments
- Original speedtest-cli by Matt Martz
- Speedtest.net by Ookla
Changelog
See CHANGELOG.md for detailed version history.
Latest Version: 1.0.6 (2025-02-08)
- ✅ Production-ready release
- ✅ Complete XML parsing rewrite for reliability
- ✅ Debug mode with
--debugflag - ✅ All platforms tested and working
- ✅ Zero compilation warnings
Version 1.0.0 (2025-02-08)
- Initial release
- Full feature parity with Python speedtest-cli
- Support for all major platforms
- Improved performance and memory efficiency
- Enhanced error handling
- Colorful terminal output
- Comprehensive test coverage
FAQ
Q: Why rewrite in Rust?
A: Rust provides better performance, lower memory usage, easier distribution (single binary), and improved safety guarantees.
Q: Is this compatible with the original speedtest-cli?
A: Yes, all command-line options are compatible, and output formats match the original.
Q: Does this work with Speedtest Mini servers?
A: Mini server support is planned for a future release.
Q: Can I use this in my scripts?
A: Absolutely! The JSON and CSV output modes are perfect for automation.
Q: Is this official?
A: No, this is an independent project. For the official Speedtest CLI, see Ookla's speedtest-cli.
Q: How do I debug connection issues?
A: Use the --debug flag to see detailed information about server discovery, latency testing, and any errors:
Troubleshooting
Connection Timeouts
If you're experiencing connection timeouts, try increasing the timeout value:
SSL/TLS Errors
If you encounter SSL errors, try running without the --secure flag:
Firewall Issues
Ensure your firewall allows outbound connections to speedtest.net servers on ports 80 and 443.
XML Parsing Errors
If you encounter XML parsing errors, try using the --debug flag to see detailed information:
This will show exactly which servers are being tested and any errors encountered.
For more debugging help, see DEBUGGING.md.
Support
If you encounter any issues or have questions:
- Check the FAQ section
- Search existing issues
- Open a new issue with detailed information about your problem
Made with ❤️ in Rust
