skills/tgcli/SKILL.md
Read, search, and send Telegram messages via your personal account using the tgcli CLI. Use when the user asks to check their Telegram messages, search Telegram history, send Telegram messages to other people, or monitor Telegram conversations. Do NOT use for normal user chats routed through OpenClaw's Telegram channel.
npx skillsauth add technickai/openclaw-config tgcliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
CLI for reading, searching, and sending Telegram messages from a personal account via MTProto 2.0. The Telegram equivalent of wacli.
Use tgcli only when the user explicitly asks you to check their Telegram messages,
search Telegram history, or send a Telegram message to someone else.
Do NOT use tgcli for normal user chats; OpenClaw routes Telegram conversations
automatically via the bot channel.
~/.tgcli/ or files containing credentials, keys, or tokens.api_id and api_hash)tgcli login
Interactive flow: enter API credentials, phone number, verification code (sent to
Telegram app), and 2FA password if enabled. Session persists in ~/.tgcli/.
tgcli logout # End session and remove local data
After login, sync recent history to build the local search index:
tgcli sync # All chats (last 100 msgs each)
tgcli sync --chat @username # Full history for one chat
tgcli sync --msgs-per-chat 500 # More history per chat
tgcli chat ls # All chats (default 50)
tgcli chat ls --type private # Only DMs
tgcli chat ls --type group # Only groups
tgcli chat ls --type channel # Only channels
tgcli chat ls --limit 20 # Limit results
tgcli chat ls --json # Machine-readable output
tgcli msg ls @username # Last 20 messages
tgcli msg ls @username --limit 50 # Last 50 messages
tgcli msg ls 123456789 --json # By user ID, JSON output
Search uses SQLite FTS5 for instant offline full-text search. Run tgcli sync first to
build the index.
tgcli msg search "meeting notes" # Search all chats
tgcli msg search "budget" --chat @username # Search one chat
tgcli msg search "keyword" --limit 50 # More results
tgcli msg search "query" --json # JSON output
tgcli msg context @username 12345 # 5 msgs before + after
tgcli msg context @username 12345 --before 10 # 10 msgs before
tgcli msg context @username 12345 --after 10 # 10 msgs after
tgcli send text @username "Hello!" # By username
tgcli send text 123456789 "Hello!" # By user ID
tgcli send text +14155551212 "Hello!" # By phone (must be in contacts)
tgcli send file @username ./report.pdf # Send file
tgcli send file @username ./photo.jpg --caption "Check this out"
tgcli export @username # JSON to stdout
tgcli export @username -o backup.json # Save to file
tgcli export @username --local # From local DB (offline)
tgcli download @username 12345 # Download media from msg
tgcli download @username 12345 -o ~/media # Custom output directory
tgcli sync # All chats, recent msgs
tgcli sync --chat @username # Full history for one chat
tgcli sync --msgs-per-chat 500 # More depth per chat
| Format | Example | Type |
| --------------- | --------------- | --------------------------- |
| @username | @durov | Username |
| 123456789 | 123456789 | User/Chat ID |
| -123456789 | -123456789 | Group |
| -100123456789 | -100123456789 | Channel / Supergroup |
| +1234567890 | +14155551212 | Phone (must be in contacts) |
Important: Display names (e.g. "Jane Doe") do NOT work as chat identifiers. Use peer
IDs from tgcli chat ls --json. The recommended workflow:
tgcli chat ls --json to find the peer_id for a chatpeer_id in subsequent msg ls, msg search --chat, send, etc.| Flag | Description | Default |
| --------------- | ---------------------------- | ---------- |
| --json | Machine-readable JSON output | false |
| --store DIR | Data directory | ~/.tgcli |
| --timeout DUR | Command timeout | 5m |
tgcli connects via gotd/td, a pure-Go MTProto 2.0 implementation. This means:
Messages fetched from the API are cached in a local SQLite database with FTS5 full-text search, enabling instant offline search across your entire history.
All data lives in ~/.tgcli/ (configurable with --store):
| File | Contents |
| -------------- | --------------------------------------------- |
| config.json | API credentials (app_id, app_hash) -- private |
| session.json | MTProto session -- private |
| tgcli.db | Local message cache + FTS5 search index |
--json when parsing output programmaticallytgcli sync periodically to keep the local search index freshdevelopment
A pause before an artifact goes into the world. Reviews external comms, money, calendar, public posts, or send-as-operator actions through a small panel of independent lenses (empathy first) and returns a verdict of pass / edit / hold / block.
development
Route real repo work to Claude Code instead of editing by hand. Triggers on "claude code" or "cc", and on any request to edit, fix, refactor, or open a PR in a repo outside ~/.openclaw/workspace. Claude Code picks up the repo's CLAUDE.md / AGENTS.md, applies its standards, and knows the /ai-coding-config:multi-review and /ai-coding-config:address-pr-comments workflows we want bug bots checking against.
testing
Drive a task all the way to a verified done state — write DoD first, verify each item with evidence, stop only at named stop conditions.
tools
Design, build, and maintain autonomous OpenClaw workflows (stewards). Use when creating new workflow agents, improving existing ones, evaluating automation opportunities, or debugging workflow reliability. Triggers on "build a workflow", "create a steward", "automate this process", "workflow audit", "what should I automate", "create a cron job", "schedule a recurring task", "build a scheduled job".