terminal-notifier posts macOS User Notifications from scripts and shells. It supports titles, sounds, scheduling, grouping, and click actions.
Overview
terminal-notifier is a command-line tool that sends macOS User Notifications. It requires a recent macOS release and is distributed as an app bundle because notifications are attributed to a sending application.
You can set message body, title, subtitle, sounds, and attached images, and group notifications so repeated posts replace earlier ones in the same group. Notifications can be delivered immediately, after a delay, or at a scheduled local time. Options exist to open URLs, run shell commands, or activate another app when the user clicks the alert.
Interactive modes add action buttons or a reply field; the tool waits for user input and prints the result on stdout, with an optional timeout for unattended scripts. Listing and removing delivered or pending notifications is supported via group identifiers.
Install via Homebrew, prebuilt release binaries, or local builds. A diagnose flag reports permission, Focus, and Notification Center state when alerts do not appear. Notifications need a logged-in GUI session and do not work from plain SSH or root daemons without a user context.
Key features
- Post User Notifications from the shell
- Scheduled and delayed delivery
- Notification grouping and replacement
- Click actions: URL, command, or app focus
- Action buttons and reply fields
- List and remove delivered notifications
- Built-in permission and environment diagnose
- Pipe message body from stdin
Use cases
- Alert when long shell commands finish
- Script-driven macOS status updates
- Ask yes/no via notification action buttons
- Replace progress notifications in one group
- Open a URL when the user clicks an alert