grove notify grove notify
Grove Notifications
grove-notifications is a command-line tool and Go package for sending local system notifications and remote push notifications via ntfy.sh.
Key Features
- Sends native desktop notifications by executing
osascripton macOS andnotify-sendon Linux. - Sends remote push notifications to a specified topic on an ntfy server via an HTTP POST request.
- Provides a Go API (
SendSystem,SendNtfy) for use within other applications. - Can be executed by other Grove tools to signal outcomes of operations like builds or tests.
Ecosystem Integration
The notify binary is designed to be called by other processes. For example, a build script can execute notify system "Build complete" to alert the user when a long-running task finishes. This provides a mechanism for event-driven feedback within the local development environment.
How It Works
The tool provides two primary notification mechanisms through subcommands:
- System Notifications: The
systemsubcommand checks the host operating system viaruntime.GOOS. On macOS, it executesosascriptwith a script to display a notification. On Linux, it executes thenotify-sendcommand. System notifications are not supported on other operating systems. - Ntfy Notifications: The
ntfysubcommand constructs and sends an HTTP POST request to a specified ntfy server URL. The message content is sent as the request body, while metadata such as title, priority, and tags are passed as HTTP headers.
Installation
Install via the Grove meta-CLI:
bash
grove install notificationsVerify installation:
bash
notify versionRequires the grove meta-CLI. See the Grove Installation Guide if you don’t have it installed.