OpenCode Chat Bridge CLI
A bot bridge: OpenCode and other ACP agents answer in Matrix, Slack, WhatsApp, Mattermost, Discord, Telegram and a web widget.
- 113 ★ on the repository
- Last commit
Broad access
Why this level
- Chat participants reach an agent that reads and edits files on the server unless `opencode.json` permissions are cut.
- The web widget has no built-in authentication, and bot tokens and the WhatsApp link live on the server.
Install
- Works in
Manual install
git clone https://github.com/ominiverdi/opencode-chat-bridgeThe first command of the Quick Start section. Then `bun install`, filling in `.env` and `chat-bridge.json` and starting a connector.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Chat participants reach an agent that reads and edits files on the server unless `opencode.json` permissions are cut.
- The web widget has no built-in authentication, and bot tokens and the WhatsApp link live on the server.
This is third-party code. Review the repository files before installing.
What it does
OpenCode Chat Bridge runs OpenCode or another ACP-compatible agent such as Ferrum as a chat bot. Each platform has its own connector: Matrix with encrypted rooms, Slack over Socket Mode, WhatsApp through Baileys, Mattermost, Discord, Telegram and an embeddable web widget. The bot answers to the `!oc` prefix or a mention. Every thread gets an isolated session that survives bridge restarts. An `allowedUsers` list limits who may talk to it and `opencode.json` sets tool permissions. Connectors start with commands like `bun connectors/telegram.ts`, and a Docker image `lbecchi/opencode-chat-bridge` exists.
Who it is for. Team administrators who want to put a coding agent in colleagues' work chat while keeping it on their own server.
Good fit when
- Colleagues ask the agent code questions from Slack without opening a terminal.
- The team lives in encrypted Matrix rooms and the bot has to work there.
- A site needs a chat widget backed by an agent with restricted permissions.
- One agent session should live inside a discussion thread and survive a restart.
Not a fit when
- The agent is for one person on one machine and a chat only complicates the setup.
- The web widget cannot be published without an authenticating proxy because it has no built-in user check.
- Chat messages must never reach the agent's model and tools.
Example request
Start the Telegram connector for OpenCode, allow only two users and deny the agent `bash` and file edits.Limitations
The bridge works as a service: the operator installs dependencies with `bun install`, fills in `.env` and `chat-bridge.json` and keeps the process running. The web widget has no built-in authentication, so keep it on a private network or behind an authenticating proxy. Any allowed chat participant steers the agent with the rights in `opencode.json`, so for shared rooms deny `bash`, `write` and `edit`. In one release the WhatsApp `allowedNumbers` field became `allowedUsers`, which breaks older configurations.
How to disable. Stop the connector process or container, revoke the bot tokens on every platform and delete the `state/` folder with saved sessions.
FAQ
How do I address the bot in a chat?
Write the `!oc` prefix and a question, for example `!oc /status`, or mention the bot. In Slack threads you can reply without mentioning the bot again.
Can I connect an agent other than OpenCode?
Yes, any ACP v1 agent over stdio. Set the command and arguments in `chat-bridge.json`, for example `ferrum acp` for the Ferrum agent.
How do I restrict what the agent does?
Permissions come from `opencode.json` and OpenCode enforces them at execution rather than via prompt text. `allowedUsers` limits who may talk to it.
Do I need Bun and Node?
Running from source needs Bun. The Docker image `lbecchi/opencode-chat-bridge` works without installing Bun or Node.
Do sessions survive a restart?
Yes. An ACP session is tied to the platform and thread, its id is written to `sessionStorePath`, and the session resumes after the bridge starts.
Discussion
No questions or reviews yet.
Related
CLI toolsConnects Claude Code, Cursor, Codex or OpenCode to Telegram, Slack and Discord: teammates message a bot, an agent replies
A plugin gives Claude Code OpenBSP API access and WhatsApp replies, forwarding channel messages only from selected contacts.
Bridges Meshtastic and MeshCore LoRa meshes with AI: an MCP server lets an agent send messages, list nodes and run extensions
MCP and plugin for zaytsv bot funnels
zaytsv-mcp
An MCP server and skill for building and publishing Telegram, MAX and Instagram bot funnels in the zaytsv /bots service from a text description
SwitchBot smart-home CLI for devices and scenes, with a built-in MCP server for Claude Code, Codex and Gemini CLI.
MAX plugin for OpenClaw
openclaw-max-plus
A channel plugin that connects the OpenClaw AI assistant to the MAX messenger via the official Bot API: text, media, buttons, streaming, multiple accounts
README in short
Connectors for seven channels, thread-level session isolation, allowed-user lists, ACP backend setup and tool presentation modes `off`, `events`, `status` and `trace`.