A CLI tool for bulk message deletion, media cleanup, and sticker purge in public Matrix rooms.
Project description
LocalModeration for Matrix
A CLI tool for bulk message deletion, media cleanup, and sticker purge in public (unencrypted) Matrix 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.
If you need to clear the saved session, type reset as your User ID.
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). |
--interactive |
Scan room once and enter Interactive Hub mode. |
--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 current review (returns to menu in Interactive Mode).
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
Interactive Mode (Scan once, filter instantly):
localmoderationmatrix "!roomID:matrix.org" --interactive --days 7
Building from Source
PyPI Package:
uv build
Standalone Executable:
pyinstaller --onefile --name LocalModerationMatrix --clean --noconfirm --optimize 2 --collect-all localmoderationmatrix src/localmoderationmatrix/cli.py
License
Apache-2.0
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
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.1.0.tar.gz.
File metadata
- Download URL: localmoderationmatrix-1.1.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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 |
78c3d1ed815de251f02cf19f2239898531319f49b06757e035c22b6d514063c5
|
|
| MD5 |
2289265b5e3c54e1893704702b061276
|
|
| BLAKE2b-256 |
f8c4b38cfe63b18588c02d92c852b32f4ac8f02d44eb3c08d521c47006b6c162
|
File details
Details for the file localmoderationmatrix-1.1.0-py3-none-any.whl.
File metadata
- Download URL: localmoderationmatrix-1.1.0-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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 |
5f2d2ce8a66eaf54f941c97789d33190a0f7b76c9e12609f27ede417601c0718
|
|
| MD5 |
fde543d15968f20443258dbd516b3132
|
|
| BLAKE2b-256 |
b634651eb8d23abd9b65fa8c4ab0a38a142c3d4960c4f02669e5499831ff95ac
|