pyre-cli 1.4.0 → 3.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 +78 -11
- package/dist/index.js +1325 -33
- package/package.json +2 -2
- package/src/formatters/index.ts +1 -1
- package/src/formatters/output.ts +47 -19
- package/src/formatters/render.ts +207 -16
- package/src/formatters/types.ts +4 -0
- package/src/history.ts +85 -47
- package/src/index.ts +200 -20
- package/src/live/export.ts +5 -2
- package/src/live/input.ts +296 -164
- package/src/live/render.ts +32 -28
- package/src/live/state.ts +41 -21
- package/src/monitors/collectors.ts +220 -17
- package/src/monitors/index.ts +2 -2
- package/src/monitors/types.ts +42 -1
- package/src/p2p/client.ts +271 -0
- package/src/p2p/index.ts +3 -0
- package/src/p2p/protocol.ts +112 -0
- package/src/p2p/server.ts +390 -0
- package/src/p2p/types.ts +97 -0
package/README.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
# pyre
|
|
2
2
|
|
|
3
|
-
Mac system monitoring CLI: temps, CPU, memory, disk, battery, live dashboard, and
|
|
3
|
+
Mac system monitoring CLI: temps, CPU, memory, disk, battery, live dashboard, packet monitor, battery predictor, export, and P2P live data streaming.
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|

|
|
7
7
|

|
|
8
8
|

