hark wraps any command, streams its output, and sends a notification when it exits or the moment a trigger string appears. Works on the desktop and in headless environments like CI runners and VMs.
hark cargo build --release- Desktop, email, and Google Chat notifications
- Triggers: notify when a string appears in stdout or stderr (e.g. a prompt waiting for input)
- Profiles: group destinations and fan out to several at once
- Transparent: output streams through untouched and the child's exit code is preserved, so it's safe inside scripts and pipelines
git clone https://github.com/n3tw0rth/hark.git
cd hark
./install.shhark [OPTIONS] <COMMAND>...| Option | Description |
|---|---|
-t, --triggers <A,B> |
Notify when a string appears in the output |
-p, --profiles <A,B> |
Destination profiles to notify (default: default) |
-n, --name <NAME> |
Label prepended to notification titles |
# notify when done
hark ping -c 5 google.com
# notify when terraform asks for input, quote phrases with spaces
hark -t approve,'Enter a value' terraform apply
# fan out to multiple profiles, labelled per run
hark -p default,work -n api-build make releaseHandy as an alias:
alias terraform='hark -t approve,"Enter a value" terraform'A default config is created at ~/.config/hark/config.toml on first run. Profiles map to one or more destinations: desktop, email.<name>, or gchat.<name>.
[profiles.default]
sendto = ["desktop"]
[profiles.work]
sendto = ["desktop", "email.work", "gchat.work"]
[email.work]
from = "ci@dev.com"
to = "me@dev.com"
username = ""
password = ""
host = "smtp.dev.com"
port = 465
[gchat.work]
webhook = "https://chat.googleapis.com/v1/spaces/..."