From the README:
terminal-notifier is a command-line tool to send Mac OS X User
Notifications, which are available in Mac OS X 10.8.
It is currently packaged as an application bundle, because
NSUserNotification does not work from a ‘Foundation tool’.
This tool will be used by Kicker to
show the status of commands which are executed due to filesystem
Prebuilt binaries, which are code-signed and ready to use, are
available from the downloads
group-ID sender-name message [bundle-ID]
In order to use terminal-notifier, you have to call the binary
inside the app bundle.
The first argument specifies the ‘group’ a notification belongs to.
For any ‘group’ only one notification will ever be shown, replacing
previously posted notifications. Examples are: the sender’s process ID
to scope the notifications by a unique process, or the current working
directory to scope notifications by a project.
The second and third arguments describe the notification itself and
are its ‘title’ and ‘message’ respectively. For example, to
communicate the sender of a notification to the user, you could
specify the sender’s name as the title.
The fourth and last argument is an optional one. It specifies which
application should be activated when the user clicks the notification.
By default this will activate Terminal.app, to launch another
application instead specify the application’s bundle identifier. For
example, to launch Safari.app use: