Self-Hosted Telegram Bot for Pi AI Agent Control
Minimalist Telegram interface to control Pi AI agent harness with shell execution and session switching
About this automation
Build a minimalist self-hosted Telegram bot that connects directly to a Pi AI agent harness, allowing you to switch sessions, task the agent from cron/at, and execute bash commands directly from Telegram. Intentionally stripped of features that bash or the LLM can handle better.
How to implement
Set up Pi AI agent harness with your custom configuration
Create Telegram bot via BotFather and obtain API token
Write TypeScript/Bun handler for Telegram messages
Implement session switching logic to preserve context across commands
Add cron/at integration to task agent from shell and receive Telegram responses
Implement bash execution handler with safety considerations
Compile to single binary and deploy on your infrastructure
Test session persistence and context management