[← SUPER DESKTOP] ~/telegram
[00] ~/telegramBYOB · FORUM TOPICS · TAILSCALE MINI APP

TELEGRAM BOT · FORUM TOPICS · MINI WEB APP

Control your agents.
Right from Telegram.

Your @BotFather bot Mini Web App (live ANSI UI) Forum Topics (1 card = 1 topic)

Run a private local Telegram worker on your Omarchy PC using your own bot token, and open the full live-themed Telegram Mini Web App via Tailscale Serve. Zero third-party relay servers, zero open ports — works behind NAT and on headless machines.

Included in SUPER DESKTOP · Outbound HTTPS long-polling · No public IP or port forwarding

[01] ~/screensFORUM TOPICS · SETTINGS

USAGE & SETUP SCREENS

What it looks like on Telegram and on your PC.

Switch between a live 2-member Forum Topics group in Telegram and the desktop Settings → Telegram screen where you pair your account and control permissions.

Tip: click topics inside the Usage screen to preview each card state
My PC Agents 2 members · you + @my_sd_bot
Forum
⚡ Claude Code · super-desktop — Fix auth flow
Linked to card sd_term_1
Waiting
Pinned 🟡 Claude Code · ~/super-desktop · Status: ◌ WAITING
Live header
🟡 Waiting for input · ⚡ Claude Code · ~/super-desktop

Prompt: Fix auth flow and render updated screenshot

Yes No 1 2
⏎ Enter Esc ⛔ Ctrl-C
📷 Screen 📎 Files
📎 Files & links · ⚡ Claude Code · ~/super-desktop

3 file(s) · 2 link(s)

Links:
• https://example.org/docs/oauth
• http://localhost:3000/callback

🖼 overlay-preview.png · 203 KB
📕 auth-trace.pdf · 1.2 MB
📝 NOTES.md · 4 KB
🔗 example.org/docs/oauth
Example image sent directly to the Telegram topic after tapping an image file
Sent straight to the topic via sendPhoto when you tap 🖼 overlay-preview.png

Illustrative previews of the live Forum Topics workspace and the PC Settings → Telegram screen (sample session data).

[02] ~/capabilities10 CORE CAPABILITIES

CAPABILITIES

What you can do from Telegram.

Everything runs locally inside a dedicated super-desktop telegram-bot child process supervised by the daemon — whether the overlay is hidden, open, or running headless.

🗂

Live Dashboard + 1 card = 1 Topic

A pinned General dashboard shows every card plus provider Usage limits. Each running card gets its own color-tagged topic with a live status header and typing… indicator while working.

🚦

Live statuses & quiet 👍 acks

Pinned headers and the General dashboard update live status dots (🟢 🟡 ✅ 🔴 ⚪ ⚫) silently in place with zero topic-rename service spam, while prompts in Forum Topics acknowledge with a clean 👍 reaction.

📺

Instant Done reports & live output

When a harness finishes, a concise ✅ Done output summary arrives right in chat (final assistant reply or cleaned terminal result without TUI chrome). Tap 📺 Live (/live) while running for an auto-updating stream.

📎

Files, PDF pages & text pager

📎 Files (/files) filters Images, Docs, and Links with pagination, sends photos directly, previews PDF pages as images, pages long redacted text files inline, and opens public URL buttons.

⌨

Quick Keys & slash shortcuts

Tap ⌨ Keys (/keys) for Yes, No, 1–3, arrows, Tab, ⇧Tab, Esc, Ctrl-C, and agent shortcuts like /resume, /compact, and /clear.

📷

Bounded screen & history

Inspect live screen state with /screen or scrollback with /history. ANSI escapes are stripped and secrets masked before leaving your PC.

🚀

Launch & close sessions

Start new agents in remembered project folders using /new's 2-step inline keyboard wizard, or close finished cards cleanly with /close + confirmation.

🖼

Send photos, files & voice

Drop a screenshot, document, or voice clip directly into a card's topic — staged privately outside workspaces, never saved to random repos.

📱

Telegram Mini Web App (Tailscale)

Tap ⚡ Open App (or /app) for an Android-like WebSocket ANSI terminal, Weekly Usage bars, Quick Keys, and interactive Files & Previews over private tailscale serve.

