LinuxCommandLibrary

ntfyme

Send notifications to various platforms

TLDR

Directly run your command

$ ntfyme exec [[-c|--cmd]] [command]
copy

Pipe your command and run
$ echo [command] | ntfyme exec
copy

Run multiple commands by enclosing them in quotes
$ echo "[command1; command2; command3]" | ntfyme exec
copy

Track and terminate the process after prolonged suspension
$ ntfyme exec [[-t|--track-process]] [[-c|--cmd]] [command]
copy

Setup the tool configurations interactively
$ ntfyme setup
copy

Encrypt your password
$ ntfyme enc
copy

See the log history
$ ntfyme log
copy

Open and edit the configuration file
$ ntfyme config
copy

SYNOPSIS

ntfyme [OPTIONS] [MESSAGE]
ntfyme [OPTIONS] send [MESSAGE]
ntfyme [OPTIONS] listen
ntfyme [OPTIONS] shell

PARAMETERS


    The target topic to which the message will be published or from which messages will be listened.

[MESSAGE]
    The content of the notification message. If omitted, ntfyme will read from standard input.

-t, --title
    Sets the title of the notification message.

-p, --priority
    Sets the priority of the notification. Common levels include 'min', 'low', 'default', 'high', 'urgent'.

-s, --tag
    Adds one or more tags to the notification (comma-separated for multiple tags). Tags can be used for filtering.

-c, --click
    Specifies a URL that will be opened when the notification is clicked.

-x, --attach
    Attaches a file to the notification. The file will be uploaded to the ntfy.sh server and a download link included.

-a, --action
    Adds an actionable button to the notification, allowing users to perform an action (e.g., open a URL) directly from the notification.

-b, --base-url
    Overrides the default ntfy.sh server URL, useful for self-hosted instances.

-u, --user [:]
    Specifies credentials for authenticating with the ntfy.sh server.

--firebase
    Enables Firebase Cloud Messaging (FCM) push, ensuring reliable delivery to Android and iOS devices.

--browser
    Opens the ntfy.sh topic page in the default web browser after sending a message.

DESCRIPTION

ntfyme is a command-line client for the ntfy.sh push notification service, providing a simple yet powerful way to send instant alerts from your Linux terminal, scripts, or automated tasks. It allows users to publish messages to specific 'topics' hosted on an ntfy.sh server, which are then immediately delivered to subscribed devices like smartphones or desktops. This makes it an ideal tool for monitoring long-running processes, build statuses, system events, or any situation requiring timely notifications without complex configurations.

The client supports a rich set of features, including setting message titles, priorities (e.g., urgent, high, default), adding tags for filtering, and embedding clickable URLs. It can also attach files or define actionable buttons that users can tap directly from the notification. Beyond sending messages, ntfyme can also act as a subscriber, listening to topics and displaying incoming notifications directly in the terminal, useful for debugging or monitoring server-side events. Its flexibility and ease of integration make ntfyme a popular choice for developers, system administrators, and anyone needing a quick and reliable notification mechanism.

CAVEATS

Requires connection to an ntfy.sh server (public or self-hosted).
Notifications are dependent on network connectivity.
For private or sensitive topics, it's crucial to use unique, unguessable topic names and/or authentication, as topic names are public by default on shared servers.
ntfyme is a client application; it does not host the notification service itself.

CONFIGURATION

ntfyme can be configured via environment variables (e.g., NTFY_TOPIC, NTFY_BASE_URL, NTFY_USER, NTFY_PASS) or a configuration file, typically located at ~/.config/ntfy/config.yml. This allows for persistent settings and credentials without specifying them on the command line every time.

TOPICS AND SECURITY

Notifications are sent to specific topics which are essentially simple labels or paths on the ntfy.sh server. While simple, it's important to note that anyone knowing a topic name can publish to or subscribe from it on a public server. Therefore, using long, random, or authenticated topic names is highly recommended for sensitive information or private alerts.

SELF-HOSTING

For complete control over data privacy and security, the ntfy.sh server software is open-source and can be self-hosted on a private server. This provides the same functionality as the public service but within a user's own infrastructure, ideal for enterprise environments or strict privacy requirements.

HISTORY

The ntfy.sh project, including its command-line client ntfyme, was created by Philipp C. Heckel. It emerged as a modern, lightweight, and open-source alternative to more complex push notification solutions, aiming to simplify sending alerts from scripts and servers. Its development began around 2021, and it quickly gained traction due to its ease of use, HTTP-based API, and the availability of a free public server. The project continues to be actively developed on GitHub, with ongoing improvements and new features being added by its community.

SEE ALSO

curl(1), mail(1), logger(1), wall(1), mutt(1)

Copied to clipboard