Files
openwork/packages/owpenbot

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).

  1. One-command setup (installs deps, builds, creates .env if missing):
pnpm -C packages/owpenbot setup
  1. Fill in packages/owpenbot/.env (see .env.example).

Required:

  • OPENCODE_URL
  • OPENCODE_DIRECTORY
  • WHATSAPP_AUTH_DIR

Recommended:

  • OPENCODE_SERVER_USERNAME
  • OPENCODE_SERVER_PASSWORD
  1. Run the bridge:
owpenbot

Owpenbot prints a QR code if WhatsApp is not paired and keeps the session alive once connected.

  1. Pair a user with the bot:
  • Run pnpm -C packages/owpenbot pairing-code to 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.

  1. Pair WhatsApp using your personal number (just run owpenbot to show the QR).
  2. Send the pairing code from a second number (SIM/eSIM or another phone).
  3. Chat from that second number to receive OpenCode replies.

Note: WhatsApps “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.

  1. Create a new WhatsApp account for the dedicated number.
  2. Pair that account by running owpenbot and scanning the QR.
  3. Share the pairing code with the person who should use the bot.
  4. 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.db unless 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