How arti2210/cli-telegram-remote-control works
CLI Telegram Remote Control is a single-file Telegram bot that relays user input to a compatible CLI server’s HTTP session API and returns agent replies. The main workflow is access-checked Telegram input → session selection → prompt submission and response polling → Telegram reply. Separate bot capabilities manage sessions, models, status, and usage; a terminal can attach to the same server-side session. The README documents these capabilities, while the sampled source is partial, so uncertain internal wiring is omitted.
Main entry points: bot.py Bot handlers
Components 15
Telegram interface
- Bot handlers
bot.py - Access control
bot.py - Text input
bot.py - Media inputs
bot.py - Bot commands
bot.py - Reply formatting
bot.py
Session control
- Session lifecycle
bot.py - Prompt exchange
bot.py - Model selection
bot.py - Status and usage
bot.py
CLI server integration
- HTTP API helpers
bot.py - CLI serve API
- Terminal attach
Other components
- Telegram user
- Telegram Bot API
Connections 24
- Telegram user → Telegram Bot API: sends updates
- Telegram Bot API → Bot handlers: delivers updates
- Bot handlers → Access control: checks access
- Bot handlers → Text input: dispatches text
- Bot handlers → Media inputs: dispatches media
- Bot handlers → Bot commands: dispatches commands
- Text input → Session lifecycle: ensures session
- Text input → Prompt exchange: submits text
- Media inputs → Telegram Bot API: downloads files
- Media inputs → Session lifecycle: ensures session
- Media inputs → Prompt exchange: submits content
- Bot commands → Session lifecycle: manages session
- Bot commands → Model selection: changes model
- Bot commands → Status and usage: gets status
- Session lifecycle → HTTP API helpers: calls endpoints
- Prompt exchange → HTTP API helpers: sends and polls
- Model selection → HTTP API helpers: lists models
- Status and usage → HTTP API helpers: reads session data
- HTTP API helpers → CLI serve API: HTTP requests
- CLI serve API → Terminal attach: shares sessions
- Prompt exchange → Reply formatting: returns response
- Reply formatting → Telegram Bot API: sends replies
- Bot commands → Telegram Bot API: sends command replies
- Telegram user → Terminal attach: attaches by command