Send Script Output to Hermes Messaging Channels
hermes send is the direct notification path for text that does not need an agent to interpret or rewrite it. It reuses configured Hermes platform adapters and credentials, sends one message, and exits. That makes it useful for CI, monitoring, shell scripts, and long-running jobs.
Address a known destination
Use a platform name for its configured home channel, or add a chat and optional thread identifier. Human-readable channel names can resolve from the channel directory.
hermes send --to telegram "deploy finished"
echo "disk usage crossed 85%" | hermes send --to discord:#ops
hermes send --to slack:#builds --subject "CI report" --file build.log
hermes send --list --jsonMessage-body precedence is positional text, then --file, then piped stdin. If stdin is interactive and no body was supplied, the command returns a usage error instead of hanging. Exit code 0 means success, 1 means platform delivery failed, and 2 indicates configuration or argument trouble.
Most token-based adapters can send without a running gateway. Plugin transports that maintain a persistent connection may require the gateway. Human-readable channel discovery depends on the directory cache, which the gateway refreshes.
Automation checklist
- Run
hermes send --listand select an exact destination. - Prefer numeric IDs for unattended critical delivery.
- Use
--quietwhen the exit code is the only required signal. - Use
--jsonwhen a script needs a returned message identifier. - Limit log excerpts before piping them to a channel.
- Preserve the original command's failure code after notifying.
Pitfalls
Do not invoke an LLM-backed cron job merely to forward a fixed string. Conversely, do not use hermes send when an agent must decide whether or how to report. A gateway-dependent plugin can fail when the gateway is down. For machine-health alerts where Python itself may not start, a minimal provider-specific fallback may be safer than Hermes.
Verification steps
- List targets and confirm the destination exists.
- Send a harmless unique marker and check exit code zero.
- Verify the exact marker arrives in the intended channel or thread.
- Simulate a bad target and ensure the calling script handles nonzero status.
- Test the real pipeline with bounded output, not an entire raw log.
Read the official Pipe Script Output guide for all target formats and delivery behavior.
