opencode-telegram-bot
AgentFreeOpenCode mobile client via Telegram: run and monitor AI coding tasks from your phone while everything runs locally on your machine. Scheduled tasks support. Can be used as lightweight OpenClaw alternative.
Capabilities13 decomposed
voice-to-code prompt submission with stt/tts pipeline
Medium confidenceAccepts voice messages via Telegram, transcribes them to text using configurable STT providers (Whisper, Google Cloud Speech-to-Text, or local alternatives), sends the transcribed prompt to OpenCode as a coding task, and streams back responses with optional TTS synthesis for voice playback. The pipeline integrates grammy's voice message handling with the @opencode-ai/sdk's event stream, buffering audio chunks and managing provider-specific authentication and format conversion.
Implements a bidirectional voice pipeline that bridges Telegram's voice message API with OpenCode's SSE event stream, supporting multiple STT/TTS providers via environment-based configuration and managing audio format conversion (Telegram OGG → provider-specific format) without intermediate file storage.
Unlike OpenClaw's web-only interface, this bot enables voice-first mobile interaction with local OpenCode execution, reducing context switching for developers on the go.
real-time sse event aggregation and pinned status message
Medium confidenceConsumes Server-Sent Events (SSE) from the OpenCode SDK's event stream, aggregates multi-event sequences (task start, model selection, context consumption, file changes, task completion) into a single coherent state, and maintains a persistent pinned Telegram message that updates in-place with live metrics: token usage, context window consumption, list of modified files, and agent status. Uses a SummaryAggregator class to deduplicate events, calculate deltas, and format structured data into Telegram's MarkdownV2 syntax.
Implements a SummaryAggregator pattern that deduplicates and coalesces SSE events into a single mutable pinned message, avoiding Telegram chat spam while maintaining real-time visibility. Uses MarkdownV2 formatting with careful escaping to render structured metrics (token counts, file diffs) in a mobile-friendly compact layout.
Provides better observability than OpenClaw's web dashboard for mobile users by consolidating multi-event sequences into a single pinned status, reducing API calls and chat clutter while maintaining real-time updates.
daemon mode execution with systemd integration
Medium confidenceSupports running the bot as a background daemon process on Linux/macOS using systemd or similar process managers. Provides configuration templates and setup guides for systemd service files, environment variable management, and log rotation. Enables the bot to start automatically on system boot and restart on failure, making it suitable for always-on local execution.
Provides systemd service templates and setup guides that enable the bot to run as a background daemon with automatic restart on failure, suitable for always-on local execution without manual intervention.
Enables production-grade deployment of the bot as a local service, unlike OpenClaw's web-only model which requires manual server management.
error handling and recovery with user-friendly error messages
Medium confidenceImplements comprehensive error handling for common failure scenarios: OpenCode server unavailable, invalid session/project, task submission errors, SSE connection drops, and API rate limits. Translates technical errors into user-friendly Telegram messages with suggested remediation steps (e.g., 'Server is offline, please check localhost:8000'). Includes retry logic for transient failures and graceful degradation when features are unavailable.
Translates technical errors into user-friendly Telegram messages with remediation suggestions, implementing retry logic for transient failures and graceful degradation for unavailable features.
Provides better error visibility and recovery than OpenClaw's web interface, with mobile-friendly error messages and automatic retry logic for common failures.
cli argument parsing and environment configuration
Medium confidenceProvides a command-line interface (CLI) for starting the bot with configurable options: Telegram token, OpenCode server URL, STT/TTS provider selection, locale, and logging level. Parses arguments using a custom args parser, validates configuration, and loads environment variables from .env files. Supports both global npm installation (via npx) and direct execution, with clear error messages for missing or invalid configuration.
Implements a custom CLI argument parser that validates configuration and loads environment variables, supporting both npx and global npm installation with clear error messages for missing or invalid options.
Provides flexible configuration management that OpenClaw's web interface doesn't support, allowing developers to customize bot behavior via CLI arguments and environment variables.
interactive agent question handling with inline button state machine
Medium confidenceImplements a state machine that intercepts OpenCode agent questions and permission requests (e.g., 'Should I modify this file?', 'Which model should I use?') via SSE events, renders them as Telegram inline keyboard buttons, captures user responses, and sends them back to OpenCode via the SDK's interaction API. The Interaction Guard class manages state transitions, prevents concurrent interactions, and ensures responses are routed to the correct agent context (session, project, task).
Uses a dedicated Interaction Guard state machine that maps Telegram callback_query events to OpenCode SDK interaction responses, preventing concurrent interactions and ensuring responses are routed to the correct task context. Integrates grammy's callback_query handler with the SDK's interaction API, managing the full round-trip from question to response.
Enables mobile-first approval workflows that OpenClaw's web interface doesn't support, allowing developers to respond to agent questions from anywhere without returning to their desktop.
session and project context switching with git worktree management
Medium confidenceProvides commands to list, create, and switch between OpenCode sessions and projects, mirroring the TUI's session management. Internally uses the OpenCode SDK to query available projects, manage git worktrees (creating isolated working directories for parallel work), and maintain session state (current project, branch, uncommitted changes). Stores session context in memory and persists it across bot restarts via environment variables or a local state file.
Mirrors OpenCode TUI's session management by wrapping the SDK's project and session APIs, providing Telegram commands that abstract away git worktree creation and branch switching. Maintains session state in memory with optional persistence, allowing users to manage multiple projects without manual git operations.
Provides mobile-friendly project switching that OpenClaw doesn't expose, allowing developers to manage multiple concurrent feature branches directly from Telegram without returning to the CLI.
natural language task scheduling with cron expression generation
Medium confidenceAccepts natural language scheduling descriptions (e.g., 'every Monday at 9am', 'daily at 3pm', 'once tomorrow at 2pm') via Telegram message, parses them using a scheduling library (likely node-cron or similar), generates cron expressions, and registers recurring or one-time tasks with the OpenCode server. The bot stores scheduled task definitions and executes them on a schedule, submitting the associated coding prompt to OpenCode at the specified time.
Implements natural language scheduling that converts user-friendly descriptions into cron expressions, storing task definitions and executing them on a schedule. Integrates with OpenCode's task submission API to run coding tasks at specified times without requiring manual CLI invocation.
Provides lightweight task scheduling without a full CI/CD pipeline, allowing developers to automate routine coding tasks directly from Telegram with natural language syntax instead of cron syntax.
code file attachment delivery with diff rendering
Medium confidenceCaptures modified files from OpenCode's file_changed SSE events, retrieves the full file content or diffs via the SDK, and delivers them to the user as Telegram file attachments (for binary or large files) or inline code blocks (for small text files). Supports syntax highlighting via Telegram's code block formatting and generates human-readable diffs showing before/after changes. Handles large files by splitting them into multiple messages or offering download links.
Implements intelligent file delivery that chooses between inline code blocks and attachments based on file size and type, with syntax highlighting and diff rendering. Handles Telegram's message size limits by splitting large files and offering download links.
Provides mobile-friendly code review that OpenClaw's web interface doesn't support, allowing developers to review and download AI-generated code directly from Telegram.
agent and model selection with keyboard ui
Medium confidenceExposes OpenCode's available agents (e.g., 'architect', 'coder', 'reviewer') and models (e.g., 'gpt-4', 'claude-3') via Telegram inline keyboard buttons, allowing users to select their preferred agent mode and model before submitting a task. Stores the selected agent and model in session state and applies them to all subsequent tasks until changed. Integrates with OpenCode's agent configuration API to fetch available options and validate selections.
Provides a keyboard-based UI for agent and model selection that mirrors OpenCode TUI's configuration options, storing selections in session state and applying them to all subsequent tasks. Fetches available options from the OpenCode server dynamically.
Simplifies agent and model selection for mobile users compared to OpenClaw's web interface, using Telegram's native inline keyboard UI instead of dropdown menus.
multi-locale internationalization with dynamic dictionary loading
Medium confidenceImplements i18n support via a dictionary-based system that loads locale-specific strings from JSON files, allowing the bot to render all Telegram messages (commands, responses, errors, keyboard labels) in the user's preferred language. Supports dynamic locale switching per user and includes a contribution guide for adding new locales. Uses a key-based lookup system (e.g., 'task.started', 'error.no_session') to manage translations without hardcoding strings.
Uses a key-based dictionary system for i18n that separates translations from code logic, enabling community contributions and dynamic locale switching. Includes a structured guide for adding new locales without modifying core code.
Provides multi-language support that OpenClaw's web interface may not fully support, using a community-driven translation model to enable global adoption.
local opencode server integration with sse event streaming
Medium confidenceEstablishes a persistent connection to a locally running OpenCode server (default: localhost:8000) using the @opencode-ai/sdk, consuming Server-Sent Events (SSE) to receive real-time updates on task progress, model usage, file changes, and agent questions. Handles connection lifecycle (connect, reconnect on failure, graceful shutdown), event parsing, and error handling. Translates SDK events into Telegram messages and maintains session context across the connection.
Implements a direct SSE integration with OpenCode's local server via the @opencode-ai/sdk, maintaining a persistent connection and translating server events into Telegram messages. Enables secure local execution without exposing public APIs.
Provides secure local execution that OpenClaw cannot match, allowing developers to run AI coding tasks entirely on their machine while controlling them from their phone via Telegram.
command-based task submission with prompt context preservation
Medium confidenceAccepts user prompts via Telegram messages (text or voice-transcribed), packages them with current session context (project, branch, uncommitted files, selected agent/model), and submits them to OpenCode as a task via the SDK. Preserves context across multiple messages by maintaining session state and allowing users to reference previous tasks or files. Handles prompt validation, context assembly, and error reporting.
Automatically assembles task context (project, branch, agent, model) from session state and submits it with the user's prompt, avoiding manual context specification. Preserves context across multiple messages and tasks.
Simplifies task submission compared to OpenClaw's web interface by automatically including session context, reducing the number of steps required to submit a task from a mobile device.
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with opencode-telegram-bot, ranked by overlap. Discovered automatically through the match graph.
Coqui TTS
Open-source TTS library — 1100+ languages, voice cloning, multiple architectures, Python API.
skales
Your local AI Desktop Agent for Windows, macOS & Linux. Agent Skills (SKILL.md), autonomous coding (Codework), multi-agent teams, desktop automation, 15+ AI providers, Desktop Buddy. No Docker, no terminal. Free.
Play.ht
AI Voice Generator. Generate realistic Text to Speech voice over online with AI. Convert text to audio.
chainlit
Build Conversational AI in minutes ⚡️
xiaozhi-esp32-server
本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
PraisonAI
A framework for building multi-agent AI systems with workflows, tool integrations, and memory. #opensource
Best For
- ✓mobile-first developers who prefer voice interaction
- ✓teams managing remote coding tasks from field or travel
- ✓developers with accessibility needs for voice-based workflows
- ✓developers running long-running AI coding tasks (5+ minutes) who need progress visibility
- ✓teams tracking token budgets and model usage across multiple concurrent tasks
- ✓users managing multiple OpenCode projects and needing unified status across sessions
- ✓developers running the bot on a dedicated machine or server
- ✓teams with always-on local OpenCode execution requirements
Known Limitations
- ⚠STT accuracy depends on provider choice and audio quality; local models may have higher latency than cloud providers
- ⚠TTS synthesis adds 1-3 seconds per response message; not suitable for real-time interactive debugging
- ⚠Voice message size limited by Telegram's 50MB file upload constraint
- ⚠No built-in speaker identification; single-user bot design assumes one authenticated user per instance
- ⚠Pinned message updates are rate-limited by Telegram API (max ~1 update per second); rapid event bursts may cause message lag
- ⚠MarkdownV2 formatting has strict escaping rules; special characters in file paths or error messages require careful sanitization
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: Apr 20, 2026
About
OpenCode mobile client via Telegram: run and monitor AI coding tasks from your phone while everything runs locally on your machine. Scheduled tasks support. Can be used as lightweight OpenClaw alternative.
Categories
Alternatives to opencode-telegram-bot
Are you the builder of opencode-telegram-bot?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →