Telegram CLI (tgctl-telethon) for Openclaw

A Python-powered command-line interface for managing Telegram user accounts via the Telethon library.

youziyouzishu
v1.0.0
Mar 30, 2026
0
799
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install telegram-telethon

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install telegram-telethon using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Telegram CLI (tgctl-telethon)?

Telegram CLI (tgctl-telethon) is a technical tool designed for developers who need to interact with Telegram at the user-account level. Unlike the standard Bot API, this skill uses the MTProto protocol through the Telethon library, allowing for actions typically reserved for human users such as joining groups, managing contacts, and updating profiles. This integration is a powerful component of the Openclaw Skills collection, providing a scriptable bridge between local environments and the Telegram ecosystem.

By serving as a drop-in replacement for traditional Go-based tools, tgctl-telethon offers a familiar interface for messaging, search, and group management. It is optimized for security and performance, ensuring that all session data remains local while providing comprehensive access to Telegram's robust communication features.

Telegram CLI (tgctl-telethon) Use Cases

  • Automating responses and message forwarding across multiple Telegram accounts.
  • Programmatically managing large Telegram groups or channels including member invites and admin roles.
  • Building custom archival tools to download chat history and media for local processing.
  • Monitoring specific chats or users in real-time for automated alert systems.
  • Updating account profiles and statuses dynamically based on external system events.

How Telegram CLI (tgctl-telethon) Works

  1. The user provides Telegram API credentials (ID and Hash) to initialize the secure MTProto connection.
  2. An interactive login process authenticates the session via a phone number and verification code.
  3. The skill stores a persistent session file locally to enable non-interactive commands in future sessions.
  4. CLI commands are translated into Telethon function calls that communicate directly with official Telegram servers.
  5. The tool processes server responses and outputs data in a clean, human-readable format or saves files to the local disk.

Telegram CLI (tgctl-telethon) Setup

To begin using this skill from the Openclaw Skills library, first run the installation script to set up dependencies:

bash <skill-dir>/scripts/install.sh

Next, retrieve your api_id and api_hash from the official Telegram API development tools and perform the initial login:

TELEGRAM_API_ID=${ID} TELEGRAM_API_HASH=${HASH} tgctl-telethon login

Finally, ensure your environment variables are configured in your shell or configuration file to maintain access without re-entering credentials.

Telegram CLI (tgctl-telethon) Data Schema & Taxonomy

The skill manages its data through a structured local file system and environment-based configuration:

Component Type Location / Format
Session Data File ~/.tgctl-telethon/<profile>/
Credentials Environment TELEGRAM_API_ID, TELEGRAM_API_HASH
User IDs Integer Positive numeric values
Group/Channel IDs Integer Negative numeric values
Media Downloads Binary User-defined output paths

All session management is handled locally to ensure privacy and compliance with Openclaw Skills security standards.

Telegram CLI (tgctl-telethon) Advanced Features

  • Support for multi-account management using the --profile flag to isolate different session data.
  • Real-time event monitoring via the listen command for building reactive automation bots.
  • Advanced group administration features including kicking, inviting, and granular admin permission management.
  • Capability to interact with third-party bots using user-account callbacks and parameters.
  • Profile management tools to programmatically update first names, last names, and bios.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*