Command reference
ed menu-bar-stats
ed menu-bar-stats reports on the Mac you are typing on: a live CPU, memory, load and
network sample, and the volumes that are mounted. It reads the machine directly
through sysctl, the Mach host statistics and the IOKit power source API.
When you ask for processes it also runs the built-in /bin/ps, the only reader
that sees CPU and memory for processes owned by other users and the system.
Nothing here talks to the Edith app and nothing here needs it running. Reach for it when
you want the numbers the app's This Mac view shows without opening a window, or
when you want them on stdout as JSON.
It is the local half of a pair. ed machines metrics <machine> is the same
report for a machine over SSH, in the same shape, so a script can treat both the
same way.
At a glance
| Command | What it does |
|---|---|
ed menu-bar-stats stats |
Samples CPU, memory, load, uptime, network and optionally the top processes. Streams with --follow. Runs when you type ed menu-bar-stats with no subcommand. |
ed menu-bar-stats disks |
Lists mounted volumes, plus battery, temperature, fan, platform profile and GPU fields in JSON. |
Commands
Exit codes
| Code | When |
|---|---|
| 0 | The sample or the volume list was printed. --help and --version also exit 0. |
| 2 | --interval was zero, negative or not finite; --processes was negative; or the command line was wrong in the ordinary way, an unknown flag, a missing value, or a value that is not a number. |
Neither command looks anything up by name and neither talks to the app, so 3 and
4 cannot happen here. Code 1 is the catch-all for an unexpected error escaping
ed menu-bar-stats stats, and nothing on the local sampling path throws one.
Notes and gotchas
ed menu-bar-statswith no subcommand ised menu-bar-stats stats.statsis declared as the group's default subcommand, so the two are the same invocation.- Sizes are formatted with decimal units.
KBis 1000 bytes,MBis 1000 KB, and so on, which is why a volume of 482797652 KB prints as494 GBrather than460 GBand 25165824 KB of memory prints as25.8 GB. The JSON is raw kilobytes, so do your own maths there if you want binary units. - At most 30 processes exist to be reported. The sampler keeps the top 30 by
CPU, so
--processes 50gives you 30 rows and no warning. cpuPercentin the process rows is the process's CPU time over the time since the previous process reading (or since it started, on the first reading), summed across cores, so a busy process reads above 100.cpu.totalPercentfor the machine is capped at 100 across all cores. The two are not on the same scale.- The process list comes from
proc_listallpidsandproc_pidinfo, sorted by CPU descending;commandis the executable path andnameits last path component. It is only read when--processesis above 0. - Network counters skip
lo0entirely, and an interface that moved no bytes during the window is left out ofinterfacesrather than listed at zero. TherxBpsandtxBpstotals exclude interfaces judged virtual, which is anything namedutun*,awdl*,llw*,bridge*,ap*,gif*,stf*oranpi*; those interfaces still appear in the list, withvirtual: true. disk.readBps,disk.writeBpsanddisk.devices, along withcpu.stealPercentandtasks.runnable, are part of the shared sample shape and are always zero or empty for this Mac. They are filled in by the collectored machines metricsruns on a Linux machine.tasks.totalcounts every process on the machine and not just the ones--processesshows.--json --followwrites one compact document per line, forever, and repeats the wholehostobject on every line. That is deliberate: each line stands alone, sojq -c,headand a pipe into another process all work without buffering a document that never ends. Without--followyou get a single pretty-printed document instead.- Object keys are sorted, in both the pretty and the compact form, so two runs diff cleanly.
statsis the sameLocalMachineSamplerthe app drives for its This Mac session, so the CLI and the window cannot disagree about a number. The window samples every two seconds and refreshes its volume and battery half on every fifteenth tick, about every thirty seconds;ed menu-bar-stats disksreads it fresh on every call.- The
menuBarStatsextension, the CPU and memory readout in the menu bar, is unrelated to these commands.ed menu-bar-statsnever consults it, and both commands work with every extension turned off.
Where to go next
ed machinesfor the same sample taken on another machine over SSH, including the disk, steal and task fields this page reports as zero.ed cleanerfor acting on whated menu-bar-stats diskstells you about free space.ed extensionsfor the menu bar CPU and memory readout.- The
edcommand line for the rest of the reference.