CLI
Test webhooks on your laptop,with no public URL.
The ModelRiver CLI receives your project’s webhook deliveries over a WebSocket and forwards them to a local server. Trigger requests, finish backend pipeline steps and check signatures from your terminal.
npm install -g @modelriver/cli Installs the modelriver command globally.
Quick start
Three commands from install to your first webhook on localhost.
- 1
Log in once
Enter your ModelRiver API key and the local URL your app listens on. They’re saved for every later command.
terminal# Saves your API key and the local URL to forward to modelriver login ✓ Configuration saved! - 2
Listen for deliveries
The CLI opens a WebSocket to ModelRiver. Each webhook delivery for your project prints here and is forwarded to your local server. No tunnel needed.
terminal 1modelriver listen --print ✓ WebSocket connected ✓ Joined webhook channel > Ready! Listening for webhook events > Local port: 3001 - 3
Trigger and answer
In a second terminal, send a test request. If the workflow has a backend pipeline step, finish it with callback.
terminal 2# Send a test async request modelriver trigger -w support_reply -m "Where is my order?" --print-channel # Answer the waiting backend pipeline step modelriver callback -c 550e8400-… -d '{"status":"shipped"}'
Configure it your way
Set your API key once with login, or pass it in each time. Flags win over environment variables, which win over the config file.
// ~/.modelriver/config.json, written by modelriver login
{
"api_key": "mr_live_…",
"forward_url": "http://localhost:3001/webhook/modelriver"
}A .modelriverrc file in your project works too.
export MODELRIVER_API_KEY=mr_live_…# Flags win over environment variables and the config file
modelriver listen --api-key mr_live_… --port 3002 --printmodelriver webhook verify \
--payload body.json \
--signature 3f9a… \
--timestamp 1793600000 \
--secret your-webhook-secretChecks a delivery’s HMAC-SHA256 signature on your machine with your webhook secret.
Commands
Every command, with its short alias where it has one.
All commands
| Command | What it does |
|---|---|
login | Saves your API key and forward URL. |
listen · l | Receives webhook deliveries over a WebSocket and forwards them locally. |
forward · f | Starts forwarding with your saved settings. |
trigger · t | Sends a test async request and prints the channel details. |
callback | Finishes a waiting backend pipeline step with your data. |
websocket · ws | Sends a request and follows its answer over a WebSocket. |
test-webhook | Checks webhook delivery end to end with a temporary webhook. |
webhook list | Lists your project’s webhooks. |
webhook verify | Checks a webhook signature on your machine. |
Good to know
Real requests
Requests you trigger are normal requests and count toward your plan, unless the workflow is in test mode.
Temporary webhooks only
listen and test-webhook set up temporary webhooks for testing. Create permanent webhooks in the console.
One session a day
The CLI’s WebSocket token lasts 24 hours and can be reused across reconnects in that time.
Works with your project
The CLI talks to ModelRiver with your own API key, so it sees the same workflows and webhooks as your app.
Frequently asked questions
How is this different from a tunnel like ngrok?
You don’t expose a public URL. ModelRiver sends deliveries to the CLI over a WebSocket, and the CLI passes them to your local server.
Do triggered requests count toward my plan?
Yes, like any other request, unless the workflow is in test mode.
How long does a listen session last?
The CLI’s WebSocket token is valid for 24 hours.
Can I test backend pipelines?
Yes. listen shows the delivery with its callback URL, and callback sends your backend data so the next step runs.
What do I need to install it?
Node.js 16 or later. Install the package globally from npm, then run modelriver login.
Works well with
Get your first webhook on localhost
Start on the free plan, install the CLI, and run modelriver listen.