All documentation / Telegram guide

Telegram guide

Answer your agent from Telegram.

Connect your own bot once. Reply to a question, approve one exact action, or receive a brief status while your agent runs on your Mac.

Connect your bot once

Build requirementThe controls in this guide require QuickTTY 0.1.5.beta-4, build 19, or newer. To install a beta, follow Installation & Updates; the stable channel never offers a prerelease. Telegram starting off on every app launch requires 0.1.5.beta-5, build 20, or newer.
  1. Use a dedicated bot. Create a bot with Telegram’s BotFather and keep its token private. Do not share this bot with another polling app or webhook.
  2. Open QuickTTY → Agent Integrations… → Telegram. Enter the token in the secure field and choose Connect bot. Never send the token to your agent or paste it into a terminal command.
  3. Open a private chat with your bot. Send the exact /start <code> shown by QuickTTY. The one-time code expires after five minutes.
  4. Confirm your account on the Mac. Check the proposed user ID and choose Confirm Telegram user … in QuickTTY. Sending the code alone does not authorize the account.
  5. Use Telegram when needed. After pairing, the section shows Connected and includes authenticated registered agents in all workspaces. On later app launches, turn the channel on manually.

The token and paired account are saved in the device-only macOS Keychain, not synchronized to other devices. Telegram starts off on every app launch, even if it was previously enabled. Turn it on manually to restore the saved connection without another token or pairing step. You do not need a separate checkbox for each workspace or new session.

Channel access allows an agent to ask; it does not approve actions or grant terminal control.

Set up or update Pi

  1. In QuickTTY → Agent Integrations…, select Pi and install or update its integration. Review the file-change preview and explicitly confirm the operation.
  2. Start Pi in a QuickTTY pane. In an existing Pi session, run /reload after applying an integration update.
  3. Ask the agent to send a short test question through Telegram, then answer that message with Reply.

After QuickTTY accepts the session’s lifecycle registration, Pi receives quicktty_ask_user, quicktty_confirm_action, and quicktty_notify, with their usage instructions. Copying instructions into every conversation is unnecessary.

Updating QuickTTY itself does not silently replace installed agent integrations. If initial registration fails temporarily, the current Pi extension retries before a later agent prompt; tools become available only after registration succeeds. It does not resend old questions or approvals.

Answer the exact question

A question opens Telegram’s Reply interface and may also offer answer buttons. Choose a button, or send text as a reply to that exact bot message. If Reply is not open, select the message and use Telegram’s Reply action.

Do not send an unrelated message such as “yes” to the bot and expect QuickTTY to guess the session. While requests are waiting, unmatched text receives feedback explaining that it needs a Reply. Accepted text receives a short acknowledgement without repeating your answer.

You can also answer in Agent Integrations… → Waiting for your reply on the Mac. The first valid local or Telegram answer closes the request; later replies cannot answer it again or a different session.

Approve one action, not a session

An action request shows the operation, affected resources, and consequences. Read all three before using Подтвердить один раз (“Confirm once”), or decline the request. This button also handles elevated Telegram requests; you do not need to copy a UUID phrase into the chat.

Approval belongs to that exact unchanged request, from the paired account in the paired private chat, once. Plain “yes” is not approval for an action. Expired, denied, cancelled, or revoked requests cannot be revived by a late reply or an old button.

The confirmation tool does not execute the action. The agent must receive approved first, then perform only the authorized action in a separate tool call. Re-reading an old approval is not permission to repeat an operation.

Native permissions still applyTelegram does not replace an agent’s native permission rules, macOS security dialogs, or QuickTTY terminal-control permission. Local elevated confirmation in the QuickTTY sheet still uses the exact CONFIRM <request-uuid> phrase.

One switch for all workspaces

Press Cmd+Opt+T while QuickTTY is active to toggle Telegram for all registered agents in all workspaces. The same control is available from the application menu, Use Telegram for agents in Agent Integrations, and the clickable Telegram indicator in the Normal or Quake top bar.

This is an application-local shortcut, not a system-wide hotkey. To customize it, use the shortcut configuration:

quicktty-shortcut = toggle-telegram=cmd+opt+t
IndicatorMeaning
Telegram OffThe channel is paused.
Telegram…Connecting or reconnecting.
Telegram OnThe enabled channel is connected.
Telegram SetupFinish pairing your account on the Mac.
Telegram ErrorOpen Agent Integrations to inspect the connection problem.
Telegram —The local messaging subsystem is unavailable.

Turning the channel off stops Telegram network activity and revokes pending requests and messaging access without deleting the bot. Turning it on restores the connection and fresh access for eligible sessions, not old answers or approvals. Enabling lasts only for the current QuickTTY session; the next app launch always starts with Telegram off.

Under Connection settings, use Reconnect to retry, Change bot… to pair another bot, or Forget bot to remove the saved connection.

What each integration provides

QuickTTY does not automatically forward every question or native permission dialog from every agent. The current integration must explicitly submit a structured request through the tools or CLI.

