- name
- telegram-readonly
- description
- Read the user's personal Telegram account in a controlled, read-only way via Telethon/MTProto. Use when you need to inspect Telegram chats, list dialogs, read recent messages from a specific chat, or search Telegram messages without relying on the Telegram Bot API. Do not use for sending, replying, editing, deleting, or any write action.
Telegram Readonly
Use the installed telegram-readonly CLI for Telegram reads from the user's personal account.
This skill exists because Telegram Bot API is the wrong tool for reading a real personal account. Use MTProto via Telethon instead.
Quick rules
- Use this skill only for reads.
- Do not improvise write actions.
- Do not add send/edit/delete logic to the wrapper unless the user explicitly asks.
- Treat the Telethon session like a high-privilege secret.
- Assume unread preservation is best-effort until tested on a real chat.
Installation preference
Prefer an installed CLI over hardcoded script paths.
Preferred install:
pipx install git+https://github.com/ropl-btc/telegram-readonly-cli.gitFallback inside a repo checkout:
pip install .After install, use:
telegram-readonly
Commands
Show built-in help
telegram-readonly helpAuthenticate once
export TELEGRAM_API_ID='12345678'
export TELEGRAM_API_HASH='your_api_hash'
telegram-readonly authList chats
dialogs --query does token-based matching across name, username, and title, so queries like petros skynet work even when the exact full string is not present as one substring.
telegram-readonly dialogs --limit 50Read recent messages
telegram-readonly messages --chat '@username' --limit 50 --reverseSearch messages
telegram-readonly search 'invoice' --limit 50Restrict search to one chat:
telegram-readonly search 'deadline' --chat '@username' --limit 50List recent unread chats
Default behavior is opinionated: exclude muted and archived chats.
telegram-readonly unread-dialogs --limit 10Include muted and/or archived when needed:
telegram-readonly unread-dialogs --limit 10 --include-muted --include-archivedList recent unread DMs only
telegram-readonly unread-dms --limit 10Workflow
- Read
references/setup-and-safety.mdif setup, auth, or unread-state behavior matters. - Ensure the
telegram-readonlyCLI is installed. - Ensure Telegram API credentials exist.
- Run
authonce to create the session. - Use
dialogs,messages,search,unread-dialogs, orunread-dmsas needed. - Keep usage narrow and intentional.
Expected outputs
The wrapper returns JSON. Parse it instead of relying on fragile text scraping.
Dialog objects include:
is_useris_groupis_channelis_botarchivedmuted- unread counters
Files
- Package repo:
https://github.com/ropl-btc/telegram-readonly-cli - Compatibility wrapper:
scripts/telegram_readonly.py - Setup notes:
references/setup-and-safety.md - Config storage:
~/.config/telegram-readonly/config.json
When to stop and ask
Stop and ask before:
- adding write capabilities
- enabling any background watcher/daemon
- broad exporting of large chat histories
- changing how secrets/session storage works