tg-drive by thedavidweng

Your Telegram channel,
as a file system.

tg-drive uploads files as ordinary Telegram media, keeps a rebuildable index, and gives you ls, tree, and a native app on top. Lose the database, and the channel rebuilds it.

Download

Everything a drive needs. Nothing Telegram doesn't already have.

The channel stays a normal channel. tg-drive adds the structure on top, and can always rebuild it.

Plain Telegram underneath

Files are ordinary media messages. Any Telegram client can browse them and filter folders by hashtag.

Recoverable by design

Telegram is the source of truth. Lose the database and td scan --full rebuilds the index from the channel.

A real file tree

Exact ls and tree. Upload and download whole trees; move, rename, delete, or tombstone files.

Scriptable

Every command speaks stable --json on stdout with documented exit codes. Logs stay on stderr.

Resumable uploads

Files larger than 10 MB pick up where they stopped. Only the parts Telegram never confirmed are sent again.

A desktop app, too

td-gui puts the same engine behind a native window: drive, transfers, import, and maintenance.

How it works

  1. 1

    One channel, one root

    td init binds a Telegram channel to a local folder and links a discussion group for machine records.

  2. 2

    Readable posts, precise records

    Each file is a media message with a human caption. Its manifest lives in the comment thread, out of the timeline.

  3. 3

    A cache you can throw away

    SQLite only mirrors the channel. On a new machine, bind the same channel again and the index comes back.

# sign in once, as your own Telegram user
$ td auth setup
$ td auth login

# bind a channel and upload
$ td init ~/Pictures --create-channel
$ td cp ~/Pictures/beach.jpg /2024/beach.jpg

$ td tree /
/
└── 2024
    └── beach.jpg

# new machine? the channel remembers
$ td init ~/Pictures --bind-channel

Free, open source, and yours.

Apache-2.0. Your files stay in your own Telegram account; tg-drive never runs a server.