A simple matrix cli client. Primarily designed for sending notifications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Stefan Tatschner 95a4448c4a Update deps 2 months ago
contrib Add sendmail interface 1 year ago
.gitignore Initial commit 1 year ago
LICENSE Initial commit 1 year ago
Makefile Add update Make target and run it 1 year ago
README.md Add contribute 1 year ago
cmd_login.go Implement E2E support 7 months ago
cmd_logout.go Prevent accidental logouts be requiring -f 1 year ago
cmd_room.go Small cleanup in room state event code 1 year ago
cmd_send.go Implement E2E support 7 months ago
cmd_synapse.go Implement E2E support 7 months ago
cmd_sync.go Implement E2E support 7 months ago
cmd_user.go Scope temporary types 1 year ago
config.go Implement E2E support 7 months ago
go.mod Update deps 2 months ago
go.sum Update deps 2 months ago
helper.go Create helper.go and move die…() helper function to the file 1 year ago
main.go Implement E2E support 7 months ago
statecache.go Implement E2E support 7 months ago



mnotify is a simple cli for the matrix chat system. It was developed for the use case of sending notifications from a headless server. It seems to develop into a fully fledged CLI client usable from oldfashioned scripts.


$ make


There is a mailing list. Instructions about sending patches are at this tutorial webpage. Just use the builtin functionality of git. :)

Get Started

Obtain a fresh matrix user account on an arbitrary homeserver. First, create a login.

mnotify asks interactively for the username and the password. Be aware to always use the complete matrix id including the domain, e.g. @user:example.org.

$ mnotify login

The access token is stored in ~/.config/mnotify/config.toml. Keep this file secret.

Now create a room and invite the user to whom you want to send notifications (here: @user:example.org).

$ mnotify room --create --direct --invites "@user:example.org"

Once the user @user:example.org joins the room, text messages can be sent to the room like this:

$ echo "Hello World!" | mnotify send --room !gBSqYoCSkyAHgqJEcW:hackbrettl.de

Alternatively it can be used like this:

$ mnotify send --room !gBSqYoCSkyAHgqJEcW:hackbrettl.de --message "Hello World!"

Further Examples

The output format is column based, the column separator is always | enabling awk magic. Every command that produces output understands the -J or --json switch. On each line one JSON object is printed.

Stream Messages

$ mnotify sync
Sep  9 15:23:28.987|m.room.message|$sBZUatMPSqnfqYaD1W-4g4wsHu8vq08wGPD-xYTn6mk|!JJaziyTEiTFWEEWILE:hackbrettl.de|@develop:hackbrettl.de|test
Sep  9 23:23:48.641|m.room.message|$0kQhv_iyRwL8Us4nbDbij19JkC9A9Nl3dtZPhhVj2MI|!JJaziyTEiTFWEEWILE:hackbrettl.de|@rumpelsepp:hackbrettl.de|test
Sep  9 23:23:51.107|m.room.message|$3j4G4eD3ASni9rmxrT2qQV-vqCa_l1L4x9eP80n4818|!JJaziyTEiTFWEEWILE:hackbrettl.de|@rumpelsepp:hackbrettl.de|hello
$ mnotify sync --json | jq
  "body": "test",
  "event_id": "$sBZUatMPSqnfqYaD1W-4g4wsHu8vq08wGPD-xYTn6mk",
  "event_type": "m.room.message",
  "room_id": "!JJaziyTEiTFWEEWILE:hackbrettl.de",
  "sender": "@develop:hackbrettl.de",
  "timestamp": "2020-09-09T15:23:28.987+02:00"

List Rooms

$ mnotify room -l --json
  "room_id": "!JJaziyTEiTFWEEWILE:hackbrettl.de",
  "members": [
      "user_id": "@develop:hackbrettl.de",
      "display_name": "develop"
      "user_id": "@rumpelsepp:hackbrettl.de",
      "display_name": "stefan"