|
|
9
9
|
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
|
+
- **P2P live data streaming** — send live system stats to another system over TCP with password authentication
|
|
12
13
|
- **Real-time system stats** — CPU brand, cores, frequency, load, and usage
|
|
13
14
|
- **Memory monitoring** — usage, swap, and total/available
|
|
14
15
|
- **Disk space** — mounted volume usage
|
|
15
|
-
- **Battery & power** — level, power source, condition, charge cycles, max capacity
|
|
16
|
+
- **Battery & power** — level, power source, condition, charge cycles, max capacity, estimated time to empty, discharge rate, power draw in watts
|
|
17
|
+
- **Packet monitor** — network packet counts, packet rates, active TCP connections, top network processes
|
|
18
|
+
- **Task list** — running tasks/applications sorted by CPU with PID, user, memory, state, and runtime
|
|
16
19
|
- **Thermal state** — CPU temperature via `pmset` and `powermetrics` (sudo for detailed readings)
|
|
17
20
|
- **Network** — RX/TX bytes and per-second rates
|
|
18
21
|
- **Top processes** — sorted by CPU, memory, or PID with live filtering
|
|
@@ -38,7 +41,6 @@ curl -fsSL https://raw.githubusercontent.com/somalip/pyre/main/install.sh | bash
|
|
|
38
41
|
### Homebrew
|
|
39
42
|
|
|
40
43
|
```bash
|
|
41
|
-
brew tap somalip/tap
|
|
42
44
|
brew install pyre
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -54,6 +56,7 @@ pyre --csv # CSV export
|
|
|
54
56
|
pyre --tsv # TSV export
|
|
55
57
|
pyre --once # Single static snapshot (same as default without live)
|
|
56
58
|
pyre --out report.json # Also write output to a file
|
|
59
|
+
pyre --packets # Include packet monitor panel
|
|
57
60
|
```
|
|
58
61
|
|
|
59
62
|
### Live dashboard
|
|
@@ -80,6 +83,62 @@ pyre live --interval 5 --log # Custom interval with auto-logging
|
|
|
80
83
|
| `--out <file>` | Write snapshot output to a file |
|
|
81
84
|
| `--export-dir <dir>` | Directory for live-mode snapshot exports and logs (default: `./pyre-exports`) |
|
|
82
85
|
| `--log` | Start continuous CSV logging immediately when live mode starts |
|
|
86
|
+
| `--packets` | Include packet monitor panel in static output |
|
|
87
|
+
|
|
88
|
+
## P2P Live Data Streaming
|
|
89
|
+
|
|
90
|
+
Send live system stats to another system over a TCP connection with password authentication.
|
|
91
|
+
|
|
92
|
+
### Start a P2P server (host)
|
|
93
|
+
|
|
94
|
+
On the machine that will send data:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pyre p2p server --p2p-host 0.0.0.0 --p2p-port 9876 --p2p-password mysecret
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The server binds to the specified host and port, and streams live system stats to any authenticated peer.
|
|
101
|
+
|
|
102
|
+
| Option | Description |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `--p2p-host <host>` | Bind address (default: `0.0.0.0`) |
|
|
105
|
+
| `--p2p-port <port>` | Port number (default: `9876`) |
|
|
106
|
+
| `--p2p-password <password>` | Password for authentication (required) |
|
|
107
|
+
| `--interval <seconds>` | Data refresh interval (default: `2`) |
|
|
108
|
+
| `--detailed` | Include detailed sensor readings |
|
|
109
|
+
|
|
110
|
+
### Connect a P2P client (peer)
|
|
111
|
+
|
|
112
|
+
On the machine that will receive data:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
pyre p2p connect --p2p-host <server-ip> --p2p-port 9876 --p2p-password mysecret
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The client connects to the server, authenticates with the password, and displays live system stats.
|
|
119
|
+
|
|
120
|
+
| Option | Description |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `--p2p-host <host>` | Server address (default: `127.0.0.1`) |
|
|
123
|
+
| `--p2p-port <port>` | Server port (default: `9876`) |
|
|
124
|
+
| `--p2p-password <password>` | Password for authentication (required) |
|
|
125
|
+
|
|
126
|
+
### P2P Protocol
|
|
127
|
+
|
|
128
|
+
The P2P connection uses a length-prefixed JSON protocol over TCP:
|
|
129
|
+
|
|
130
|
+
1. Client connects to the server
|
|
131
|
+
2. Client sends an `auth` message with the password
|
|
132
|
+
3. Server validates the password and responds with `auth-ok` or `auth-fail`
|
|
133
|
+
4. Once authenticated, the server streams `data` messages containing `StatsData` snapshots at the configured interval
|
|
134
|
+
5. Both sides exchange `ping`/`pong` keepalive messages every 15 seconds
|
|
135
|
+
6. Either side can send a `disconnect` message to close gracefully
|
|
136
|
+
|
|
137
|
+
### P2P Controls
|
|
138
|
+
|
|
139
|
+
While connected, the client displays live system stats in a formatted table. Press `Ctrl+C` to disconnect.
|
|
140
|
+
|
|
141
|
+
On the server, type `status` to see the number of connected peers, or `q`/`quit`/`exit` to shut down.
|
|
83
142
|
|
|
84
143
|
## Live Dashboard Controls
|
|
85
144
|
|
|
@@ -109,12 +168,12 @@ When running `pyre live`, use these keyboard shortcuts:
|
|
|
109
168
|
|
|
110
169
|
Press `c` to open the customizer overlay. From there you can:
|
|
111
170
|
|
|
112
|
-
- Cycle through
|
|
113
|
-
- Toggle individual panels (CPU, Memory, Power, Battery, Thermal, Network, Disk, Processes) on or off
|
|
171
|
+
- Cycle through six built-in themes (Default, Dracula, Cyberpunk, Monochrome, Nord, Gruvbox)
|
|
172
|
+
- Toggle individual panels (CPU, Memory, GPU, Power, Battery, Thermal, Network, Packets, Tasks, Disk, Processes) on or off
|
|
114
173
|
|
|
115
174
|
## Themes
|
|
116
175
|
|
|
117
|
-
|
|
176
|
+
Six built-in visual themes are available in the live dashboard:
|
|
118
177
|
|
|
119
178
|
| Theme | Description |
|
|
120
179
|
|---|---|
|
|
@@ -122,6 +181,8 @@ Four built-in visual themes are available in the live dashboard:
|
|
|
122
181
|
| **dracula** | The popular Dracula dark palette |
|
|
123
182
|
| **cyberpunk** | High-contrast neon on black |
|
|
124
183
|
| **monochrome** | White-only; useful for colour-blind users or terminals without 256-colour support |
|
|
184
|
+
| **nord** | Arctic-inspired cool tones |
|
|
185
|
+
| **gruvbox** | Retro warm palette |
|
|
125
186
|
|
|
126
187
|
Themes are cycled with `c` in the customizer overlay.
|
|
127
188
|
|
|
@@ -149,7 +210,7 @@ pyre-log-2026-07-26T10-54-47-191Z.csv
|
|
|
149
210
|
Each row contains:
|
|
150
211
|
|
|
151
212
|
```
|
|
152
|
-
timestamp,cpu_usage,mem_usage_percent,temp_c,net_rx_bytes,net_tx_bytes,thermal_state
|
|
213
|
+
timestamp,cpu_usage,mem_usage_percent,temp_c,net_rx_bytes,net_tx_bytes,net_rx_packets,net_tx_packets,connections,thermal_state
|
|
153
214
|
```
|
|
154
215
|
|
|
155
216
|
## Requirements
|
|
@@ -164,8 +225,8 @@ timestamp,cpu_usage,mem_usage_percent,temp_c,net_rx_bytes,net_tx_bytes,thermal_s
|
|
|
164
225
|
pyre/
|
|
165
226
|
├── src/
|
|
166
227
|
│ ├── index.ts # CLI entry point (commander definitions, main())
|
|
167
|
-
│ ├── monitors/ # System metric collection (CPU, memory, disk, battery, thermal, network)
|
|
168
|
-
│ │ ├── index.ts # Public API: collectAll, collectPower
|
|
228
|
+
│ ├── monitors/ # System metric collection (CPU, memory, disk, battery, thermal, network, packets, power, tasks)
|
|
229
|
+
│ │ ├── index.ts # Public API: collectAll, collectPower, collectPackets, collectTasks
|
|
169
230
|
│ │ ├── types.ts # TypeScript interfaces for all metric types
|
|
170
231
|
│ │ ├── smc.ts # SMC sensor reading with caching
|
|
171
232
|
│ │ ├── collectors.ts # Individual metric collectors and orchestrator
|
|
@@ -174,7 +235,7 @@ pyre/
|
|
|
174
235
|
│ │ ├── index.ts # Public API: formatTable, formatJson, formatCsv, formatTsv, formatGraphs
|
|
175
236
|
│ │ ├── output.ts # JSON/CSV/TSV serialisation and sparkline graphs
|
|
176
237
|
│ │ ├── render.ts # Dashboard table layout, cards, and panels
|
|
177
|
-
│ │ ├── themes.ts #
|
|
238
|
+
│ │ ├── themes.ts # Six built-in colour themes
|
|
178
239
|
│ │ ├── types.ts # TableOptions, VisibleItems, ThemeName
|
|
179
240
|
│ │ └── types.ts # Public-facing type definitions
|
|
180
241
|
│ ├── live/ # Interactive live dashboard
|
|
@@ -184,6 +245,12 @@ pyre/
|
|
|
184
245
|
│ │ ├── render.ts # Screen rendering and alert checking
|
|
185
246
|
│ │ ├── export.ts # Snapshot export and CSV logging
|
|
186
247
|
│ │ └── types.ts # LiveOptions, ExportFormat, InputMode, SortMode
|
|
248
|
+
│ ├── p2p/ # P2P live data streaming (server + client)
|
|
249
|
+
│ │ ├── index.ts # Public API: P2PServer, P2PClient
|
|
250
|
+
│ │ ├── types.ts # P2P protocol type definitions
|
|
251
|
+
│ │ ├── protocol.ts # Length-prefixed JSON message framing
|
|
252
|
+
│ │ ├── server.ts # TCP server that authenticates and streams stats
|
|
253
|
+
│ │ └── client.ts # TCP client that connects and displays live data
|
|
187
254
|
│ ├── history.ts # Rolling history buffer for sparkline data
|
|
188
255
|
│ ├── sparkline.ts # ASCII sparkline rendering
|
|
189
256
|
│ └── utils/ # Shared utility functions
|