Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.

Commit 34e4dd5

Browse files
committed
docs: CLI README — add local try-it, JSON output example, command descriptions
- "Try it Locally (2 minutes)" section with copy-paste steps - "Why hookflare?" one-liner differentiator vs SaaS alternatives - --json output example for connect command (agent-friendly) - Command table with one-line descriptions per command - Note on init idempotency and forwarded headers
1 parent ec845a4 commit 34e4dd5

1 file changed

Lines changed: 73 additions & 28 deletions

File tree

packages/cli/README.md

Lines changed: 73 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,53 @@ Stripe/GitHub/Slack → hookflare (Cloudflare edge) → your API
1616
└─ never lose an event
1717
```
1818

19-
hookflare sits between webhook providers and your application. It accepts webhooks at 300+ Cloudflare edge locations, verifies signatures, and reliably delivers them to your API with automatic retries, circuit breaking, and a dead letter queue. Zero servers to manage.
19+
hookflare sits between webhook providers and your application. It accepts webhooks at 300+ Cloudflare edge locations, verifies signatures, and reliably delivers them to your API with automatic retries, circuit breaking, and a dead letter queue. Zero servers to manage, zero idle cost.
2020

21-
## Quick Start
21+
**Why hookflare?** Unlike SaaS webhook tools (Hookdeck, Svix), hookflare runs on **your own** Cloudflare account — you own the data, pay Cloudflare directly ($0 on free tier for most workloads), and deploy in 30 seconds.
2222

23-
### 1. Deploy hookflare
24-
25-
If you haven't deployed hookflare yet, see the [deployment guide on GitHub](https://github.com/hookedge/hookflare#quick-start) — one-click deploy to Cloudflare or `npx wrangler deploy`.
26-
27-
### 2. Install the CLI
23+
## Try it Locally (2 minutes)
2824

2925
```bash
26+
# 1. Clone and start
27+
git clone https://github.com/hookedge/hookflare.git && cd hookflare
28+
pnpm install && pnpm --filter @hookflare/shared build && pnpm --filter @hookflare/providers build
29+
pnpm --filter @hookflare/worker db:migrate:local
30+
pnpm --filter @hookflare/worker dev # starts on http://localhost:8787
31+
32+
# 2. In another terminal — install CLI and bootstrap
3033
npm i -g hookflare
34+
hookflare config set api_url http://localhost:8787
35+
hookflare init
36+
37+
# 3. Create a Stripe webhook pipeline
38+
hookflare connect stripe --secret whsec_test --to https://httpbin.org/post
39+
40+
# 4. Send a test webhook
41+
curl -X POST http://localhost:8787/webhooks/<source_id_from_output> \
42+
-H "Content-Type: application/json" \
43+
-d '{"type":"payment_intent.succeeded","data":{"amount":4999}}'
44+
45+
# 5. Check delivery
46+
hookflare events ls
3147
```
3248

33-
### 3. Connect to your instance
49+
## Quick Start (Production)
50+
51+
### 1. Deploy hookflare
52+
53+
See the [deployment guide on GitHub](https://github.com/hookedge/hookflare#quick-start) — one-click deploy to Cloudflare or `npx wrangler deploy`.
54+
55+
### 2. Install the CLI and bootstrap
3456

3557
```bash
58+
npm i -g hookflare
3659
hookflare config set api_url https://your-hookflare.workers.dev
3760
hookflare init # creates your admin API key (stored automatically)
3861
```
3962

40-
`init` calls the one-time bootstrap endpoint to create your first API key. The key is saved to `~/.hookflare/config.json`. All subsequent commands authenticate with it.
63+
`init` calls the one-time bootstrap endpoint to create your first API key. The key is saved to `~/.hookflare/config.json`. All subsequent commands authenticate with it. Running `init` again on an already-bootstrapped instance is a no-op.
4164

42-
### 4. Set up Stripe webhooks
65+
### 3. Set up Stripe webhooks
4366

4467
```bash
4568
hookflare connect stripe \
@@ -60,38 +83,60 @@ Webhook URL: https://your-hookflare.workers.dev/webhooks/src_a1b2c3
6083
Next: Add this URL to your Stripe Dashboard → Developers → Webhooks.
6184
```
6285

63-
Omit `--events` to forward all events.
86+
Omit `--events` to forward all events. hookflare forwards the original payload as-is to your destination with these headers added: `X-Hookflare-Event-Id`, `X-Hookflare-Delivery-Id`, `X-Hookflare-Attempt`.
6487

6588
## What You Can Do
6689

6790
- **Connect providers** — Stripe, GitHub, Slack, Shopify, Vercel with one command
6891
- **Inspect & replay events** — view delivery attempts, replay failed events
69-
- **Monitor health** — circuit breaker status, DLQ inspection, real-time streaming
70-
- **Manage routing** — fan-out one source to multiple destinations with event filters
71-
- **Backup & migrate** — export/import configuration between instances
92+
- **Monitor health** — circuit breaker status, DLQ inspection, real-time streaming with `hookflare tail`
93+
- **Manage routing** — fan-out one source to multiple destinations with event type filters
94+
- **Backup & migrate** — export/import configuration, one-command instance-to-instance migration
7295

7396
## Agent-Friendly
7497

75-
The CLI is built for AI agents. `--json` structured output, `--dry-run` safe validation, `--data` raw JSON input, and `hookflare schema` for runtime API discovery. See [AGENTS.md](https://github.com/hookedge/hookflare/blob/main/packages/cli/AGENTS.md) for the complete agent guide.
98+
The CLI is built for AI agents. See [AGENTS.md](https://github.com/hookedge/hookflare/blob/main/packages/cli/AGENTS.md) for the complete guide.
7699

77100
```bash
78-
hookflare schema sources # discover fields
79-
hookflare connect stripe --dry-run --json -d '{...}' # validate
80-
hookflare connect stripe --json -d '{...}' # execute
101+
# Discover → Validate → Execute
102+
hookflare schema sources # discover fields at runtime
103+
hookflare connect stripe --dry-run --json -d '{...}' # validate without creating
104+
hookflare connect stripe --json -d '{...}' # execute, get JSON output
81105
```
82106

83-
## All Commands
107+
`--json` output example:
108+
109+
```json
110+
{
111+
"data": {
112+
"source": { "id": "src_a1b2c3", "name": "stripe", "provider": "stripe" },
113+
"destination": { "id": "dst_d4e5f6", "url": "https://api.myapp.com/hooks" },
114+
"subscription": { "id": "sub_g7h8i9", "event_types": ["payment_intent.*"] },
115+
"webhook_url": "https://your-hookflare.workers.dev/webhooks/src_a1b2c3"
116+
}
117+
}
118+
```
119+
120+
Key flags: `--json` (structured output), `--dry-run` (safe validation), `-d/--data` (raw JSON input), `--fields` (limit output columns), `hookflare schema` (API introspection).
121+
122+
## Commands
84123

85-
| Category | Commands |
124+
| Command | Description |
86125
|---|---|
87-
| **Setup** | `connect`, `init`, `config`, `health` |
88-
| **Providers** | `providers ls`, `providers describe` |
89-
| **Resources** | `sources`, `dest`, `subs` (create/ls/rm) |
90-
| **Events** | `events ls/get/replay`, `tail` |
91-
| **Operations** | `export`, `import`, `migrate`, `dev` |
92-
| **Introspection** | `schema` |
93-
94-
Run `hookflare --help` or `hookflare <command> --help` for details.
126+
| `connect <provider>` | One-shot setup: source + destination + subscription |
127+
| `init` | Bootstrap admin API key on a fresh instance |
128+
| `providers ls/describe` | Browse supported providers, events, and verification |
129+
| `sources create/ls/get/rm` | Manage webhook receiving endpoints |
130+
| `dest create/ls/get/rm` | Manage delivery destinations with retry policies |
131+
| `subs create/ls/rm` | Manage routing rules (source → destination) |
132+
| `events ls/get/replay` | Inspect received events and replay failed deliveries |
133+
| `tail` | Real-time event and delivery streaming |
134+
| `dev` | Local development tunnel with signature verification |
135+
| `export/import` | Backup and restore configuration |
136+
| `migrate` | Instance-to-instance migration |
137+
| `schema [resource]` | Runtime API schema introspection |
138+
| `config set/get` | CLI configuration (`api_url`, `token`) |
139+
| `health` | Check server connectivity and setup status |
95140

96141
## Links
97142

0 commit comments

Comments
 (0)