# oh-my-pi-telegram
**A Telegram companion hub for live [Oh My Pi](https://github.com/can1357/oh-my-pi) (`omp`) sessions —
queue prompts, stream replies, send files and voice, and supervise your agent from your phone.**



[Install](#installation) · [Features](#what-it-does) · [How it works](#how-it-works) · [Limitations](#limitations) · [Development](#development) · [CI/CD](#cicd)
> [!NOTE]
> **Project status:** fork of [`@llblab/pi-telegram@0.22.0`](https://github.com/llblab/pi-telegram/tree/v0.22.0)
> (SHA `afe09c5`), repackaged as `@evandrodevbr/oh-my-pi-telegram` and declared as an
> `omp` extension. Per [`CHANGELOG.md`](CHANGELOG.md), the fork passes the upstream
> gates (typecheck, 1229/1230 tests with one platform-only skip, `npm audit` with 0
> vulnerabilities, clean `npm pack --dry-run`). The latest commit adds a design spec
> for an OMP 17 status-bar segment ([`docs/superpowers/specs/`](docs/superpowers/specs/2026-07-15-telegram-omp-status-design.md));
> that spec needs a new OMP core API and is **not implemented in this repository yet**.
> [!IMPORTANT]
> **This is a runtime adapter, not a remote terminal.** Telegram prompts are normal
> model turns in the instance's *currently active* session and inherit its
> post-compaction context, so token cost is not proportional only to the new mobile
> message. Telegram can compact the current session, but cannot create, resume, fork,
> browse or switch sessions, and arbitrary slash commands are never forwarded to the TUI.
## Installation
Requires `omp` ≥ 16.5.2 (`@oh-my-pi/pi-coding-agent`) and Node.js ≥ 22.19.0.
```bash
# From git (this repository)
omp plugin install https://git.evandro.dev.br/evandro/oh-my-pi-telegram.git
# From npm (once the package is published)
omp plugin install npm:@evandrodevbr/oh-my-pi-telegram
# From a local checkout (development)
omp plugin link /path/to/oh-my-pi-telegram
```
Restart (or reload) `omp` so the extension loads, then:
1. Create a bot with [@BotFather](https://t.me/BotFather) (`/newbot`) and copy the token.
2. In `omp`, run `/telegram-setup` and paste the token.
3. Run `/telegram-connect` to activate polling for this instance.
4. In the bot DM, send `/start`.
> [!WARNING]
> **The first Telegram user to message the bot becomes the allowed owner**; everyone
> else is ignored. Pair right after `/telegram-connect`, and never put the bot token in
> chat, source, committed config or logs. Setup can prefill the token from
> `TELEGRAM_BOT_TOKEN`, `TELEGRAM_BOT_KEY`, `TELEGRAM_TOKEN` or `TELEGRAM_KEY`; the saved
> config lives in `~/.pi/agent/telegram.json`.
## Why this fork and not upstream
`llblab/pi-telegram@0.22.0` targets the Pi extension platform (`@earendil-works/pi-*`).
`omp` consumes the same platform republished as `@oh-my-pi/pi-coding-agent`. This fork:
1. Renames the package to `@evandrodevbr/oh-my-pi-telegram` so it is unambiguous in the `omp` extension registry.
2. Keeps the upstream `peerDependencies` on `@earendil-works/pi-{ai,agent-core,coding-agent}` `>=0.80.6`, the runtime surface `omp` consumes — no code changes or shims.
3. Declares the extension through an `omp` block in `package.json` (`extensions`, display name and `compatibleWith: >=16.5.2`); the old `pi` block was replaced by it.
4. Re-runs every upstream gate (`typecheck` → `test` → `audit` → `pack:check`) on the `v0.22.0` source.
Lineage: `badlogic/pi-telegram` → `llblab/pi-telegram` (0.22.0) → **this fork**.
## What it does
| Surface | What you can do |
|---|---|
| **Prompt intake** | Send text, replies, edits, images, files, albums and voice notes into the session |
| **Queue control** | Messages sent while the agent is busy become queued turns; inspect, delete, promote, continue, abort, stop or force the next one |
| **Operator menu** | `/start` opens status, prompt templates, model, thinking level, settings, queue and extension sections |
| **Prompt templates** | Run Pi prompt templates as Telegram-safe commands such as `/fix_tests` |
| **Model and thinking** | Switch model or reasoning level through safe continuation flows; confirm `/compact` |
| **Rich replies** | Native Rich Markdown (default) or legacy Markdown-to-HTML for final answers; optional live draft previews; native `…typing` status while the agent works |
| **Files** | Inbound files land in `