CLI and tunnels

The hookline CLI forwards what your endpoints capture to a server on your machine, prints requests live, replays them and sends realistic test events.

Install#

brew install --cask kaanxsrd/tap/hookline      # macOS
scoop bucket add hookline https://github.com/kaanxsrd/scoop-bucket
scoop install hookline                          # Windows
npm install -g @hookline/cli                    # any platform with Node 18+

Archives for macOS, Linux and Windows (x64 and arm64) are also on the releases page, with checksums. To build from source, use Go 1.27 or later:

git clone https://github.com/kaanxsrd/hookline
cd hookline/cli
go build -o hookline .

Release builds use the hosted instance by default; set HOOKLINE_URL or pass --url to use your own.

Check for a newer release at any time with hookline update. It prints the right upgrade command for how you installed it.

Sign in#

hookline login

The CLI shows a code and opens your browser. Approve the code and choose an organization, and the CLI stores an API key for it in your user configuration directory (hookline/config.json, readable only by you). hookline whoami shows the organization and key in use, and hookline logout revokes the key.

In CI or other scripts, set HOOKLINE_API_KEY to an API key instead.

Forward to localhost#

hookline listen <slug> --forward http://localhost:3000/api/webhooks

Each request is sent to your server with its method, sub-path, query, headers and body, and printed with your server's answer:

✓ Forwarding https://<your instance>/h/<slug> → http://localhost:3000/api/webhooks
12:04:31  POST /h/<slug>/stripe  → 200  38 ms  payment_intent.succeeded
FlagWhat it does
--forward URLWhere to send requests (required)
--syncAnswer the sender with your server's response (endpoints in CLI sync mode)
--path-rewrite /from=/toRewrite a path prefix; repeatable
--header Name:valueSet a header on forwarded requests; repeatable
--filter-method POSTOnly forward these methods; repeatable

listen takes up to 10 slugs at once. Your plan sets how many tunnels can be open at the same time. The tunnel reconnects on its own after network trouble or a server restart.

Sync responses#

Normally the sender gets the endpoint's configured response straight away. Put the endpoint in CLI sync mode and run listen --sync, and the sender gets your local server's status, headers and body instead. If your server cannot be reached or does not answer within the endpoint's sync timeout, the configured response is sent.

Watch without forwarding#

hookline tail <slug>
hookline tail <slug> --json | jq .

Replay#

hookline replay <requestId> --to http://localhost:3000/api/webhooks
hookline replay <requestId> --cli
hookline replay <requestId> --destination <destinationId>
hookline replay <requestId> --cli --edit

--to sends the request from your machine, --cli sends it to every CLI listening on its endpoint, and --destination queues it for one of the endpoint's destinations. --edit opens the request as YAML in $HOOKLINE_EDITOR, $VISUAL or $EDITOR before sending it.

Send test events#

hookline trigger --list
hookline trigger <slug> stripe.payment_intent.succeeded

trigger sends a realistic sample event (Stripe, GitHub, Shopify, Discord or generic JSON) to an endpoint. It is signed with the endpoint's secret, so it shows up as verified. Use --secret or HOOKLINE_SIGNING_SECRET to sign with a different one.

Manage endpoints#

hookline endpoints list
hookline endpoints create "Stripe staging"
hookline endpoints open <slug>
hookline endpoints delete <slug>

Global flags and environment#

Flag / variableMeaning
--jsonMachine-readable output
--org slugOrganization to act for, when you are logged in to several
--url / HOOKLINE_URLThe Hookline instance to use
--no-color / NO_COLORPlain output
HOOKLINE_API_KEYUse this key instead of the stored one
HOOKLINE_NO_BROWSERNever open a browser (print URLs instead)

Shell completion: hookline completion bash|zsh|fish|powershell.