hookee - Command line webhooks, on demand: see, answer, forward, and capture requests from your terminal

Version Python Versions Coverage Build Docs GitHub License

hookee gives you a public URL to your terminal with one command. Point any service’s webhooks at it, then see, answer, and forward every request as it happens, with no code.

  • See any webhook, instantly. Run hookee, paste its URL into any service’s console, and every request is dumped to your terminal, with JSON, XML, and form bodies formatted.
  • Answer it from the command line. Respond with any body, status code, headers, or delay, and see how the service reacts.
  • Sit in front of your app. --forward-to relays every request to your local app and shows both sides, including streamed responses.
  • Debug a phone or browser against your local backend. Every API call shows up in your console, with nothing to set up on the device.
  • Capture real payloads as test fixtures. Save each request, and your app’s response, as JSON.
  • Verify signatures, test error handling, and mock services. Check that requests really came from the service, break one endpoint while the rest keep working, or stand in for an API your app calls.

Installation

hookee is available on PyPI and can be installed using pip:

pip install hookee

or conda:

conda install -c conda-forge hookee

That’s it! hookee is now available as a Python package and is available from the command line.

Configure authtoken

To get the most out of hookee, you’ll want to obtain an authtoken from ngrok (it’s free!) and install it into hookee’s config file:

hookee authtoken $NGROK_AUTHTOKEN

Basic Usage

Start hookee, and it gives you a public URL whose /webhook endpoint dumps every request it receives, and the response sent back, to your console:

hookee

Each workflow below is a single command:

You want to …Run
See what a webhook sendshookee
Reply without writing codehookee --response-file reply.xml
Test error handling and retrieshookee --status-code 503 --delay 10
Forward to your app, and watch both sideshookee --forward-to http://localhost:3000
Capture real payloads as fixtureshookee --forward-to http://localhost:3000 --save-dir tests/fixtures
Record a third-party API’s real responseshookee --forward-to https://api.example.com --host-header api.example.com --save-dir tests/fixtures
Verify webhook signatureshookee --verify-webhook <provider>:<secret>
Debug a device against your local APIhookee --forward-to http://localhost:3000 --url my-api.ngrok.dev
Break one endpoint, keep the rest workinghookee --forward-to http://localhost:3000 --response-route "^GET /api/" --status-code 503
Mock a service your app callshookee --response-file feed.ics
Run locally, without a tunnelhookee --no-tunnel --port 19780 --response "Ok"

To see every way hookee can be configured right from the console:

hookee --help

Documentation

For more advanced usage, hookee’s official documentation is available on Read the Docs, including how to change its defaults, extend it with plugins, and integrate it into your own code.

Contributing

If you would like to get involved, be sure to review the Contribution Guide.

Want to contribute financially? If you’ve found hookee useful, sponsorship would also be greatly appreciated!