@royhk920/opencode-telegram
v1.0.3
Published
Telegram bot bridge for remote control of OpenCode CLI on Linux
Maintainers
Readme
opencode-telegram
Telegram bot bridge for remote control of OpenCode CLI on Linux.
Install
Published package:
npm install -g @royhk920/opencode-telegramThen run the setup wizard:
opencode-telegram-installStart the bot:
opencode-telegramWhat It Does
- Sends prompts from Telegram to OpenCode
- Streams model responses back to Telegram
- Supports session management and model selection
- Supports file uploads
- Supports background cron jobs
- Supports optional MemPalace cron job actions if the related scripts are configured
Runtime Paths
The npm/global install stores data in user paths instead of inside node_modules:
- Config:
~/.config/opencode-telegram/config.json - Data:
~/.local/share/opencode-telegram/ - Env token:
~/.config/opencode/opencode-telegram.env
The bot also supports legacy fallback to a repo-local config.json if present.
Configuration
Example config:
{
"telegram": {
"token": "PASTE_YOUR_BOT_TOKEN_HERE",
"allowedUsers": [0],
"adminChatId": 0
},
"opencode": {
"host": "127.0.0.1",
"port": 4096,
"password": ""
},
"defaults": {
"model": "",
"agent": "build",
"thinking": "",
"autoSummarizeTokenThreshold": 120000
},
"cron": {
"enabled": false,
"jobs": []
}
}You can store the Telegram token in either:
~/.config/opencode-telegram/config.json~/.config/opencode/opencode-telegram.envasTELEGRAM_BOT_TOKEN=...
OpenCode Setup
Install OpenCode:
npm install -g opencode-aiMake sure the OpenCode server is available. The bot expects:
- host:
127.0.0.1 - port:
4096
Default OpenCode config example:
{
"mcp": {},
"$schema": "https://opencode.ai/config.json",
"permission": "allow"
}Commands
/helpshow help/newcreate a new session/listlist sessions/switch Nswitch session/delete Ndelete session/modelselect model/agentselect agent/statusshow connection and token info/summarizecompact current session/thinkingset thinking level/reviewrun OpenCode review/stopstop current task and clear queue/clearclear queued messages/cronmanage cron jobs/restartrestart bot or services/file pathread a file/find patternsearch files/grep textsearch file contents/shell cmdrun a shell command/projectshow project info
Systemd
The repo includes:
opencode-telegram.serviceopencode-server.service
For clone-based Linux installs you can still use:
./install.shDevelopment
Run tests:
npm testDry-run package check:
npm pack --dry-run