twilio-opencode

A lightweight express server to handle Twilio voice and messaging webhooks for prompting Opencode.
git clone https://unitehenry.com/git/twilio-opencode.git
Log | Files | Refs | README | LICENSE

commit f58c92369901049431aee9a53e8f40ab216fc668
parent e537d4070e2039bc7f35c700a36df5bf08ade9b6
Author: Henry Unite <unitehenry@gmail.com>
Date:   Sun,  8 Mar 2026 00:38:02 +0000

docs: ngrok usage

Diffstat:
MREADME.md | 32++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -8,20 +8,11 @@ A lightweight express server to handle twilio voice and messaging webhooks for p 2. [Start the twilio opencode server](#start-server) 3. [Configure twilio](#configure-twilio) -## Environment variables - -| Variable | Description | Default | -|----------|-------------|---------| -| `OPENCODE_BASE_URL` | Base URL for the opencode client to connect to. | None | -| `PORT` | Port on which the express server listens. | 3000 | -| `FROM_WHITELIST` | Comma-separated list of whitelisted phone numbers for incoming requests. (Ex: `+1234567891,+13456789201`) If not set, all numbers will be able to prompt opencode. | None | -| `TWILIO_AUTH_TOKEN` | Twilio Auth Token for webhook validation. If not set, webhooks will not be validated. | None | - ### Start server ```bash docker run twilio-opencode \ - -e OPENCODE_BASE_URL="http://127.0.0.1:409369676" \ + -e OPENCODE_BASE_URL="http://127.0.0.1:4096" \ -p 3000:3000 ``` @@ -38,6 +29,27 @@ curl -X POST \ -d "twilioAccountSid=$TWILIO_ACCOUNT_SID&twilioPhoneNumberSid=$TWILIO_PHONE_NUMBER_SID&twilioAuthToken=$TWILIO_AUTH_TOKEN" ``` +## Environment variables + +| Variable | Description | Default | +|----------|-------------|---------| +| `OPENCODE_BASE_URL` | Base URL for the opencode client to connect to. | None | +| `PORT` | Port on which the express server listens. | 3000 | +| `FROM_WHITELIST` | Comma-separated list of whitelisted phone numbers for incoming requests. (Ex: `+1234567891,+13456789201`) If not set, all numbers will be able to prompt opencode. | None | +| `TWILIO_AUTH_TOKEN` | Twilio Auth Token for webhook validation. If not set, webhooks will not be validated. | None | + +## Local Proxy + +There is a `ngrok` script to make local development easy. + +```bash +TWILIO_ACCOUNT_SID="ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ +TWILIO_PHONE_NUMBER_SID="PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ +TWILIO_AUTH_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ +OPENCODE_BASE_URL="http://127.0.0.1:4096" \ +scripts/ngrok.sh +``` + ## Build an image ```bash