Installation
Install the Unhook CLI globally using your preferred package manager:Quick Start
- Initialize your project:
- Start the webhook:
- Use the generated webhook URL in your provider’s settings:
Core Commands
unhook init
Authenticate with Unhook and set up your project. Creates an unhook.yml config and guides you through connecting your webhook provider.
unhook listen
Start the Unhook relay to receive and forward webhooks to your local server. Keeps the CLI running and displays incoming requests.
unhook login
Authenticate your CLI with your Unhook account. Opens a browser for login.
Global Options
| Option | Alias | Description | Default |
|---|---|---|---|
--verbose | -v | Enable verbose debug logging for troubleshooting | false |
--help | -h | Show help | - |
--version | - | Show version number | - |
Configuration
Configuration File
The CLI uses anunhook.yml file for configuration. This file should be in your project root:
Configuration File Locations
The CLI will look for configuration files in the following order:unhook.yml(current directory)unhook.yaml(current directory)unhook.config.yml(current directory)unhook.config.yaml(current directory)unhook.config.js(current directory)unhook.config.cjs(current directory)unhook.config.ts(current directory)unhook.config.json(current directory)
Environment Variables
All configuration options can be set via environment variables:Interactive UI
The CLI includes an interactive terminal UI that shows:- Connection status
- Webhook activity
- Error messages
- Debug information (when enabled)
UI Elements
- Status Bar: Shows connection status and client ID
- Activity Log: Real-time webhook request log
- Debug Panel: Detailed debug information (visible with
--verbose) - Error Messages: Highlighted in red for visibility
Navigation
- Arrow Keys: Navigate through lists and menus
- Enter: Select items or execute actions
- ESC: Go back to previous screen
- q: Quit the application
- ?: Show keyboard shortcuts
Health Checks
Theping option in your configuration configures connection health monitoring:
Authentication
Authentication data is stored locally at~/.unhook/auth-storage.json:
- Authentication state
- User tokens
- Organization ID
- Basic user info
Exit Codes
| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid configuration |
| 3 | Network error |
| 4 | Authentication error |
Examples
Basic Development Setup
Team Development
Custom Configuration
Debug Mode
Best Practices
- Use Configuration Files: Store your settings in
unhook.ymlfor consistency - Enable Debug Logging: Use
--verbosewhen troubleshooting issues - Health Checks: Configure appropriate health checks for your setup
- Environment Variables: Use env vars for sensitive information
- Team Configuration: Share configuration files in version control
Troubleshooting
Common Issues
-
Connection Issues
- Check your internet connection
- Verify the webhook ID is correct
- Ensure the port is available
-
Authentication Problems
- Clear auth data:
rm ~/.unhook/auth-storage.json - Re-run initialization:
npx @unhook/cli init
- Clear auth data:
-
Configuration Issues
- Verify YAML syntax in
unhook.yml - Check file permissions
- Ensure required fields are present
- Verify YAML syntax in
-
Debug Mode
- Enable debug logging:
npx @unhook/cli listen --verbose - Check the debug panel for detailed information
- Enable debug logging:
Getting Help
- Documentation: docs.unhook.sh
- GitHub Issues: github.com/unhook-sh/unhook/issues
- Discord Community: discord.gg/unhook