Process manager for Telegram bots with auto-restart, persistent logging, and a Textual TUI
Project description
Bot Master
A process manager for Telegram bots with a terminal UI. Runs as a background daemon (survives reboots via systemd) with a Textual TUI client for monitoring.
Architecture
- Daemon (
bot-master-daemon) — manages bot subprocesses, auto-restarts on crash (exponential backoff), buffers logs in memory and writes to disk. Communicates via Unix socket. - TUI Client (
bot-master) — connects to the daemon to view live status, stream logs, and send start/stop/restart commands. If the TUI crashes, bots keep running.
Setup
cd ~/bots/bot-master
uv sync
Configuration
Edit bots.yaml:
bots:
my-bot:
directory: /path/to/bot
command: uv run python main.py
Usage
Start the daemon manually
uv run bot-master-daemon
Install as a systemd service (auto-start on boot, auto-restart on failure)
./install.sh
This generates the systemd unit from the current directory, enables and starts the service.
Connect with the TUI
uv run bot-master
TUI Keybindings
| Key | Action |
|---|---|
s |
Start selected bot |
x |
Stop selected bot |
r |
Restart selected bot |
a |
Start all bots |
z |
Stop all bots |
j/k or arrows |
Navigate bot list |
q |
Quit TUI (daemon keeps running) |
Logs
Logs are stored in the logs/ directory (one file per bot, 10 MB rotation with 5 backups):
logs/
au-tomator.log
zapier.log
writing-assistant.log
The daemon also keeps the last 5000 lines per bot in memory for fast streaming to the TUI.
Environment Variables
| Variable | Default | Description |
|---|---|---|
BOT_MASTER_SOCK |
/tmp/bot-master.sock |
Unix socket path |
BOT_MASTER_CONFIG |
bots.yaml |
Config file path |
BOT_MASTER_LOG_DIR |
logs |
Log directory path |
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 bot_master-0.1.1.tar.gz.
File metadata
- Download URL: bot_master-0.1.1.tar.gz
- Upload date:
- Size: 37.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afb5d01822de747f205318d4a9a80a5738fdece48dd385a6c5772e74deb042d9
|
|
| MD5 |
e7d87dcc6d4875ed24e78ae95c06c323
|
|
| BLAKE2b-256 |
bd04d7d8cfbff69180720bb63d53bc2e2d325d7e147f8b7718bee9a5877475fd
|
File details
Details for the file bot_master-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bot_master-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.12 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a87cb7d65a472375079b572ed6845df6dd18c98672f2fb551cabfd6e0875b2
|
|
| MD5 |
e5c48d09f6f14b09d8eaeca2dabc137e
|
|
| BLAKE2b-256 |
5c2b9c443f7f8e0998cfb0af769a74ab4ac2733e69ae21bb89f48cd789677b98
|