tg-cli
Read-only Telegram CLI via MTProto. Lists chats, fetches messages, downloads media, manages local accounts/sessions. Does not send messages or modify Telegram data. Use when the user asks to read Telegram chats, fetch messages, download media, or automate Telegram data extraction.
Why use this skill?
Use the tg-cli skill to read Telegram messages, download media, and extract chat data via MTProto. High-performance, read-only, and no bot limits.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cyberash-dev/tg-mtproto-cliWhat This Skill Does
The tg-cli skill provides OpenClaw with a high-performance, read-only interface for Telegram using the native MTProto protocol. Unlike Bot API-based tools, this skill allows for raw access to Telegram history, including chat listing, message fetching, and media downloads, bypassing standard bot limitations. It operates by maintaining a persistent session file locally, allowing the AI to act as a secure, authenticated reader for your Telegram activity.
Installation
To enable this skill, run the following command in your terminal:
clawhub install openclaw/skills/skills/cyberash-dev/tg-mtproto-cli
Ensure you have Node.js installed on your system. After installation, verify the setup by running tg --version. You will also need to provide your api_id and api_hash obtained from my.telegram.org/apps during the initial tg auth phase, which requires an interactive phone and OTP verification process.
Use Cases
- Automated Research: Fetching historical data from Telegram channels or groups to perform sentiment analysis or data extraction.
- Media Archiving: Automatically downloading specific media types from private chats or public channels to a local directory for long-term storage.
- Message Context Retrieval: Quickly searching through specific forum topics or chat histories to retrieve lost information without manually scrolling through the mobile application.
- Personal Productivity: Aggregating messages from multiple channels into a local structured format (JSON) for processing with other tools like
jq.
Example Prompts
- "List the last 20 messages from the 'Open Source Updates' channel and save them to a file."
- "Download all images shared in the 'Family Photos' group from the last 48 hours to the ./downloads folder."
- "Search for the numeric ID of the 'Tech Support' group so I can start fetching messages from it."
Tips & Limitations
- Read-Only: This skill cannot send messages or alter your Telegram state. It is strictly for information retrieval.
- Session Security: Your session files are stored in
~/.tg-mtproto-cli/sessions/. Keep this directory secure as it contains authentication tokens. - Interactive Setup: You cannot automate the initial
tg authprocess; it requires an active terminal window to input your Telegram phone number and verification code. - Chat Identification: Always prefer using the numeric ID for precise targeting, as usernames can change.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cyberash-dev-tg-mtproto-cli": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: network-access, file-write, file-read, external-api
Related Skills
claude-cost-cli
Query Claude API usage and cost reports from the command line. Secure macOS Keychain storage for Admin API key. Table/JSON output.
caldav-cli
Manage CalDAV calendars (iCloud, Google, Yandex) from the command line. Supports OAuth2 and Basic auth, multi-account, table/JSON output.
claude-usage-cli
Query Claude API usage and cost reports from the command line. Secure macOS Keychain storage for Admin API key. Table/JSON output.
grok-image-cli
Generate and edit images via Grok API from the command line. Cross-platform secure credential storage for xAI API key. Supports batch generation, aspect ratios, and style transfer.