CLI
AvailableThe emithook CLI is a thin client over the same scoped management API (via @emithook/sdk) — it never speaks HTTP directly, so the console, CLI and MCP server stay in lockstep. JSON or line output, scriptable for CI and runbooks.
v0.1 scope
The shipped command set is the operational core: send, logs (with --follow to tail), replay, dlq redrive, and keys current — documented below. Richer resource management (endpoint/destination/domain CRUD, profiles, archive download) is driven through the API, console, or MCP server today and is tracked on the roadmap.
Install & authenticate
npm i -g @emithook/cli
export EMITHOOK_API_KEY=ek_live_… # required; every command reads it
export EMITHOOK_BASE_URL=https://api.emithook.com # optional (self-host override)There is no login step or stored profile — the CLI is stateless and key-driven, which is what makes it drop into CI unchanged.
Commands
Send
emithook send <destination> --type <event_type> --payload <json> \
[--idempotency-key <key>] [--json]
# example
emithook send dst_acme --type invoice.created \
--payload '{"id":"INV-1","amount":4999}' --idempotency-key inv_001<destination> is a registered destination id or a validated HTTPS URL. Prints queued <message_id> (or the raw JSON with --json).
Logs (and tail)
emithook logs [--status delivered|failed|retrying|dlq] [--endpoint <id>] \
[--event-type <t>] [--since <iso>] [--until <iso>] [--limit <n>] [--follow] [--json]
# one-shot
emithook logs --status failed --endpoint ep_razorpay --since 2026-06-01T00:00:00Z
# tail live events (polls; prints each event once)
emithook logs --endpoint ep_shopify --followWithout --json each row is <event_id> <status> <event_type> <received_at>; a … more (cursor …) line is printed when the page is truncated.
Replay
emithook replay <event_id> # re-deliver one event (flagged webhook-replayed)DLQ redrive
emithook dlq redrive [--endpoint <id>] [--since <iso>] [--json] # bulk-replay dead-lettered eventsPrints redriven <n> (or JSON).
Keys
emithook keys current # inspect the LOCAL key: masked value + env (live/test)keys current only inspects the key in EMITHOOK_API_KEY — it never prints the full secret and does not call a key-management API (key lifecycle is console/API-side in v0.1).
Output & scripting
Add --json to send, logs and dlq redrive for machine output; combine with jq:
emithook logs --status dlq --json | jq -r '.data[].id'Paginated lists return the envelope { "data": [...], "next_cursor": "…" }; pass --limit and re-issue with no cursor flag yet (cursor paging is API-side — see API conventions).
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | Runtime / API error (the API's type: message is printed to stderr). |
2 | Usage error (missing/invalid arguments). |
The same operations are available through the API and the MCP server, so terminal, code, and AI agents share one model. See the Glossary for the entity names used in flags.