Skip to content

CLI Command Reference

Authenticate with your HookBridge API key.

Terminal window
hb login
hb login --api-key YOUR_API_KEY

The CLI prompts for your API key, verifies it against the HookBridge API, and saves credentials to the config file.

FlagDescription
--api-keyAPI key for non-interactive login

Remove stored credentials.

Terminal window
hb logout

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

On startup, the CLI finds an existing CLI-mode inbound endpoint in your project or creates one automatically. It then prints the Webhook URL and connects to receive incoming webhooks.

Webhooks are forwarded to your local server as HTTP POST requests with the original headers, body, and content type preserved.

Forward webhooks to a local server on port 3000:

Terminal window
hb listen --port 3000

Forward to a specific URL path on your local server:

Terminal window
hb listen --forward http://localhost:8080/webhooks/stripe

Display webhooks in the terminal without forwarding, with full headers and body:

Terminal window
hb listen --no-forward --verbose
FlagShortDefaultDescription
--port-p3000Localhost port to forward to (http://localhost:{port})
--forwardFull URL to forward to (overrides --port)
--no-forwardfalseDisplay webhooks without forwarding
--verbose-vfalseShow full headers and body for each webhook
--endpointUse a specific endpoint by ID instead of auto-selecting

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.

Terminal window
hb endpoints

Prints a table of CLI-mode endpoints with their ID, name, and active status.

ID NAME ACTIVE
-------------------------------------- ------------------ ------
ie_abc123... CLI Endpoint yes

If no CLI-mode endpoints exist, the command suggests creating one.

Create a new CLI-mode inbound endpoint.

Terminal window
hb endpoints create
hb endpoints create --name "Stripe Local"
FlagDefaultDescription
--nameCLI EndpointName for the new endpoint

Prints the endpoint ID and Webhook URL (receive URL) on success.

Print the installed CLI version.

Terminal window
hb version
VariableDescription
HB_API_KEYOverride the stored API key

Environment variables take precedence over values in the config file.

Credentials are stored in a config.json file inside the .hookbridge directory under your home folder:

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

Personalize Examples

Enter your credentials to populate code examples throughout the docs.