🌐

Zero ports, headless-ready

Uses outbound HTTPS long-polling to api.telegram.org. Combine with Settings → System launch to control a PC with no display logged in.

[03] ~/setup5 STEPS · @BOTFATHER + APPROVAL

STEP BY STEP

Setup in five steps (with screenshots).

Takes about two minutes. You stay the sole owner of your bot token, your Telegram pairing, your Tailscale URL, and every permission switch.

Telegram Create your own bot via @BotFather

  1. Open Telegram and message the official verified @BotFather bot with /newbot.
  2. Pick a display name (for example My Super Desktop) and a unique username ending in bot (for example my_superdesktop_bot).
  3. Copy the HTTP API token (looks like 123456789:ABC...) and keep it private.

Privacy note: Leave @BotFather Group Privacy Mode enabled — promoting the bot to Admin in your private 2-member Forum group already lets it receive messages in topics.

PC Save the token, enable the bot, and pair your account

  1. Press Super + Shift + Q → open ⚙ Settings → Telegram.
  2. Under Bot setup (BYOB), paste your @BotFather token, click Save & verify (checks api.telegram.org/getMe), and switch Enable Telegram bot on until the green Running chip appears.
  3. Under Account pairing, click Pair Telegram account to generate a single-use QR code and t.me/<bot>?start=… invite link.
  4. Scan or tap the link in Telegram, hit Start, confirm the 6-digit comparison code matches on both screens, and click Approve on your PC. Access locks to your numeric Telegram user_id only.
SUPER DESKTOP Settings → Telegram showing Bot setup with Running status and Account pairing with single-use QR code, invite link, 6-digit comparison code, and Approve/Reject buttons
Settings → Telegram (Bot & Pairing): Token stays masked on disk (0600), QR/deep link expires after 5 minutes, and desktop approval verifies the 6-digit code.

Telegram Link a 2-member Forum Topics supergroup (recommended)

  1. In Telegram, create a new private group and add only your bot (2 members max — if any third person is in the group, /linkforum refuses to link).
  2. Open Group Info → Edit → Topics → Enable so topics are turned on.
  3. Open Administrators → Add Admin → select your bot and turn on Manage Topics, Delete Messages (to remove closed cards’ topics), and Pin Messages (so each topic can silently pin its live status card and delete closed card topics cleanly).
  4. Open the group's General topic and send /linkforum. SUPER DESKTOP pins a live Dashboard in General and spawns one color-tagged topic per running card — with zero status-rename spam and automatic ✅ Done output reports as soon as a turn finishes.
SUPER DESKTOP Settings → Telegram showing Forum Topics controls (Sync topics now, Unlink forum, Auto-create and Delete on close switches) and Mini Web App (Tailscale) configuration
Forum Topics & Mini Web App card: Toggle automatic topic creation/deletion, trigger manual resyncs, or click Auto-setup Tailscale Serve in one click.

PC Choose your permissions

By default, only Notifications and Redact common secrets start enabled. Turn on only the controls you want from Telegram — changes take effect immediately without restarting cards:

  • Enable Read terminal output to receive full ✅ Done result summaries, Waiting snippets, /screen, /history, /live, 📎 Files, and the Mini Web App terminal.
  • Enable Submit prompts and Control keys to reply directly from topics, approve prompts with Yes/No, or send interrupts.
SUPER DESKTOP Settings → Telegram Permissions list with granular toggles for Notifications, Read terminal output, Submit prompts, Control keys, Shell input, Launch, Close, Attachments, and Redact common secrets
Granular Permissions: Every risky action defaults Off; secret redaction masks API tokens, Bearer headers, .env secrets, and PEM keys before sending.

Phone Open the Mini Web App or message any topic

  1. Turn on Tailscale on your phone (if using the Mini Web App below) and tap ⚡ Open App or send /app in your 1:1 bot chat.
  2. Or jump into your linked Forum group: tap any topic, reply directly to steer that harness, tap inline Quick Keys, or check /usage in General.
[04] ~/mini-appTAILSCALE SERVE · LIVE ANSI UI

OPTIONAL · PRIVATE TAILNET UI

