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.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.1.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hermes_notify-0.1.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.1.1.tar.gz
Algorithm Hash digest
SHA256 6f018550e8bd92f182c32711c0543004458b5dd62f5bc0142b4af27834fdb07f
MD5 d5eaaaec481d1473a4c31a6cb961cb74
BLAKE2b-256 9f4677dcc4222bf04a42109bec41689caa19469a2168aea57e8481803f3281a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hermes_notify-0.1.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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b0c1c1c465991e72547098cbf20cf264b4ba6ca36a6708455239b323805a96d
MD5 dc3046e7218e12ed343ee2de0177e336
BLAKE2b-256 b285582e25165362e344b7edf2d0d4bb372dc5dcf8f95507f85f0cf24bd4f44f

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