mirror of
https://github.com/different-ai/openwork
synced 2026-05-10 09:12:03 +02:00
Owpenbot
Simple WhatsApp bridge for a running OpenCode server. Telegram support exists but is not yet E2E tested.
Install + Run (WhatsApp)
One-command install (recommended):
curl -fsSL https://raw.githubusercontent.com/different-ai/openwork/dev/packages/owpenbot/install.sh | bash
Then follow the printed next steps (edit .env, run owpenbot).
- One-command setup (installs deps, builds, creates
.envif missing):
pnpm -C packages/owpenbot setup
- Fill in
packages/owpenbot/.env(see.env.example).
Required:
OPENCODE_URLOPENCODE_DIRECTORYWHATSAPP_AUTH_DIR
Recommended:
OPENCODE_SERVER_USERNAMEOPENCODE_SERVER_PASSWORD
- Run the bridge:
owpenbot
Owpenbot prints a QR code if WhatsApp is not paired and keeps the session alive once connected.
- Pair a user with the bot:
- Run
pnpm -C packages/owpenbot pairing-codeto get the code. - Send a WhatsApp message containing the code (e.g.
123456 hello). - You should receive an OpenCode response in the same chat.
Usage Flows
One-person flow (personal testing)
Use your own WhatsApp account as the bot and test from a second number you control.
- Pair WhatsApp using your personal number (just run
owpenbotto show the QR). - Send the pairing code from a second number (SIM/eSIM or another phone).
- Chat from that second number to receive OpenCode replies.
Note: WhatsApp’s “message yourself” thread is not reliable for bot testing.
Two-person flow (dedicated bot)
Use a separate WhatsApp number as the bot account so it stays independent from your personal chat history.
- Create a new WhatsApp account for the dedicated number.
- Pair that account by running
owpenbotand scanning the QR. - Share the pairing code with the person who should use the bot.
- Optionally pre-allowlist specific numbers with
ALLOW_FROM_WHATSAPP=.
Telegram (Untested)
Telegram support is wired but not E2E tested yet. To try it:
- Set
TELEGRAM_BOT_TOKEN. - Optionally set
TELEGRAM_ENABLED=true.
Commands
owpenbot
pnpm -C packages/owpenbot pairing-code
Defaults
- SQLite at
~/.owpenbot/owpenbot.dbunless overridden. - Allowlist is enforced by default; a pairing code is generated if not provided.
- Group chats are disabled unless
GROUPS_ENABLED=true.
Tests
pnpm -C packages/owpenbot test:unit
pnpm -C packages/owpenbot test:smoke