finds.dev← search

// the find

badlogic/pi-telegram

★ 312 · TypeScript · updated Apr 2026

Telegram DM bridge extension for pi

A pi extension that bridges a pi coding-agent session to Telegram DMs so you can drive it from your phone instead of a terminal — send prompts, images, and files, get generated files sent back, with streaming previews of the agent's output. It's for people already using pi who want to check on or steer a long-running session remotely.

The single-user pairing scheme (first DM to the bot claims it) is a pragmatic zero-config auth model for a personal tool — no OAuth setup, no manual allowlisting. It handles real Telegram API quirks correctly: splitting replies under the 4096-char limit, trying sendMessageDraft for streaming and falling back to sendMessage/editMessageText when unsupported, and queuing follow-up messages instead of dropping them while the agent is busy. File handling is bidirectional — inbound images/files get downloaded and forwarded as paths, outbound files go through a dedicated telegram_attach tool — which is the harder half of a bridge like this to get right.

It's a single index.ts file with no tests anywhere in the tree, so any regression in the streaming or queueing logic has nothing to catch it before it ships to a user's bot. The "first DM wins" pairing has no documented re-pair or revoke path — if anyone else messages the bot before you do, they become the permanent allowed user with no way out short of hand-editing telegram.json. Downloaded files land in ~/.pi/agent/tmp/telegram with no mention of cleanup, so regular image or file sharing will quietly grow that directory forever. There's also no discussion of what happens on Telegram polling disconnects, API failures, or token revocation, which matters for something meant to be a reliable remote control for an agent session.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →