A better Telegram archiver.
Early development. Currently working:
- Incremental sync (picks up from the last archived message)
- Append-only storage — nothing is ever modified or deleted from the archive
- Full-text search — find messages across all archived chats
- Media deduplication — avoid storing the same file twice, saving significant disk space
- AI enhancements — auto-tagging, categorization, OCR, audio transcription and summarization
- Frontend — a local web UI with proper topic support and resolved deleted-user identities
- Developer-friendly data access — clean API/library interface for building on top of the archive
Copy .env.example to .env and fill in your values:
cp .env.example .env| Variable | Required | Description |
|---|---|---|
TG_APP_ID |
yes | Telegram app ID (integer) — from my.telegram.org/apps |
TG_APP_HASH |
yes | Telegram app hash — from my.telegram.org/apps |
TG_PHONE |
yes | Your Telegram account phone number in international format (e.g. +15551234567) |
BTGA_SESSION |
no | Telethon session file name, default btga (a <name>.session file is created) |
BTGA_DB_URL |
no | Sqlite database URL, default sqlite+aiosqlite:///btga.db |
# Show config and archive status
btga status
# List your Telegram chats
btga chats
# Sync a chat (interactive picker if no argument given)
btga sync
btga sync 'me' # sync your saved messages
btga sync username # or @username
btga sync -0000000000000 # chat id
# Verbose
btga -v sync
btga -vv sync # debug