Skills2026年5月9日·1 分钟阅读

speedtest-cli — Test Network Bandwidth from the Command Line

A Python CLI that measures download, upload, and ping against Ookla Speedtest servers, ideal for scripted network monitoring and CI health checks.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
speedtest-cli Overview
通用 CLI 安装命令
npx tokrepo install 4e2d478d-4b7f-11f1-9bc6-00163e2b0d79

Introduction

speedtest-cli is a command-line interface for testing internet bandwidth using Ookla's Speedtest.net infrastructure. It lets developers and ops teams measure network performance from servers, containers, or CI pipelines without opening a browser.

What speedtest-cli Does

  • Measures download and upload throughput against the nearest Speedtest server
  • Reports latency (ping) to the selected test server
  • Outputs results in plain text, CSV, or JSON for scripted consumption
  • Lets you pick a specific server by ID or list available servers by distance
  • Supports simple and share-image output modes

Architecture Overview

speedtest-cli is a single-file Python script that communicates with the Speedtest.net HTTP API. It fetches a server list ranked by geographic distance, selects the best candidate based on latency, then performs multi-threaded download and upload transfers to calculate throughput. Results are computed locally and printed to stdout.

Self-Hosting & Configuration

  • Install via pip, pipx, or your distro package manager
  • No configuration files needed; all options are passed as CLI flags
  • Use --server to pin a specific Speedtest server ID for consistent benchmarks
  • Integrate into monitoring with --json piped to a time-series database
  • Works on Linux, macOS, Windows, and inside Docker containers

Key Features

  • Zero-config instant bandwidth test from any terminal
  • JSON and CSV output for integration with dashboards and alerting
  • Server selection by ID, country, or automatic nearest-server detection
  • Lightweight single-file script with no compiled dependencies
  • Widely used as a baseline network diagnostic in DevOps runbooks

Comparison with Similar Tools

  • Ookla Speedtest CLI — official binary from Ookla; speedtest-cli is the community Python alternative
  • fast-cli — tests against Netflix Fast.com; speedtest-cli uses the Ookla network
  • iperf3 — measures raw TCP/UDP between two endpoints you control; speedtest-cli tests internet bandwidth
  • LibreSpeed — self-hosted speed test; speedtest-cli relies on public Ookla servers
  • mtr — focuses on route-level latency and packet loss; speedtest-cli measures throughput

FAQ

Q: Is speedtest-cli the same as the official Ookla Speedtest CLI? A: No. speedtest-cli is a community open-source Python project. Ookla later released their own closed-source binary with the same name concept.

Q: Can I run it in a cron job for continuous monitoring? A: Yes. Use --json and pipe results into InfluxDB, Prometheus Pushgateway, or a log file for trend analysis.

Q: How accurate are the results compared to the browser test? A: Results are generally comparable. Differences may arise from thread count, server selection, and network conditions during the test window.

Q: Does it support IPv6? A: The tool defaults to the system's preferred IP version. Some Speedtest servers support IPv6 depending on their configuration.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产