$ cat ~/map/pi-telegram-gateway.md
Pi Telegram Gateway
Telegram gateway on the official pi SDK — per-chat sessions, follow-up queueing, mid-flight steering, and cron jobs.
tools✓ Sep 8
Facts
- GitHub Stars
- ★ 0
- Forks
- 0
- license
- —
- npm / mo
- —
- last push
- Sep 24, 2026
## TL;DR
A Telegram gateway for pi built on the official SDK: per-chat persistent sessions, follow-up queueing when pi is busy, /steer mid-flight redirection, /cron scheduled autonomous jobs, and live throttled tool notifications.
## Key points
- $Runs pi's full tool surface — bash, read, write, edit, plus installed skills and extensions — behind a Telegram bot built on the official @earendil-works/pi-coding-agent SDK with grammY and croner.
- $Each Telegram chat gets its own persistent conversation history and context management.
- $Messages sent while pi is busy queue automatically as follow-up tasks; /steer <instruction> adjusts the agent's course mid-flight.
- $/cron creates scheduled autonomous background jobs such as daily briefings; tool notifications stream live with throttling.
- $Setup is a BotFather token → .env (TELEGRAM_BOT_TOKEN, optional ALLOWED_USERS) → bun run start, with npm run daemon for an auto-restarting background run (Termux wake-lock) and a loopback /health endpoint on port 4080.
## FAQ
Q Can multiple people use one gateway?
Set ALLOWED_USERS in .env to restrict who can talk to the bot; every chat keeps its own persistent session and context.
Q How do I keep it running long-term?
npm run daemon starts it as an auto-restarting background process (with a Termux wake-lock on Android), and npm run status reports live health — the gateway also exposes a /health JSON endpoint on port 4080.
## References
## Related entries
$ Pi Telegram
Telegram frontend pairing one bot with one live pi session — owner-only input, steering, and Rich Message answers.
$ aft
Sensorimotor-cortex layer that ships thin adapters for Pi and OpenCode, replacing raw read/write/edit/bash with semantic operations.
$ CCompactor
Turns finished coding-agent sessions — Pi, Claude Code, Codex — into compact, verified, provenance-linked handoff artifacts, in TypeScript.
## Guides
Last updated: Sep 8, 2026