# OpenAB โ€” Open Agent Broker [![Stars](https://img.shields.io/github/stars/openabdev/openab?style=flat-square)](https://github.com/openabdev/openab) [![GitHub Release](https://img.shields.io/github/v/release/openabdev/openab?style=flat-square&logo=github)](https://github.com/openabdev/openab/releases/latest) ![License](https://img.shields.io/badge/license-MIT-A374ED?style=flat-square) ![OpenAB banner](images/banner.jpg) A lightweight, secure, cloud-native ACP harness that bridges **Discord, Slack**, and any [Agent Client Protocol](https://github.com/anthropics/agent-protocol)-compatible coding CLI (Kiro CLI, Claude Code, Codex, Gemini, OpenCode, Copilot CLI, Hermes, Grok Build, Antigravity, Pi, etc.) over stdio JSON-RPC โ€” delivering the next-generation development experience. **Telegram, LINE, Feishu/Lark, Google Chat**, and other webhook-based platforms are supported via the standalone [Custom Gateway](gateway/). ๐Ÿชผ **Join our community!** Come say hi on Discord โ€” we'd love to have you: **[๐Ÿชผ OpenAB โ€” Official](https://discord.gg/DmbhfDZjQS)** ๐ŸŽ‰ ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” Gateway WS โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” ACP stdio โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Discord โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚ โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚ coding CLI โ”‚ โ”‚ User โ”‚ โ”‚ openab โ”‚โ—„โ”€โ”€ JSON-RPC โ”€โ”€โ”‚ (acp mode) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค Socket Mode โ”‚ (Rust) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ Slack โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚ โ”‚ โ”‚ kiro-cli acp โ”‚ โ”‚ User โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ claude-agent-acp โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ WebSocket โ”‚ codex-acp โ”‚ โ”‚ Telegram โ”‚โ—„โ”€โ”€webhookโ”€โ”€โ” โ”‚ (outbound) โ”‚ gemini --acp โ”‚ โ”‚ User โ”‚ โ”‚ โ”‚ โ”‚ copilot --acp โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ–ผ โ–ผ โ”‚ hermes-acp โ”‚ โ”‚ LINE โ”‚โ—„โ”€โ”€webhookโ”€โ”€โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ opencode acp โ”‚ โ”‚ User โ”‚ โ”‚ Custom Gateway โ”‚ โ”‚ grok agent stdio โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ (standalone) โ”‚ โ”‚ agy-acp โ”‚ โ”‚ Feishu/Lark โ”‚โ—„โ”€โ”€โ”€WSโ”€โ”€โ”€โ”€โ”€โ”€โ”‚ โ”‚ โ”‚ pi-acp โ”‚ โ”‚ User โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ Google Chat โ”‚โ—„โ”€โ”€webhookโ”€โ”€โ”‚ โ”‚ โ”‚ User โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ## Demo ![openab demo](images/demo.png) ## Features - **Multi-platform** โ€” supports Discord and Slack, run one or both simultaneously - **Custom Gateway** โ€” extend to Telegram, LINE, Feishu/Lark, Google Chat, MS Teams via standalone [gateway](gateway/) - **Pluggable agent backend** โ€” swap between Kiro CLI, Claude Code, Codex, Gemini, OpenCode, Copilot CLI, Hermes, Grok Build, Antigravity, Pi via config - **@mention trigger** โ€” mention the bot in an allowed channel to start a conversation - **Thread-based multi-turn** โ€” auto-creates threads; no @mention needed for follow-ups - **Multi-agent collaboration** โ€” bot-to-bot messaging for coordinated workflows ([docs/multi-agent.md](docs/multi-agent.md)) - **Agent-controlled reply-to** โ€” agents choose which message to reply to via `[[reply_to:id]]` directive, enabling clear conversation threads in multi-bot channels ([docs/output-directives.md](docs/output-directives.md)) - **Edit-streaming** โ€” live-updates the Discord message every 1.5s as tokens arrive - **Emoji status reactions** โ€” ๐Ÿ‘€โ†’๐Ÿค”โ†’๐Ÿ”ฅ/๐Ÿ‘จโ€๐Ÿ’ป/โšกโ†’๐Ÿ‘+random mood face - **Image & file support** โ€” send images and files through chat ([docs/sendimages.md](docs/sendimages.md), [docs/sendfiles.md](docs/sendfiles.md)) - **Scheduled messages** โ€” config-driven cron jobs for automated agent prompts ([docs/cronjob.md](docs/cronjob.md)) - **Slash commands** โ€” built-in slash command support ([docs/slash-commands.md](docs/slash-commands.md)) - **Session pool** โ€” one CLI process per thread, auto-managed lifecycle - **ACP protocol** โ€” JSON-RPC over stdio with tool call, thinking, and permission auto-reply support - **Kubernetes-ready** โ€” Dockerfile + k8s manifests with PVC for auth persistence - **Voice message STT** โ€” auto-transcribes Discord voice messages via Groq, OpenAI, or local Whisper server ([docs/stt.md](docs/stt.md)) - **Lifecycle hooks** โ€” run custom scripts at startup (`pre_boot`) and shutdown (`pre_shutdown`) for bootstrapping, S3 sync, and state backup ([docs/hooks.md](docs/hooks.md)) ## Quick Start ### Prerequisites Before running openab, enable these in the [Discord Developer Portal](https://discord.com/developers/applications): 1. **Bot โ†’ Privileged Gateway Intents**: - โœ… Message Content Intent - โœ… Server Members Intent 2. **OAuth2 โ†’ URL Generator โ†’ Bot Permissions**: - Send Messages, Embed Links, Attach Files - Read Message History, Add Reactions See [docs/discord.md](docs/discord.md) for a detailed step-by-step guide. ### 1. Create a Bot
Discord See [docs/discord.md](docs/discord.md) for a detailed step-by-step guide.
Slack See [docs/slack.md](docs/slack.md) for a detailed step-by-step guide.
Telegram (via Custom Gateway) See [docs/telegram.md](docs/telegram.md) for the full setup guide. Requires the standalone [Custom Gateway](gateway/) service.
LINE (via Custom Gateway) See [docs/line.md](docs/line.md) for the full setup guide. Requires the standalone [Custom Gateway](gateway/) service.
Feishu/Lark (via Custom Gateway) See [docs/feishu.md](docs/feishu.md) for the full setup guide. Requires the standalone [Custom Gateway](gateway/) service. Supports WebSocket long-connection (default, no public URL needed) and HTTP webhook fallback.
Google Chat (via Custom Gateway) See [docs/google-chat.md](docs/google-chat.md) for the full setup guide. Requires the standalone [Custom Gateway](gateway/) service.
WeCom (ไผไธšๅพฎไฟก) (via Custom Gateway) See [docs/wecom.md](docs/wecom.md) for the full setup guide. Requires the standalone [Custom Gateway](gateway/) service.
### 2. Install with Helm (Kiro CLI โ€” default) ```bash helm repo add openab https://openabdev.github.io/openab helm repo update helm install openab openab/openab \ --set agents.kiro.discord.botToken="$DISCORD_BOT_TOKEN" \ --set-string 'agents.kiro.discord.allowedChannels[0]=YOUR_CHANNEL_ID' # Slack helm install openab openab/openab \ --set agents.kiro.slack.enabled=true \ --set agents.kiro.slack.botToken="$SLACK_BOT_TOKEN" \ --set agents.kiro.slack.appToken="$SLACK_APP_TOKEN" \ --set-string 'agents.kiro.slack.allowedChannels[0]=C0123456789' ``` For additional Helm values such as `fullnameOverride`, `nameOverride`, `envFrom`, and `agentsMd`, see [charts/openab/README.md](charts/openab/README.md). ### 3. Authenticate (first time only) ```bash kubectl exec -it deployment/openab-kiro -- kiro-cli login --use-device-flow kubectl rollout restart deployment/openab-kiro ``` ### 4. Use In your Discord channel: ``` @YourBot explain this code ``` The bot creates a thread. After that, just type in the thread โ€” no @mention needed. **Slack:** `@YourBot explain this code` in a channel โ€” same thread-based workflow as Discord. ## Other Agents | Agent | CLI | ACP Adapter | Guide | |-------|-----|-------------|-------| | Kiro (default) | `kiro-cli acp` | Native | [docs/kiro.md](docs/kiro.md) | | Claude Code | `claude-agent-acp` | [@agentclientprotocol/claude-agent-acp](https://github.com/agentclientprotocol/claude-agent-acp) | [docs/claude-code.md](docs/claude-code.md) | | Codex | `codex-acp` | [@zed-industries/codex-acp](https://github.com/zed-industries/codex-acp) | [docs/codex.md](docs/codex.md) | | Gemini | `gemini --acp` | Native | [docs/gemini.md](docs/gemini.md) | | OpenCode | `opencode acp` | Native | [docs/opencode.md](docs/opencode.md) | | Copilot CLI โš ๏ธ | `copilot --acp --stdio` | Native | [docs/copilot.md](docs/copilot.md) | | Cursor | `cursor-agent acp` | Native | [docs/cursor.md](docs/cursor.md) | | Hermes Agent | `hermes-acp` | Native | [docs/hermes.md](docs/hermes.md) | | Grok Build | `grok agent stdio` | Native | [docs/grok.md](docs/grok.md) | | Antigravity | `agy-acp` | [agy-acp](agy-acp/) | [docs/antigravity.md](docs/antigravity.md) | | Pi | `pi-acp` | [pi-acp](https://www.npmjs.com/package/pi-acp) | [docs/pi.md](docs/pi.md) | | **Native Agent** | `openab-agent` | Built-in (Rust) | [docs/native-agent.md](docs/native-agent.md) | > ๐Ÿ”ง Running multiple agents? See [docs/multi-agent.md](docs/multi-agent.md) ## AgentCore Runtime Run any coding agent remotely on [Amazon Bedrock AgentCore](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime.html) โ€” no CLI bundled in the OAB image. ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Discord โ”‚ โ”‚ โ”‚ ACP โ”‚ โ”‚ AWS โ”‚ AgentCore Runtime โ”‚ โ”‚ Slack โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ OAB โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ agentcore-acp โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ–ถ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚Telegram โ”‚ โ”‚ โ”‚ stdio โ”‚ (adapter) โ”‚ SDK โ”‚ โ”‚ Firecracker ฮผVM โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ Kiro / Claudeโ€ฆ โ”‚ โ”‚ โ”‚ โ”‚ /mnt/workspace โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ```toml [agentcore] runtime_arn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:runtime/my-agent" ``` Smaller image (~50MB), persistent filesystem, isolated microVMs, pay-per-use. See [docs/agentcore.md](docs/agentcore.md) for full setup. ## Configuration Reference > ๐Ÿ“– Full reference with all options, defaults, and Helm mapping: [docs/config-reference.md](docs/config-reference.md) ```toml [discord] bot_token = "${DISCORD_BOT_TOKEN}" # supports env var expansion allowed_channels = ["123456789"] # channel ID allowlist # allowed_users = ["987654321"] # user ID allowlist (empty = all users) [slack] bot_token = "${SLACK_BOT_TOKEN}" # Bot User OAuth Token (xoxb-...) app_token = "${SLACK_APP_TOKEN}" # App-Level Token (xapp-...) for Socket Mode allowed_channels = ["C0123456789"] # channel ID allowlist (empty = allow all) # allowed_users = ["U0123456789"] # user ID allowlist (empty = allow all) [agent] # command, args, and working_dir default from OPENAB_AGENT_COMMAND and $HOME # env = { OPENAI_API_KEY = "${OPENAI_API_KEY}" } [pool] max_sessions = 10 # max concurrent sessions session_ttl_hours = 24 # idle session TTL [reactions] enabled = true # enable emoji status reactions remove_after_reply = false # remove reactions after reply ``` ## Kubernetes Deployment The Docker image bundles both `openab` and `kiro-cli` in a single container. ``` โ”Œโ”€ Kubernetes Pod โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ openab (PID 1) โ”‚ โ”‚ โ””โ”€ kiro-cli acp --trust-all-tools (child process) โ”‚ โ”‚ โ”œโ”€ stdin โ—„โ”€โ”€ JSON-RPC requests โ”‚ โ”‚ โ””โ”€ stdout โ”€โ”€โ–บ JSON-RPC responses โ”‚ โ”‚ โ”‚ โ”‚ PVC (/data) โ”‚ โ”‚ โ”œโ”€ ~/.kiro/ (settings, sessions) โ”‚ โ”‚ โ””โ”€ ~/.local/share/kiro-cli/ (OAuth tokens) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ### Deploy without Helm ```bash kubectl create secret generic openab-secret \ --from-literal=discord-bot-token="your-token" kubectl apply -f k8s/configmap.yaml kubectl apply -f k8s/pvc.yaml kubectl apply -f k8s/deployment.yaml ``` | Manifest | Purpose | |----------|---------| | `k8s/deployment.yaml` | Single-container pod with config + data volume mounts | | `k8s/configmap.yaml` | `config.toml` mounted at `/etc/openab/` | | `k8s/secret.yaml` | `DISCORD_BOT_TOKEN` injected as env var | | `k8s/pvc.yaml` | Persistent storage for auth + settings | ## Inspired By - [sample-acp-bridge](https://github.com/aws-samples/sample-acp-bridge) โ€” ACP protocol + process pool architecture - [OpenClaw](https://github.com/openclaw/openclaw) โ€” StatusReactionController emoji pattern ## License MIT