lmtop
lmtop is a cross-platform host resource monitor (CPU, memory, disk, network) that runs as a non-interactive newline-delimited JSON server over stdio. It continuously samples 24 lmdebug-aligned metrics into a bounded in-memory ring buffer and answers status, now, history, summary, and stop queries.
Quick reference
lmtop --help
lmtop client status
lmtop client now
lmtop client summary '{"seconds": 60}'
| Interface or flag | Signature or syntax | Purpose |
|---|---|---|
| Server mode (default) | lmtop [server] [--interval MS] [--cap-mb N] | Start the background sampling thread and serve newline-delimited JSON requests on stdin/stdout. |
| Client one-shot mode | lmtop client [--id N] [--interval MS] <method> [params-json] | Spawn a private server, wait for one sample window, run a single query, and stop the server cleanly. |
| Client FIFO mode (POSIX) | lmtop client [--id N] --in PATH --out PATH <method> [params-json] | Send a request with a fresh id to a long-lived supervised server over named pipes. |
| status method | {"id":1,"method":"status"} | Return protocol tag (lmtop/1), PID, hostname, platform, uptime, sample counts, missed ticks, and 24-metric catalog. |
| now method | {"id":2,"method":"now"} | Return the newest sample timestamp, measured dt_s, cpu_count, per-group health status, and all 24 metric values. |
| history method | {"id":3,"method":"history","params":{"seconds":60,"max_points":60}} | Return time-series columns and downsampled rows over the requested window (always preserving the newest sample). |
| summary method | {"id":4,"method":"summary","params":{"seconds":300}} | Compute per-metric n, min, mean, median, p95, p99, max, stddev (Welford), first, and last over the window. |
| stop method | {"id":5,"method":"stop"} | Acknowledge with {"stopping":true} and terminate the server loop cleanly with exit code 0. |
# Query a live sample and summary over stdio NDJSON
printf '{"id":1,"method":"status"}\n{"id":2,"method":"now"}\n{"id":3,"method":"stop"}\n' | lmtop server --interval 200
# Or run a one-shot client query
lmtop client --interval 200 now
Documentation pages
- Skill — agent authoring rules, server and client commands, memory and sampling bounds, exit codes, and verification steps.
- Guide — stdio NDJSON protocol, platform backends (Linux procfs, Windows PDH, macOS Mach/IOKit), disk deduplication, and window statistics.
- Reference — complete CLI flags, NDJSON request and response schemas, all 24 metric definitions, and exit codes.