pyre-cli 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -255
- package/dist/index.js +1454 -281
- package/package.json +1 -1
- package/src/anomalies.ts +102 -0
- package/src/formatters/index.ts +3 -3
- package/src/formatters/output.ts +355 -21
- package/src/formatters/render.ts +316 -97
- package/src/formatters/types.ts +33 -17
- package/src/history.ts +57 -13
- package/src/index.ts +226 -13
- package/src/live/export.ts +64 -7
- package/src/live/input.ts +84 -39
- package/src/live/render.ts +175 -118
- package/src/live/state.ts +76 -70
- package/src/live/types.ts +10 -2
- package/src/monitors/collectors.ts +142 -35
- package/src/monitors/smc.ts +60 -12
- package/src/monitors/types.ts +1 -0
- package/src/p2p/server.test.ts +2 -2
- package/src/sparkline.ts +82 -13
- package/src/state/config.ts +130 -0
- package/Formula/pyre.rb +0 -19
package/README.md
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
# pyre
|
|
2
2
|
|
|
3
|
-
Mac system monitoring CLI: temps, CPU, memory, disk, battery, live dashboard, packet monitor,
|
|
3
|
+
Mac system monitoring CLI: temps, CPU, memory, disk, battery, GPU, power draw, live dashboard, packet monitor, process management, export, alerts, P2P live data streaming, web dashboard, SSH monitoring, and micro-benchmarking.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|

