Skip to main content

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


Download files

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

Source Distribution

localmoderationmatrix-1.0.1.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

localmoderationmatrix-1.0.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file localmoderationmatrix-1.0.1.tar.gz.

File metadata

  • Download URL: localmoderationmatrix-1.0.1.tar.gz
  • Upload date:
  • Size: 15.7 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

Hashes for localmoderationmatrix-1.0.1.tar.gz
Algorithm Hash digest
SHA256 af9c19fc647ca13403b66f42d61d8de9fe1f7306a0843d02eec3f213aacaedef
MD5 da759763009ab7da0af305047e524167
BLAKE2b-256 2d083ac2dda899fbae80952d488130e104222c37d74f59b1bc4c5f11e4b2de7a

See more details on using hashes here.

File details

Details for the file localmoderationmatrix-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: localmoderationmatrix-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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

Hashes for localmoderationmatrix-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4880f6b9928b1f0678bc7878807849f18fe27a444f01ecf9f839f74650fd40a2
MD5 22730e255fb10a72670ad331d63c6c9e
BLAKE2b-256 81e015f34ccc1ad78c61ea3eae58288fd66608734d133e23c517774680a16365

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