Skip to content

nadams/go-matrixcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

matrixcli

Send and receive messages from a matrix server.

  • Send messages
  • Multiple account/server support
  • Tail messages
  • Filter incoming messages
  • Join/leave rooms

Setup

Simply log into a homeserver.

$ matrixcli accounts login https://chat.mydomain.com

Commands that deal with a server need an account to work with. By default the program will select the "current" account to work with. You can set the current account by looking below. If you wish to use a different account without changing the current accout, pass in the --account <name> flag. The name refers to the account name seen in the account list.

List Accounts

$ matrixcli accounts list

+------------------+---------------------------+-------------------------------------+---------+
| NAME             | HOMESERVER                | USERID                              | CURRENT |
+------------------+---------------------------+-------------------------------------+---------+
| my-account       | https://chat.mydomain.com | @my-account:chat.mydomain.com       |         |
| my-other-account | https://chat.mydomain.com | @my-other-account:chat.mydomain.com | *       |
+------------------+---------------------------+-------------------------------------+---------+

Set Current Account

$ matrixcli account select my-account

Remove Account

$ matrixcli accounts remove my-account

Send Messages

Simple message

$ matrixcli send '!someid:chat.mydomain.com' 'my message'

Piped from stdin

$ mycmd | matrixcli send '!someid:chat.mydomain.com'

Message with title

$ cmd-with-long-output | matrixcli send '!someid:chat.mydomain.com' --title 'Backup Stuff'

Rich Text

Channel aliases are supported

$ matrixcli send '#mychannel:chat.mydomain.com' 'my msg'

Full channel ids are optional

$ matrixcli send '#mychannel' 'my msg'

$ matrixcli send '!someid' 'my msg'

This pulls the domain from the homeserver configured with the account used.

Alternate account

$ matrixcli send --account my-account '#mychannel:chat.mydomain.com' 'hello there'