mactop
/install mactop
Mactop Skill
Execute mactop in headless TOON mode and parse the output for hardware metrics.
Prerequisites
- mactop installed:
brew install mactop - PATH includes /usr/sbin: Required for sysctl access
Usage
Get Full Metrics
mactop --format toon --headless --count 1
Parse Key Metrics
CPU Usage:
mactop --format toon --headless --count 1 | grep "^cpu_usage:" | awk '{print $2}'
RAM (used/total GB):
mactop --format toon --headless --count 1 | grep -E "^ (Used|Total):" | awk '{printf "%.1f", $2/1073741824}'
GPU Usage:
mactop --format toon --headless --count 1 | grep "^gpu_usage:" | awk '{print $2}'
Power (total/CPU/GPU):
mactop --format toon --headless --count 1 | grep -E "^ (TotalPower|CPUPower|GPUPower):" | awk '{print $2}'
Thermal State:
mactop --format toon --headless --count 1 | grep "^thermal_state:" | awk '{print $2}'
Temperature:
mactop --format toon --headless --count 1 | grep "^ SocTemp:" | awk '{print $2}'
Chip Info:
mactop --format toon --headless --count 1 | grep "^ Name:" | awk '{print $2}'
Network I/O (bytes/sec):
mactop --format toon --headless --count 1 | grep -E "^( InBytesPerSec| OutBytesPerSec):" | awk '{print $2}'
Thunderbolt Buses:
mactop --format toon --headless --count 1 | grep "^ Name:" | awk '{print $2}'
Options
| Option | Description |
|---|---|
--count N |
Number of samples (default: 1) |
--interval MS |
Sample interval in milliseconds (default: 1000) |
TOON Format
timestamp: "2026-01-25T20:00:00-07:00"
soc_metrics:
CPUPower: 0.15
GPUPower: 0.02
TotalPower: 8.5
SocTemp: 42.3
memory:
Total: 25769803776
Used: 14852408320
Available: 10917395456
cpu_usage: 5.2
gpu_usage: 1.8
thermal_state: Normal
system_info:
Name: Apple M4 Pro
CoreCount: 12
Response Example
Format metrics in a readable box:
┌─ Apple M4 Pro ──────────────────────┐
│ CPU: 5.2% | RAM: 13.8/24.0 GB │
│ GPU: 1.8% | Power: 8.5W total │
│ Thermal: Normal | SoC: 42.3°C │
└─────────────────────────────────────┘
Troubleshooting
- "sysctl not found" → Add
/usr/sbinto PATH - No output → Verify mactop is installed:
which mactop
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install mactop - 安装完成后,直接呼叫该 Skill 的名称或使用
/mactop触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
mactop 是什么?
Retrieve real-time hardware metrics from Apple Silicon Macs using mactop's TOON format. Provides CPU, RAM, GPU, power, thermal, network, disk I/O, and Thunderbolt bus information. Use when the user wants system stats, hardware monitoring, or performance metrics on Apple Silicon Macs. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2301 次。
如何安装 mactop?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install mactop」即可一键安装,无需额外配置。
mactop 是免费的吗?
是的,mactop 完全免费(开源免费),可自由下载、安装和使用。
mactop 支持哪些平台?
mactop 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 mactop?
由 metaspartan(@metaspartan)开发并维护,当前版本 v1.0.1。