Get the FREE Ultimate OpenClaw Setup Guide →

machealth

npx machina-cli add skill lu-zhengda/macos-toolkit/machealth --openclaw
Files (1)
SKILL.md
2.9 KB

machealth — macOS System Health Checker

Run a one-shot health assessment:

!machealth --human 2>&1 || echo "machealth not installed — brew install lu-zhengda/tap/machealth"

Analyze the output above. Report the overall health score and status (green/yellow/red). Flag any subsystems that are degraded or critical. Offer to run machealth diagnose --human for actionable recommendations or machealth watch --human for continuous monitoring.

Commands

CommandPurposeExample
machealthOne-shot health assessment (JSON)machealth
machealth checkSame as default (explicit)machealth check
machealth --humanHuman-readable health reportmachealth --human
machealth diagnoseHealth check with actionable recommendations (JSON)machealth diagnose
machealth diagnose --humanHuman-readable diagnose outputmachealth diagnose --human
machealth watchContinuous monitoring (JSON Lines)machealth watch --interval 10s
machealth watch --humanLive terminal dashboardmachealth watch --human

Monitored Subsystems

SubsystemWeightMetrics
CPU20%Load averages, per-core utilization
Memory25%Memory pressure, swap usage
Thermal20%CPU speed limit, throttling detection
Disk15%Available space, usage percentage
Battery10%Charge level, power source, health
iCloud5%Sync status
Network5%Reachability, active interface
Time Machine0%Backup state (informational only)

Exit Codes

CodeStatusScore Range
0Healthy (green)80-100
1Degraded (yellow)50-79
2Critical (red)0-49

JSON Output

All commands output JSON by default. Use --human for human-readable format:

machealth                    # JSON output
machealth --human            # Human-readable output
machealth diagnose           # JSON with recommendations
machealth diagnose --human   # Human-readable recommendations

Safety Guidelines

  • Read-only: All commands are non-destructive — they only read system metrics
  • Low overhead: Health checks are lightweight and safe to run frequently
  • Watch mode: Continuous monitoring exits cleanly on Ctrl+C

Source

git clone https://github.com/lu-zhengda/macos-toolkit/blob/main/skills/machealth/SKILL.mdView on GitHub

Overview

machealth performs a one-shot health assessment on macOS, returning an overall health score and a green/yellow/red status. It flags degraded or critical subsystems and can provide actionable guidance via diagnose or continuous monitoring via watch. By default, outputs are JSON, with --human offering a readable report.

How This Skill Works

On invocation, machealth analyzes monitored subsystems (CPU, Memory, Thermal, Disk, Battery, iCloud, Network, Time Machine) and aggregates their metrics into a 0–100 health score with a color status. It supports JSON output by default and has modes for human-readable reports (--human), actionable recommendations (diagnose), and continuous monitoring (watch).

When to Use It

  • When you want a quick, all-in-one health snapshot after suspecting performance issues
  • To verify CPU load, memory pressure, thermal throttling, or disk space health
  • To confirm iCloud sync status or Time Machine backup state
  • When diagnosing system issues and identifying degraded or critical subsystems
  • For ongoing monitoring with machealth watch for proactive maintenance

Quick Start

  1. Step 1: Run machealth to get a one-shot health assessment (default JSON)
  2. Step 2: If the score is not green, run machealth diagnose for actionable recommendations
  3. Step 3: For ongoing visibility, start machealth watch --human or machealth watch --interval <seconds>

Best Practices

  • Run machealth first to establish a baseline health score
  • Use machealth --human for quick interpretation and triage
  • If a subsystem is degraded or critical, run machealth diagnose for actionable guidance
  • Combine with watch for continuous monitoring on mission-critical Macs
  • Keep backups and power sources consistent; watch will reflect changes in real-time

Example Use Cases

  • machealth outputs a JSON object with score and status when you run it
  • machealth --human presents a readable health report highlighting degraded subsystems
  • machealth diagnose provides JSON with recommendations
  • machealth watch --human runs a live dashboard
  • machealth watch --interval 10s runs continuous checks with a 10-second cadence

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers