Skip to content
Back to skills

Tgsearch

ASecurity

Search Telegram from the CLI — discover public channels by keyword or search messages within a channel. Use when the user wants to find Telegram channels, look up posts/messages in a channel, or do Telegram OSINT from the terminal.

  • 6 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
toolspythonbashapi

Works with

  • terminal
  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 3 files and shows the line behind each finding

Scanned November 15, 2026

npx -y skills add gbencke/dotfiles --skill tgsearch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tgsearch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tgsearch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gbencke-tgsearch/badge)](https://www.skillsdirectory.com/skills/gbencke-tgsearch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tgsearch
description: Search Telegram from the CLI — discover public channels by keyword or search messages within a channel. Use when the user wants to find Telegram channels, look up posts/messages in a channel, or do Telegram OSINT from the terminal.
---

# tgsearch

CLI for Telegram search, built on Telethon (MTProto user API — not the Bot API).

## Setup

1. `pip install telethon`
2. Set `TG_API_ID` and `TG_API_HASH` in the environment — get them at https://my.telegram.org (API Development Tools).
3. First run prompts for phone number + login code; the session is cached in `tgsearch.session` afterwards.

## Usage

Run the script in this skill's directory (`tgsearch.py`):

```bash
python3 tgsearch.py find "osint"              # discover public channels by keyword
python3 tgsearch.py find "osint" -n 50        # more results
python3 tgsearch.py grep @channelname "cve"   # search messages within a channel
python3 tgsearch.py grep @channelname "cve" -n 100
```

Output of `find`: `@username  members  title` per line. Output of `grep`: `date  first-100-chars-of-message` per line.

## Notes

- `find` uses Telegram's contacts search — the same discovery the apps use. There is no API for a true global search of all public channels; results are what Telegram returns for the account.
- `grep` searches message text server-side in a single channel the account can see (public channels work without joining).
- Rate limits apply: keep `-n` modest and avoid rapid repeated calls.

Files in this skill

  • README.md571 B
  • SKILL.md1.5 KB
  • tgsearch.py2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.