DEV Community

Cover image for Your Mac, lit up with data.
Pranav Somalinga
Pranav Somalinga

Posted on

Your Mac, lit up with data.

Meet Pyre: The Ultimate Mac System Monitoring CLI for Power Users


Hey devs! 👋

Ever wished you could monitor your Mac’s vitals—CPU, GPU, memory, disk, network, power draw, and even thermal states—all from the comfort of your terminal? Or maybe you’ve wanted to stream live system stats to another machine securely, or even benchmark your system’s performance with a single command?

If so, I’ve got something for you: Pyre.


Why Pyre?

Pyre is a feature-packed, real-time system monitoring CLI for macOS. It’s designed for power users, developers, and sysadmins who want deep insights into their system’s performance without leaving the terminal. Whether you’re debugging a slow app, monitoring a remote server, or just curious about your Mac’s health, Pyre has you covered.


Key Features

1. Real-Time System Stats

  • CPU: Brand, cores, frequency, load, and per-core utilization (with mini-bars!).
  • GPU: Model, VRAM usage, temperature, and process count.
  • Memory: Usage, swap, pressure levels, and kernel VM stats.
  • Disk: Read/write speeds, mounted volumes, and space usage.
  • Battery: Health, charge cycles, power source, and estimated time to empty.
  • Network: RX/TX bytes, packet rates, and active TCP connections.
  • Thermal: CPU temperature (via pmset and powermetrics).
  • Power Draw: CPU/GPU watts and combined power consumption.

2. Interactive Live Dashboard

  • Full-screen TUI with keyboard controls, mouse support, and configurable layouts.
  • Tab-based navigation to switch between panels (CPU, memory, GPU, etc.).
  • Graph modes: Toggle between sparklines and bar graphs.
  • Themes: 6 built-in themes (Default, Dracula, Cyberpunk, Monochrome, Nord, Gruvbox) + custom JSON themes.

3. P2P Live Data Streaming

  • Securely stream live stats to another Mac over TCP.
  • Authentication: Password-protected with TLS encryption.
  • Rate limiting, IP allow/deny lists, and HMAC message signing for security.
  • Audit logging to track connections and anomalies.

4. Alerts & Notifications

  • Configurable thresholds for CPU usage, temperature, etc.
  • Terminal bell, desktop notifications, and webhook support (e.g., Slack, Discord).
  • Custom shell commands on alert triggers.

5. Export & Logging

  • Snapshot exports: JSON, CSV, TSV, HTML, or Markdown.
  • Continuous CSV logging for long-term analysis.
  • Anomaly detection: Statistical spike analysis (pyre anomalies).

6. Benchmarking & Diagnostics

  • Micro-benchmarking: Measure resource usage and estimate energy cost (kWh) for any command.
  • CPU benchmark: 1-minute stress test calculating digits of π.
  • System diagnostics: Check permissions, SMC access, Gatekeeper, SIP status, and more (pyre doctor).

7. Remote & Multi-Host Monitoring

  • SSH monitoring: Stream live stats from a remote Mac (pyre ssh <host>).
  • Fleet dashboard: Monitor multiple Macs simultaneously (pyre fleet).
  • Web dashboard: Auto-refreshing HTML dashboard with real-time SSE streaming (pyre web).

8. Extensibility

  • Grafana integration: Import a ready-to-use dashboard template.
  • Menu bar integration: Generate an xbar/SwiftBar plugin for background monitoring.
  • Persistent config: Save themes, thresholds, and profiles in ~/.config/pyre/.

Getting Started

Installation

# Via npm
npm install -g pyre-cli

# Or via curl
curl -fsSL https://raw.githubusercontent.com/somalip/pyre/main/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Basic Usage

# Static snapshot of all system stats
pyre

# Detailed mode (includes sensor/powermetrics data)
pyre --detailed

# JSON/CSV/HTML/Markdown output
pyre --json
pyre --csv
pyre --html

# Launch the interactive live dashboard
pyre live

# Start a P2P server (default port: 9876, password: mysecret)
pyre p2p server --p2p-port 9876 --p2p-password mysecret

# Connect to a P2P server
pyre p2p connect --p2p-host <server-ip> --p2p-port 9876 --p2p-password mysecret

# Run a 1-minute CPU benchmark
pyre benchmark

# Check system diagnostics
pyre doctor
Enter fullscreen mode Exit fullscreen mode

Live Dashboard Controls

Key Action
q Quit
p Pause/resume refresh
d Toggle detailed sensor mode
g Toggle sparkline graphs
s Cycle sort order (CPU, memory, etc.)
t Toggle process tree view
k Kill a process (enter PID)
r Toggle P2P server
1-0 Jump to panel (CPU, memory, GPU, etc.)

Why I Built Pyre

I wanted a single tool that could replace a dozen others—something that was fast, scriptable, and packed with features without sacrificing usability. Whether you’re a developer optimizing an app, a sysadmin monitoring a fleet of Macs, or just a curious tinkerer, Pyre gives you the data you need, when you need it.


Customization & Themes

Pyre supports 6 built-in themes and custom JSON themes. To add your own:

  1. Create a JSON file in ~/.config/pyre/themes/.
  2. Define colors for panels, graphs, and alerts.
  3. Load it with --theme <your-theme>.

Example theme snippet:

{
  "name": "My Theme",
  "colors": {
    "cpu": "#FF5733",
    "memory": "#33FF57",
    "gpu": "#3357FF"
  }
}
Enter fullscreen mode Exit fullscreen mode

Grafana Integration

Pyre includes a pre-built Grafana dashboard template (grafana/pyre-dashboard.json). Import it into Grafana to visualize your system stats in real time.


Contributing

Pyre is open-source and welcoming contributions! Check out the CONTRIBUTING.md for guidelines. Whether it’s bug reports, feature requests, or PRs, your input is valuable.


What’s Next?

  • More integrations: Prometheus, InfluxDB, and more.
  • Windows/Linux support: Currently macOS-only, but cross-platform is on the roadmap.
  • Plugin system: Extend Pyre with custom modules.

Final Thoughts

Pyre is more than just a monitoring tool—it’s a Swiss Army knife for macOS system insights. Whether you’re debugging, benchmarking, or just exploring, it’s designed to save you time and give you control.

Try it out, and let me know what you think!


GitHub: https://github.com/somalip/pyre
Issues/Feature Requests: Open an issue on GitHub!
License: MIT


What’s your favorite Pyre feature? Or is there something you’d love to see added? Drop a comment below! 👇

Top comments (0)