Command-line tool that exports Telegram chats in the exact format of Telegram Desktop's JSON export, and converts exports into self-contained PDFs (media embedded as attachments).
- Talks MTProto directly (there is no OAuth for user accounts); all traffic is encrypted, with Perfect Forward Secrecy enabled.
- Handles long chats like Telegram Desktop does: takeout session, ascending slices of 100 messages, streaming output, and resume after an interruption.
- A single static Go binary with fonts embedded. Plain, pipe-friendly CLI.
make # builds bin/tg-export (Go 1.25+)
tg-export login # API ID/hash from my.telegram.org/apps
tg-export chats
tg-export export CHAT -o ~/backup --pdfDetails: docs/guide.md. Contributor and agent notes: AGENTS.md.
MIT © 2026 Maxim Altoukhov. Bundled Noto fonts are under the SIL OFL 1.1.