Matrix User Manager
A terminal tool for administering Matrix accounts on a self-hosted Synapse server. Use the menu for one-off tasks or run commands directly for scripts. Account changes go through the Synapse Admin API, and database backups run while Synapse stays online.


Screenshots · CLI guide · Database guide · Operations guide · Changelog
Quick start
You need Bash, Python 3.10 or later, and access to Docker on Linux or WSL. Use a Synapse administrator token for the menu and account commands. The official Synapse container image includes the Python runtime and YAML module the tool uses to read its configuration.
git clone https://github.com/Ilia-Shakeri/Matrix-User-Manager.git
cd Matrix-User-Manager
./matrix_user_manager.sh --container synapse doctor
./matrix_user_manager.sh --container synapse menu
Replace synapse with your container name. The first command checks the server, listener, and database. The menu prompts for your administrator token and shows the selected server at the top.
For the keyboard menu on Debian or Ubuntu, install whiptail with sudo apt install whiptail. The manager uses the text menu if Whiptail is unavailable or the terminal is smaller than 56 columns by 16 rows. Set menu --ui text to open it directly.
Screenshots
The main menu groups account lookups, access changes, and database tools. The bar at the top shows the server and Docker target.

Search by name, filter by account state, then open an account directly from the results. Both screens use a local test server.

Common tasks
| I need to… |
Command |
| Find an account by name |
list --search alice |
| Check an account, its devices, and room membership |
info alice |
| Reset a password and sign out existing devices |
reset-password alice |
| Block sign-in or limit room activity |
lock alice or suspend alice |
| Export a database backup |
backup --directory /secure/backups |
| Pull a read-only list of user records |
report "SELECT name, admin FROM users LIMIT 25" |
Run these after ./matrix_user_manager.sh --container synapse. Use --help on any command for its options.
For PostgreSQL, configure a report role and backup client first. PostgreSQL setup
deactivate revokes sessions, removes devices, and queues room departures. Use lock or suspend for temporary restrictions. Creating an account requires shared-secret registration on Synapse. Account commands and authentication
Documentation
- CLI guide covers Docker target selection, accounts, scripting, audit logs, and exit codes.
- Database guide covers read-only queries, PostgreSQL roles, online backups, and restore checks.
- Operations guide covers preflight checks, recovery, and publishing a release.
- Security explains how to report vulnerabilities in private.
- Contributing explains how to run tests with disposable Synapse containers.
- Changelog lists changes and upgrade notes by version.
License
Released under the MIT License.
评论