A config-driven notification router — rule matching, audio playback, multi-backend command execution
Project description
hermes-notify
A config-driven notification router for Hermes Agent — rule matching, context injection, audio playback, and custom command execution.
Transport-agnostic. Reads messages from stdin or a Bus hook, matches against notify.yaml rules, and executes the configured action.
What is this?
hermes-notify is a message router for the Hermes Agent ecosystem. When a message arrives (from a bus, a script, or stdin), it checks the message type against your notify.yaml rules. If a rule matches, it executes the configured command — anything from a macOS notification to a Slack webhook.
Quickstart
- Install:
pip install hermes-notify - Create a
notify.yamlconfig file with a rule (see Configuration below) - Send a message:
notify-hermes --to my-service --type task_done "Hello" - The callback matches
match_type: task_doneand runs your command
Install
pip install hermes-notify
Or from source:
git clone https://github.com/mlinquan/hermes-notify.git
cd hermes-notify && pip install -e .
CLI
# Send a message to any bus endpoint
notify-hermes --to my-service --type task_done "Task completed"
notify-hermes --to my-service --type progress "50% done"
notify-hermes --to my-service --type ack "Received"
# Send a notification to a tmux session
notify-agent mysession "Start working"
notify-agent --simple mysession "FYI: something happened"
# Process a callback message from stdin
echo '{"body":{"type":"task_done","text":"done"}}' | hermes-callback
Configuration
Messages are routed by notify.yaml. Each callback rule specifies a match_type and a command to execute:
callbacks:
- match_type: task_error
print: false
context: true
command: "notify-send 'Task failed'"
- match_type: task_done
print: false
context: true
command: "afplay ~/sounds/done.mp3"
Two boolean fields control behavior: print (terminal output), context (inject into LLM context).
The command field receives these environment variables:
MESSAGE— full message JSONTYPE— message typeFROM— sender endpoint name- Stdin — raw message JSON (for backward compatibility)
Example callback scripts are bundled in examples/:
examples/macos-notify.py # macOS notification via osascript
examples/play-sound.py # Play random sound via afplay
examples/slack-notify.sh # Slack webhook (set SLACK_WEBHOOK_URL)
Architecture
stdin / Bus hook ──→ bus_callback.py ──→ notify.yaml rules
│
Match?
├─ yes → execute command
└─ no → silent
notify-hermes — Bus message sender
notify-agent — tmux notification sender
Session Aliases
Map tmux session names to human-readable sender names in notify.yaml:
session_aliases:
session-1: alias-1
session-2: alias-2
default_sender: notify-agent
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hermes_notify-0.1.0.tar.gz.
File metadata
- Download URL: hermes_notify-0.1.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14cf9f1b0cd03a2d0695fecccf517a5926d7d37b1acba80e72954f26461b77f5
|
|
| MD5 |
6df6cb67f316820e39aa6ace9e0a679e
|
|
| BLAKE2b-256 |
9edf2b7c413a8928d863edbf00ddcc41b2c01834517466560472e21e2ea3b042
|
File details
Details for the file hermes_notify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: hermes_notify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de47255f7a02e92721ba5819e0a743a8423e329798f5c61fee6facddfa59cc7a
|
|
| MD5 |
1490f7c15f3d28de8debd503614c230c
|
|
| BLAKE2b-256 |
1ab4b65c594d0b560ca70fb88dc9e08a04ee517b28ef201f70ec1bf9117be10e
|