Add the meter
- Choose Add Meter… and pick Script.
- Paste the command and choose how often it runs.
- If it prints JSON, add a key path. Set a range if the number isn’t a percentage.
Scripts need the direct download version of Multimeter from this site, which is the one on sale now. The Mac App Store sandbox doesn’t let apps run your scripts; there, have the script send a link or write a file.
How commands run
- With
/bin/zsh -c, as you./opt/homebrew/bin,/usr/local/bin,~/.local/binand~/.bun/binare added to thePATH. - Your
~/.zshrcis not loaded (it only runs for interactive shells), so aliases and functions defined there aren’t available. Use full commands, or put shared settings in~/.zshenv. - A command that runs longer than 10 seconds is stopped. A new run never starts while the last one is still going.
- Only standard output is read; errors on standard error are ignored.
- Choose Refresh Now from the meter’s menu to run it immediately.
What the command should print
Web addresses, files and scripts all read the same two formats.
A plain number, or any text with a number in it. Multimeter takes the first number it finds, and drops thousands separators between digits, so 1,284 stars reads as 1284.
JSON. Either a bare number, or an object with value and any of these extras:
{
"value": 38,
"min": 0,
"max": 50,
"label": "DEPLOY",
"unit": "today",
"formatted": "38 of 50"
}Pointing at bigger JSON you don’t control, like an API response? Give the meter a key path. Dots walk into objects and numbers pick array items: data.items.0.count. Numbers inside strings work too ("67012.45"), and true/false count as 1 and 0.
Without min and max the range is 0 to 100, so for bigger numbers set a range in Customize This Meter… or send max.
Commands to start from
brew outdated --quiet | wc -lls ~/Downloads | wc -lgit -C ~/code/my-app status --porcelain | wc -ldocker ps -q | wc -lsysctl -n vm.loadavg | awk '{print $2}'gh search prs --review-requested=@me --state=open --json number -q lengthcurl -s -H "Authorization: Bearer $(cat ~/.config/mytoken)" https://api.example.com/stats | jq .active_usersCommands that can be slow (network calls, big directories) should run every minute or less often. Check timing in Terminal with time first.
Check it worked
Run the command in Terminal first: it should print one number. Paste it into the meter and choose Refresh Now; the meter should show the same number.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| The script didn’t print a number | The output has no digits, or the number is on standard error. | Run it in Terminal and check. Add 2>&1 if the tool prints to standard error. |
| The script took longer than 10 seconds | A slow network call or a command waiting for input. | Add timeouts (curl -m 5, ssh -o ConnectTimeout=5 -o BatchMode=yes) and make sure nothing asks for a password. |
| Works in Terminal, “command not found” in the meter | The tool lives outside the folders on the meter’s PATH, or is an alias from ~/.zshrc. | Use the full path (find it with which tool). |
| Scripts need the version from multimeterapp.com | This copy of Multimeter came from the Mac App Store. | Use a link or a file instead, or the direct download version. |