MATRIX-SEND(1) General Commands Manual MATRIX-SEND(1)

matrix-sendsend a message to a Matrix room

matrix-send [-t type] [-c config] [-CVmessage room

matrix-send sends messages to Matrix rooms. The default event type is m.text (standard text message), but you can specify a custom type with -t.

The options are as follows:

Clear cached access tokens and transaction IDs then exit.
config
Instead of reading the default configuration file (~/.config/matrix-send.conf), read config.
type
Change the event type to type. Currently supported types are m.text and . Default is m.text.
Print version information and exit.

To begin, start by making a configuration file. This always has the location of .

At the very least, your configuration file has to contain three values: , , and . Let's say your Matrix server is envs.net, your username is john, and your password is supersecretpassword. Your configuration could look like this:

login = {
	server = "envs.net",
	username = "john",
	password = "supersecretpassword"
}

It could also look like this:

login.server = "envs.net"
login.username = "john"
login.password = "supersecretpassword"

More information on configuration options can be found in matrix-send-config(5).

To use matrix-send, you will need to get the Room ID of the room you'd like to send to. This will be something like .

Type the Room ID as the argument after the message you wish to send. You may have to write the Room ID in quotes to avoid shell patterns.

matrix-send 'Hello world!' '!zyxwvutsrq:example.org'

That would send a message saying to the room with the Room ID !zyxwvutsrq:example.org.

By default, matrix-send caches access tokens in . If you would like to disable caching of access tokens, add

cache.disable = true

to your .

Encryption is not supported. All messages will be sent unencrypted. There are currently no plans to add encryption to matrix-send.

~/.config/matrix-send/config.lua
configuration file for matrix-send
~/.cache/matrix-send
cache directory

Send a message saying "Hello world!" to the Matrix room !TfbDbeqp:example.org:

matrix-send 'Hello world!' '!TfbDbeqp:example.org'

matrix-send-config(5)

January 1, 2023 OpenBSD 7.4