← Catalog

pi-telebridge

A pi extension that creates a two-way relay between your active pi coding agent session and a Telegram bot.

Extension

Install

Install with PiG

pig install npm:pi-telebridge

Install with Pi

pi install npm:pi-telebridge
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.4.0 (README.md). PiG does not review it.

pi-telebridge

A pi extension that creates a two-way relay between your active pi coding agent session and a Telegram bot. Enable it per-session with /telegram, then interact with your session from your phone.

  • Agent → Phone: Every final assistant response is forwarded to your Telegram chat
  • Phone → Agent: Your Telegram replies are injected as user messages into the session
  • Voice Messages: Voice, audio, and video note messages are downloaded and forwarded to the agent for transcription
  • Photos: Photos are downloaded and forwarded to the agent for viewing/analysis

Both the pi TUI and Telegram inputs coexist — you can use either at any time.

Install

pi install npm:pi-telebridge

Setup

  1. Create a bot with @BotFather on Telegram and copy the token
  2. In pi, run /telegram setup
  3. Enter your bot token when prompted
  4. Send any message to your bot on Telegram — this links your chat ID
  5. Done! Config is saved to ~/.pi/agent/telebridge.json

Environment Variables (optional)

You can skip the interactive setup by setting these beforehand:

VariablePurpose
TELEGRAM_BOT_TOKENBot token from @BotFather
TELEGRAM_CHAT_IDYour Telegram chat ID

Usage

CommandDescription
/telegramToggle relay on/off for this session
/telegram setupGuided setup: enter bot token, discover chat ID
/telegram statusShow connection state, chat ID, relay status

When the relay is enabled:

  • A 📡 TG indicator appears in the footer
  • Every assistant response is forwarded to your Telegram chat
  • Messages you send to the bot are injected into the pi session
  • Voice/audio messages are downloaded to ~/.pi/agent/voice_messages/ and forwarded as [Voice message received: <path>]
  • Photos are downloaded to ~/.pi/agent/photo_messages/ and forwarded as [Photo received: <path>]
  • If the agent is idle, your message starts a new turn; if busy, it's queued as a follow-up

Security

  • Only messages from your configured chat_id are accepted
  • All other Telegram messages are silently ignored
  • Bot token and chat ID are stored locally in ~/.pi/agent/telebridge.json

License

MIT