Skip to content

Commit 3f59bd3

Browse files
refactor: Update README for clarity and structure; enhance content organization
1 parent 05c450c commit 3f59bd3

1 file changed

Lines changed: 105 additions & 116 deletions

File tree

README.md

Lines changed: 105 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# flow
22

3-
See your network breathe.
3+
A terminal dashboard for real-time network throughput.
44

55
<img src="./docs/demo.gif" alt="flow demo" width="100%">
66

@@ -13,39 +13,18 @@ See your network breathe.
1313
<img src="https://img.shields.io/github/stars/programmersd21/flow?style=for-the-badge&labelColor=000000&color=ffcc00" alt="stars">
1414
</p>
1515

16-
## Modes
17-
18-
flow adapts to your terminal width with three distinct views.
19-
20-
| hero | compact | tiny |
21-
|:---:|:---:|:---:|
22-
| <img src="./docs/normal_mode.png" alt="hero mode"> | <img src="./docs/compact_mode.png" alt="compact mode"> | <img src="./docs/tiny_mode.png" alt="tiny mode"> |
23-
| full dashboard with sparklines, peaks, and daily totals | numbers-only view for narrow terminals | single-line output for tmux status bars |
24-
25-
## Anatomy
26-
27-
The UI is intentionally minimal and centered both axes:
28-
29-
```mermaid
30-
flowchart TD
31-
Title["● flow"]
32-
Download["╭─ DOWNLOAD ───────────────────────╮<br/>│ ↓ 124.8 MB/s ↗ Peak: 382.0 MB/s │<br/>│ ⢀⣀⣠⣴⣶⣾⣿⣿⣿⣿⋯ │<br/>╰──────────────────────────────────╯"]
33-
Upload["╭─ UPLOAD ─────────────────────────╮<br/>│ ↑ 14.6 MB/s ↘ Peak: 56.0 MB/s │<br/>│ ⢀⣀⣠⣴⣶⣾⣿⣿⣿⣿⋯ │<br/>╰──────────────────────────────────╯"]
34-
Info["today ↓ 21.8 GB · today ↑ 4.6 GB · wlan0"]
35-
Footer["q quit · r reset · i interface · c units · ? help"]
36-
37-
Title --> Download
38-
Download --> Upload
39-
Upload --> Info
40-
Info --> Footer
41-
```
16+
## Contents
4217

