Skip to content
n3tw0rthPublic

About

A CLI tool for sending desktop notifications and multi-channel alerts when a terminal process finishes or when predefined triggers occur

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

52 Commits

Folders and files

Repository files navigation

hark

Get notified when your long-running commands finish.

CI License: Apache-2.0 Rust

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

Features

  • 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

Install

git clone https://github.com/n3tw0rth/hark.git
cd hark
./install.sh

Usage

hark [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 release

Handy as an alias:

alias terraform='hark -t approve,"Enter a value" terraform'

Configuration

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/..."

License

Apache-2.0

About

A CLI tool for sending desktop notifications and multi-channel alerts when a terminal process finishes or when predefined triggers occur

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages