Send Messages From Your Scripts To Multiple Messaging Platforms Using PingMe

Pingme send notifications from desktop to devices

PingMe is a command line tool for sending messages or alerts from Linux, Windows or macOS to various messaging platforms like Discord, Slack, Telegram, Microsoft Teams, Twillio, Mastodon, and more.

The developer notes the reason behind creating PingMe:

I needed a small app which I can just call from my backup scripts, cron jobs, CI/CD pipelines or from anywhere to send a message with particular information.

Supported services:

  • Discord
  • Email 
  • Line 
  • Mastodon 
  • Mattermost
  • Microsoft Teams
  • Pushbullet
  • Pushover
  • RocketChat
  • Slack
  • Telegram
  • Twillio
  • Zulip

For sending messages to various platforms, PingMe uses the Notify Go library, which supports a few extra services which are not yet supported by PingMe, like Twitter, WeChat and WhatsApp. The plan is to add its own API, so other services can easily be integrated directly into PingMe.

The tool supports both command line flags and environment variables. This means you can send a message like the following (for Telegram in this example):

pingme telegram --token "0125:AAFHvnYf_ABC" --title "Message title" --msg "My message" --channel="-1001001001"

Or export the token and channel environment variables, for example TELEGRAM_TOKEN="0125:AAFHvnYf_ABC" and TELEGRAM_CHANNELS="-1001001001", and only pass the message title and body in the PingMe command (pingme telegram --title "Message title" --msg "My message").

One thing PingMe lacks is instructions for obtaining the required tokens, etc., needed to send a message to a particular service. For Telegram you can find exact instructions in this article (scroll down to the part about configuring Telegram). For everything else you'll need to search for the information yourself.

You might also like: How To Repeat A Command Every X Seconds On Linux

PingMe is similar to Noti, which I covered on Linux Uprising a while back, with some differences. Noti was created for triggering notifications when a command has finished running (although you don't have to use it only for that), while PingMe doesn't have such capabilities built-in (but you can still use it for that (e.g. sudo apt upgrade; pingme ...)

Also, while they have some supported services in common, like Telegram, Twillio, etc., they each support some extra services, e.g. PingMe supports Discord, email, Line, Mastodon and RoketChat, while Noti supports BearyChat, Keybase, Pushsafer and Simplepush (as well as desktop notification bubbles and sounds, which PingMe doesn't support).

And finally, at least for me, PingMe has the advantage that it runs on Raspberry Pi OS, which Noti doesn't (it seems Noti only supports amd64).

You might like: broot Is An Interactive Treeview Directory Navigation Tool For The Command Line

Download PingMe

There are PingMe binaries available for Linux (generic binaries, DEB and RPM for i386, amd64, arm64 and armv6), macOS (x86_64 and arm64) and Windows (i386, x86_64 and armv6). You can also install Pingme using Homebrew, Go Get and Scoop and Docker.

You might also like: 179 Color Schemes For Your Gtk-Based Linux Terminal (Gnome Terminal, Tilix, Xfce Terminal, More)