Available formats
Universal Speedtest CLI supports two output formats:- Human-readable format (default) - Colored, formatted text with progress updates
- JSON format - Machine-readable structured data for automation
Human-readable format
The default format provides a rich, interactive experience with:- Real-time progress updates during testing
- Color-coded output for better readability
- Formatted report with clear sections
- Network quality scores and recommendations
Color support
The human-readable format uses ANSI color codes to highlight:- Bold text for section headers
- Green for speed values
- Magenta for latency and jitter
- Color-coded quality scores (green for Good, red for Poor)
- The
NO_COLORenvironment variable is set TERM=dumbis detected- Output is piped to a file or another command
JSON format
Use the-json flag to output results as JSON:
Differences from human-readable format
No progress output
Progress messages are suppressed. The tool runs silently until completion.
No colors
Plain JSON output without ANSI color codes.
Compact by default
Single-line JSON output (use
-pretty for formatted JSON).Machine-readable
Structured data that’s easy to parse programmatically.
Pretty-printed JSON
For human-readable JSON with indentation:The
-pretty flag automatically enables JSON output, so you don’t need to specify -json as well.When to use each format
Use human-readable format when:
- Running tests interactively from the terminal
- You want to see progress updates in real-time
- You need to quickly interpret results visually
- Troubleshooting network issues manually
Use JSON format when:
- Integrating with monitoring systems
- Automating speed tests in scripts
- Storing results in a database
- Processing results with other tools (jq, scripts, etc.)
- Running tests in CI/CD pipelines
- Building dashboards or reports
Disabling color output
There are multiple ways to disable color output while keeping the human-readable format:Using NO_COLOR environment variable
Using TERM environment variable
Piping output
When output is piped, color codes are still included by default. UseNO_COLOR to strip them:
Format selection reference
| Flag | Output Format | Progress | Colors | Use Case |
|---|---|---|---|---|
| (none) | Human-readable | Yes | Yes* | Interactive terminal use |
-json | JSON | No | No | Automation, compact output |
-pretty | JSON | No | No | Automation, readable JSON |
NO_COLOR is set or TERM=dumb
Implementation details
The output format is controlled by flag parsing incmd/unispeedtest/main.go:16-24:
- When
-jsonor-prettyis set, theverboseflag is disabled - When
verboseis false, progress functions become no-ops - The reporter chooses between
PrintHuman()andPrintJSON()based on the verbose flag