NAME
matrix-send
—
send a message to a Matrix
room
SYNOPSIS
matrix-send |
[-t type]
[-c config]
[-CV ] message
room |
DESCRIPTION
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:
-C
- Clear cached access tokens and transaction IDs then exit.
-c
config- Instead of reading the default configuration file (~/.config/matrix-send.conf), read config.
-t
type- Change the event type to type. Currently supported types are m.text and m.notice. Default is m.text.
-V
- Print version information and exit.
To begin, start by making a configuration file. This always has the location of ~/.config/matrix-send/config.lua.
At the very least, your configuration file has to contain three values: login.server, login.username, and login.password. 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
!zyxwvutsrq:example.org.
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 Hello world! to the room with the Room ID !zyxwvutsrq:example.org.
By default,
matrix-send
caches access tokens in
$HOME/.cache/matrix-send/token.
If you would like to disable caching of access tokens, add
cache.disable = true
to your config.lua.
Encryption is not supported. All messages will be sent
unencrypted. There are currently no plans to add encryption to
matrix-send
.
FILES
- ~/.config/matrix-send/config.lua
- configuration file for
matrix-send
- ~/.cache/matrix-send
- cache directory
EXAMPLES
Send a message saying "Hello world!" to the Matrix room !TfbDbeqp:example.org:
matrix-send 'Hello world!'
'!TfbDbeqp:example.org'