Backup Telegram Chats with CLI Tool
The synchromessotron tool lets you export messages, media files, and metadata from Telegram channels, groups, and private chats to local storage. Requests are made on behalf of the user via official Telegram API libraries, ensuring access only to visible content. Supports Markdown for human reading and JSON for parsing, with media saved in original formats.
Installation and Setup
Download the release from GitHub: github.com/vsirotin/synchromessotron/releases.
- Download the documentation in your preferred language (Russian available).
- Choose the executable for your OS: telegram-cli.exe for Windows, corresponding binaries for Linux/macOS.
- Place all files in the same directory.
- Start the backup process with:
telegram-cli backup
Command-line interface. For GUI version, check the repository for updates.
Security and Limitations
- Data Storage: API ID, hash, and session are stored locally in a config file next to the exe. Accessible only with physical machine access. Delete the file to reset.
- Data Transfer: All data flows exclusively to Telegram servers via TDLib-like calls—no third-party endpoints involved.
- Flood Limits: Respects Telegram’s rate limits; ban risk is minimal as the tool mimics real user behavior.
- Formats: Text in Markdown, JSON with full structure (entities, reactions, replies), media preserved without conversion.
Unlike the official Desktop client export, it supports incremental sync, date/ID filtering, and script-based automation.
Export Configuration
The backup command captures all available content by default. Additional options:
--chat-id <ID>: specific chat or channel.--from-date <YYYY-MM-DD>: start from a given date.--limit <N>: maximum number of messages.--media-only: export only media files.
Example of selective export:
telegram-cli backup --chat-id @mychannel --from-date 2024-01-01 --limit 5000
JSON output includes message_id, date, from_id, reply_to, media (photo/video/document), and text with entities (bold, link, code).
Comparison with Alternatives
| Feature | synchromessotron | Official Export | tg-archive |
|--------|------------------|-----------------|------------|
| GUI | No (CLI only) | Yes | No |
| Incremental Sync | Yes | No | Partial |
| JSON + Markdown | Yes | HTML/JSON | JSON |
| Rate Limits | Enforced | Limited | May be violated |
| Media Export | Full | Yes | Yes |
Ideal for local analysis, data migration, and offline archiving. Open-source under MIT license.
Key Points
- Local session storage reduces leakage risks.
- Adherence to API rate limits prevents account bans.
- Dual format (Markdown/JSON) ensures readability for both humans and machines.
- Scriptable automation enables scheduled backups.
- Works with private groups and channels without extra permissions.
— Editorial Team
No comments yet.