Skip to content

The Telegram Bridge (Advanced)

A bonus, not a requirement. Your system runs completely without it.

Once set up, you can reach your operating system from your phone — think through a problem, read your files, edit a project, capture a decision — through a private Telegram chat.

It runs locked down deliberately. From your phone the agent can read and edit your files, but it has no way to act on the outside world. It cannot send email, post to social, or touch any connected tool.

Ask it to do something outward and it writes the task into a queue file (inbox/desk-queue.md) for you to handle later at your computer.

This needs a computer that is always on and always running your system — in practice a small cloud server. Your phone talks to that machine; that machine runs the system and answers you.

See Setting Up on a Server. Everything below assumes that machine exists and your system is installed on it.

Everything you will touch lives in automations/telegram-bridge/. The scripts are already there — you create the bot, fill in a small settings file, and turn it on.

In Telegram, open a chat with @BotFather and send /newbot.

Give it a display name and a username ending in bot. BotFather sends back a token like 123456789:AAH9xV...

Step 2 — Put the token in your settings file

Section titled “Step 2 — Put the token in your settings file”

On your always-on machine:

Terminal window
cd automations/telegram-bridge
cp .env.example .env

Open .env and paste your token:

TELEGRAM_BOT_TOKEN=123456789:AAH9xV...your-secret-token

Lock the file so only you can read it:

Terminal window
chmod 600 .env

Leave the other lines blank for now.

The bot only answers people on an approved list, identified by a numeric Telegram ID.

First, message your new bot anything from your phone. Then on the machine:

Terminal window
python3 identify.py

It confirms your token works and prints your numeric ID. Put that number into .env in both places — for a one-person setup they are the same number:

ROBERT_USER_ID=your-numeric-id
TELEGRAM_CHAT_ID=your-numeric-id

These IDs are not secrets. The bot simply ignores every message from an ID that is not approved.

bot.py does the listening and responds only to approved IDs. It uses long polling, so there are no open ports and nothing exposed to the public web.

Nothing to configure. It is described here so you know what is running: a quiet, approved-list-only doorman.

Already enforced in agent_runner.py. Nothing to change, but here is what is locked:

No shell, no commands. The phone agent runs with a fixed, minimal tool set — Read, Edit, Write, Glob, Grep. It can read and edit files but cannot run programs.

No integrations. It loads zero connected tools, so it has no path to your email, social accounts, or CRM.

Both locks are required. During the build, the tool limit alone was not enough — an integration leaked through once and created a real contact before the second lock was added. With both in place, the phone-side system can think and edit but physically cannot reach the outside world.

Each conversation keeps its own saved session, so the bot remembers what you were discussing instead of starting over every message. Nothing to set up.

Terminal window
bash install-service.sh

It asks for your machine’s admin password, because it registers the bridge as a permanent background service — starting on boot and restarting itself if it stops.

You should see bridge up as @YourBotName.

To check on it later:

Terminal window
sudo systemctl status telegram-bridge
sudo journalctl -u telegram-bridge -n 30

From your phone, ask something only your system would know: “What’s in my current priorities?” Then confirm three things:

  1. It answers using your real content
  2. It remembers — send “summarize that in one line” and it should know what “that” was
  3. It refuses to act outward — ask it to “email this to my partner.” It should send nothing, and tell you it parked the task in your desk queue.

If all three hold, you are done.

The bot never messages you first. It only replies when you reach out. No schedule, nothing it sends on its own. Mute the chat if you want it quieter still.

It is a tool you pick up, never one that taps you on the shoulder.