tg-mtproto-cli
由 cyberash-dev 提供
Browser & Automation简介
Read-only Telegram CLI via MTProto.
描述
该技能的功能
Read-only Telegram CLI that uses the MTProto protocol directly, bypassing the Bot API. Lists chats, fetches message history, downloads media, and manages multiple authenticated sessions. Cannot send messages or modify any Telegram data.
Direct MTProto access avoids Bot API rate limits and works on any chat the user is a member of, not just bots.
何时使用
- Pulling recent messages from a Telegram channel for archiving
- Downloading photos or videos from a group chat
- Searching message history across multiple accounts
- Monitoring a forum topic for new posts since a given date
- Extracting structured message data for scripts or pipelines
示例工作流
User asks: Download all photos posted in @mychat in the last 50 messages
- 1
Run
tg messages @mychat -n 50 --jsonto fetch recent messages as JSON - 2
Pipe output through
jqto filter messages where.media.type == "photo"and extract.idvalues - 3
Loop over each message ID and run
tg download @mychat <id> --out ./photos - 4
Confirm download completion from exit codes and
--jsonoutput
All photos from the last 50 messages saved to ./photos directory
前置要求
- Telegram api_id and api_hash from my.telegram.org/apps
- tg-mtproto-cli installed globally via npm (`npm install -g tg-mtproto-cli`)
- Telegram phone number and OTP code for initial `tg auth` session setup
安装
clawhub install cyberash-dev/tg-mtproto-cli运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。