CLI moderation tool for bulk message deletion and media cleanup in public Matrix rooms.
Project description
LocalModeration for Matrix
A CLI tool for bulk message deletion, media cleanup, and sticker purge in Matrix rooms.
Note: This tool targets public (unencrypted) rooms. Encrypted messages are skipped automatically.
Installation
View on PyPI: pypi.org/project/localmoderationmatrix
Using pip:
pip install localmoderationmatrix
Using uv:
uv tool install localmoderationmatrix
Standalone Executable: GitHub Releases
Session
Once logged in, your session is saved in your home directory. Just enter your User ID on the next run to auto-login.
Usage
localmoderationmatrix <room_id> [options]
Parameters
| Parameter | Description |
|---|---|
room_id |
(Required) The Matrix room ID. |
--search |
Search for a single keyword. |
--file |
Search using a wordlist file (one word per line). |
--purge-media |
Delete media older than X days (0 for all). |
--purge-sticker |
Delete stickers older than X days (0 for all). |
--log-room |
Room ID to send moderation logs. |
--days |
Time filter: Days (Default: 0). |
--hours |
Time filter: Hours (Default: 1). |
--minutes |
Time filter: Minutes (Default: 0). |
--homeserver |
Custom homeserver URL. |
Interactive Keys
y: Delete.n: Skip.a: Delete All remaining items automatically.q: Quit.
Examples
Search for a keyword:
localmoderationmatrix "!roomID:matrix.org" --search "spam"
Scan with a wordlist and log actions:
localmoderationmatrix "!roomID:matrix.org" --file words.txt --days 7 --log-room "!LogRoomID:matrix.org"
Delete media older than 90 days:
localmoderationmatrix "!roomID:matrix.org" --purge-media 90
Delete ALL stickers:
localmoderationmatrix "!roomID:matrix.org" --purge-sticker 0
Custom time filter:
localmoderationmatrix "!roomID:matrix.org" --search "test" --days 3 --hours 12
Building from Source
PyPI Package:
uv build
Standalone Executable:
pyinstaller --onefile --name LocalModerationMatrix --clean --noconfirm --optimize 2 src/localmoderationmatrix/cli.py
License
Apache-2.0
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file localmoderationmatrix-1.0.2.tar.gz.
File metadata
- Download URL: localmoderationmatrix-1.0.2.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f6b0deaaaf0fad062cd28e3ea60b4e57daa7e845e7fe29af3762dd3226d0a0b
|
|
| MD5 |
ee7e9a88b20006d6fd8747fa546bfc73
|
|
| BLAKE2b-256 |
dfe11375d42c7859f783e197ff81abd6553609f7fad93042070cd478e727ba26
|
File details
Details for the file localmoderationmatrix-1.0.2-py3-none-any.whl.
File metadata
- Download URL: localmoderationmatrix-1.0.2-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
234d189e72088f2fa40ceec1e07bae7dc3fe3fde994c9ceef7a49892bf4590fc
|
|
| MD5 |
2b7aa7d5cf5a3a87ef5f852bac1db4ab
|
|
| BLAKE2b-256 |
2c8ba0ce09cb9cb7a0c6be0e19a2a9d556d39be02dbaa82e78f2a1d030dc8fd6
|