CLI Getting Started
Install the Better Webhook CLI and start capturing, replaying, and testing webhooks locally in minutes.
CLI Getting Started
The Better Webhook CLI is a local development tool for capturing, replaying, and testing webhooks without exposing your localhost to the internet.
Installation
Install the CLI globally:
bash npm install -g @better-webhook/cli bash pnpm add -g @better-webhook/cli bash yarn global add @better-webhook/cli Verify the installation:
better-webhook --versionQuick Start
The fastest way to get started is with the dashboard command, which starts both the UI and a capture server:
Start the Dashboard
better-webhook dashboardThis starts:
- Dashboard UI at
http://localhost:4000 - Capture Server at
http://localhost:3001
Point Webhooks to the Capture Server
Configure your webhook source (GitHub, Ragie, etc.) to send webhooks to:
http://localhost:3001/webhooks/your-providerUse a tunnel service like ngrok or cloudflared to expose the capture server if your webhook source can't reach localhost.
Trigger a Webhook
Perform an action that triggers a webhook (push code, create an issue, etc.). The webhook will be captured and appear in the dashboard.
Replay to Your Local Server
From the dashboard, select a captured webhook and replay it to your local development server:
http://localhost:3000/api/webhooks/githubYou can replay the same webhook as many times as needed while debugging.
Alternative: CLI-Only Workflow
If you prefer working entirely in the terminal:
# Start the capture server
better-webhook capture --port 3001
# In another terminal, list captured webhooks
better-webhook captures list
# Replay a captured webhook
better-webhook replay abc12345 http://localhost:3000/api/webhooks/githubUsing Templates
Don't have real webhooks to test with? Use pre-built templates:
# List available templates
better-webhook templates list
# Download a template
better-webhook templates download github-push
# Run a template against your endpoint
better-webhook run github-push --url http://localhost:3000/api/webhooks/githubTemplates include proper headers and can generate valid signatures when you provide a secret.
Next Steps
- Command Reference — Full documentation for all CLI commands
- Templates — Learn about available templates and how to use them