# CLI and Postman

> Send, forward live events to localhost and fire fixture events with the whabuzz CLI; import the Postman collection.

Canonical: https://docs.whabuzz.com/sdks/cli/

The CLI ships inside the [Node.js package](https://docs.whabuzz.com/sdks/node.md). Node 18+.

```bash
npx whabuzz login
```

`login` asks for your API key (input hidden), checks it against `GET /v1/tenant` and saves it to `~/.whabuzz/config.json` (mode 0600). `WHABUZZ_API_KEY` in the environment wins over the saved key.

## Send {#send}

```bash
npx whabuzz send --from +14692311132 --to "$TO" --text "Hello from WhaBuzz"
npx whabuzz send --from +14692311132 --to "$TO" --template order_update --lang en --param 1234
npx whabuzz send --json '{"from":"+14692311132","to":"'"$TO"'","type":"text","text":{"body":"hi"}}'
```

## Listen {#listen}

```bash
npx whabuzz listen --forward-to http://localhost:3000/hook --secret whsec_local_dev
```

Forwards your account's events to your local server as signed deliveries, so the same verify code works in development. Today it polls `/v1/events` (`--interval`, `--types`); it will move to the push stream when that ships.

## Trigger {#trigger}

```bash
npx whabuzz trigger --list
npx whabuzz trigger message.inbound --to http://localhost:3000/hook
```

Builds an event from the same Meta fixtures WhaBuzz tests against, signs it (default secret `whsec_local_dev`, or `--secret`) and POSTs it. No WhatsApp account needed.

## Postman {#postman}

`tools/postman/whabuzz.postman_collection.json` in the [repository](https://github.com/WhaBuzz/whabuzz) has every route of the [API reference](https://docs.whabuzz.com/reference.md), grouped by tag. Import it, set the one collection variable `WHABUZZ_API_KEY`, and the first request (health) and the tenant request run as they are.
