Skip to content
CLI Reference

CLI Reference

Complete command reference for speedtest-go, generated from the program itself.

A command-line tool to test internet download and upload speeds using speedtest.net servers.

Usage

speedtest-go

Without a command, speedtest-go runs a speed test with the options below.

Commands

CommandDescription
citiesList predefined city labels
listList available speedtest servers
versionPrint version information

Options

These flags apply to the speed test.

FlagShortDefaultTypeDescription
--custom-url""stringSpecify the url of the server instead of fetching from speedtest.net.
--dl-size0intSet the download block size, from 350 to 4000 (default 1000).
--jsonfalseboolOutput results in json format.
--jsonlfalseboolOutput results in jsonl format (one json object per line).
--multi-mfalseboolEnable multi-server mode.
--no-downloadfalseboolDisable download test.
--no-uploadfalseboolDisable upload test.
--ping-modehttpstringSelect a method for Ping (support icmp/tcp/http).
--protocolhttpstringSelect the download and upload protocol (http or tcp).
--saving-modefalseboolTest with few resources, though low accuracy (especially > 30Mbps).
--server-s[]intSliceSelect server id to run speedtest.
--thread-t0intSet the number of concurrent connections.
--ul-size0intSet the upload block size in kB, from 100 to 4000 (default 1000, or 800 with –multi).
--unit-u""stringSet human-readable and auto-scaled rate units for output (options: decimal-bits/decimal-bytes/binary-bits/binary-bytes).
--unixfalseboolOutput results in unix like format.

Global options

Every command accepts these flags.

FlagShortDefaultTypeDescription
--base-url""stringSet the speedtest API base URL (default https://www.speedtest.net).
--city""stringChange the location with a predefined city label.
--config""stringsettings file (default speedtest-go/config.yaml in the user config directory)
--debugfalseboolEnable debug mode.
--dns-bind-sourcefalseboolDNS request binding source (experimental).
--dscp0intMark connections with a DSCP code point from 0 to 63 (Linux, macOS and BSD).
--filter-cc[]stringSliceOnly use servers in these countries (two-letter codes, or auto for your own).
--location""stringChange the location with a precise coordinate (format: lat,lon).
--mask-ispfalseboolMask your IP address, ISP, coordinates, and distances to servers in all output.
--proxy""stringSet a proxy(http[s] or socks) for the speedtest.
--search""stringFuzzy search servers by a keyword.
--source""stringSend from a source IP address or network interface name.
--ua""stringSet the user-agent header for the speedtest.

Every flag except --help can also be set with an environment variable, and every flag except --help and --config in the settings file. See Configuration for the names and the order in which they apply.