๐ Simple command-line client to send messages to Rocket.Chat
rocket-notify
can be installed via the homebrew package manager on macOS and linux
brew tap ianmclinden/extras
brew install rocket-notify
curl -L https://github.com/ianmclinden/rocket-notify/releases/latest/download/rocket-notify-x86_64-unknown-linux-gnu.tar.gz | tar zx
sudo install -t /usr/local/bin rocket-notify
Binaries for linux/arm64
and linux/arm
are also available from the releases page.
curl -L https://github.com/ianmclinden/rocket-notify/releases/latest/download/rocket-notify-x86_64-apple-darwin.tar.gz | tar zx
sudo cp rocket-notify /usr/local/bin/
Binaries for darwin/arm64
(Apple Silicon) are also available from the releases page.
A rocket-notify.exe
for windows/amd64
is available as a tarball from the releases page.
In order for Rocket.Chat to receive webhooks, a valid webhook URL must be provisioned by a Rocket.Chat admin. The URL is associated with permissions that restricts what users can send and recieve messages.
Once a webhook URL is acquired, it can be added to the environment as ROCKET_NOTIFY_URL
. To do this automatically (in bash), add the following to ~/.bashrc
, or ~/.bash_profile
, or /etc/environment
.
export ROCKET_NOTIFY_URL=https://{webhookURL}
rocket-notify [options] <channel> <message>
For example
rocket-notify --icon ":tada:" --alias "Project Builder" @myusername "Build Finished!"
For a full list of options
rocket-notify --help
The cli can also be invoked via a Docker container. In this case, parameters can be passed via the environment, for example:
docker run \
-e ROCKET_NOTIFY_URL="https://{webhookURL}" \
-e ROCKET_NOTIFY_ALIAS="Project Builder" \
-e ROCKET_NOTIFY_ICON=":tada:" \
-e ROCKET_NOTIFY_CHANNEL="@myusername" \
-e ROCKET_NOTIFY_MESSAGE="Build Finished!" \
--rm ijmclinden/rocket-notify:latest
Expand
Rocket.Chat webhook URL
Channel to which the mesage will be sent, like '#general' or '@eric'
Message to send
Alias for the message sender
Default <hostname>
Set the sender's icon to the provided URL. Supercedes ROCKET_NOTIFY_ICON
Color of the message header
Default darkgrey
Set the sender's icon to an emoji
Default :computer:
Send with message block collapsed
Title of the message