AgentCurrent messaging integration
PiDedicated question, one-time action confirmation, and notification tools after accepted lifecycle registration.
Claude CodeCLI instructions after SessionStart. A guarded question hook supports the exact verified arm64 2.1.318 binary; other binaries fall back to the native prompt. This is not automatic action-permission forwarding.
Codex and GeminiCLI instructions after SessionStart. Native question and permission forwarding is not implemented; vendor runtime behavior is not verified.
Other launch-capable adaptersShared CLI backend for an authenticated registered origin. Automatic instruction delivery and vendor runtime are not verified.
Blocked adaptersNo messaging access; an existing lifecycle blocker is not removed by enabling Telegram.

See the agent registry for native, wrapper, and blocked adapters. Session restoration and messaging support are separate capabilities.

CLI reference

quicktty agent request reads one JSON object from stdin and writes one JSON result to stdout. Run it from the authenticated registered agent’s original QuickTTY pane, with its integration current and Telegram connected and enabled. Do not copy session credentials into another shell.

Generate a request UUID once per logical question or action, and retain it with the unchanged payload until the request finishes. This example sends a harmless choice question; only the generated UUID is interpolated, not arbitrary question text:

request_id=$(/usr/bin/uuidgen) &&
printf '{"version":1,"operation":"question","requestID":"%s","text":"Which response format would you prefer?","choices":["Short","Detailed"],"timeoutMilliseconds":900000}\n' "$request_id" |
  quicktty agent request

Every operation includes version: 1 and requestID. Available operations:

OperationAdditional fields and behavior
questiontext, optional choices and timeoutMilliseconds.
actiontext describes the operation; resources and consequences are required. Optional elevated defaults to true; optional timeoutMilliseconds.
statusOnly the original question/action request ID; inspect its known state.
waitThe original request ID and a bounded timeoutMilliseconds of 100–30000 ms.
cancelThe original request ID; closes a pending request, not an already executed action.
notifyA fresh request ID, text, and status: working, waiting, completed, or failed. Working does not notify the phone.

An initial submission may return pending. Use wait or status with the same request ID to obtain the eventual answer; one CLI invocation is not an unbounded wait. Unlike the raw CLI, Pi’s question and confirmation tools handle the bounded waiting for you.

Question/action deadlines are 1–1800 seconds, default 900 seconds. Questions allow up to 2304 UTF-8 bytes and eight unique choices of up to 64 bytes each. Action text allows 1024 bytes, resources/consequences 768 bytes each, and notification text 512 bytes. Keep requests small and non-secret; never truncate an action to hide relevant details.

A question returns text with an answer, or choice with a zero-based choiceIndex and label. Only approved for the exact unchanged action authorizes it once. pending, denied, cancelled, expired, revoked, error, and an exit code of zero are not approval. Notify accepted means queued, not proven delivery.

After deliveryUncertain, inspect status for the same request ID; do not send another question with a fresh ID. After requestIDConflict, stop and reconcile the original payload. Reading an old approved result never authorizes another execution.

Privacy and operating limits

  • Bot chats are not end-to-end encrypted. Explicitly submitted questions, action descriptions, answers, brief notifications, displayed workspace/agent names, and request IDs travel through Telegram.
  • Credentials stay local. QuickTTY keeps the bot token and paired account in device-only, non-synchronizing Keychain storage. Internal session/pane credentials are not included in Telegram messages.
  • No transcript relay. Send only the minimum non-secret content. Do not send tokens, passwords, raw tool arguments, terminal dumps, or transcripts. QuickTTY cannot guarantee redaction of secrets embedded in text chosen by an agent.
  • Your Mac remains the host. QuickTTY and the registered agent must remain running, and the Mac must be awake and online for requests to progress. Telegram does not move execution to the cloud or preserve shell processes during sleep.
  • Requests are temporary. Deadlines continue across sleep. App restart does not restore old questions, answers, or approvals. Ending or replacing the origin session revokes its pending requests.

Read the privacy disclosure for the app’s storage and network behavior.

Recover without guessing

The agent still waits after I typed an answer
Use Reply on the exact question, from the paired account in the private chat. Unthreaded text is never assigned to a guessed session. Check the acknowledgement or answer locally under Waiting for your reply.
The bot connects, but Pi has no Telegram tools
Check the installed app version, apply the Pi integration update, then run /reload or start Pi again inside QuickTTY. Registration must succeed; do not copy credentials or guess an origin.
Another app or webhook is using this bot
Use a dedicated bot or stop the other poller yourself. QuickTTY does not silently remove someone else’s webhook. Do not run two QuickTTY instances polling the same bot.
Pairing expired or Telegram rejected the token
Connect again for a fresh five-minute code. If needed, obtain a valid token from BotFather and enter it only in the secure field; never send it to the agent.
Keychain or network connection failed
Open Agent Integrations, inspect the connection state, and use Reconnect when appropriate. Temporary connection failures retry with backoff; message sends are not automatically repeated.
permissionRequired or channel unavailable
Check the switch and current connection. Telegram is an optional channel, not a gate: ask and answer in the terminal instead, subject to the same native permission rules. An unanswered request is never approval.
An old button or late reply no longer works
The request may have expired, been cancelled, or lost its origin/grant. Do not replay an approval or bypass a denial with another ID. A genuinely new action needs a new explicit decision.
I received no completion notification
Working updates do not notify the phone, and accepted only means queued. Verify actual task completion separately; do not infer delivery or success from a quiet chat.