@hooklink/cli
v0.1.35
Published
HookLink CLI - Forward webhooks to your local development machine
Maintainers
Readme
HookLink CLI
Forward webhooks to your local development machine via WebSocket tunnel.
Installation
npm install -g @hooklink/cliQuick Start
Login with your API key:
hooklink loginView your endpoints:
hooklink endpointsConnect and start forwarding:
hooklink connect myapp --target http://localhost:3000
Commands
hooklink login
Authenticate with your HookLink API key.
# Interactive prompt
hooklink login
# With API key flag
hooklink login --key hlk_your_api_key_herehooklink logout
Clear stored credentials.
hooklink logouthooklink connect [endpoint]
Connect to HookLink and forward webhooks to your local server.
# Connect to specific endpoint
hooklink connect myapp --target http://localhost:3000
# Use port shorthand
hooklink connect myapp --port 3000
# Connect to first active endpoint
hooklink connect --port 8080Options:
-t, --target <url>- Local target URL (default: http://localhost:3000)-p, --port <port>- Local port (alternative to --target)
hooklink status
Show current configuration and connection status.
hooklink statushooklink endpoints
List all your endpoints.
hooklink endpoints
# or
hooklink lshooklink logs
View recent webhook request logs.
# Show recent logs
hooklink logs
# Filter by endpoint
hooklink logs --endpoint myapp
# Limit number of logs
hooklink logs --limit 50Options:
-e, --endpoint <keyword>- Filter by endpoint keyword-l, --limit <number>- Number of logs to fetch (default: 20)
hooklink config
View or modify CLI configuration.
# List all configuration
hooklink config
# Get specific value
hooklink config --get apiUrl
# Set configuration value
hooklink config --set apiUrl=https://api.hooklink.net
hooklink config --set defaultPort=8080
# Delete configuration value
hooklink config --delete defaultPort
# Reset all configuration
hooklink config --resetConfiguration
Configuration is stored in ~/.config/hooklink/config.json (or OS-specific config directory).
Available configuration keys:
apiKey- Your HookLink API key (usehooklink logininstead)apiUrl- API base URL (default: https://api.hooklink.net)wsUrl- WebSocket server URL (default: wss://ws.hooklink.net/ws)defaultEndpoint- Default endpoint keyword to connect todefaultPort- Default local port (default: 3000)
How It Works
- The CLI establishes a WebSocket connection to the HookLink server
- When a webhook arrives at your public URL, the server forwards it through the WebSocket
- The CLI receives the webhook and forwards it to your local server
- The response from your local server is sent back through the WebSocket
- HookLink returns the response to the original webhook sender
Troubleshooting
Connection Issues
- Ensure you're logged in:
hooklink login - Check your endpoint is active:
hooklink endpoints - Verify your local server is running
- Check WebSocket URL:
hooklink config --get wsUrl
Authentication Errors
- Verify your API key is valid:
hooklink status - Re-login if needed:
hooklink logout && hooklink login
Request Not Forwarding
- Check logs:
hooklink logs - Ensure your endpoint URL matches the webhook source
- Verify source whitelist settings in the dashboard
Examples
Basic Usage
# Login
hooklink login --key hlk_your_api_key
# Start forwarding to localhost:3000
hooklink connect myapp
# Start forwarding to different port
hooklink connect myapp --port 8080Custom Configuration
# Set custom API URL (for self-hosted)
hooklink config --set apiUrl=https://api.yourdomain.com
hooklink config --set wsUrl=wss://ws.yourdomain.com
# Set default port
hooklink config --set defaultPort=8080
# Now connect uses your defaults
hooklink connect myappViewing Logs
# View recent logs
hooklink logs
# View logs for specific endpoint
hooklink logs --endpoint myapp
# View more logs
hooklink logs --limit 100License
MIT
