Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dendritecli-1.1.0.tar.gz (54.7 kB view details)

Uploaded Source

Built Distribution

dendritecli-1.1.0-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file dendritecli-1.1.0.tar.gz.

File metadata

  • Download URL: dendritecli-1.1.0.tar.gz
  • Upload date:
  • Size: 54.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dendritecli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 60ce0a411ac05648a9d96076bebf446db5c7e6f3e85f060514b29f3176d8d7c9
MD5 bec5d0d51eeded7367c284e878c9ca3d
BLAKE2b-256 6d2fd5f48602c4d800cf7e09b3eda14c45ac0dc86d162f348894d0450434a219

See more details on using hashes here.

File details

Details for the file dendritecli-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: dendritecli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for dendritecli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8df543354525f61ad2dfbe724055d6dc2944579758d706203791d4637186572c
MD5 f7599ece281a8d8728c348f98328d522
BLAKE2b-256 699b05d5890a1c5d84812af9009a990b2bbcff447949010435f793840cf1c05b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page