Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

tg-hub

Skill by OpenMinis

tg-hub reads and writes Telegram data through Telethon, using Python and UV. It syncs group and channel messages into a local SQLite database for keyword search, filtering, statistics and speaker rankings. It suits users who need programmatic access to their Telegram chats.

  • Score 75
  • 628 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install tg-hub

Built from the published package, never by AI.

git clone --depth 1 https://github.com/OpenMinis/MinisSkills /tmp/MinisSkills && mkdir -p ~/.claude/skills && cp -r /tmp/MinisSkills/tg-hub ~/.claude/skills/tg-hub

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install tg-hub in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

tg-hub is a skill for reading and writing Telegram data with Python and UV. It uses the MTProto protocol through Telethon rather than the Bot API, so it logs in with your own Telegram account. Group and channel messages are synced into a local SQLite database, and searches, multi-keyword filters, today's messages, speaker rankings and timeline statistics then run offline.

The first login is done once in a terminal with a phone number and verification code, after which the session is saved. Refresh calls fetch only new messages incrementally. The skill is based on jackwener/tg-cli under the Apache-2.0 licence and keeps Telethon as its only third-party dependency. It suits users who want programmatic access to Telegram group and channel messages.

Written from the project's SKILL.md and checked against it.

What it can do

  • syncSyncs a single group or channel's messages into local SQLite.
  • sync_allSyncs all groups with optional throttling and a chat count limit.
  • refreshQuickly fetches new messages incrementally, recommended for daily use.
  • searchSearches locally stored messages by keyword or regex.
  • filterFilters local messages by multiple keywords using OR logic.
  • todayReturns today's locally stored messages.
  • recentReturns locally stored messages from the last N hours.
  • top_sendersRanks speakers by message count in a chat over a time window.
  • timelineShows message timeline statistics by granularity such as hour.
  • statsReports local database totals and the groups stored.

What you need

  • Python and UV
  • A Telegram account with access to your phone number
  • Telegram verification code for the first login
  • Your own TG_API_ID and TG_API_HASH (recommended)

Try asking

  • Sync the latest messages from my Telegram group and show new counts.
  • Search my synced Telegram groups for messages containing 'Python'.
  • Who were the top 5 speakers in my Telegram channels over the last 24 hours?

Good to know

  • The first login must be completed in an interactive terminal.
  • Using the default api_id=2040 prints a warning and is only a fallback.
  • Telegram applies rate limits, and large syncs can take a long time.
  • Search and statistics only cover messages already synced to the local database.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: tg-hub/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to tg-hub

All alternatives →

Compare with setup-zoom-webhooks, baoyu-post-to-weibo or add-dial-number

tg-hub: common questions

Does tg-hub need a Telegram bot token?

No. tg-hub uses the MTProto protocol through Telethon, not the Bot API, so it logs in with your own Telegram account.

Do searches need an internet connection?

Read operations such as search, today and recent query the local SQLite database with no network access. Only sync and refresh connect to Telegram.

Why does tg-hub recommend my own API ID and hash?

The source says the public app ID is only a fallback and that using your own credentials is recommended to reduce risk-control issues for long-term use.

How do I install tg-hub?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is tg-hub free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is tg-hub safe to use?

It scores 75 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to tg-hub?

Similar skills: setup-zoom-webhooks, baoyu-post-to-weibo, add-dial-number, setup-zoom-websockets.

tg-hub Install

Add to stack

Loading.