Discord and Telegram Remote Control
Use bots to create terminals, send commands, read output, receive agent notifications, and get screenshots. Since 1.20, Discord session threads map conversations to terminals.
Telegram setup
- Create a bot with @BotFather using /newbot and copy its token.
- Start a conversation with your bot and obtain that conversation’s chat ID.
- In Settings > Remote Control > Telegram, enter the bot token and chat ID and enable the integration and Remote Control. Only the configured chat can control the terminals.
Discord setup
- Create an application in the Discord Developer Portal and get its bot token.
- Invite it to your server with bot and applications.commands scopes. In the target text channel, allow View Channel, Send Messages, Read Message History, Embed Links, Attach Files, Create Public Threads, and Send Messages in Threads.
- Enable Message Content Intent in the Bot settings for ordinary messages and thread replies. Termdock requests Guilds and GuildMessages as well. Without Message Content, slash commands still work, but direct text input and session threads are unavailable.
- In Settings > Remote Control > Discord, enter the bot token, guild (server) ID, and channel ID. Enable the integration and Remote Control. Restrict access to the configured channel because its messages can run terminal commands.
A thread for each session
The first session push creates a Discord thread under the configured channel. Ordinary messages in that thread go to its terminal without a session number. Replies do not automatically subscribe you to every agent output; use /watch if you want ongoing updates.
If Message Content is unavailable or the channel cannot host a thread, pushes fall back to the main channel. A thread left over from an app restart may no longer be attached; Termdock reports this and creates a new thread on the next session push.
Use /attach in Telegram or the Discord main channel to send ordinary messages to a chosen session; /detach stops this mode. Text beginning with / is reserved for commands, so use /send to pass a slash-prefixed prompt to an agent.
Commands
Both bots support the commands below. Use the session number or ID from /list. Discord /key uses the named option keyname.
/ws
/new [workspace]
/list
/send <session> <content>
/read <session> [lines] [raw]
/watch <session>
/unwatch <session>
/key <session> <key>
/kill <session>
/snap [session]
/attach <session>
/detach- /ws lists workspaces; /new creates a terminal in the selected workspace; /list lists sessions.
- /send sends text, /read reads output (default 50 lines), and /key sends special keys such as enter, tab, esc, or ctrl+c.
- /watch starts output or prompt notifications; /unwatch stops them. /kill closes a session on either platform.
- /snap returns a session screenshot as an image. Without a session it captures the app window. Screens and output reads also support LAN and SSH sessions.
Proactive agent messages
Enable push notifications in Remote Control settings and connect a provider. An agent or script can notify you when work finishes or needs a decision. Inside Termdock, notify uses $TERMDOCK_SESSION_ID automatically; outside it, pass --session explicitly.
termdock notify "The review needs your decision"
termdock notify "Starting the build" --session <id> --title "Build review" --jsonWith a session and a thread-capable Discord connection, notification delivery selects Discord. Without such a thread connection, it uses connected remote providers. Without a session, it sends to connected remotes. --title applies only when the first Discord thread is created; Telegram ignores it.
Messages are limited to 4000 trimmed characters and six sends per minute per session. A non-zero CLI exit means delivery failed; read stderr rather than retrying in a loop.
Notification HTTP APIPrompt buttons and boundaries
Detected terminal choices can produce clickable Discord buttons or Telegram inline keyboards. Check the session and prompt before responding. Screenshots and output can contain sensitive data; share only in trusted channels.
Telegram messages have a 4096-character limit and inline callback data a 64-byte limit. Discord messages have a 2000-character limit and up to five prompt buttons. Long pushed text is split into messages.
Use terminals directly in a phone browser