mirror of
https://github.com/different-ai/openwork
synced 2026-04-25 17:15:34 +02:00
2.6 KiB
2.6 KiB
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 (run owpenbot setup, link WhatsApp, start the bridge).
- One-command setup (installs deps, builds, creates
.envif missing):
pnpm -C packages/owpenbot setup
- (Optional) Fill in
packages/owpenbot/.env(see.env.example).
Required:
OPENCODE_URLOPENCODE_DIRECTORYWHATSAPP_AUTH_DIR
Recommended:
OPENCODE_SERVER_USERNAMEOPENCODE_SERVER_PASSWORD
- Run setup (writes
~/.owpenbot/owpenbot.json):
owpenbot setup
- Link WhatsApp (QR):
owpenbot whatsapp login
- Start the bridge:
owpenbot start
Owpenbot keeps the WhatsApp session alive once connected.
- Pair a user with the bot (only if DM policy is pairing):
- Run
owpenbot pairing listto view pending codes. - Approve a code:
owpenbot pairing approve <code>. - The user can then message again to receive OpenCode replies.
Usage Flows
One-person flow (personal testing)
Use your own WhatsApp account as the bot and test from a second number you control.
- Run
owpenbot setupand choose “personal number.” - Run
owpenbot whatsapp loginto scan the QR. - Message yourself or from a second number; your number is already allowlisted.
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.
- Run
owpenbot setupand choose “dedicated number.” - Run
owpenbot whatsapp loginto scan the QR. - If DM policy is pairing, approve codes with
owpenbot pairing approve <code>.
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 setup
owpenbot whatsapp login
owpenbot start
owpenbot pairing list
owpenbot pairing approve <code>
owpenbot status
Defaults
- SQLite at
~/.owpenbot/owpenbot.dbunless overridden. - Config stored at
~/.owpenbot/owpenbot.json(created byowpenbot setup). - DM policy defaults to
pairingunless changed in setup. - Group chats are disabled unless
GROUPS_ENABLED=true.
Tests
pnpm -C packages/owpenbot test:unit
pnpm -C packages/owpenbot test:smoke