Get notified on Telegram when your OpenCode sessions complete.
- Start a chat with @opencodetelegramnotificationbot
- Send
/start - Run the command the bot sends you
- Done!
| Command | Description |
|---|---|
/start |
Get installation command |
/revoke |
Generate new key (invalidates old one) |
/status |
Check installation status |
/help |
Show help message |
- The bot generates a unique installation key for you
- The installation script configures the plugin with your key
- When OpenCode finishes a task, the plugin notifies the bot
- The bot sends you a Telegram message
Your Telegram chat ID is never stored in the plugin — only a revocable key.
rm ~/.config/opencode/plugin/telegram-notify.jsOptionally, send /revoke to the bot to invalidate your key.
- Your chat ID never leaves the server
- You can revoke your key anytime with
/revoke - The plugin only contains a UUID key, not your chat ID
- Node.js 22+
- pnpm 10+
- Cloudflare account
- Telegram Bot Token (from @BotFather)
# Install dependencies
pnpm install
# Create KV namespace
wrangler kv namespace create "USERS"
# Add KV ID to worker/wrangler.jsonc
# Set bot token
wrangler secret put BOT_TOKEN
# Start local development
pnpm dev# 1. Login to Cloudflare (first time only)
cd worker && pnpm exec wrangler login
# 2. Create KV namespace (first time only)
pnpm exec wrangler kv namespace create "USERS"
# Copy the ID and update worker/wrangler.jsonc
# 3. Deploy the worker
pnpm exec wrangler deploy
# 4. Set the BOT_TOKEN secret (first time or when rotating token)
pnpm exec wrangler secret put BOT_TOKEN
# Paste your bot token when prompted
# 5. Set Telegram webhook (first time only)
curl "https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://opencode-telegram-bot.<your-subdomain>.workers.dev/webhook"To redeploy after changes, just run:
cd worker && pnpm exec wrangler deployAfter deployment, set the Telegram webhook:
curl "https://api.telegram.org/bot<BOT_TOKEN>/setWebhook?url=https://opencode-telegram-bot.<subdomain>.workers.dev/webhook"