Instantly share code, notes, and snippets.

What would you like to do?
Homebrew Package Update Notifications on Mountain Lion
# Notify of Homebrew updates via Notification Center on Mac OS X
# Author: Chris Streeter
# Requires: terminal-notifier. Install with:
# gem install terminal-notifier
TERMINAL_NOTIFIER=`which terminal-notifier`
$BREW_EXEC update 2>&1 > /dev/null
outdated=`$BREW_EXEC outdated | tr ' ' '\n'`
if [ -z "$outdated" ] ; then
if [ -e $TERMINAL_NOTIFIER ]; then
# No updates available
-title "No Homebrew Updates Available" \
-message "No updates available yet for any homebrew packages."
# We've got an outdated formula or two
# Nofity via Notification Center
if [ -e $TERMINAL_NOTIFIER ]; then
lc=$((`echo "$outdated" | wc -l`))
outdated=`echo "$outdated" | tail -$lc`
message=`echo "$outdated" | head -5`
if [ "$outdated" != "$message" ]; then
message="Some of the outdated formulae are:
message="The following formulae are outdated:
# Send to the Nofication Center
-title "Homebrew Update(s) Available" -message "$message"

This comment has been minimized.

tmitchell commented Aug 6, 2012

Works great, thanks for the gist! One fix: line 7 should be # gem install terminal-notifier


This comment has been minimized.


streeter commented Feb 25, 2013



This comment has been minimized.

jbarratt commented Jun 21, 2014

Alternatively you could do brew install terminal-notifier, which since this tool is targeting brew users, seems like has better odds of working out of the box.


This comment has been minimized.

SimonSimCity commented Sep 3, 2014

I've extended the script to exclude pinned formulae in the list of outdated formulas:


This comment has been minimized.

grantovich commented Aug 3, 2015

I wanted to include this in our laptop setup script, so I enhanced it with a simple cron job "installer" and made it a real project repository:

Thanks to @streeter for approving the open-source license!


This comment has been minimized.

todmephis commented Jul 27, 2018

Added some new features on my forked version. macOS High Sierra

Thanks @streeter. Great script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment