opencode-channels-plugin
v0.1.4
Published
Connect OpenCode to messaging channels (Telegram/Slack/Discord) for remote permission handling and notifications
Downloads
88
Maintainers
Readme
OpenCode Channels Plugin
Connect OpenCode to messaging channels (Telegram/Slack/Discord) for remote permission handling and notifications.
Features
- Permission Requests - Forward permission prompts to messaging channel, receive user response
- Task Completion - Notify when agent finishes
- Error Alerts - Ping user on errors/blocks
- Session Status - Notify on idle/paused states
Installation
Quick Install (Recommended)
npx opencode-channels-plugin install
# or
bunx opencode-channels-plugin installThis will:
- Add plugin to
~/.config/opencode/opencode.json - Create config template at
~/.config/opencode/channels.json
CLI Commands
| Command | Description |
|---------|-------------|
| install | Add plugin to opencode.json + create config template |
| install -p | Install to project-local .opencode/ directory |
| init | Create config template only |
| uninstall | Remove plugin from opencode.json |
Manual Install
bun install opencode-channels-pluginOr build from source:
bun install
bun run buildConfiguration
Create ~/.config/opencode/channels.json:
{
"enabled": true,
"defaultChannel": "telegram",
"telegram": {
"botToken": "YOUR_BOT_TOKEN",
"chatId": "YOUR_CHAT_ID",
"parseMode": "Markdown"
},
"notifications": {
"onPermission": true,
"onComplete": true,
"onError": true,
"onIdle": false
},
"timeout": 300
}Telegram Setup
- Create a bot via @BotFather
- Get your chat ID by messaging @userinfobot
- Add bot token and chat ID to config
Config Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| enabled | boolean | true | Enable/disable plugin |
| defaultChannel | string | "telegram" | Channel to use |
| timeout | number | 300 | Permission response timeout (seconds) |
Notification Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| onPermission | boolean | true | Forward permission requests |
| onComplete | boolean | true | Notify on task completion |
| onError | boolean | true | Alert on errors |
| onIdle | boolean | false | Notify on idle state |
Usage
Once configured, the plugin automatically:
- Forwards permission requests to your Telegram chat
- Waits for your response (✅ Allow / ❌ Deny / custom text)
- Sends notifications based on your config
Permission Request Format
🔔 Permission Required
Tool: bash
Command: npm install express
Reply: ✅ allow | ❌ deny | custom textResponding
- Click ✅ Allow or ❌ Deny buttons
- Or reply with:
allow,yes,y,deny,no,n - Or type custom response text
Channels
| Channel | Status | |---------|--------| | Telegram | ✅ Implemented | | Slack | 🔜 Planned | | Discord | 🔜 Planned |
Development
# Install dependencies
bun install
# Build
bun run build
# Watch mode
bun run dev
# Type check
bun run typecheckLicense
MIT
