tg-cli

Syncs Telegram chats and searches/export messages locally via CLI.

277|32|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/public-clis/tg-cli --skill tg-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tg-cli
Source: https://github.com/public-clis/tg-cli/tree/main
Command: npx skills add https://github.com/public-clis/tg-cli --skill tg-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CLI tool for Telegram enables local management of chats and messages, allowing you to sync chats, search messages, filter keywords, and monitor groups from the terminal for AI-assisted retrieval and analysis.

Core Features & Use Cases

  • Sync chats: maintain a local, queryable cache of Telegram conversations for offline access and AI agent retrieval.
  • Search messages: perform keyword or regex searches across stored messages with optional filters.
  • Export and monitor: export messages in JSON, YAML, or plain text formats and listen for near real-time updates.
  • Use Case: feed AI agents with local chat data to reason about conversations without hitting Telegram APIs.

Quick Start

Install kabi-tg-cli, then run tg chats to verify your connection and see your chats.

Frequently Asked Questions about tg-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync Telegram chats to a local cache for offline access?

You can sync Telegram chats to a local, queryable cache using this CLI tool, enabling offline access and AI agent retrieval without hitting Telegram APIs repeatedly.

Can I search Telegram messages with regex and filters from the terminal?

Yes, you can perform keyword or regex searches across stored Telegram messages with optional filters to find specific conversations quickly from your terminal.

Does tg-cli support exporting Telegram messages in JSON or YAML formats?

tg-cli supports exporting Telegram messages in JSON, YAML, or plain text formats, allowing you to feed structured chat data to AI agents for analysis.

What is the best way to monitor Telegram group activity in near real-time?

You can monitor Telegram group activity in near real-time by using the CLI's listen feature, which tracks updates and feeds them into your local workflows.

How does local Telegram data management work with Telethon for AI retrieval?

Local Telegram data management works by syncing chats via Telethon into a structured local cache, allowing AI agents to reason about conversations offline.

Do I need Telegram API credentials to use a terminal-based Telegram chat manager?

Yes, you need Telegram API credentials to authenticate your connection, allowing the CLI to securely sync and manage your chats locally from the terminal.