Personal Telegram account automation via MTProto (Telethon)
Read-only access to a personal Telegram account via Telethon (MTProto API).
One-time: bash scripts/setup.sh (installs Telethon, runs interactive auth).
Requires api_id + api_hash from https://my.telegram.org → API Development.
Credentials stored at ~/.config/telegram-personal/credentials.json (mode 600).
Session file at ~/.config/telegram-personal/session.session.
scripts/tg.py# List all conversations
tg dialogs [--limit N]
# Read messages from a chat (username, phone, or numeric ID)
tg read <chat> [--limit 20]
# Search across all chats (or one specific chat)
tg search "query" [--chat <name>] [--limit 20]
# Show unread DMs/groups with previews
tg unread [--limit 30]
# Download media from a message
tg download <chat> <msg_id> [-o dir]
# Export chat to markdown
tg export <chat> [--since 7d] [--limit 500] [-o file.md]
# Get info about a chat or yourself
tg info [chat]
Any of: @username, +phone, numeric ID (from tg dialogs), or chat title.
--chat when possibleFrom a skill or heartbeat, call via exec:
cd /path/to/telegram-personal && uv run tg search "keyword" --limit 10
cd /path/to/telegram-personal && uv run tg unread