Repository navigation
Command Line
Brandon Dalton edited this page Dec 1, 2026
·
9 revisions
-
macmonitorstreams Endpoint Security events and network flows from Mac Monitor's Security Extension to a terminal or a pipe, manages the saved mute set, the indicators and their signed packs, and checks traces against the telemetry schema. - You can run at most 3 streams at once.
-
Settings > Command Line links the tool to
/usr/local/bin/macmonitorafter an administrator approves. -
Tab completion is optional. Run
macmonitor completion zsh(orbash) for the one line to add to your shell's startup file. It completes commands, options and this Mac's event names.
| Command | Description | Needs sudo
|
|---|---|---|
stream [EVENT...] |
Streams events until Ctrl-C, --for or --count. With no EVENT, the events Mac Monitor records by default. The network flows, new_flow and flow_closed, stream only when named, or with all. |
Yes |
mute list|add|remove|import|export|reset|update |
Shows or changes the saved mute set Mac Monitor and every stream share. import, reset and update ask first unless you pass --yes. --event also takes new_flow and flow_closed. A flow has no target path, so only literal and prefix mutes apply to it. |
Yes |
indicators list|show|add|edit|import|remove|enable|disable|export |
Shows or changes the indicators the Security Extension runs on every event. | Yes |
indicators pack status|install |
Shows which indicator pack Mac Monitor's own indicators are, or installs a later signed pack's file. install asks first unless you pass --yes. |
Yes |
indicators pack verify FILE |
Checks a signed pack as the Security Extension would, and says who signed it and what it holds. | No |
indicators test PACK --plan PLAN |
Replays a pack's recorded events through the Security Extension's own matching. | No |
status [--json] |
Shows what's installed, which indicator pack, whether the Security Extension is ready, who is capturing, and whether network flows are being read. | No |
update check [--json] |
Says whether a newer Mac Monitor is out. It installs nothing. | No |
events |
Lists the events it can stream. * marks the defaults. |
No |
schema |
Prints the telemetry schema, as Mac Monitor ships it. | No |
validate [--eslogger] TRACE |
Checks a trace against the schema. | No |
completion zsh|bash, version, help <command>
|
completion shows the line that turns on Tab completion, or the script when piped. version shows the tool's version, and help a command's options. |
No |
Settings > Command Line > Without sudo lets any user stream, and separately change mutes and indicators, without sudo.
-
Output: text on a terminal, JSONL when piped (
--format text|jsonl|pretty). -
Events: short names (
exec), full names (ES_EVENT_TYPE_NOTIFY_EXEC), orall. -
Filters:
--pid,--process,--signing-id,--target,--grep,--predicateand--indicator. Repeating a filter matches any of its values. Repeating--predicaterequires all of them. See Predicate Search. -
Closes: only closes of modified files, unless you pass
--every close. As it starts, a stream names any indicator that leaves nothing to match. -
Mutes: the saved mute set applies unless you pass
--no-mutes.--include-selfshows the events of the stream's own pipeline, such asjq's. -
Scans:
--yara-scanscans each written Mach-O and script, and each script an exec runs, with Apple's XProtect rules. What it found is on the close, rename or exec asyara_scan. It needscloseorexec. -
Flows:
--no-url-pathsends a flow'surlat its host and port, leaving out its path and query.
- Mac Monitor's own indicators are a signed pack.
sudo macmonitor indicators pack statussays which one this Mac has. -
sudo macmonitor indicators pack install FILEinstalls a later pack's file, once the Security Extension has verified that Swiftly Detecting signed it. It says what would change and asks first. An indicator you edited or deleted stays as it is. -
macmonitor indicators pack verify FILEruns the same check and installs nothing. - For now, new packs ship with Mac Monitor updates.
sudo macmonitor stream # Mac Monitor's default events
sudo macmonitor stream exec fork exit --for 30s # these three, for 30 seconds
sudo macmonitor stream all | jq -c . # every event, as JSONL
sudo macmonitor stream new_flow flow_closed --for 1m # network flows, for a minute
# an osascript script asking for a password
sudo macmonitor stream exec --target '/osascript$' --predicate '
(event.exec.script_content CONTAINS[c] "display dialog" AND event.exec.script_content CONTAINS[c] "password") OR
(event.exec.command_line CONTAINS[c] "display dialog" AND event.exec.command_line CONTAINS[c] "password")'
# written files an XProtect rule matched
sudo macmonitor stream close --yara-scan --predicate 'event.close.yara_scan.rules.@count > 0'
sudo macmonitor mute add /usr/libexec/diagnosticd --event open
sudo macmonitor indicators list # this Mac's indicators, with each one's severity
sudo macmonitor stream --indicator 'Property list modified' # only the events that matched it
sudo macmonitor indicators pack status # which indicator pack this Mac has
macmonitor validate trace.jsonl
macmonitor status # versions, and whether the Security Extension is ready
macmonitor update check # whether a newer Mac Monitor is outmacmonitor follows sysexits.h. macmonitor help <command> covers every option.
| Status | Means |
|---|---|
0 |
Done. A closed pipe, such as | head, counts as done, except for validate. |
1 |
You answered no to "Continue?", so nothing changed. |
64 |
An unknown command or option, a missing argument, or a change that asks first with no terminal to ask at. |
65 |
Mutes or a trace it can't use, such as a trace with a record that doesn't follow the schema. |
66 |
A file to import or validate that can't be read. |
69 |
The Security Extension isn't running, is out of date, refused it, or lacks Full Disk Access. |
74 |
Standard output or the saved mute set can't be written. |
75 |
Too many streams at once, or GitHub couldn't be reached for update check. Try again later. |
77 |
Not root. Run it with sudo. |
130 |
Stopped with Ctrl-C. |