Run OpenAI Codex against a local repo from WhatsApp.
This project connects:
- Twilio WhatsApp Sandbox or sender
- a local
codexCLI install - one repo on your machine
- background status messages back to WhatsApp
- receives incoming WhatsApp messages from Twilio
- runs
codex execagainst a configured local repo - sends start, progress, success, and failure messages back to WhatsApp
- allows one active job at a time so repo edits do not overlap
- Node 20+
codexinstalled and authenticated locally- a Twilio account with WhatsApp Sandbox or a production sender
- a local repository you want Codex to control
git clone https://github.com/YOUR_GITHUB_USERNAME/codex-whatsappconnect.git
cd codex-whatsappconnect
npm installCopy the environment template:
cp .env.example .envFill in:
TARGET_REPO_PATHALLOWED_WHATSAPP_FROMTWILIO_ACCOUNT_SIDTWILIO_AUTH_TOKENTWILIO_WHATSAPP_FROM
Example:
PORT=3000
TARGET_REPO_PATH=/absolute/path/to/your/repo
ALLOWED_WHATSAPP_FROM=whatsapp:+15551234567
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_WHATSAPP_FROM=whatsapp:+14155238886
CODEX_BIN=codex
CODEX_MODEL=
CODEX_SANDBOX=workspace-write
CODEX_CONFIG_JSON=[]Start the webhook server:
npm run devExpose it publicly with Cloudflare Tunnel:
npm run tunnelCloudflare will print a public URL like:
https://random-name.trycloudflare.com
Use this in Twilio:
https://random-name.trycloudflare.com/twilio/whatsapp
Method: POST
- Open Twilio WhatsApp Sandbox.
- Join the sandbox from your phone.
- Set
When a message comes into your public webhook URL. - Make sure
ALLOWED_WHATSAPP_FROMmatches your WhatsApp number exactly.
list filesreviewwhat folder are you infind the main app entry pointfix the failing tests and summarize what changed
- each WhatsApp message starts a fresh
codex execrun - repo state persists on disk
- Codex session memory does not persist between jobs
- restrict this bridge to one repo at a time
- keep
CODEX_SANDBOX=workspace-writeunless you fully trust the environment - do not commit your real
.env - rotate Twilio credentials if they are ever pasted into chat or logs
- persistent Codex sessions across WhatsApp messages
/status,/stop, and/resetcommands- git diff summaries after each completed job
- approval gates for dangerous commands
- support for multiple repos
MIT