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

Uploaded Python 3

File details

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

File metadata

  • Download URL: hermes_notify-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 98d5cb88221f1bb05b4509de564149c3aa1cf4727aa9ca2eb5f64892b715d205
MD5 b8ebd9c00a5b838afb94824abb237868
BLAKE2b-256 76848e5f9e0bf7735c3a67b7306d52b39fbed0ab976ae619cf3fe8b6c6a4e67c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hermes_notify-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90aa41dd8d8804b4723ffb6d8e43ad4344b8cd37850684d2f58b37530e304cc5
MD5 0e148a334ee1c8d5ef26dacd3b7fb208
BLAKE2b-256 5aa972bf8fdf7700ddfb6b633772e0c039e1e53c65181fda7d0acf384134a258

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