ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified communication Safety 4/5

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.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/cyberash-dev/tg-mtproto-cli
Or

What 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

  1. "List the last 20 messages from the 'Open Source Updates' channel and save them to a file."
  2. "Download all images shared in the 'Family Photos' group from the last 48 hours to the ./downloads folder."
  3. "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 auth process; 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

Stars3409
Views1
Updated2026-03-25
View Author Profile
AI Skill Finder

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 skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-cyberash-dev-tg-mtproto-cli": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#telegram#mtproto#cli#automation#messenger
Safety Score: 4/5

Flags: network-access, file-write, file-read, external-api