# Command line tool ## Install the CLI Use Node.js 24 or later. Set `FREEBIN_API_KEY` to an account API key before running commands that access your bins. ```bash curl -fsS https://freebin.org/freebin.mjs -o freebin.mjs export FREEBIN_API_KEY='YOUR_API_KEY' node freebin.mjs bins ``` The CLI supports `bins`, `create`, `send`, `requests`, `watch`, `export`, `replay`, `local-forward`, `assert`, and `delete-request`. The watch and local-forward commands emit JSON lines and accept `--include-existing`. Local forwarding runs on the machine running the CLI and can reach localhost. It strips authorization, cookies, credential-like headers, hop-by-hop headers, and selected source-address headers. Set `FREEBIN_URL=http://localhost:8788` for a local instance on port 8788; adjust the origin to match your server. ```bash node freebin.mjs assert BIN_ID --method POST --path '/webhooks/*' \ --header x-event=invoice.created --body-json data.status=paid --timeout 30 ``` Assertions combine method, path glob, repeated header, repeated body substring, and repeated JSON dot-path predicates with AND semantics. Exit code `0` indicates a match, `2` a timeout, and `1` a usage or operational error. Start an assertion before triggering the webhook. By default it matches requests captured after the command starts. Use `--include-existing` to include retained requests, or `--since` with an ISO timestamp. Assertions check the latest 100 requests on each poll. Source: [Freebin API documentation](https://freebin.org/docs) and [Freebin quickstart](https://github.com/corridora/freebin/blob/main/QUICKSTART.md).