Badgeify Command-Line Interface
Badgeify bundles a lightweight CLI inside the desktop binary so automations can inspect notification badges without launching the UI. Run thebadgeify executable with one of the supported subcommands to query state and exit immediately.
0 on success and 1 on error. Errors are emitted on stderr.
Installation & Setup
Locating the CLI Executable
After installing Badgeify via the dmg, the CLI executable is bundled inside the application package at:Making the CLI Accessible
You have several options to use the CLI conveniently: Option 1: Create an alias (Recommended) Add this line to your shell configuration file (~/.zshrc for zsh or ~/.bashrc for bash):
Verify Installation
Test that the CLI is accessible by running:Prerequisites
- Badgeify must already be configured with the apps or groups you want to monitor.
- macOS accessibility permissions are required. If the CLI fails with a
NO_PERMISSIONSerror, grant access via System Settings → Privacy & Security → Accessibility and relaunch Badgeify once to register the permission.
Discover Available IDs
Uselist to retrieve the apps and groups that can be queried. Each entry exposes an id, type, name, and whether it is currently enabled.
The following examples use
badgeify as the command. If you haven’t set up an alias or symlink, replace badgeify with the full path /Applications/Badgeify.app/Contents/MacOS/Badgeify.id field becomes the argument for other subcommands.
Free tier note: Without an active license, only the first three configured items are returned.
Query Unread Status
Fetch the current menubar badge for a specific app or group withstatus and the --id flag.
unread– integer badge count (0 when cleared).statusLabel– raw menubar badge text (mirrors what macOS reports).shown– whether the item is currently visible in the Badgeify tray.isRunning– whether the underlying app is running right now.
NOT_FOUND error:
Free tier note: For unlicensed users,statusis limited to the first three configured items and returns aFORBIDDENerror for others.
Exit Codes
0– Command succeeded and JSON was printed to stdout.1– Validation, permission, or runtime error; JSON error payload printed to stderr.
Automation Tips
- The CLI sets the
BADGEIFY_CLI_MODE=1environment variable while running. You can detect this flag inside scripts if needed. - Poll
badgeify status --id <bundle>on an interval to react to badge changes from tools like Hammerspoon. - Parse stdout as JSON to inspect
unread. For shell scripting, tools such asjqmake it easy:
Troubleshooting
| Symptom | Likely Cause | Resolution |
|---|---|---|
NO_PERMISSIONS error | Accessibility access not granted | Open System Settings, add Badgeify to Accessibility, relaunch the app |
| CLI exits without printing JSON | Command failed before reaching the handler | Re-run with badgeify --help to verify syntax; check stderr for the error payload |
| Badge count differs from macOS dock | The monitored app may suppress menubar badges or accessibility APIs | Confirm the badge appears in the macOS menu bar. Badgeify reports exactly what macOS exposes |

