https://github.com/nadams/go-matrixcli
Interact with matrix servers from the cli
https://github.com/nadams/go-matrixcli
go matrix matrix-client
Last synced: about 2 months ago
JSON representation
Interact with matrix servers from the cli
- Host: GitHub
- URL: https://github.com/nadams/go-matrixcli
- Owner: nadams
- License: apache-2.0
- Created: 2020-02-18T16:33:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T05:14:09.000Z (about 1 year ago)
- Last Synced: 2025-03-29T04:51:14.347Z (2 months ago)
- Topics: go, matrix, matrix-client
- Language: Go
- Homepage:
- Size: 77.1 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# matrixcli
Send and receive messages from a matrix server.- [x] Send messages
- [x] Multiple account/server support
- [ ] Tail messages
- [ ] Filter incoming messages
- [ ] Join/leave rooms## Setup
Simply log into a homeserver.
```sh
$ 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 ` flag. The name refers to the account name seen in the account list.
## List Accounts
```sh
$ 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
```sh
$ matrixcli account select my-account
```## Remove Account
```sh
$ matrixcli accounts remove my-account
```## Send Messages
Simple message
```sh
$ matrixcli send '!someid:chat.mydomain.com' 'my message'
```Piped from stdin
```sh
$ mycmd | matrixcli send '!someid:chat.mydomain.com'
```Message with title
```sh
$ cmd-with-long-output | matrixcli send '!someid:chat.mydomain.com' --title 'Backup Stuff'
```
Channel aliases are supported
```sh
$ matrixcli send '#mychannel:chat.mydomain.com' 'my msg'
```Full channel ids are optional
```sh
$ matrixcli send '#mychannel' 'my msg'$ matrixcli send '!someid' 'my msg'
```This pulls the domain from the homeserver configured with the account used.
Alternate account
```sh
$ matrixcli send --account my-account '#mychannel:chat.mydomain.com' 'hello there'
```