Skip to main content

A config-driven notification router — rule matching, audio playback, multi-backend command execution

Project description

hermes-notify

English | 中文

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

  1. Install: pip install hermes-notify
  2. Create a notify.yaml config file with a rule (see Configuration below)
  3. Send a message: notify-hermes --to my-service --type task_done "Hello"
  4. The callback matches match_type: task_done and 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

Route rules are defined in ~/.hermes/bus-rules.yaml and processed by hermes-bus-plugin. See its README for the full rule format.

This section only covers session aliases (used by notify-hermes for sender name resolution) and the default_sender config:

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 JSON
  • TYPE — message type
  • FROM — 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

notify-hermes ──→ hermes-bus (Unix Socket)
notify-agent  ──→ tmux send-keys

Message routing (print/inject/command) is handled by hermes-bus-plugin
via ~/.hermes/bus-rules.yaml.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hermes_notify-0.3.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_notify-0.3.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file hermes_notify-0.3.1.tar.gz.

File metadata

  • Download URL: hermes_notify-0.3.1.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

Hashes for hermes_notify-0.3.1.tar.gz
Algorithm Hash digest
SHA256 ad5c4c7d9603dd65a126727b39a6dbf400d4038ab4403796cbebcd95b8b20cb5
MD5 f1ca729e787516173eec74cee81aaeb4
BLAKE2b-256 b1068a0a15f5a2e916cf6db80cbba5aa9699e96d46435adb9969d89be961bb7f

See more details on using hashes here.

File details

Details for the file hermes_notify-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: hermes_notify-0.3.1-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

Hashes for hermes_notify-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24f2114fe51a650e860c21dde3ea3813d3255564ed0b4ec30e188a814659a186
MD5 5df92d59cd0b8fb6cfdfc10c4170111c
BLAKE2b-256 55de8cbbc3f7e45d5c77ad09eca8aca0d9df5027a61e05622e3e4508b5f2711c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page