开源AI工作流 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
通过Telegram运行和监控AI编码任务
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
通过Telegram运行和监控AI编码任务
开源AI工作流 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:npm 全局安装 npm install -g opencode-telegram-bot # 方式二:npx 直接运行(无需安装) npx opencode-telegram-bot --help # 方式三:项目依赖安装 npm install opencode-telegram-bot # 方式四:从源码运行 git clone https://github.com/grinev/opencode-telegram-bot cd opencode-telegram-bot npm install npm start
# 命令行使用
opencode-telegram-bot --help
# 基本用法
opencode-telegram-bot [options] <input>
# Node.js 代码中使用
const opencode_telegram_bot = require('opencode-telegram-bot');
const result = await opencode_telegram_bot.run(options);
console.log(result);
# opencode-telegram-bot 配置说明 # 查看配置选项 opencode-telegram-bot --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export OPENCODE_TELEGRAM_BOT_CONFIG="/path/to/config.yml"
OpenCode Telegram Bot is a secure Telegram client for OpenCode CLI that runs on your local machine.
Run AI coding tasks, monitor progress, switch models, and manage sessions from your phone.
No open ports, no exposed APIs. The bot communicates with your local OpenCode server and the Telegram Bot API only.
Scheduled tasks support. Turns the bot into a lightweight OpenClaw alternative for OpenCode users.
Platforms: macOS, Windows, Linux
Languages: English (en), Deutsch (de), Español (es), Français (fr), Русский (ru), 简体中文 (zh)
<p align="center"> <img src="assets/screencast.gif" width="45%" alt="OpenCode Telegram Bot screencast" /> </p>
init/review) from an inline menu with confirmation/tts/worktreeBOT_LOCALE)/ls to browse files and directories inside the current project, open subdirectories, go back, and download files by tapping themPlanned features currently in development are listed in Current Task List.
The fastest way — run directly with npx:
npx @grinev/opencode-telegram-bot@latest
Note: This README tracks themainbranch, which may include unreleased changes. The latest npm release may not include every feature described here yet. See recent commits onmain.
Quick start is for npm usage. You do not need to clone this repository. If you run this command from the source directory (repository root), it may fail with opencode-telegram: not found. To run from sources, use the Development section.
On first launch, an interactive wizard will guide you through the configuration — it asks for interface language first, then your bot token, user ID, OpenCode API URL, and optional OpenCode server credentials (username/password). After that, you're ready to go. Open your bot in Telegram and start sending tasks.
npm install -g @grinev/opencode-telegram-bot
opencode-telegram start
start runs in the foreground by default. This is the recommended mode for systemd, Docker, local debugging, and other external process managers.
To run the bot in the built-in background mode instead:
opencode-telegram start --daemon
opencode-telegram status
opencode-telegram stop
Built-in daemon mode is intended for standalone npm installs without an external supervisor. Forsystemd,pm2, or Docker, keep usingopencode-telegram startwithout--daemon.
For Linux systemd setup, see docs/LINUX_SYSTEMD_SETUP.md.
To reconfigure at any time:
opencode-telegram config
When installed via npm, the configuration wizard handles the initial setup. The .env file is stored in your platform's app data directory:
~/Library/Application Support/opencode-telegram-bot/.env%APPDATA%\opencode-telegram-bot\.env~/.config/opencode-telegram-bot/.env| Variable | Description | Required | Default |
|---|---|---|---|
TELEGRAM_BOT_TOKEN | Bot token from @BotFather | Yes | — |
TELEGRAM_ALLOWED_USER_ID | Your numeric Telegram user ID | Yes | — |
TELEGRAM_PROXY_URL | Proxy URL for Telegram API (SOCKS5/HTTP) | No | — |
TELEGRAM_API_ROOT | Custom Telegram Bot API root URL (e.g. nginx reverse-proxying api.telegram.org); applied to API calls and file downloads | No | https://api.telegram.org |
TELEGRAM_PROXY_SECRET | Shared secret sent as X-Proxy-Secret header on every Bot API request and file download (used with TELEGRAM_API_ROOT) | No | — |
TELEGRAM_FORCE_IPV4 | Force IPv4 for direct Telegram API and file requests; useful when IPv6 DNS works but outbound IPv6 is broken | No | false |
OPENCODE_API_URL | OpenCode server URL | No | http://localhost:4096 |
OPENCODE_AUTO_RESTART_ENABLED | Automatically restart a local OpenCode server when health-checks fail | No | false |
OPENCODE_MONITOR_INTERVAL_SEC | Health monitor interval in seconds when OpenCode auto-restart is enabled | No | 300 |
OPENCODE_SERVER_USERNAME | Server auth username | No | opencode |
OPENCODE_SERVER_PASSWORD | Server auth password | No | — |
OPENCODE_MODEL_PROVIDER | Default model provider | Yes | opencode |
OPENCODE_MODEL_ID | Default model ID | Yes | big-pickle |
BOT_LOCALE | Bot UI language (supported locale code, e.g. en, de, es, fr, ru, zh) | No | en |
SESSIONS_LIST_LIMIT | Sessions per page in /sessions | No | 10 |
MESSAGES_LIST_LIMIT | User messages per page in /messages | No | 10 |
PROJECTS_LIST_LIMIT | Projects per page in /projects | No | 10 |
OPEN_BROWSER_ROOTS | Comma-separated paths /open is allowed to browse (supports ~) | No | ~ (home directory) |
COMMANDS_LIST_LIMIT | Items per page in /commands and /skills | No | 10 |
TASK_LIMIT | Maximum number of scheduled tasks that can exist at once | No | 10 |
SCHEDULED_TASK_EXECUTION_TIMEOUT_MINUTES | Maximum time the bot waits for one scheduled task run before marking it failed | No | 120 |
BASH_TOOL_DISPLAY_MAX_LENGTH | Maximum displayed length for bash tool commands in Telegram summaries; longer commands are truncated | No | 128 |
SERVICE_MESSAGES_INTERVAL_SEC | Service messages interval (thinking + tool calls); keep >=2 to avoid Telegram rate limits, 0 = immediate | No | 5 |
HIDE_THINKING_MESSAGES | Hide 💭 Thinking... service messages | No | false |
HIDE_TOOL_CALL_MESSAGES | Hide tool-call service messages (💻 bash ..., 📖 read ..., etc.) | No | false |
HIDE_TOOL_FILE_MESSAGES | Hide file edit documents sent as .txt attachments (edit_*.txt, write_*.txt) | No | false |
TRACK_BACKGROUND_SESSIONS | Track detached/non-current sessions in the current selected project/worktree and send short notifications | No | true |
RESPONSE_STREAMING | Stream assistant replies while they are generated across one or more Telegram messages | No | true |
MESSAGE_FORMAT_MODE | Assistant reply formatting mode: markdown (Telegram MarkdownV2) or raw | No | markdown |
CODE_FILE_MAX_SIZE_KB | Max file size (KB) to send as document | No | 100 |
STT_API_URL | Whisper-compatible API base URL (enables voice/audio transcription) | No | — |
STT_API_KEY | API key for your STT provider | No | — |
STT_MODEL | STT model name passed to /audio/transcriptions | No | whisper-large-v3-turbo |
STT_LANGUAGE | Optional language hint (empty = provider auto-detect) | No | — |
STT_NOTE_PROMPT | Optional note prepended to the LLM prompt as [Note: ...] for voice transcriptions; empty / false / 0 disable it | No | — |
TTS_PROVIDER | TTS provider: openai for OpenAI-compatible APIs or google for Google Cloud TTS | No | openai |
TTS_API_URL | OpenAI-compatible TTS API base URL | No | — |
TTS_API_KEY | OpenAI-compatible TTS API key | No | — |
TTS_MODEL | OpenAI-compatible TTS model name passed to /audio/speech | No | gpt-4o-mini-tts |
TTS_VOICE | TTS voice name. Defaults to alloy for OpenAI-compatible APIs and en-US-Studio-O for Google Cloud TTS | No | provider-specific |
GOOGLE_APPLICATION_CREDENTIALS | Path to a Google Cloud service account JSON key file for TTS_PROVIDER=google | No | — |
LOG_LEVEL | Log level (debug, info, warn, error) | No | info |
LOG_RETENTION | Number of log files to keep: launch files in sources, daily files in installed | No | 10 |
Keep your .env file private. It contains your bot token. Never commit it to version control.
Logs are written to ./logs when running from sources and to the runtime config directory logs/ folder in installed mode. Log rotation depends on runtime mode: sources creates one file per bot launch, while installed appends to one file per day. Old log files are removed according to LOG_RETENTION.
For environments that block api.telegram.org but allow your own HTTPS endpoint (corporate networks, restricted regions), you can route Bot API traffic through a reverse proxy you control. This is an alternative to the SOCKS/HTTP forward proxy configured with TELEGRAM_PROXY_URL.
Set TELEGRAM_API_ROOT to your reverse-proxy URL — both Bot API calls and file downloads (including voice/audio files) will use it. Optionally set TELEGRAM_PROXY_SECRET so the bot sends an X-Proxy-Secret header your proxy can use to authorize callers.
.env:
TELEGRAM_API_ROOT=https://tg-proxy.yourdomain.com
TELEGRAM_PROXY_SECRET=some-long-random-string
Example nginx config:
server {
listen 443 ssl http2;
server_name tg-proxy.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/tg-proxy.yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/tg-proxy.yourdomain.com/privkey.pem;
access_log off; # the bot token appears in URL paths
client_max_body_size 50m;
if ($http_x_proxy_secret != "some-long-random-string") { return 403; }
location / {
proxy_pass https://api.telegram.org;
proxy_ssl_server_name on;
proxy_set_header Host api.telegram.org;
}
}
TELEGRAM_API_ROOT and TELEGRAM_PROXY_URL are alternative connectivity modes — the former picks the URL the bot connects to (a reverse proxy on your side), while the latter tunnels TCP through a forward proxy. Configure only one of them; the bot rejects using both at startup.
If the bot fails during startup with errors such as Network request for 'setMyCommands' failed or Network request for 'getWebhookInfo' failed, and the same machine has broken outbound IPv6 connectivity, force direct Telegram requests to use IPv4:
TELEGRAM_FORCE_IPV4=true
This affects direct Bot API calls and Telegram file downloads. It is not a replacement for TELEGRAM_PROXY_URL or TELEGRAM_API_ROOT when Telegram is blocked by the network.
If STT_API_URL and STT_API_KEY are set, the bot will:
voice and audio Telegram messagesPOST {STT_API_URL}/audio/transcriptionsIf STT_NOTE_PROMPT is set to a non-empty value other than false or 0, the bot prepends [Note: ...] to the transcription before sending it to the LLM. The recognized text shown in Telegram stays unchanged.
If TTS credentials are configured, you can toggle spoken replies globally with /tts. The preference is stored in settings.json and persists across restarts.
OpenAI-compatible TTS configuration example:
TTS_PROVIDER=openai
TTS_API_URL=https://api.openai.com/v1
TTS_API_KEY=your-tts-api-key
TTS_MODEL=gpt-4o-mini-tts
TTS_VOICE=alloy
Google Cloud TTS configuration example:
TTS_PROVIDER=google
TTS_VOICE=en-US-Studio-O
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.json
Supported provider examples (Whisper-compatible):
STT_API_URL=https://api.openai.com/v1STT_MODEL=whisper-1STT_API_URL=https://api.groq.com/openai/v1STT_MODEL=whisper-large-v3-turboSTT_API_URL=https://api.together.xyz/v1STT_MODEL=openai/whisper-large-v3If STT variables are not set, voice/audio transcription is disabled and the bot will ask you to configure STT.
The model picker uses OpenCode local model state (favorite + recent):
✅OPENCODE_MODEL_PROVIDER + OPENCODE_MODEL_ID is always included in favoritesTo add a model to favorites, open OpenCode TUI (opencode), go to model selection, and press Cmd+F/Ctrl+F on the model.
Build and run:
bash npm run dev ```
Bot doesn't respond to messages
TELEGRAM_ALLOWED_USER_ID matches your actual Telegram user ID (check with @userinfobot)"OpenCode server is not available"
OPENCODE_API_URL (default: http://localhost:4096)opencode serve or use /opencode_start in TelegramOPENCODE_AUTO_RESTART_ENABLED=true to let the bot restart a local OpenCode server when health-checks failOPENCODE_API_URL points to a remote server, verify that the address is reachable from the bot machine and that the remote server is healthyNo models in model picker
OPENCODE_MODEL_PROVIDER and OPENCODE_MODEL_ID point to an available model in your setupLinux: permission denied errors
chmod +x $(which opencode-telegram)~/.config/opencode-telegram-bot/高质量的开源AI工作流项目
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,开源AI工作流 在Agent工作流赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | opencode-telegram-bot |
| 原始描述 | 开源AI工作流:OpenCode mobile client via Telegram: run and monitor AI coding tasks from your p。⭐725 · TypeScript |
| Topics | ai-agentautonomous-agentcoding-agentdeveloper-tools |
| GitHub | https://github.com/grinev/opencode-telegram-bot |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-29 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端