Telegram Mini Web App via Tailscale.

Want a full Android-like experience right inside Telegram — live colored ANSI terminal over WebSocket, automatic live Omarchy theme syncing (dark & light), weekly allowance meters, swipeable Quick Keys, and interactive image/PDF/code previews? Serve the embedded UI on 127.0.0.1:7789 and wrap it privately inside your own Tailscale tailnet using tailscale serve (never public Funnel).

Use this prompt to setup

Paste this prompt into Claude Code, Codex, OpenCode, Antigravity, Grok, or any AI coding agent on your Linux PC to configure Tailscale Serve and enable the Mini Web App safely without exposing any tokens.

AI Agent Setup Prompt · tailscale serve + config.json
Configure the SUPER DESKTOP Telegram Mini Web App on this Linux PC using Tailscale Serve (never Tailscale Funnel).

Rules:
- Never print, echo, or commit my bot token (`botToken`) or any secrets from config.json.
- Use `tailscale serve` (private to my tailnet only), never `tailscale funnel`.
- Keep all existing Telegram settings (`enabled`, `botToken`, `allowedUser`, `forum`, `permissions`) intact.

Steps:
1. Check Tailscale status with `tailscale status --json` and ensure it is Running with a `Self.DNSName`.
   - If MagicDNS or HTTPS Certificates are disabled, stop and tell me what toggle to enable in https://login.tailscale.com/admin/dns.
2. Expose only SUPER DESKTOP's local loopback Mini App server privately via Tailscale Serve:
   `tailscale serve --bg --https=8443 http://127.0.0.1:7789`
   and record `URL="https://<DNSName_without_trailing_dot>:8443"`.
3. Inspect `${XDG_STATE_HOME:-$HOME/.local/state}/super-desktop/telegram/config.json`:
   - If the Telegram bot is not yet configured (`enabled: false` or empty `botToken` or no `allowedUser`), stop and guide me through Settings → Telegram (`@BotFather` token + account pairing) first.
   - Otherwise update `config.json` atomically (`chmod 600`) to set:
     `miniApp.enabled = true`, `miniApp.listenPort = 7789`, `miniApp.publicUrl = "$URL"` (preserving `miniApp.shortName` and all other fields).
4. Signal/verify the worker cleanly:
   - Check `curl -fsS http://127.0.0.1:7789/health` and `curl -fsS "$URL/health"`.
   - If the `super-desktop telegram-bot` process isn't listening on `127.0.0.1:7789` yet, wait a couple seconds after updating `config.json` (the daemon hot-reloads it) or restart SUPER DESKTOP with `super-desktop status`.
5. Report back concisely:
   - The private Mini App `$URL`
   - Whether `/health` succeeded locally and via Tailscale HTTPS
   - Next steps on my phone (keep Tailscale ON, tap ⚡ Open App in 1:1 chat with the bot or run `/app`; optionally register `/newapp` in `@BotFather` and paste the short name into Settings → Telegram → Mini Web App for Forum Topic deep links).

Manual setup & optional @BotFather Forum Topic deep links

  1. Ensure MagicDNS and HTTPS Certificates are enabled in Tailscale Admin → DNS, and Tailscale is running on both your PC and your phone.
  2. Toggle Enable Telegram Mini Web App on in ⚙ Settings → Telegram, then click Auto-setup Tailscale Serve (or run tailscale serve --bg --https=8443 http://127.0.0.1:7789) and verify your https://<pc>.<tailnet>.ts.net:8443 URL saves cleanly.
  3. In your 1:1 chat with your bot, tap ⚡ Open App or send /app (works on Android, iOS, and Telegram Desktop while connected to your tailnet).
  4. Optional for Forum Topic buttons: Message @BotFather → /newapp, pick your bot, register a short name (e.g. superdesktop) pointing to your Tailscale Serve URL, and paste it in BotFather short name. Every card topic and ✅ Done report gains a 📱 Open App deep link directly to that card.
Multiple laptops & Linux servers? Telegram's Bot API allows only one active poller per bot token (sharing one token across two machines causes 409 Conflict). Simply create one @BotFather bot per machine (e.g. @sd_laptop_bot and @sd_server_bot) and group them — along with their Forum groups — into a single Telegram Chat Folder. Each machine runs independently with its own Tailscale Serve Mini App and its own live Omarchy theme.
[05] ~/commandsBOT COMMANDS

REFERENCE

Bot commands.

In a linked Forum group, messages and commands sent inside a topic apply automatically to that topic's card. In a private 1:1 chat with your bot, use /cards or reply to any card alert.

CommandAction
/appOpen the Android-like Telegram Mini Web App (live ANSI terminal, Usage & Files)
/cardsList active terminal cards with quick select, 📷 screen, and 📎 files buttons
/dashboard · /usageShow or refresh the live workspace dashboard, or view weekly allowance & progress bars for each provider
/statusShow selected card status, model, prompt, and inline action keyboard
/screenCapture current terminal screen (bounded, ANSI-stripped)
/history [N]Capture recent terminal scrollback (20–300 lines)
/liveStream a live auto-updating terminal tail message while the card runs
/keysOpen Quick Keys (↑/↓/Tab/⇧Tab/Yes/No/Ctrl-C + slash shortcuts)
/filesBrowse referenced images, PDF page previews, redacted text pages, and links
/newLaunch a new harness card via 2-step folder → harness picker
/closeClose the selected card on your PC after confirmation
/ctrlc · /enter · /escSend interrupt, Enter, or Escape to the selected card
/syncForce-sync Forum Topics with live cards (and recreate unlinked/deleted topics)
/linkforumBind the current 2-member Forum supergroup
/unlinkforumUnlink the Forum group
/unlinkUnlink the current Forum Topic without closing its card
/helpShow available commands and currently enabled permissions
[06] ~/permissionsGRANULAR DEFAULTS

CONTROL

Permissions & safe defaults.

All inspection, input, launch, close, and attachment capabilities default to Off until you explicitly turn them on in ⚙ Settings → Telegram.

SwitchDefaultWhat it allows
NotificationsOnPush Finished, Waiting, and Error alerts with inline buttons
Redact common secretsOnBest-effort masking of API keys, Bearer/bot tokens, .env secrets, and PEM private keys
Read terminal outputOff/screen, /history, and 📎 Files / /files
Submit promptsOffSending text prompts to AI harness cards
Control keysOffInline/command Yes, No, 1, 2, Enter, Esc, Ctrl-C
Allow shell inputOffTyping text or keys into plain Shell cards (higher risk)
Launch new cardsOff/new harness launching in remembered project folders
Close cardsOffClosing cards from Telegram after explicit confirmation
Receive attachmentsOffStaging photos, documents, and voice clips privately for harnesses
[07] ~/securityBYOB TRUST MODEL

TRUST MODEL

Private control, honest limits.

Your bot, your PC, zero developer server: Bot credentials and state stay owner-only (0700/0600) on your Linux machine. Nobody else can pair without physical approval of a single-use invite + matching 6-digit code on your desktop, and any Forum group with more than 2 members is refused automatically.
Telegram Bot API is not end-to-end encrypted: Messages, images, and terminal output sent through a Telegram bot pass through Telegram's servers (and Telegram clients). Keep Redact common secrets enabled, leave unneeded switches off, and never send secrets to the chat. When you want direct device-to-device TLS with no third party at all, use the Android / iPhone / iPad app over LAN or Tailscale. Read the full Security model.
[08] ~/troubleshootingDIAGNOSTICS

HELP

Troubleshooting.

SymptomFix
Status chip shows Stopped or ErrorIn ⚙ Settings → Telegram, verify the token with Save & verify, turn on Enable Telegram bot, and ensure outbound HTTPS access to api.telegram.org.
Refused: this group has N members…Remove everyone except you and your bot so the group has at most 2 members, then run /linkforum again.
Promote this bot to Administrator…In Group Settings → Administrators, make the bot Admin with Manage Topics (and optionally Pin Messages).
Bot replies that an action is disabledEnable the corresponding switch under ⚙ Settings → Telegram → Permissions (for example Read terminal output for 📎 Files and /screen).
Old messages sent offline don't runMessages older than ~2 minutes or queued before worker startup are ignored by design so stale commands never replay unexpectedly on wake.