Receive webhooks on your local machine during development. The HookBridge CLI connects your local server to HookBridge infrastructure so you can test webhook integrations without exposing your machine to the internet.
- Configure your webhook provider (Stripe, GitHub, etc.) to send events to your HookBridge Webhook URL.
- HookBridge receives and stores the webhook at its public endpoint.
- The CLI receives the webhook over a persistent WebSocket connection within milliseconds.
- The CLI forwards it to your local server as an HTTP POST, preserving the original headers, body, and content type.
- The local response (status code and latency) is displayed in your terminal.
No inbound ports are required — the CLI connects outbound to HookBridge over HTTPS/WSS.
- A HookBridge account
- An API key (create one in the console under API Keys)
brew install hookbridge/tap/hbDownload the latest release from GitHub Releases for your platform.
macOS (Apple Silicon):
curl -L https://github.com/hookbridge/hookbridge-cli/releases/download/v1.0.2/hb_v1.0.2_darwin_arm64.tar.gz | tar xz
sudo mv hb /usr/local/bin/macOS (Intel):
curl -L https://github.com/hookbridge/hookbridge-cli/releases/download/v1.0.2/hb_v1.0.2_darwin_amd64.tar.gz | tar xz
sudo mv hb /usr/local/bin/Linux (x86_64):
curl -L https://github.com/hookbridge/hookbridge-cli/releases/download/v1.0.2/hb_v1.0.2_linux_amd64.tar.gz | tar xz
sudo mv hb /usr/local/bin/Linux (ARM64):
curl -L https://github.com/hookbridge/hookbridge-cli/releases/download/v1.0.2/hb_v1.0.2_linux_arm64.tar.gz | tar xz
sudo mv hb /usr/local/bin/Windows (x86_64):
Download hb_v1.0.2_windows_amd64.zip from GitHub Releases, extract hb.exe, and add it to a directory in your PATH. Use Windows Terminal or PowerShell for the best experience — color-coded output is not supported in the legacy Command Prompt.
If you have Go installed:
go install github.com/hookbridge/hookbridge-cli/cmd/hb@latesthb versionAuthenticate with your HookBridge API key:
hb loginYou will be prompted to enter your API key. The CLI verifies the key against the HookBridge API and saves credentials locally.
You can also pass the key non-interactively:
hb login --api-key YOUR_API_KEYStart your local server, then run:
hb listen --port 3000The CLI will:
- Find or create a CLI-mode inbound endpoint in your project.
- Print a Webhook URL — copy this into your webhook provider's settings.
- Connect and wait for webhooks.
HookBridge CLI v1.0.0
Endpoint: CLI Endpoint (ie_abc123)
Webhook URL: https://receive.hookbridge.io/v1/webhooks/receive/ie_abc123/sk_xyz789
Paste this URL into your webhook provider's settings.
Forwarding to http://localhost:3000
Ready. Waiting for webhooks...
From another terminal, send a test request to the Webhook URL printed above:
curl -X POST "YOUR_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d '{"event":"test","data":{"id":"123"}}'You should see the webhook arrive in your CLI output:
12:34:01 POST → 200 89ms application/json (42 bytes)
Replace the test curl with a real webhook provider:
- Go to your provider's webhook settings (Stripe Dashboard, GitHub repo settings, etc.).
- Set the webhook URL to the Webhook URL from
hb listen. - Trigger an event in the provider.
- Watch the webhook arrive in your terminal and hit your local server.
The Webhook URL is stable across sessions — you do not need to update your provider settings each time you restart the CLI.
Authenticate with your HookBridge API key.
hb login
hb login --api-key YOUR_API_KEY| Flag | Description |
|---|---|
--api-key |
API key for non-interactive login |
Remove stored credentials.
hb logoutDeletes the config file. If you are already logged out, this prints a confirmation message without error.
Listen for webhooks and forward them to a local server.
hb listen --port 3000
hb listen --forward http://localhost:8080/webhooks/stripe
hb listen --no-forward --verbose
hb listen --endpoint ie_abc123| Flag | Short | Default | Description |
|---|---|---|---|
--port |
-p |
3000 |
Localhost port to forward to (http://localhost:{port}) |
--forward |
Full URL to forward to (overrides --port) |
||
--no-forward |
false |
Display webhooks without forwarding | |
--verbose |
-v |
false |
Show full headers and body for each webhook |
--endpoint |
Use a specific endpoint by ID instead of auto-selecting |
Output:
Each webhook prints a log line:
12:34:01 POST → 200 89ms application/json (328 bytes)
Status codes are color-coded: green for 2xx, red for 4xx/5xx, yellow for connection errors.
With --verbose, headers and body are printed below each log line.
Press Ctrl+C to stop listening. The CLI prints a summary of how many webhooks were received during the session.
List CLI-mode inbound endpoints in your project.
hb endpointsID NAME ACTIVE
-------------------------------------- ------------------ ------
ie_abc123... CLI Endpoint yes
Create a new CLI-mode inbound endpoint.
hb endpoints create
hb endpoints create --name "Stripe Local"| Flag | Default | Description |
|---|---|---|
--name |
CLI Endpoint |
Name for the new endpoint |
Print the installed CLI version.
hb version| Variable | Description |
|---|---|
HB_API_KEY |
Override the stored API key |
HB_API_URL |
Override the API base URL |
HB_STREAM_URL |
Override the WebSocket stream URL |
Environment variables take precedence over values in the config file.
Credentials are stored in ~/.hookbridge/config.json:
| Platform | Path |
|---|---|
| macOS / Linux | ~/.hookbridge/config.json |
| Windows | %USERPROFILE%\.hookbridge\config.json |
{
"api_key": "hb_live_...",
"project_id": "proj_..."
}On macOS and Linux, the file is created with 0600 permissions (owner read/write only).
The CLI maintains a WebSocket connection to receive webhooks in real time. If the connection drops (network change, laptop sleep, etc.), it automatically reconnects with exponential backoff. If reconnection fails, it switches to an HTTP polling fallback.
While polling, the CLI periodically retries the WebSocket connection. When restored, it switches back to real-time streaming automatically.
Webhooks that arrive while the CLI is offline are stored by HookBridge and delivered when you reconnect.
- No inbound ports — your machine does not need to be publicly accessible. The CLI connects outbound over HTTPS/WSS.
- API key authentication — only authenticated clients with access to the endpoint can receive webhooks.
- Credentials stored locally — your API key is saved with restricted file permissions (
0600). - TLS everywhere — all communication between the CLI and HookBridge uses TLS encryption.
Run hb login and enter a valid API key. If you have already logged in, the config file may have been deleted — log in again.
Your API key may have been revoked or may be from a different project. Create a new key in the HookBridge console and run hb login again.
The real-time streaming connection could not be established. The CLI will continue to work via HTTP polling. This may happen on networks that block WebSocket connections. Webhooks will still be received, with slightly higher latency.
- Confirm your local server is running and accepting POST requests on the expected port.
- Check that the Webhook URL in your provider's settings matches the URL printed by
hb listen. - Try
hb listen --no-forward --verboseto see if webhooks are reaching HookBridge but failing to forward locally. - Check that the endpoint is active with
hb endpoints.
Your local server is not running or is not listening on the port/URL the CLI is forwarding to. Start your server and confirm the port matches the --port or --forward flag.
Full documentation is available at docs.hookbridge.io.
This project is licensed under the Apache License 2.0. See LICENSE for details.