# mikkelam/fast-cli architecture

> Architecture diagram of the GitHub repository mikkelam/fast-cli, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mikkelam/fast-cli
- Repository: https://github.com/mikkelam/fast-cli

## Overview

fast-cli is a command-line internet speed tester that measures connection performance through the fast.com v2 API and can report download speed, latency, and optionally upload speed in human-readable or JSON form. Its documented stopping policy ramps workers, then measures at a steady worker count until results stabilize or the duration limit is reached. The source excerpts were unavailable, so module-level calls and data transfers cannot be verified; the graph shows only README-supported relationships.

Main entry points: [`src/lib/http_speed_tester_v2.zig`](https://github.com/mikkelam/fast-cli/blob/main/src/lib/http_speed_tester_v2.zig) (Speed Test), [`src/main.zig`](https://github.com/mikkelam/fast-cli/blob/main/src/main.zig) (CLI Entry), [`src/lib/measurement_strategy.zig`](https://github.com/mikkelam/fast-cli/blob/main/src/lib/measurement_strategy.zig) (Stability Strategy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command Line"]
  node_cli_entry["CLI Entry<br/>[main.zig]"]
  node_cli_args["CLI Arguments<br/>[args.zig]"]
  node_cli_root["CLI Root<br/>[root.zig]"]
end

subgraph group_measurement["Speed Measurement"]
  node_speed_test["Speed Test"]
  node_latency_test["Latency Test"]
  node_strategy["Stability Strategy"]
  node_worker_manager["Worker Manager<br/>[worker_manager.zig]"]
  node_speed_worker["Speed Worker<br/>[speed_worker.zig]"]
  node_bandwidth["Bandwidth<br/>[bandwidth.zig]"]
  node_fast_helper["Fast Helper<br/>[fast.zig]"]
end

subgraph group_reporting["Results"]
  node_progress["Progress Display<br/>[progress.zig]"]
  node_terminal["Terminal Output<br/>[terminal.zig]"]
end

node_user(("User"))
node_fast_service{{"fast.com API"}}

node_user -->|"runs"| node_cli_entry
node_cli_entry -->|"tests speed"| node_speed_test
node_speed_test -->|"uses API"| node_fast_service
node_strategy -->|"stops when stable"| node_speed_test

click node_cli_entry "https://github.com/mikkelam/fast-cli/blob/main/src/main.zig"
click node_cli_args "https://github.com/mikkelam/fast-cli/blob/main/src/cli/args.zig"
click node_cli_root "https://github.com/mikkelam/fast-cli/blob/main/src/cli/root.zig"
click node_speed_test "https://github.com/mikkelam/fast-cli/blob/main/src/lib/http_speed_tester_v2.zig"
click node_latency_test "https://github.com/mikkelam/fast-cli/blob/main/src/lib/http_latency_tester.zig"
click node_strategy "https://github.com/mikkelam/fast-cli/blob/main/src/lib/measurement_strategy.zig"
click node_worker_manager "https://github.com/mikkelam/fast-cli/blob/main/src/lib/workers/worker_manager.zig"
click node_speed_worker "https://github.com/mikkelam/fast-cli/blob/main/src/lib/workers/speed_worker.zig"
click node_bandwidth "https://github.com/mikkelam/fast-cli/blob/main/src/lib/bandwidth.zig"
click node_fast_helper "https://github.com/mikkelam/fast-cli/blob/main/src/lib/fast.zig"
click node_progress "https://github.com/mikkelam/fast-cli/blob/main/src/lib/progress.zig"
click node_terminal "https://github.com/mikkelam/fast-cli/blob/main/src/lib/terminal.zig"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli_entry,node_cli_args,node_cli_root,node_user toneBlue
class node_speed_test,node_latency_test,node_strategy,node_worker_manager,node_speed_worker,node_bandwidth,node_fast_helper toneAmber
class node_progress,node_terminal,node_fast_service toneMint
```

## Components

### Command Line

- [CLI Entry](https://github.com/mikkelam/fast-cli/blob/main/src/main.zig): `src/main.zig`
- [CLI Arguments](https://github.com/mikkelam/fast-cli/blob/main/src/cli/args.zig): `src/cli/args.zig`
- [CLI Root](https://github.com/mikkelam/fast-cli/blob/main/src/cli/root.zig): `src/cli/root.zig`

### Speed Measurement

- [Speed Test](https://github.com/mikkelam/fast-cli/blob/main/src/lib/http_speed_tester_v2.zig): `src/lib/http_speed_tester_v2.zig`
- [Latency Test](https://github.com/mikkelam/fast-cli/blob/main/src/lib/http_latency_tester.zig): `src/lib/http_latency_tester.zig`
- [Stability Strategy](https://github.com/mikkelam/fast-cli/blob/main/src/lib/measurement_strategy.zig): `src/lib/measurement_strategy.zig`
- [Worker Manager](https://github.com/mikkelam/fast-cli/blob/main/src/lib/workers/worker_manager.zig): `src/lib/workers/worker_manager.zig`
- [Speed Worker](https://github.com/mikkelam/fast-cli/blob/main/src/lib/workers/speed_worker.zig): `src/lib/workers/speed_worker.zig`
- [Bandwidth](https://github.com/mikkelam/fast-cli/blob/main/src/lib/bandwidth.zig): `src/lib/bandwidth.zig`
- [Fast Helper](https://github.com/mikkelam/fast-cli/blob/main/src/lib/fast.zig): `src/lib/fast.zig`

### Results

- [Progress Display](https://github.com/mikkelam/fast-cli/blob/main/src/lib/progress.zig): `src/lib/progress.zig`
- [Terminal Output](https://github.com/mikkelam/fast-cli/blob/main/src/lib/terminal.zig): `src/lib/terminal.zig`

### Other components

- **User**
- **fast.com API**

## Connections

- User → CLI Entry: runs (evidence: `README.md`)
- CLI Entry → Speed Test: tests speed (evidence: `README.md`)
- Speed Test → fast.com API: uses API (evidence: `README.md`)
- Stability Strategy → Speed Test: stops when stable (evidence: `README.md`)
