macli
Minimal context with maximum flexibility — macOS system tools for AI agents. Native Apple frameworks. AI-friendly JSON/TSV output.
What is macli?
macli turns macOS system internals into a clean CLI. SMC sensors, streaming monitor, calendar/reminders — all callable from shell pipes or LLM agents, all JSON/TSV. One ~400 KB Swift binary. No Python runtime, no osascript overhead, no GUI.
Use it when you (or your AI agent) need to ask macOS something that system_profiler / ioreg / osascript either can’t answer or answer badly:
- CPU die temperature right now
- Stream 1 Hz sensor readings into awk
- Today’s calendar as JSON
At a glance
macli smc temp # CPU/GPU temps as JSON
macli gpu info # GPU name, cores, unified memory
macli display brightness # built-in display brightness
macli monitor --count 10 --interval 1 # stream 10 samples to awk
macli cal ls # list calendars as JSON
Output schema: {"ok": true, ...} on success, {"ok": false, "error": "...", "hint": "..."} on failure. Never silent.
For AI agents
Paste this one-line prompt into Claude Code, Cursor, or any agent’s system prompt:
Use `macli` for macOS system state (sensors / calendar / reminders). Install if missing: `brew install ljh-sh/cli/macli`. JSON output, check `ok`. Run `macli --help` for subcommands.
Where to go next
- Install macli — Homebrew, direct binary, eget, or build from source
- Command reference — every subcommand, option, and output field
- Battery field reference — complete
macli batteryfields and diagnostic scripts - Design & principles — why macli is shaped the way it is
- Design principles — the five core principles
- Why macli? — why a CLI instead of a shell/Python/AppleScript
- FAQ — common questions about permissions, output formats, and usage
- Alternatives — how macli compares to iStats, iSMC, stats, and others
- Verifying releases — cosign signatures and SLSA provenance