Intercept local traffic
wiretap intercept start runs a local HTTP/HTTPS man-in-the-middle proxy and opens a child shell configured to use it. Requests and responses are saved to Wiretap’s local store.
Choose a shell
Section titled “Choose a shell”Wiretap follows $SHELL by default. Select a supported shell explicitly when needed:
wiretap intercept start --shell bashwiretap intercept start --shell fishwiretap intercept start --shell powershellwiretap intercept start --shell gitbashPOSIX-compatible shells use the Bash form. Fish and PowerShell receive native syntax.
Attach additional shells
Section titled “Attach additional shells”An active interception proxy can serve multiple shells concurrently. In each additional terminal, run:
wiretap intercept attachEvery attached shell routes through the existing proxy, trusts the same local CA, and stores captures under the same interception session. Select a different supported shell when needed:
wiretap intercept attach --shell fishLeaving an attached shell does not stop interception. Leaving the original
shell does, because the original intercept start process owns the proxy. For
a long-running owner independent of any child shell, use this pattern:
# Terminal 1wiretap intercept start --no-shell
# Terminals 2, 3, and laterwiretap intercept attachWhen the owner stops, attached shells close rather than retaining proxy variables that point to a dead listener.
Run without a child shell
Section titled “Run without a child shell”For CI or another managed process, keep the proxy in the foreground and configure the client yourself:
wiretap intercept start --no-shellWith the default configuration:
export HTTP_PROXY=http://127.0.0.1:8888export HTTPS_PROXY=http://127.0.0.1:8888export SSL_CERT_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/wiretap/ca/wiretap-ca.crt"export NODE_EXTRA_CA_CERTS="$SSL_CERT_FILE"Press Ctrl-C to stop the proxy.
TLS trust
Section titled “TLS trust”Wiretap creates a local certificate authority and issues a certificate for each HTTPS host requested through the proxy. The child shell points compatible clients at that CA without changing your system trust store.
Some tools ignore SSL_CERT_FILE, use a bundled trust store, or read a tool-specific setting. Wiretap prepends temporary shims for Git, curl, and Node so their Wiretap-specific CA options stay scoped to the child shell.
To trust the CA system-wide instead:
sudo wiretap intercept trust-caSystem-wide trust affects every process on the machine. Use it only when shell-scoped trust cannot support your client.
Stop and clean up
Section titled “Stop and clean up”Normally, leave the intercepted child shell with exit. To restore its environment without closing it:
wiretap_stop_interceptionIf a previous version or interrupted setup left managed blocks in shell startup files, remove them with:
wiretap intercept stopThis command removes only Wiretap-managed blocks.
Use the local control API
Section titled “Use the local control API”While interception is running, the loopback API exposes health and recent records:
curl http://127.0.0.1:9876/local/healthcurl 'http://127.0.0.1:9876/local/captures?limit=50'curl 'http://127.0.0.1:9876/local/webhooks?project=new-project&limit=50'Filters run against the whole local history, not just the newest page:
# Any capture whose URL contains "checkout"curl 'http://127.0.0.1:9876/local/captures?q=checkout'
# Failed requests only: a status family, or an exact code like 404curl 'http://127.0.0.1:9876/local/captures?status=5xx'curl 'http://127.0.0.1:9876/local/captures?q=orders&method=POST&status=201'Each response includes total and has_more. total counts every match, so when it exceeds the returned page there are older matches to page through with a smaller ?limit= and a narrower query.
Keep intercept.local_api_addr on loopback. These endpoints are unauthenticated and can return captured data.
Apply transforms
Section titled “Apply transforms”Enabled on_request transforms run before the request goes upstream. Enabled on_response transforms run before the response returns to the child process. Changes are captured, so the dashboard shows what the destination or client actually received.
See Transform payloads for a complete example.