Manage the Dendrite API from your command line!
Project description
Dendritecli
A friendly command line interface for managing Dendrite admin APIs.
Installing
You will need python 3.10 or later. You will also need pipx
(pip install pipx && python3 -m pipx ensurepath
)
You can then install dendritecli with the following command:
pipx install git+https://github.com/nexy7574/dendritecli.git
or, as a library:
pip install git+https://github.com/nexy7574/dendritecli.git
Usage
As a command line tool
pipx
creates two commands (in $HOME/.local/bin
on Linux): dendritecli
and dendrite-cli
.
They are identical, so you can use either one.
You can get help with dendritecli --help
or dendritecli <command> --help
.
The Configuration File section describes how to configure dendritecli.
As a library
You can use dendritecli as a library. The main entry point is dendritecli.api.HTTPAPIManager
.
from dendritecli.api import HTTPAPIManager
manager = HTTPAPIManager(
access_token="<access token>"
)
Configuration File
You can configure dendritecli with a configuration file. The default location is $HOME/.config/dendritecli.toml
,
or if $HOME/.config
does not exist, $HOME/.dendritecli.toml
.
The configuration file supports the following options:
access_token = "<the access token from your homeserver>"
server = "<the URL of your homeserver>" # e.g: matrix-client.matrix.org, not matrix.org
override-password-length-check = false
# Due to a bug in Dendrite (https://github.com/matrix-org/dendrite/issues/3012), passwords cannot be over 72 bytes
# in length (usually). If you want to override this check, set this to true.
# You shouldn't do this unless you know your homeserver
timeout = 60.0
# the timeout for requests, in seconds. Includes connect, read, and write timeouts.
# By default, the library has a 10 second connect timeout, 3 minute read timeout (for long responses),
# and a 1 minute write timeout. This has been specially tuned for Dendrite servers.
# If you're having issues with timeouts (due to a slow homeserver), feel free to bump this to a higher value,
# like 600 (10 minutes).
[proxies]
# By default, if these arent specified, the library will use the system proxy settings.
http = "http://my.http.prox:13"
https = "https://my.https.prox:13"
socks5 = "socks5://my.socks5.prox:13"
[headers]
# headers to send with every request
# You should not overwrite Accept, or Content-Type, as they are required for the API to work.
# You also cannot overwrite User-Agent.
X-My-Header = "my header value"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dendritecli-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8df543354525f61ad2dfbe724055d6dc2944579758d706203791d4637186572c |
|
MD5 | f7599ece281a8d8728c348f98328d522 |
|
BLAKE2b-256 | 699b05d5890a1c5d84812af9009a990b2bbcff447949010435f793840cf1c05b |