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

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 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

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


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.1.3.tar.gz (11.5 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.1.3-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hermes_notify-0.1.3.tar.gz
  • Upload date:
  • Size: 11.5 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.1.3.tar.gz
Algorithm Hash digest
SHA256 5395cd9325509275203b6455d236bc7de990cb851e9ab3fcc18b70add9fdc292
MD5 a343725fa429cedaf60fe2bc72be90a0
BLAKE2b-256 cdf16de2f921156b54297c323f9ff1cb946716523a8dfef54306f2c7c011244a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hermes_notify-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.2 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dd0f4f6d6f2464ec78d197d4a3b4db6b10ea12f21af1d5df7950725ac93e4bf6
MD5 47bdaabc66b8c94160e346617f445bb5
BLAKE2b-256 aa8c34a6805473ade5c27e8e7466496085c0860e37d817ac3ec138e0c16806d4

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