LinuxCommandLibrary

terminal-notifier

TLDR

Send a basic notification

$ terminal-notifier -message "[Task completed]"
copy
Send with title and subtitle
$ terminal-notifier -title "[Build]" -subtitle "[Success]" -message "[All tests passed]"
copy
Send with a sound
$ terminal-notifier -message "[Done]" -sound default
copy
Send and open URL on click
$ terminal-notifier -message "[New issue]" -open "[https://github.com]"
copy
Send and activate an app on click
$ terminal-notifier -message "[Sync complete]" -activate [com.apple.AddressBook]
copy
Send from piped input
$ echo "[Build finished]" | terminal-notifier
copy
Group notifications (replace previous)
$ terminal-notifier -group "[build]" -message "[Completed]"
copy

SYNOPSIS

terminal-notifier [-title title] [-subtitle subtitle] [-message message] [-sound name] [-group id] [-activate bundleid] [-open url]

DESCRIPTION

terminal-notifier sends macOS User Notifications from the command line. It enables scripts and terminal commands to display native system notifications with customizable content, sounds, and click actions.
Notifications can include titles, subtitles, message bodies, and sounds. Click actions can open URLs, activate applications, or execute callbacks. Group identifiers allow replacing previous notifications instead of stacking them.
The tool is useful for alerting when long-running processes complete, such as builds, downloads, or scheduled tasks.

PARAMETERS

-message text

The notification message body (required unless piping)
-title text
The notification title (default: "Terminal")
-subtitle text
The notification subtitle
-sound name
Play a sound from /System/Library/Sounds; use "default" for system default
-group id
Group identifier; only one notification per group shown at a time
-activate bundleid
Activate specified app when notification is clicked
-open url
Open URL when notification is clicked
-remove id
Remove notification with specified group ID
-list id
List notifications with specified group ID

CAVEATS

Sticky notifications (alerts) require manual configuration in System Settings > Notifications > terminal-notifier. Action buttons are not supported; use alerter for that functionality. Requires macOS 10.10 or higher.

HISTORY

terminal-notifier was created by Eloy DurĂ¡n (julienXX) as an open-source tool to bring macOS notifications to command-line workflows. It became popular for integrating native notifications into development toolchains.

SEE ALSO

Copied to clipboard