Skip to main content

Manage the Dendrite API from your command line!

Project description

Dendritecli

Python package PyPI version PyPI - Downloads

A friendly command line interface for managing Dendrite admin APIs.

Features

Dendritecli has full support for all the admin endpoints, including:

  • Registering users (the same as the create-account command)
  • Evacuating both rooms and users
  • Puring rooms
  • Refreshing devices
  • Reindexing events
  • whois

with the addition of some patches and workarounds for missing things, such as:

  • Listing registered accounts
  • Listing rooms
  • Deactivating accounts

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
# We're on PyPi now:
pipx install dendritecli
# Or, if you want to be able to use it as a library:
pip install dendritecli

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.

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
database_uri = "<the URI of your database>"  
# e.g: sqlite:///dendritecli.db
# e.g: postgres://username:password@hostname:port/database?option=value
# Both SQLite and PostgreSQL are supported.

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 = 120.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.proxy:13"
https = "https://my.https.proxy:13"
socks5 = "socks5://my.socks5.proxy: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.2.0.post1.tar.gz (59.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dendritecli-1.2.0.post1-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file dendritecli-1.2.0.post1.tar.gz.

File metadata

  • Download URL: dendritecli-1.2.0.post1.tar.gz
  • Upload date:
  • Size: 59.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for dendritecli-1.2.0.post1.tar.gz
Algorithm Hash digest
SHA256 6e0d99507288a404201c0677f3cc7b21d444baddac8aa7f9f37e510521fad7ac
MD5 205de9ca280f376912fa35fa9693a1da
BLAKE2b-256 21bba7e09992c95083b24c7870e325a97062b66fc7bf4b553f7d23babf4906b7

See more details on using hashes here.

File details

Details for the file dendritecli-1.2.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for dendritecli-1.2.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 546ef7c4f622bda693e8107b20c65e9e0dba43bfc4dd6c8357b73bc47c8563b0
MD5 323635b0af09f543f815494f15608bbf
BLAKE2b-256 b0dee1c7eeaa887dcae55a84ed15cbca24ada0014d6680c115d33e773fd3d11a

See more details on using hashes here.

Supported by

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