Frequently Asked Questions

What is macli and why not just use system_profiler / ioreg / osascript?

macli is a small Swift CLI that turns macOS system internals into clean, parseable output. SMC sensors, battery/SSD health, display brightness, calendar/reminders — all JSON or TSV, all callable from shell pipes or LLM agents.

system_profiler, ioreg, and osascript can expose some of the same data, but they are not built for automation:

macli links native frameworks directly (IOKit, HID, EventKit, Metal, DisplayServices), requests permissions once, and returns stable JSON/TSV.

Why does macli need permissions?

No sudo is required for any macli command.

Why must I run it from Terminal.app / iTerm / Warp instead of a bare CLI process?

macOS TCC grants permissions to the parent application, not the binary itself. If you run macli cal ls from a bare subprocess, an SSH session, or a launchd job with no controlling terminal, the system may silently deny access because there is no app bundle to attribute the permission to.

The fix is usually to run macli from a terminal that has been granted Calendar/Reminders access:

Once the terminal is allowed, scripts launched from that terminal inherit the access.

How do I grant permissions?

  1. Run any calendar or reminders command once from your terminal, e.g.
    macli cal ls
    
  2. Click Allow in the system dialog.
  3. If you missed the dialog, go to System Settings → Privacy & Security → Calendars (or Reminders) and enable the terminal you are using.

For direct-download installs, you may also need to strip the quarantine attribute once:

xattr -dr com.apple.quarantine /usr/local/bin/macli

Homebrew does this automatically.

What output formats are available and when to use JSON vs TSV?

Use JSON when a program needs to parse nested or named fields. Use TSV when you want to treat the output as rows in a shell pipeline.

Why is there no GUI?

macli is deliberately a pipe stage, not a dashboard. There are already excellent GUI tools like stats. macli stays small and scriptable so it can be composed with awk, jq, gnuplot, and LLM agents. No GUI keeps the binary ~400 KB and the interface predictable.

How do I use macli from a script or AI agent?

Use the JSON envelope as the contract:

macli battery | jq -e '.healthPercent < 80'
macli smc temp --tsv | awk -F'\t' '$2 > 80 {print $1, "OVERHEAT"}'

For agents, paste this into the 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.

Every command returns {"ok": true, ...} on success or {"ok": false, "error": "...", "hint": "..."} on failure.

Why are some commands Apple Silicon only or Intel only?

Apple changed the sensor stack between Intel and Apple Silicon:

The same universal binary contains both code paths; the subcommand selects which one to use. Some newer features (e.g. experimental GPU utilization in monitor) are Apple Silicon only because the underlying framework counters do not exist on Intel hardware.

Where are dev docs / stories kept?


Found a bug or have a question? Open an issue on GitHub.