43-
- Large centered breathing title row that scales to a multi-line ASCII art logo on larger terminals.
44-
- Clean stacked panels separating download and upload statistics, wrapped in custom rounded borders with speed-reactive glow (transitions from dark slate/forest to bright cyan/emerald under load).
45-
- High-resolution U+2800 Braille-grid waveforms scrolling horizontally with sub-pixel precision at 30 FPS.
46-
- Velocity glyphs (↗ ↘ →) next to values indicating trend direction.
47-
- Session peaks (flashes white on updates) and daily totals in a clean info bar.
48-
- Quiet footer with interface name and keybindings.
18+
- [Install](#install)
19+
- [Rationale](#rationale)
20+
- [Modes](#modes)
21+
- [Features](#features)
22+
- [Usage](#usage)
23+
- [Configuration](#configuration)
24+
- [Architecture](#architecture)
25+
- [Development](#development)
26+
- [Star History](#star-history)
27+
- [License](#license)
4928

5029
## Install
5130

@@ -61,77 +40,71 @@ cd flow
6140
make install
6241
```
6342

64-
Pre-built binaries for Linux, macOS, Windows (amd64/arm64) are on the
65-
[releases page](https://github.com/programmersd21/flow/releases).
43+
Pre-built binaries for Linux, macOS, and Windows (amd64 and arm64) are available on the [releases page](https://github.com/programmersd21/flow/releases).
6644

67-
## Philosophy
45+
## Rationale
6846

69-
```mermaid
70-
flowchart LR
71-
Input["Network Throughput"] --> Q{"Understood in<br/>under 1 second?"}
72-
Q -->|Yes| Keep["Keep Feature"]
73-
Q -->|No| Cut["Cut It"]
74-
Keep --> Result["Calm · Expensive · Minimal"]
75-
Cut --> Result
76-
```
77-
78-
> Does this help someone understand their network in under one second?
79-
> If no — cut it.
47+
Most network monitors display CPU usage, per-process breakdowns, packet counts, and connection tables. flow displays throughput only.
8048

81-
flow stays deliberately small. No CPU panels, no packet counters, no multi-pane layouts. Download and upload throughput, in real time, nothing else.
49+
Every feature decision is evaluated against a single question: does this help the user understand their network within one second. If not, it is not included.
8250

83-
The interface is built to feel calm and expensive: large typography, soft gradients, spring-driven motion, and restrained decoration.
51+
The result is a small, deliberately scoped tool. There are no additional panels, no required configuration, and no unnecessary complexity in either the interface or the underlying implementation.
8452

85-
## Features
53+
## Modes
8654

87-
- Real-time download (↓) and upload (↑) throughput
88-
- Spring-driven interpolation for display values
89-
- Pulse and shimmer microinteractions tied to live traffic
90-
- High-resolution Braille-grid waveforms with 30 FPS horizontal smooth scrolling
91-
- Speed-reactive, glowing rounded borders
92-
- Typographic peak highlights (bold white flash on breaching records)
93-
- Velocity glyphs (↗ ↘ →) show traffic direction trend
94-
- Auto-scaling units: B/s, KB/s, MB/s, GB/s (cycle with `c`)
95-
- Saturated color gradients that brighten with activity
96-
- Session peak tracking and daily traffic totals
97-
- Three view modes: hero, compact, tiny
98-
- Graceful auto-resize between modes
99-
- Zero configuration — optional TOML config at
100-
`~/.config/flow/config.toml`
101-
- Non-interactive modes: `--json` and `--once` for scripts
102-
- Cross-platform: Linux, macOS, Windows
55+
flow adjusts its display according to terminal width.
10356

104-
## Keybindings
57+
| hero | compact | tiny |
58+
|:---:|:---:|:---:|
59+
| <img src="./docs/normal_mode.png" alt="hero mode"> | <img src="./docs/compact_mode.png" alt="compact mode"> | <img src="./docs/tiny_mode.png" alt="tiny mode"> |
60+
| Full dashboard with sparklines, peaks, and daily totals | Numeric values only, for narrow terminals | Single-line output, intended for status bars |
10561

106-
![keybinds](docs/keybinds.png)
62+
## Features
10763

108-
| Key | Action |
109-
|-------------|-----------------------------|
110-
| `q` / `^C` | quit |
111-
| `r` | reset session peaks |
112-
| `i` | cycle interfaces |
113-
| `c` | cycle units (auto/KB/MB/GB) |
114-
| `p` | pause / resume |
115-
| `?` | toggle help |
64+
- Real-time download and upload throughput
65+
- Interpolated display values using spring-based animation
66+
- Braille-grid waveform rendering at 30 frames per second
67+
- Border color reflects current transfer speed
68+
- Visual indication when a new session peak is recorded
69+
- Directional indicators for traffic trend
70+
- Automatic unit scaling from B/s to GB/s
71+
- Session peak tracking and daily traffic totals
72+
- Three display modes with automatic switching on resize
73+
- No required configuration; optional TOML configuration file
74+
- Non-interactive output modes for use in scripts
75+
- Supported on Linux, macOS, and Windows
11676

11777
## Usage
11878

11979
![help](docs/cli_help.png)
12080

12181
```sh
12282
flow # hero view, auto interface
123-
flow --tiny # single-line tmux mode
124-
flow --compact # numbers only
125-
flow --json # one-shot JSON, then exit
126-
flow --once # one-shot plain text, then exit
127-
flow --interface wlan0 # pin interface
128-
flow --refresh 500ms # slower sampling (default 100ms)
83+
flow --tiny # single-line mode for status bars
84+
flow --compact # numeric values only
85+
flow --json # single JSON output, then exit
86+
flow --once # single plain-text output, then exit
87+
flow --interface wlan0 # specify network interface
88+
flow --refresh 500ms # adjust sampling interval (default 100ms)
12989
flow --no-color
13090
flow --version
13191
flow --help
13292
```
13393

134-
### --json output
94+
### Keybindings
95+
96+
![keybinds](docs/keybinds.png)
97+
98+
| Key | Action |
99+
|-------------|-----------------------------|
100+
| `q` / `^C` | Quit |
101+
| `r` | Reset session peaks |
102+
| `i` | Cycle network interfaces |
103+
| `c` | Cycle display units |
104+
| `p` | Pause or resume |
105+
| `?` | Toggle help |
106+
107+
### JSON output
135108

136109
```json
137110
{
@@ -144,7 +117,7 @@ flow --help
144117
}
145118
```
146119

147-
### tmux
120+
### tmux integration
148121

149122
```sh
150123
# ~/.tmux.conf
@@ -154,46 +127,73 @@ set -g status-interval 1
154127

155128
## Configuration
156129

157-
`~/.config/flow/config.toml` is auto-created on first run. It respects
158-
`XDG_CONFIG_HOME`.
130+
A configuration file is created automatically at `~/.config/flow/config.toml` on first run. The `XDG_CONFIG_HOME` environment variable is respected if set.
159131

160132
```toml
161133
refresh = "100ms" # sampling interval
162-
history = 60 # seconds of sparkline history retained
134+
history = 60 # seconds of retained sparkline history
163135
theme = "default"
164-
unit = "auto" # auto | kb | mb | gb (case-insensitive)
165-
interface = "auto" # auto or name (e.g. eth0, wlan0)
136+
unit = "auto" # auto, kb, mb, or gb
137+
interface = "auto" # auto, or a specific interface name (e.g. eth0, wlan0)
166138
no_color = false
167139
```
168140

141+
<details>
142+
<summary>Interface layout</summary>
143+
144+
```mermaid
145+
flowchart TD
146+
Title["flow"]
147+
Download["DOWNLOAD panel: current speed, peak, waveform"]
148+
Upload["UPLOAD panel: current speed, peak, waveform"]
149+
Info["Daily totals and active interface"]
150+
Footer["Keybinding reference"]
151+
152+
Title --> Download
153+
Download --> Upload
154+
Upload --> Info
155+
Info --> Footer
156+
```
157+
158+
All elements are centered on both axes. Panel border color changes according to current transfer speed.
159+
160+
</details>
161+
169162
## Architecture
170163

171-
Two decoupled loops connected by a channel:
164+
flow runs two independent loops connected by a channel.
172165

173166
```mermaid
174167
flowchart LR
175-
subgraph Sampling["Sampling Loop (~10 Hz)"]
176-
OS["/proc/net/dev · sysctl · GetIfTable2"] --> SlidingWindow["Sliding-Window Average<br/>(last N samples)"]
177-
SlidingWindow --> Channel["Channel&lt;Sample&gt;"]
168+
subgraph Sampling["Sampling loop, approximately 10 Hz"]
169+
OS["Network counters via gopsutil"] --> SlidingWindow["Sliding-window average"]
170+
SlidingWindow --> Channel["Sample channel"]
178171
end
179172
180-
subgraph Rendering["Render Loop (~30 fps)"]
181-
Channel --> Spring["Spring Interpolation<br/>(smooth value animation)"]
182-
Spring --> Display["Dashboard Render<br/>(Bubble Tea TUI)"]
183-
Theme["Theme Config"] -.-> Display
173+
subgraph Rendering["Render loop, approximately 30 fps"]
174+
Channel --> Spring["Spring interpolation"]
175+
Spring --> Display["Dashboard render (Bubble Tea)"]
176+
Theme["Theme configuration"] -.-> Display
184177
end
185178
```
186179

187-
- **Sampling loop** (~10 Hz): reads OS network counters via gopsutil, computes a sliding-window average, emits a sample on a channel.
188-
- **Render loop** (~30 fps): springs display values toward the latest sample, decays brief pulses, clears the terminal, and renders the full dashboard.
180+
- The sampling loop reads network counters from the operating system, computes a sliding-window average, and emits a sample on a channel.
181+
- The render loop interpolates display values toward the latest sample and renders the dashboard.
182+
183+
Separating collection from rendering keeps the interface responsive without adding load to the sampler. Idle CPU usage remains below one percent.
189184

190-
The model keeps rendering separate from collection so the UI can stay smooth without adding work to the sampler. Idle CPU stays well under 1%.
185+
**Platform notes:** Linux reads `/proc/net/dev` via gopsutil. macOS uses sysctl and getifaddrs. Windows uses `GetIfTable2`. No elevated privileges are required on any platform.
186+
187+
## Development
191188

192-
## Platform notes
189+
```sh
190+
make check # format check, vet, lint, and test
191+
make build # build ./bin/flow
192+
make test # go test ./... -race -cover
193+
make release-dry # goreleaser snapshot build, no publish
194+
```
193195

194-
- Linux: reads `/proc/net/dev` via gopsutil.
195-
- macOS: sysctl / getifaddrs.
196-
- Windows: `GetIfTable2`. No elevated privileges.
196+
See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
197197

198198
## Star History
199199

@@ -205,17 +205,6 @@ The model keeps rendering separate from collection so the UI can stay smooth wit
205205
</picture>
206206
</a>
207207

208-
## Development
209-
210-
```sh
211-
make check # fmt-check + vet + lint + test — run before every PR
212-
make build # build ./bin/flow
213-
make test # go test ./... -race -cover
214-
make release-dry # goreleaser snapshot (no publish)
215-
```
216-
217-
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide.
218-
219208
## License
220209

221-
MIT — see [LICENSE](LICENSE).
210+
MIT. See [LICENSE](LICENSE).

0 commit comments

Comments
 (0)