Telegram interface for OpenCode, implemented as an OpenCode plugin.
- OpenCode installed
- Bun
- Telegram bot token from @BotFather
- Your Telegram user ID from @userinfobot
bun install
cp .env.example .env
# Edit .env with your bot token and allowed user IDsSymlink the plugin into your OpenCode workspace:
mkdir -p /path/to/workspace/.opencode/plugins
ln -s /path/to/clawcode/src/main.ts /path/to/workspace/.opencode/plugins/clawcode.tsOr use the Makefile to install the systemd service, plugin, and .opencode/ assets:
make install
systemctl --user enable --now opencode-server.serviceSet TELEGRAM_BOT_TOKEN and TELEGRAM_ALLOWED_USERS in the server's environment (e.g., EnvironmentFile= in the systemd unit).
The Telegram bot is on-demand by default. Use /telegram connect in the OpenCode TUI to start it. The systemd unit sets TELEGRAM_AUTOCONNECT=1 to auto-start.
To remove:
make uninstall| Command | Description |
|---|---|
/new |
New session |
/sessions |
List and switch sessions |
/abort |
Abort current session |
/history |
Recent messages from current session |
/agent <name> |
Switch agent (omit name to list available) |
/remember <text> |
Save a memory to MEMORY.md via OpenCode |
/start_llama |
Start llama systemd service |
/stop_llama |
Stop llama systemd service |
Send any text message to prompt OpenCode. Responses stream in real-time. Permission requests appear as inline keyboards.
Every exchange is automatically saved to exchanges/ as qmd-compatible markdown.
/remember <text>— tells OpenCode to append a memory toMEMORY.mdin the workspace (always read on startup)- The
recallskill lets the model search past exchanges via qmd on demand
After first run, create a qmd collection for the exchanges:
qmd collection add /path/to/exchanges --name exchanges --mask "**/*.md"
qmd embedNew exchanges are automatically indexed via qmd update && qmd embed after each save (if qmd is installed).