ianmclinden / rocket-notify

:rocket: Simple command-line client to send messages to Rocket.Chat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐Ÿš€ rocket-notify

About

๐Ÿš€ Simple command-line client to send messages to Rocket.Chat

Installation

Homebrew

rocket-notify can be installed via the homebrew package manager on macOS and linux

brew tap ianmclinden/extras
brew install rocket-notify

Linux

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.

macOS

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.

Windows

A rocket-notify.exe for windows/amd64 is available as a tarball from the releases page.

Usage

Webhook Creation

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}

Cli Usage

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

Docker

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

Reference

Expand

Environment Variables

ROCKET_NOTIFY_URL (Required)

Rocket.Chat webhook URL

ROCKET_NOTIFY_CHANNEL (Required)

Channel to which the mesage will be sent, like '#general' or '@eric'

ROCKET_NOTIFY_MESSAGE (Required)

Message to send

ROCKET_NOTIFY_ALIAS

Alias for the message sender

Default <hostname>

ROCKET_NOTIFY_AVATAR

Set the sender's icon to the provided URL. Supercedes ROCKET_NOTIFY_ICON

ROCKET_NOTIFY_COLOR

Color of the message header

Default darkgrey

ROCKET_NOTIFY_ICON

Set the sender's icon to an emoji

Default :computer:

ROCKET_NOTIFY_MINIMIZE

Send with message block collapsed

ROCKET_NOTIFY_TITLE

Title of the message

About

:rocket: Simple command-line client to send messages to Rocket.Chat

License:MIT License


Languages

Language:Rust 98.4%Language:Dockerfile 1.6%