Use cases
Export a Telegram chat to Markdown
With Dotiphant, you can turn any Telegram chat into a clean Markdown transcript. In the local viewer, copy selected messages or the last 7 days, or download the whole chat as a file. In the terminal, dotiphant export CHAT prints the chat as Markdown, for any time range, ready to save or pipe into an AI tool.
Why Markdown
Telegram Desktop can export chats as HTML or JSON. Both are made for machines or for archiving, not for reading or pasting into an AI assistant. Markdown is plain text with a little structure: every AI tool reads it well, it fits into notes apps and Git repositories, and you can read it yourself without any viewer.
Dotiphant keeps a read-only archive of your chats on your computer, so exporting is a local operation. It sends no request to Telegram and works offline.
Before you start
Install Dotiphant and run the setup once. It takes about five minutes and loads the last 365 days of your people and groups by default. For older messages, run dotiphant sync --all-history once. See Install Dotiphant.
In the viewer
- Open the viewer. It runs on your computer at 127.0.0.1 and opens in your browser.
dotiphant open - Open the chat you want.
- Pick what to export. "Copy last 7 days" puts the last week on your clipboard. "Export chat" downloads the whole chat as a Markdown file. To copy only some messages, select them and choose "Copy as Markdown".
- Paste the result into your AI assistant, a note or a document.
On the command line
dotiphant export prints a chat as Markdown. CHAT can be a chat id, an @username or part of the title. dotiphant chats lists the chats in your archive if you are not sure of the name.
dotiphant export "Acme" # the whole chatdotiphant export "Acme" --since 7d # the last 7 daysdotiphant export "Acme" --since 2026-09-01 --until 2026-09-30dotiphant export @clara --limit 200 # the newest 200 messagesdotiphant export "Acme" --since 30d --out acme.md # save to a file--since takes a duration like 24h or 7d, or a date like 2026-09-01. --until ends the range, --limit keeps only the newest messages, and --out (or -o) writes a file instead of printing. The file is created readable only by your user account.
What the transcript looks like
The transcript is built to be easy to read, for people and for AI:
- A heading with the chat title, then one line that says whether it is a Telegram or WhatsApp chat, what kind of chat it is, how many messages it holds and which dates it covers. Times are in UTC.
- One heading per message, with the date and time, the sender and the message id, like
## 2026-09-14 10:02, Clara (#4812). - Forum topics, forwards, replies and edits are noted with the message, so the context survives.
- Attachments show as a short label in brackets, like the file type and name, not as the file itself.
Pipe it into an AI tool
Because the export goes to standard output, you can send it straight into any command line AI tool. For example, with Claude Code:
dotiphant export "Acme" --since 7d | claude -p "What are the open action items?"If your AI app supports MCP, you may not need an export at all: connect it with dotiphant connect and it can search and read your chats on its own. See A local Telegram MCP server.
Already have a Telegram Desktop export?
You can import it. Import is experimental: it is tested with sample files, not yet with many real exports. In Telegram Desktop, choose "Export chat history" for one chat, or Settings > Advanced > "Export Telegram data" for the account, with the format "Machine-readable JSON". Then add it to the archive and export it as Markdown like any other chat:
dotiphant import ~/Downloads/Telegram\ Desktop/ChatExport_2024-01-31The path can be the export folder or its result.json. Importing again is safe: messages already in the archive are kept as they are.
Limits
- The export holds what your archive holds. Secret chats are never included, and channels are off by default.
- Media files are not embedded in the Markdown. Download them in the viewer or with
dotiphant media CHAT. - When you paste a transcript into an AI app, its provider receives those messages, under its privacy terms. The transcript also contains other people's messages, so share it with care.
Install Dotiphant
Free and open source (MIT). macOS and Linux; Windows experimental. The command installs the latest GitHub release and opens the setup in your browser. It takes about five minutes.
The script is about 150 lines. Read it first, or see other ways to install. The installer verifies the download against the release checksums (SHA256SUMS) before installing. You can check signed build provenance with gh attestation verify; see Verify a download.
curl -fsSL https://dotiphant.com/install.sh | shdotiphant open # setup opens in your browser