Skill: Send Notification via ntfy
Goal
Send a notification to your phone/devices when a long-running task completes.
Setup Check
Verify ntfy is available before use:
nix-shell -p ntfy-sh --run "ntfy --version"
Default topic: agent. Server: ntfy.hallstrom.duckdns.org
Basic Notification
nix-shell -p ntfy-sh --run "ntfy publish ntfy.hallstrom.duckdns.org/agent 'Task completed'"
After Long-Running Command (Success + Failure)
Wrap any command to notify on both outcomes:
nix-shell -p ntfy-sh --run "ntfy publish ntfy.hallstrom.duckdns.org/agent 'Task succeeded'" || \
nix-shell -p ntfy-sh --run "ntfy publish --tags warning --priority high ntfy.hallstrom.duckdns.org/agent 'Task FAILED'"
Title, Emoji Tags & Priority
Add a title, emojis, and priority level to make notifications more useful:
nix-shell -p ntfy-sh --run "ntfy publish \
--title 'NixOS Deploy' \
--tags white_check_mark,rocket \
--priority high \
ntfy.hallstrom.duckdns.org/agent 'Switch complete'"
Tags work two ways: if a tag matches an emoji shortcode (e.g. warning,
skull, rocket), it's prepended as an emoji to the notification. Other tags
appear as labels below the message. Comma-separate multiple tags.
Priority levels: min / low / default / high / urgent — controls
vibration and sound on your device.
Useful emoji shortcodes for task notifications:
white_check_mark✅ — successwarning⚠️ — failure or cautionrotating_light🚨 — urgent / criticalrocket🚀 — deploy / launchstopwatch⏱️ — timing infocomputer💻 — generic script/task
Full list: https://docs.ntfy.sh/emojis/
Rich Markdown Notification
nix-shell -p ntfy-sh --run 'ntfy publish --markdown \
--title "Deploy Complete" \
--tags rocket \
ntfy.hallstrom.duckdns.org/agent "# Success
**Duration:** 5 minutes
**Result:** All systems go"'
Use single quotes around the message to prevent bash from interpreting
special characters. With --markdown, use double quotes and escape
internally, or use a heredoc.
Supported Markdown
Bold, italic, # headings, - lists, `code`, [links](url)
Converted and distributed by TomeVault — claim your Tome and manage your conversions.