matrixtool client - Commandline client utilities for a Matrix homeserver
$ matrixtool client login @username:example.com
This command provides a commandline interface to various client APIs on a Matrix homeserver. It has various sub-commands that provide particular functionality, along with some common options between them.
These sub-commands offers a convenience over using simpler tools like curl directly because they will automatically fill in details like access tokens and server hostnames, when given a user-id argument. This works by storing a cache of access tokens in the user's home directory, under .matrix/client-tokens.
user-id
By using the matrixtool client login command you can add an access token for your user account into this cache:
matrixtool client login
$ matrixtool client login @me:example.com Password: [OK] Obtained access token
Having logged in, you can now use the -u option to other matrixtool client subcommands, causing it to automatically supply this access token on every request:
-u
matrixtool client
$ matrixtool client -u @me:example.com json /_matrix/client/r0/publicRooms ...
The following additional options are recognised
--user-id
User ID to supply the access_token of.
access_token
--user-id-parameter
-U
User ID to set as the value of the user_id HTTP query parameter. This is usually only useful for controlling application service ghosted users.
user_id
--server
-s
Server to connect to. Usually optional, as it is implied by the user-id if provided.
The following sub-commands are recognised
Perform a direct JSON request
$ matrixtool client json PATH [DATA]
See also App::MatrixTool::Command::client::json.
Obtain a client authentication token
$ matrixtool client login USER-ID
See also App::MatrixTool::Command::client::login.
Upload a file to the media repository
$ matrixtool client upload FILE [TYPE]
See also App::MatrixTool::Command::client::upload.
Paul Evans <leonerd@leonerd.org.uk>
To install App::MatrixTool, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MatrixTool
CPAN shell
perl -MCPAN -e shell install App::MatrixTool
For more information on module installation, please visit the detailed CPAN module installation guide.