|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
|
|
10
|
-
> Note
|
|
11
|
-
|
|
12
|
-
>
|
|
10
|
+
> **Note:** things may not work as intended if your firewall settings do not allow inbound connections for this program.
|
|
11
|
+
>
|
|
12
|
+
> You can skip init with Enter, but you may encounter some UI bugs. This is being worked on.
|
|
13
13
|
|
|
14
14
|
## Features
|
|
15
15
|
|
|
16
16
|
- **P2P live data streaming** — send live system stats to another system over TCP with password authentication, TLS encryption, rate limiting, IP allow/deny lists, audit logging, and HMAC message signing
|
|
17
17
|
- **Real-time system stats** — CPU brand, cores, frequency, load, and usage
|
|
18
|
+
- **GPU monitoring** — GPU model, VRAM, utilization, temperature, and process count (detailed mode)
|
|
19
|
+
- **Power draw monitoring** — CPU watts, GPU watts, and combined power draw via SMC/ioreg
|
|
18
20
|
- **Memory monitoring** — usage, swap, and total/available
|
|
19
21
|
- **Disk space** — mounted volume usage
|
|
20
22
|
- **Battery & power** — level, power source, condition, charge cycles, max capacity, estimated time to empty, discharge rate, power draw in watts
|
|
@@ -22,11 +24,19 @@ Mac system monitoring CLI: temps, CPU, memory, disk, battery, live dashboard, pa
|
|
|
22
24
|
- **Task list** — running tasks/applications sorted by CPU with PID, user, memory, state, and runtime
|
|
23
25
|
- **Thermal state** — CPU temperature via `pmset` and `powermetrics` (sudo for detailed readings)
|
|
24
26
|
- **Network** — RX/TX bytes and per-second rates
|
|
25
|
-
- **Top processes** — sorted by CPU, memory, or PID with live filtering
|
|
26
|
-
- **Interactive live dashboard** — full-screen TUI with keyboard-driven controls
|
|
27
|
-
- **Snapshot export** — JSON, CSV, or
|
|
28
|
-
- **Continuous CSV logging** — automatic per-tick data logging to timestamped files
|
|
29
|
-
- **Visual themes** —
|
|
27
|
+
- **Top processes** — sorted by CPU, memory, or PID with live filtering, tree view, and kill with signal picker
|
|
28
|
+
- **Interactive live dashboard** — full-screen TUI with keyboard-driven controls, mouse support, and tab-based panel navigation
|
|
29
|
+
- **Snapshot export** — JSON, CSV, TSV, HTML, or Markdown output formats
|
|
30
|
+
- **Continuous CSV logging** — automatic per-tick data logging to timestamped files with log rotation
|
|
31
|
+
- **Visual themes** — six built-in colour themes for the dashboard
|
|
32
|
+
- **Alert system** — configurable CPU usage and temperature threshold alerts with terminal bell and desktop notification
|
|
33
|
+
- **Graph mode toggle** — switch between sparkline and bar graph rendering in the live dashboard
|
|
34
|
+
- **P2P dashboard panel** — monitor P2P server status and peer events directly from the live dashboard
|
|
35
|
+
- **Temperature unit toggle** — switch between Celsius and Fahrenheit display in live mode
|
|
36
|
+
- **Hardware overview** — `pyre info` prints a concise hardware summary
|
|
37
|
+
- **Remote SSH monitoring** — `pyre ssh <host>` streams a remote Mac's live dashboard locally
|
|
38
|
+
- **Web dashboard** — `pyre web` serves a self-contained HTML report on a local port
|
|
39
|
+
- **Micro-benchmarking** — `pyre bench <cmd>` logs resource usage during any command
|
|
30
40
|
|
|
31
41
|
## Installation
|
|
32
42
|
|
|
@@ -42,46 +52,49 @@ npm install -g pyre-cli
|
|
|
42
52
|
curl -fsSL https://raw.githubusercontent.com/somalip/pyre/main/install.sh | bash
|
|
43
53
|
```
|
|
44
54
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
### Static snapshot
|
|
55
|
+
## Quick Start
|
|
48
56
|
|
|
49
57
|
```bash
|
|
50
|
-
pyre
|
|
51
|
-
pyre --detailed
|
|
52
|
-
pyre --json
|
|
53
|
-
pyre --
|
|
54
|
-
|
|
55
|
-
pyre
|
|
56
|
-
pyre --
|
|
57
|
-
pyre --
|
|
58
|
+
pyre # Static snapshot, all system stats
|
|
59
|
+
pyre --detailed # Include sensor / powermetrics detail
|
|
60
|
+
pyre --json # JSON output (also --csv, --tsv, --html, --md)
|
|
61
|
+
pyre --html --out report.html # Self-contained HTML report
|
|
62
|
+
|
|
63
|
+
pyre live # Interactive live dashboard
|
|
64
|
+
pyre live --interval 3 --log # Custom refresh interval + auto-logging
|
|
65
|
+
pyre live --alert-cpu 80 --alert-temp 85 --temp-unit f
|
|
66
|
+
|
|
67
|
+
pyre server # Print ready-to-paste P2P server/client commands for your LAN
|
|
68
|
+
pyre info # Concise hardware overview
|
|
69
|
+
pyre ssh build-server # Stream remote Mac stats over SSH
|
|
70
|
+
pyre web # Serve HTML dashboard on localhost
|
|
71
|
+
pyre bench "make build" # Log resources during a command
|
|
58
72
|
```
|
|
59
73
|
|
|
60
|
-
|
|
74
|
+
## Options Reference
|
|
61
75
|
|
|
62
|
-
|
|
63
|
-
pyre live # Start the interactive live dashboard
|
|
64
|
-
pyre live --interval 3 # Refresh every 3 seconds
|
|
65
|
-
pyre live --detailed # Live mode with detailed sensor readings
|
|
66
|
-
pyre live --export-dir ./my-exports # Custom directory for snapshot exports and logs
|
|
67
|
-
pyre live --log # Start continuous CSV logging immediately
|
|
68
|
-
pyre live --interval 5 --log # Custom interval with auto-logging
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Options
|
|
76
|
+
These options apply to both static snapshots and `pyre live`, except where noted.
|
|
72
77
|
|
|
73
78
|
| Option | Description |
|
|
74
79
|
|---|---|
|
|
75
80
|
| `-j, --json` | Output as JSON |
|
|
81
|
+
| `--html` | Output as self-contained HTML |
|
|
82
|
+
| `--md` | Output as Markdown |
|
|
76
83
|
| `-c, --csv` | Output as CSV |
|
|
77
84
|
| `-t, --tsv` | Output as TSV |
|
|
78
85
|
| `--detailed` | Include detailed system info and sensor readings |
|
|
86
|
+
| `--theme <name>` | Theme for live mode (`default`, `dracula`, `cyberpunk`, `monochrome`, `nord`, `gruvbox`) |
|
|
79
87
|
| `--interval <seconds>` | Refresh interval for live mode (default: `2`) |
|
|
80
88
|
| `--once` | Show a single static snapshot instead of live feed |
|
|
81
89
|
| `--out <file>` | Write snapshot output to a file |
|
|
82
90
|
| `--export-dir <dir>` | Directory for live-mode snapshot exports and logs (default: `./pyre-exports`) |
|
|
83
91
|
| `--log` | Start continuous CSV logging immediately when live mode starts |
|
|
84
|
-
| `--
|
|
92
|
+
| `--tree` | Show process tree view instead of flat list |
|
|
93
|
+
| `--sort <key>` | Sort processes by: `cpu`, `mem`, `pid`, `user`, `command`, `state`, `threads`, `runtime` |
|
|
94
|
+
| `--limit <n>` | Max processes in snapshot (`0` = all, default: `10`) |
|
|
95
|
+
| `--alert-cpu <pct>` | CPU usage alert threshold (default: `90`) |
|
|
96
|
+
| `--alert-temp <c>` | CPU temperature alert threshold in Celsius (default: `95`) |
|
|
97
|
+
| `--temp-unit <unit>` | Temperature display unit: `c` or `f` (default: `c`) |
|
|
85
98
|
|
|
86
99
|
## Commands
|
|
87
100
|
|
|
@@ -90,123 +103,63 @@ pyre live --interval 5 --log # Custom interval with auto-logging
|
|
|
90
103
|
| Command | Description |
|
|
91
104
|
|---|---|
|
|
92
105
|
| `pyre` | Show all system stats in a formatted table |
|
|
93
|
-
| `pyre --detailed` | Include detailed sensor and powermetrics readings |
|
|
94
|
-
| `pyre --json` | Output stats as JSON |
|
|
95
|
-
| `pyre --csv` | Output stats as CSV |
|
|
96
|
-
| `pyre --tsv` | Output stats as TSV |
|
|
97
106
|
| `pyre --once` | Show a single static snapshot (same as default without live) |
|
|
98
|
-
| `pyre --
|
|
99
|
-
| `pyre --
|
|
107
|
+
| `pyre --json` | JSON output |
|
|
108
|
+
| `pyre --html` | Self-contained HTML report |
|
|
109
|
+
| `pyre --md` | Markdown tables |
|
|
100
110
|
|
|
101
|
-
###
|
|
111
|
+
### Hardware overview
|
|
102
112
|
|
|
103
113
|
| Command | Description |
|
|
104
114
|
|---|---|
|
|
105
|
-
| `pyre
|
|
106
|
-
| `pyre live --interval <seconds>` | Set refresh interval for live mode (default: `2`) |
|
|
107
|
-
| `pyre live --detailed` | Live mode with detailed sensor readings |
|
|
108
|
-
| `pyre live --export-dir <dir>` | Custom directory for snapshot exports and logs |
|
|
109
|
-
| `pyre live --log` | Start continuous CSV logging immediately |
|
|
115
|
+
| `pyre info` | Concise hardware summary (CPU, memory, GPU, battery, thermal) |
|
|
110
116
|
|
|
111
|
-
###
|
|
117
|
+
### Benchmarking
|
|
112
118
|
|
|
113
119
|
| Command | Description |
|
|
114
120
|
|---|---|
|
|
115
|
-
| `pyre
|
|
121
|
+
| `pyre bench <cmd>` | Log CPU, memory, network, and thermal usage while running a command |
|
|
116
122
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
### P2P server
|
|
123
|
+
### Remote monitoring
|
|
120
124
|
|
|
121
125
|
| Command | Description |
|
|
122
126
|
|---|---|
|
|
123
|
-
| `pyre
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
| `pyre p2p server --p2p-password <password>` | Password for authentication (required) |
|
|
127
|
-
| `pyre p2p server --interval <seconds>` | Data refresh interval (default: `2`) |
|
|
128
|
-
| `pyre p2p server --detailed` | Include detailed sensor readings |
|
|
129
|
-
| `pyre p2p server --p2p-cert <file>` | TLS certificate file (PEM) for encrypted connections |
|
|
130
|
-
| `pyre p2p server --p2p-key <file>` | TLS private key file (PEM) for the server |
|
|
131
|
-
| `pyre p2p server --p2p-ca <file>` | TLS CA certificate file (PEM) — required by clients using `--p2p-tls` |
|
|
132
|
-
| `pyre p2p server --p2p-rate-limit <n>` | Max auth attempts per IP per minute (default: `5`) |
|
|
133
|
-
| `pyre p2p server --p2p-allow <ips>` | Comma-separated list of allowed IPs (empty = all) |
|
|
134
|
-
| `pyre p2p server --p2p-deny <ips>` | Comma-separated list of denied IPs |
|
|
135
|
-
| `pyre p2p server --p2p-audit-log <dir>` | Directory for P2P audit logs |
|
|
136
|
-
| `pyre p2p server --p2p-hmac-key <key>` | HMAC key for message signing (default: derived from password) |
|
|
137
|
-
|
|
138
|
-
### P2P client
|
|
127
|
+
| `pyre ssh <host>` | Stream live stats from a remote Mac over SSH |
|
|
128
|
+
|
|
129
|
+
### Live dashboard
|
|
139
130
|
|
|
140
131
|
| Command | Description |
|
|
141
132
|
|---|---|
|
|
142
|
-
| `pyre
|
|
143
|
-
| `pyre p2p connect --p2p-host <host>` | Server address (default: `127.0.0.1`) |
|
|
144
|
-
| `pyre p2p connect --p2p-port <port>` | Server port (default: `9876`) |
|
|
145
|
-
| `pyre p2p connect --p2p-password <password>` | Password for authentication (required) |
|
|
146
|
-
| `pyre p2p connect --p2p-tls` | Enable TLS encryption for the connection |
|
|
147
|
-
| `pyre p2p connect --p2p-ca <file>` | TLS CA certificate file (PEM) — required when using `--p2p-tls` |
|
|
148
|
-
| `pyre p2p connect --p2p-insecure` | Skip TLS certificate verification (client only) |
|
|
149
|
-
| `pyre p2p connect --p2p-audit-log <dir>` | Directory for P2P client audit logs |
|
|
150
|
-
| `pyre p2p connect --p2p-hmac-key <key>` | HMAC key for message signing (must match server) |
|
|
133
|
+
| `pyre live` | Start the interactive live dashboard |
|
|
151
134
|
|
|
152
|
-
###
|
|
135
|
+
### Web dashboard
|
|
153
136
|
|
|
154
|
-
|
|
|
137
|
+
| Command | Description |
|
|
155
138
|
|---|---|
|
|
156
|
-
|
|
|
157
|
-
| `-c, --csv` | Output as CSV |
|
|
158
|
-
| `-t, --tsv` | Output as TSV |
|
|
159
|
-
| `--detailed` | Include detailed system info and sensor readings |
|
|
160
|
-
| `--interval <seconds>` | Refresh interval for live mode (default: `2`) |
|
|
161
|
-
| `--once` | Show a single static snapshot instead of live feed |
|
|
162
|
-
| `--out <file>` | Write snapshot output to a file |
|
|
163
|
-
| `--export-dir <dir>` | Directory for live-mode snapshot exports and logs (default: `./pyre-exports`) |
|
|
164
|
-
| `--log` | Start continuous CSV logging immediately when live mode starts |
|
|
165
|
-
| `--packets` | Include packet monitor panel in static output |
|
|
139
|
+
| `pyre web` | Serve a self-contained HTML dashboard on localhost |
|
|
166
140
|
|
|
167
|
-
###
|
|
141
|
+
### P2P
|
|
168
142
|
|
|
169
|
-
|
|
|
143
|
+
| Command | Description |
|
|
170
144
|
|---|---|
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `g` | Show / hide sparkline graphs |
|
|
175
|
-
| `s` | Cycle sort order (CPU → memory → PID) |
|
|
176
|
-
| `f` | Cycle export format (JSON → CSV → TSV) |
|
|
177
|
-
| `e` | Export a snapshot to the export directory |
|
|
178
|
-
| `l` | Toggle continuous CSV logging |
|
|
179
|
-
| `c` | Open the UI customizer |
|
|
180
|
-
| `/` | Open process filter |
|
|
181
|
-
| `k` | Open process kill (enter PID, then Enter to confirm) |
|
|
182
|
-
| `+` | Increase refresh interval by 1 second |
|
|
183
|
-
| `-` | Decrease refresh interval by 1 second |
|
|
184
|
-
| `↑` / `k` | Navigate customizer options |
|
|
185
|
-
| `↓` / `j` | Navigate customizer options |
|
|
186
|
-
| `Enter` / `Space` | Toggle visibility or select theme in customizer |
|
|
187
|
-
| `Esc` | Close customizer or clear filter/kill input |
|
|
145
|
+
| `pyre server` | Detect the local IP and print ready-to-paste commands for starting a P2P server and connecting a client on the same LAN (default port `9876`, default password `mysecret`) |
|
|
146
|
+
| `pyre p2p server` | Start a P2P server that streams live stats to authenticated peers |
|
|
147
|
+
| `pyre p2p connect` | Connect to a P2P server and display live stats |
|
|
188
148
|
|
|
189
|
-
|
|
149
|
+
See [P2P Live Data Streaming](#p2p-live-data-streaming) below for the full option set.
|
|
190
150
|
|
|
191
|
-
|
|
192
|
-
|---|---|
|
|
193
|
-
| `status` | Print the number of currently connected peers |
|
|
194
|
-
| `q` / `quit` / `exit` | Shut down the server gracefully |
|
|
151
|
+
---
|
|
195
152
|
|
|
196
153
|
## P2P Live Data Streaming
|
|
197
154
|
|
|
198
|
-
Send live system stats to another system over a TCP connection with password authentication. The server streams `StatsData` snapshots to authenticated peers at the configured interval.
|
|
199
|
-
|
|
200
|
-
### Start a P2P server (host)
|
|
155
|
+
Send live system stats to another system over a TCP connection with password authentication. The server streams `StatsData` snapshots to authenticated peers at the configured interval. You can also start or stop the P2P server from the live dashboard by pressing `r`.
|
|
201
156
|
|
|
202
|
-
|
|
157
|
+
### Server options
|
|
203
158
|
|
|
204
159
|
```bash
|
|
205
160
|
pyre p2p server --p2p-host 0.0.0.0 --p2p-port 9876 --p2p-password mysecret
|
|
206
161
|
```
|
|
207
162
|
|
|
208
|
-
The server binds to the specified host and port, and streams live system stats to any authenticated peer.
|
|
209
|
-
|
|
210
163
|
| Option | Description |
|
|
211
164
|
|---|---|
|
|
212
165
|
| `--p2p-host <host>` | Bind address (default: `0.0.0.0`) |
|
|
@@ -214,86 +167,21 @@ The server binds to the specified host and port, and streams live system stats t
|
|
|
214
167
|
| `--p2p-password <password>` | Password for authentication (required) |
|
|
215
168
|
| `--interval <seconds>` | Data refresh interval (default: `2`) |
|
|
216
169
|
| `--detailed` | Include detailed sensor readings |
|
|
217
|
-
|
|
218
|
-
### Server-Side Security Features
|
|
219
|
-
|
|
220
|
-
#### TLS Encryption
|
|
221
|
-
|
|
222
|
-
Enable TLS for encrypted connections between the server and clients:
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
pyre p2p server --p2p-cert /path/to/cert.pem --p2p-key /path/to/key.pem --p2p-password mysecret
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
| Option | Description |
|
|
229
|
-
|---|---|
|
|
230
|
-
| `--p2p-cert <file>` | TLS certificate file (PEM) for the server |
|
|
170
|
+
| `--p2p-cert <file>` | TLS certificate file (PEM) for encrypted connections |
|
|
231
171
|
| `--p2p-key <file>` | TLS private key file (PEM) for the server |
|
|
232
172
|
| `--p2p-ca <file>` | TLS CA certificate file (PEM) — required by clients using `--p2p-tls` |
|
|
233
|
-
|
|
234
|
-
#### Rate Limiting
|
|
235
|
-
|
|
236
|
-
Prevent brute-force password attacks by limiting authentication attempts per IP:
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
pyre p2p server --p2p-rate-limit 10 --p2p-password mysecret
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
| Option | Description |
|
|
243
|
-
|---|---|
|
|
244
173
|
| `--p2p-rate-limit <n>` | Max auth attempts per IP per minute (default: `5`) |
|
|
245
|
-
|
|
246
|
-
#### IP Allow/Deny Lists
|
|
247
|
-
|
|
248
|
-
Restrict connections to specific IPs or block known bad actors:
|
|
249
|
-
|
|
250
|
-
```bash
|
|
251
|
-
# Allow only specific IPs
|
|
252
|
-
pyre p2p server --p2p-allow 192.168.1.100,192.168.1.101 --p2p-password mysecret
|
|
253
|
-
|
|
254
|
-
# Deny specific IPs (all others allowed)
|
|
255
|
-
pyre p2p server --p2p-deny 10.0.0.99 --p2p-password mysecret
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
| Option | Description |
|
|
259
|
-
|---|---|
|
|
260
174
|
| `--p2p-allow <ips>` | Comma-separated list of allowed IPs (empty = all) |
|
|
261
175
|
| `--p2p-deny <ips>` | Comma-separated list of denied IPs |
|
|
262
|
-
|
|
263
|
-
#### Audit Logging
|
|
264
|
-
|
|
265
|
-
Log all connection events (connects, auth successes/failures, disconnects, rate limit hits, IP blocks) to a directory:
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
pyre p2p server --p2p-audit-log /var/log/pyre --p2p-password mysecret
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
| Option | Description |
|
|
272
|
-
|---|---|
|
|
273
176
|
| `--p2p-audit-log <dir>` | Directory for P2P audit logs |
|
|
274
|
-
|
|
275
|
-
#### HMAC Message Signing
|
|
276
|
-
|
|
277
|
-
All P2P messages are signed with HMAC-SHA256 to ensure integrity and authenticity. The HMAC key is derived from the password by default, but can be overridden for rotation or interoperability:
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
pyre p2p server --p2p-hmac-key my-custom-key --p2p-password mysecret
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
| Option | Description |
|
|
284
|
-
|---|---|
|
|
285
177
|
| `--p2p-hmac-key <key>` | HMAC key for message signing (default: derived from password) |
|
|
286
178
|
|
|
287
|
-
###
|
|
288
|
-
|
|
289
|
-
On the machine that will receive data:
|
|
179
|
+
### Client options
|
|
290
180
|
|
|
291
181
|
```bash
|
|
292
182
|
pyre p2p connect --p2p-host <server-ip> --p2p-port 9876 --p2p-password mysecret
|
|
293
183
|
```
|
|
294
184
|
|
|
295
|
-
The client connects to the server, authenticates with the password, and displays live system stats.
|
|
296
|
-
|
|
297
185
|
| Option | Description |
|
|
298
186
|
|---|---|
|
|
299
187
|
| `--p2p-host <host>` | Server address (default: `127.0.0.1`) |
|
|
@@ -305,9 +193,17 @@ The client connects to the server, authenticates with the password, and displays
|
|
|
305
193
|
| `--p2p-audit-log <dir>` | Directory for P2P client audit logs |
|
|
306
194
|
| `--p2p-hmac-key <key>` | HMAC key for message signing (must match server) |
|
|
307
195
|
|
|
308
|
-
###
|
|
196
|
+
### Security features
|
|
197
|
+
|
|
198
|
+
- **TLS encryption** — pass `--p2p-cert`/`--p2p-key`/`--p2p-ca` on the server and `--p2p-tls --p2p-ca` on the client for encrypted connections.
|
|
199
|
+
- **Rate limiting** — `--p2p-rate-limit <n>` caps authentication attempts per IP per minute to deter brute-force attacks.
|
|
200
|
+
- **IP allow/deny lists** — `--p2p-allow` restricts connections to specific IPs; `--p2p-deny` blocks specific IPs while allowing all others.
|
|
201
|
+
- **Audit logging** — `--p2p-audit-log <dir>` logs connects, auth successes/failures, disconnects, rate-limit hits, and IP blocks.
|
|
202
|
+
- **HMAC message signing** — every message is signed with HMAC-SHA256. The key derives from the password by default, or set `--p2p-hmac-key` explicitly for rotation or interoperability (must match on both sides).
|
|
203
|
+
|
|
204
|
+
### Same local network (LAN) setup
|
|
309
205
|
|
|
310
|
-
Both machines must be
|
|
206
|
+
Both machines must be on the same local network (same Wi-Fi or wired subnet). The server listens on `0.0.0.0` (all interfaces) by default, so any device on the LAN can reach it as long as the port is open.
|
|
311
207
|
|
|
312
208
|
On the **server machine**, find its local IP address:
|
|
313
209
|
|
|
@@ -317,7 +213,7 @@ hostname -I
|
|
|
317
213
|
ifconfig | grep "inet " | grep -v 127.0.0
|
|
318
214
|
```
|
|
319
215
|
|
|
320
|
-
Use
|
|
216
|
+
Use that IP (e.g. `192.168.1.25`) in the client command:
|
|
321
217
|
|
|
322
218
|
```bash
|
|
323
219
|
pyre p2p connect --p2p-host 192.168.1.25 --p2p-port 9876 --p2p-password mysecret
|
|
@@ -325,42 +221,40 @@ pyre p2p connect --p2p-host 192.168.1.25 --p2p-port 9876 --p2p-password mysecret
|
|
|
325
221
|
|
|
326
222
|
**Troubleshooting**
|
|
327
223
|
|
|
328
|
-
- If the client
|
|
224
|
+
- If the client can't reach the server, confirm both machines are on the same subnet (ping the server IP from the client).
|
|
329
225
|
- Verify the port is open (no local firewall blocking TCP `9876`).
|
|
330
|
-
- Never expose the server directly to the public internet; it
|
|
226
|
+
- Never expose the server directly to the public internet; it's designed for LAN use only.
|
|
331
227
|
|
|
332
|
-
###
|
|
228
|
+
### Protocol
|
|
333
229
|
|
|
334
|
-
|
|
230
|
+
Length-prefixed JSON over TCP, with HMAC-SHA256 signing on every message:
|
|
335
231
|
|
|
336
|
-
1. Client connects to the server
|
|
337
|
-
2. Server sends a `challenge` message with a random nonce
|
|
338
|
-
3. Client responds with an `auth` message containing the SHA-256 hash of `password:nonce
|
|
339
|
-
4. Server validates the hash and responds with `auth-ok` or `auth-fail
|
|
340
|
-
5. Once authenticated, the server streams `data` messages containing `StatsData` snapshots at the configured interval
|
|
341
|
-
6. Both sides exchange `ping`/`pong`
|
|
342
|
-
7. Either side can send a `disconnect` message to close gracefully
|
|
232
|
+
1. Client connects to the server.
|
|
233
|
+
2. Server sends a `challenge` message with a random nonce.
|
|
234
|
+
3. Client responds with an `auth` message containing the SHA-256 hash of `password:nonce`.
|
|
235
|
+
4. Server validates the hash and responds with `auth-ok` or `auth-fail`.
|
|
236
|
+
5. Once authenticated, the server streams `data` messages containing `StatsData` snapshots at the configured interval.
|
|
237
|
+
6. Both sides exchange `ping`/`pong` keepalives every 15 seconds.
|
|
238
|
+
7. Either side can send a `disconnect` message to close gracefully.
|
|
343
239
|
|
|
344
|
-
|
|
240
|
+
### Server controls
|
|
345
241
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
While the P2P server is running, type these commands on the server's stdin:
|
|
242
|
+
While the server is running, type these on its stdin (or press `Ctrl+C`):
|
|
349
243
|
|
|
350
244
|
| Command | Action |
|
|
351
245
|
|---|---|
|
|
352
246
|
| `status` | Print the number of currently connected peers |
|
|
353
247
|
| `q` / `quit` / `exit` | Shut down the server gracefully |
|
|
354
248
|
|
|
355
|
-
|
|
249
|
+
### Client controls
|
|
356
250
|
|
|
357
|
-
|
|
251
|
+
While connected, the client displays live stats in a formatted table. Press `Ctrl+C` to disconnect. It reconnects automatically after 3 seconds if the connection drops.
|
|
358
252
|
|
|
359
|
-
|
|
253
|
+
---
|
|
360
254
|
|
|
361
|
-
## Live Dashboard
|
|
255
|
+
## Live Dashboard
|
|
362
256
|
|
|
363
|
-
|
|
257
|
+
Run with `pyre live`.
|
|
364
258
|
|
|
365
259
|
| Key | Action |
|
|
366
260
|
|---|---|
|
|
@@ -368,30 +262,101 @@ When running `pyre live`, use these keyboard shortcuts:
|
|
|
368
262
|
| `p` | Pause / resume the refresh cycle |
|
|
369
263
|
| `d` | Toggle detailed sensor mode |
|
|
370
264
|
| `g` | Show / hide sparkline graphs |
|
|
371
|
-
| `
|
|
372
|
-
| `
|
|
265
|
+
| `b` | Cycle graph mode (sparkline ↔ bar) |
|
|
266
|
+
| `s` | Cycle sort order (CPU → memory → PID → user → command → state → threads → runtime) |
|
|
267
|
+
| `f` | Cycle export format (JSON → CSV → TSV → HTML → Markdown) |
|
|
268
|
+
| `T` | Cycle temperature unit (Celsius ↔ Fahrenheit) |
|
|
373
269
|
| `e` | Export a snapshot to the export directory |
|
|
374
270
|
| `l` | Toggle continuous CSV logging |
|
|
375
271
|
| `c` | Open the UI customizer |
|
|
376
272
|
| `/` | Open process filter |
|
|
377
273
|
| `k` | Open process kill (enter PID, then Enter to confirm) |
|
|
378
|
-
|
|
|
379
|
-
|
|
|
380
|
-
|
|
|
381
|
-
|
|
|
382
|
-
|
|
|
274
|
+
| `S` | Open signal picker for kill (cycle SIGTERM → SIGKILL → SIGINT → SIGHUP → SIGSTOP → SIGCONT) |
|
|
275
|
+
| `t` | Toggle process tree view |
|
|
276
|
+
| `r` | Toggle P2P server (or enter P2P password input) |
|
|
277
|
+
| `+` / `-` | Increase / decrease refresh interval by 1 second |
|
|
278
|
+
| `←` / `→` / `Tab` | Cycle to previous / next panel tab |
|
|
279
|
+
| `1`–`9`, `0` | Jump to panel by number (cpu, mem, gpu, power, battery, thermal, network, packets, tasks, disk) |
|
|
280
|
+
| `P` | Toggle process panel |
|
|
383
281
|
| `Esc` | Close customizer or clear filter/kill input |
|
|
384
282
|
|
|
385
283
|
### UI Customizer
|
|
386
284
|
|
|
387
|
-
Press `c` to open the customizer overlay. From there
|
|
285
|
+
Press `c` to open the customizer overlay. From there:
|
|
388
286
|
|
|
389
|
-
- Cycle through six built-in themes (Default, Dracula, Cyberpunk, Monochrome, Nord, Gruvbox)
|
|
287
|
+
- Cycle through six built-in themes (Default, Dracula, Cyberpunk, Monochrome, Nord, Gruvbox) — `↑`/`↓` or `j`/`k` to navigate, `Enter`/`Space` to select
|
|
390
288
|
- Toggle individual panels (CPU, Memory, GPU, Power, Battery, Thermal, Network, Packets, Tasks, Disk, Processes) on or off
|
|
289
|
+
- Switch graph mode between sparkline and bar charts
|
|
290
|
+
- Toggle process tree view
|
|
291
|
+
- Toggle temperature unit between Celsius and Fahrenheit
|
|
292
|
+
- Toggle notifications on or off
|
|
391
293
|
|
|
392
|
-
|
|
294
|
+
### Mouse support
|
|
295
|
+
|
|
296
|
+
- **Click tab bar** — click a panel tab (row 4) to jump directly to that panel
|
|
297
|
+
- **Scroll** — scroll through process lists in panels with many entries
|
|
298
|
+
- Enabled by default; disable with `mouseEnabled = false` in the customizer
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Process Management
|
|
303
|
+
|
|
304
|
+
Available in the live dashboard (and partially in static snapshots via flags).
|
|
305
|
+
|
|
306
|
+
### Sorting
|
|
307
|
+
|
|
308
|
+
Press `s` to cycle through sort modes, or use `--sort <key>` in static snapshot mode (default: `cpu`):
|
|
393
309
|
|
|
394
|
-
|
|
310
|
+
| Sort key | Description |
|
|
311
|
+
|---|---|
|
|
312
|
+
| `cpu` | Sort by CPU usage (descending) |
|
|
313
|
+
| `mem` | Sort by memory usage (descending) |
|
|
314
|
+
| `pid` | Sort by process ID |
|
|
315
|
+
| `user` | Sort by username |
|
|
316
|
+
| `command` | Sort by command name |
|
|
317
|
+
| `state` | Sort by process state |
|
|
318
|
+
| `threads` | Sort by thread count |
|
|
319
|
+
| `runtime` | Sort by total runtime |
|
|
320
|
+
|
|
321
|
+
### Filtering
|
|
322
|
+
|
|
323
|
+
Press `/` to open a process filter and type a substring to narrow the list. Press `Esc` to clear it.
|
|
324
|
+
|
|
325
|
+
### Tree view
|
|
326
|
+
|
|
327
|
+
Press `t` to toggle between a flat process list and a tree view showing parent/child relationships. In static snapshot mode, use `--tree`.
|
|
328
|
+
|
|
329
|
+
### Killing processes
|
|
330
|
+
|
|
331
|
+
Press `k` to enter kill mode: type the PID, then press `Enter` to send `SIGTERM` (default), or `Esc` to cancel.
|
|
332
|
+
|
|
333
|
+
### Signal picker
|
|
334
|
+
|
|
335
|
+
Press `S` to open the signal picker. Cycle with `↑`/`↓` or `j`/`k`, then `Enter` to send the selected signal to the PID entered in kill mode:
|
|
336
|
+
|
|
337
|
+
| Signal | Description |
|
|
338
|
+
|---|---|
|
|
339
|
+
| `SIGTERM` | Graceful termination (default) |
|
|
340
|
+
| `SIGKILL` | Force kill |
|
|
341
|
+
| `SIGINT` | Interrupt (Ctrl+C equivalent) |
|
|
342
|
+
| `SIGHUP` | Hangup |
|
|
343
|
+
| `SIGSTOP` | Stop (pause) the process |
|
|
344
|
+
| `SIGCONT` | Continue a stopped process |
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Alerts & Notifications
|
|
349
|
+
|
|
350
|
+
The live dashboard monitors critical metrics and notifies you when thresholds are exceeded:
|
|
351
|
+
|
|
352
|
+
| Metric | Default threshold | Alert behavior |
|
|
353
|
+
|---|---|---|
|
|
354
|
+
| CPU usage | 90% | Terminal bell (`\x07`) + red status message for 5 seconds + desktop notification |
|
|
355
|
+
| CPU temperature | 95°C | Terminal bell + red status message for 5 seconds + desktop notification |
|
|
356
|
+
|
|
357
|
+
Alerts fire once when a threshold is first crossed and reset when conditions clear. Thresholds are configurable via `--alert-cpu` and `--alert-temp`, or in the config file (`cpuAlertPct` and `tempAlertC` in `~/.config/pyre/config.json`).
|
|
358
|
+
|
|
359
|
+
## Themes
|
|
395
360
|
|
|
396
361
|
| Theme | Description |
|
|
397
362
|
|---|---|
|
|
@@ -402,30 +367,32 @@ Six built-in visual themes are available in the live dashboard:
|
|
|
402
367
|
| **nord** | Arctic-inspired cool tones |
|
|
403
368
|
| **gruvbox** | Retro warm palette |
|
|
404
369
|
|
|
405
|
-
|
|
370
|
+
Cycle themes with `c` in the customizer overlay, or set a default with `--theme <name>`.
|
|
406
371
|
|
|
407
372
|
## Export Formats
|
|
408
373
|
|
|
409
|
-
### Snapshot export
|
|
374
|
+
### Snapshot export
|
|
410
375
|
|
|
411
|
-
|
|
376
|
+
Triggered by the `e` key in live mode, or the `--out` flag. Written to the export directory (`./pyre-exports` by default):
|
|
412
377
|
|
|
413
378
|
```
|
|
414
379
|
pyre-2026-07-26T10-54-47-191Z.json
|
|
415
380
|
pyre-2026-07-26T10-54-52-306Z.csv
|
|
381
|
+
pyre-2026-07-26T10-54-52-306Z.html
|
|
382
|
+
pyre-2026-07-26T10-54-52-306Z.md
|
|
416
383
|
```
|
|
417
384
|
|
|
418
|
-
|
|
385
|
+
Format follows the current export format — cycle with `f` in live mode, or set via `--json`, `--csv`, `--tsv`, `--html`, `--md` in static mode.
|
|
419
386
|
|
|
420
|
-
### Continuous CSV logging
|
|
387
|
+
### Continuous CSV logging
|
|
421
388
|
|
|
422
|
-
|
|
389
|
+
Triggered by the `l` key in live mode, or the `--log` flag. Each tick appends a row to a timestamped file. Old logs are automatically rotated (max 20 files or 50 MB, files older than 7 days are pruned):
|
|
423
390
|
|
|
424
391
|
```
|
|
425
392
|
pyre-log-2026-07-26T10-54-47-191Z.csv
|
|
426
393
|
```
|
|
427
394
|
|
|
428
|
-
|
|
395
|
+
Row format:
|
|
429
396
|
|
|
430
397
|
```
|
|
431
398
|
timestamp,cpu_usage,mem_usage_percent,temp_c,net_rx_bytes,net_tx_bytes,net_rx_packets,net_tx_packets,connections,thermal_state
|
|
@@ -454,8 +421,7 @@ pyre/
|
|
|
454
421
|
│ │ ├── output.ts # JSON/CSV/TSV serialisation and sparkline graphs
|
|
455
422
|
│ │ ├── render.ts # Dashboard table layout, cards, and panels
|
|
456
423
|
│ │ ├── themes.ts # Six built-in colour themes
|
|
457
|
-
│ │
|
|
458
|
-
│ │ └── types.ts # Public-facing type definitions
|
|
424
|
+
│ │ └── types.ts # TableOptions, VisibleItems, ThemeName, and other public-facing type definitions
|
|
459
425
|
│ ├── live/ # Interactive live dashboard
|
|
460
426
|
│ │ ├── index.ts # Public API: startLive, stopLive
|
|
461
427
|
│ │ ├── state.ts # Shared mutable session state
|
|
@@ -491,38 +457,14 @@ cd pyre
|
|
|
491
457
|
npm install
|
|
492
458
|
```
|
|
493
459
|
|
|
494
|
-
### Build
|
|
495
|
-
|
|
496
|
-
```bash
|
|
497
|
-
npm run build
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
This uses `tsup` to compile TypeScript to ESM in `dist/`.
|
|
501
|
-
|
|
502
|
-
### Run in dev mode
|
|
503
|
-
|
|
504
|
-
```bash
|
|
505
|
-
npm run dev
|
|
506
|
-
```
|
|
507
|
-
|
|
508
|
-
Runs the CLI directly via `tsx` without a build step.
|
|
509
|
-
|
|
510
|
-
### Test
|
|
511
|
-
|
|
512
|
-
```bash
|
|
513
|
-
npm test
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
Verifies the built binary runs and responds to `--help`.
|
|
517
|
-
|
|
518
460
|
### Scripts
|
|
519
461
|
|
|
520
462
|
| Script | Description |
|
|
521
463
|
|---|---|
|
|
522
|
-
| `build` | Compile TypeScript to ESM via tsup |
|
|
523
|
-
| `start` | Run the built binary from `dist/` |
|
|
524
|
-
| `dev` | Run directly via tsx (no build step) |
|
|
525
|
-
| `test` | Verify the built binary responds to `--help` |
|
|
464
|
+
| `npm run build` | Compile TypeScript to ESM via tsup, output to `dist/` |
|
|
465
|
+
| `npm start` | Run the built binary from `dist/` |
|
|
466
|
+
| `npm run dev` | Run directly via `tsx` (no build step) |
|
|
467
|
+
| `npm test` | Verify the built binary responds to `--help` |
|
|
526
468
|
|
|
527
469
|
## License
|
|
528
470
|
|