> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hookstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

Manage hookstream from the terminal — stream events live, create sources, replay webhooks, and script everything.

The `hookstream` CLI (/cli) is a command-line tool for managing your webhook infrastructure. It does everything the dashboard does — plus things the dashboard cannot, like streaming events to your terminal in real time and piping results through `jq`.

**Install and log in**

## What you can do

**[Real-time streaming](/cli/commands)**

`hookstream listen` streams events from any source to your terminal over WebSocket — perfect for local development.
  **[Full CRUD](/cli/commands)**

Manage sources, destinations, connections, topics, alerts, and channels without leaving the terminal.
  **[Browser login](/cli/authentication)**

Device-flow authentication — no copy-pasting API keys. Also supports `--api-key` and `HOOKSTREAM_API_KEY` for CI.
  **[Scriptable output](/cli/commands#global-flags)**

Every command supports `--json` for clean, machine-readable output ready to pipe into `jq` or other tools.

## When to reach for the CLI

- **Local webhook development** — run `hookstream listen --forward http://localhost:3000/webhook` to receive live webhooks on your laptop.
- **CI/CD pipelines** — create sources, destinations, and connections as part of your deploy scripts.
- **Quick ops** — triage a failed delivery, reset a circuit breaker, or check metrics without opening the dashboard.
- **Bulk operations** — replay events, retry failed deliveries, or export collections.
- **Debugging** — `hookstream events get <id>` shows full headers and payload inline.

## Command groups

The CLI has 19 command groups and 50+ subcommands. The most common ones:

| Group | Purpose |
|---|---|
| `login`, `logout`, `whoami` | Authentication |
| `init` | First-run onboarding wizard |
| `test`, `listen` | Send test events and stream webhooks live |
| `sources`, `destinations`, `connections` | Core pipeline resources |
| `events`, `deliveries` | Inspect event history and delivery attempts |
| `metrics` | Usage and latency stats |
| `topics`, `replay` | Pub/sub fan-out and historical replay |
| `issues`, `alerts`, `channels` | Observability and notifications |
| `collections` | Instant Database |
| `applications` | Outbound webhooks |
| `billing` | Plan and usage |

See the [full command reference](/cli/commands) for every command and option.

## Quick example

Send a test event to a source and watch it arrive in real time — two terminals:

```bash Terminal 1 — listen
hookstream listen
```

```bash Terminal 2 — send
hookstream test src_abc123 --payload '{"type":"test.ping"}'
```

The CLI reads your API key from `~/.config/hookstream/config.json` after `hookstream login`. You can also pass `--api-key` per command or set `HOOKSTREAM_API_KEY` — see [Authentication](/cli/authentication).

## Next steps

**[Install](/cli/installation)**

npm, pnpm, yarn, or bun.
  **[Authenticate](/cli/authentication)**

Browser flow or API key.
  **[Commands](/cli/commands)**

Full reference.