npm.io
1.4.1 • Published 3d agoCLI

@anonymilyhq/cli

Licence
MIT
Version
1.4.1
Deps
4
Size
42 kB
Vulns
0
Weekly
282

@anonymilyhq/cli

The official CLI for Anonymily — forward webhooks from the cloud straight to your localhost.

npm version License: MIT Node.js


What is it?

The Anonymily CLI connects to your webhook endpoint via a Server-Sent Events (SSE) stream and forwards every incoming request — with the exact same method, headers, query params, and body — to a port on your local machine. It also captures your server's response and streams it back to the dashboard in real time, so you can see status codes, latency, and error bodies without leaving the UI.

No account required to start — capture, inspect, and replay on a throwaway random URL. One command.

npx @anonymilyhq/cli listen 3000

Installation

Run instantly via npx (no install):

npx @anonymilyhq/cli listen 3000

Or install globally:

npm install -g @anonymilyhq/cli

Quick Start

npx @anonymilyhq/cli listen 3000

# Output:
# Anonymily CLI is running!
# Forwarding: https://api.anonymily.com/h/xk92bzte  →  http://127.0.0.1:3000
# Tier: FREE | Storage: 0/200 | Retention: 48 hours
# Waiting for requests...

The Tier, Storage, and Retention line is read live from GET /pricing, so it always reflects the current server-side limits. The numbers shown above (200 / 48h) are the Free-tier defaults at time of writing — see the Tiers table for the contract.

Send a test payload:

curl -X POST https://api.anonymily.com/h/xk92bzte \
  -H "Content-Type: application/json" \
  -d '{"event": "payment.succeeded", "amount": 9900}'

CLI output:

[12:01:45] Incoming POST  →  localhost:3000  |  200 OK  |  11ms

Commands

listen <port>

Listen for incoming webhooks and forward them to your local port.

npx @anonymilyhq/cli listen <port> [options]
Option Description
<port> Required. Local port to forward to (e.g. 3000)
-i, --id <id> Use a persistent named endpoint ID (e.g. stripe-test) instead of a random one. Needs a (free) account + PAT to own it — Free can keep 1 named endpoint; additional named endpoints require Pro.
-t, --token <token> Personal Access Token — authenticates to your claimed named endpoints. Also readable from ANONYMILY_TOKEN env var. Not needed for random anonymous endpoints.

Examples:

# Anonymous — random endpoint, no account, no auth
npx @anonymilyhq/cli listen 3000

# Named endpoint with your PAT (Free includes 1 named endpoint; more = Pro)
npx @anonymilyhq/cli listen 3000 --id stripe-dev --token pat_example123

# PAT via env var
export ANONYMILY_TOKEN=pat_example123
npx @anonymilyhq/cli listen 3000 --id stripe-dev
trigger <provider> <event>

Fire a synthetic, correctly-signed provider event at your endpoint — no real charge, PR, or order required. Pro feature (requires a PAT).

npx @anonymilyhq/cli trigger <provider> <event> [options]
Option Description
<provider> Provider name (e.g. github, stripe, shopify, razorpay, slack).
<event> Event name (e.g. push, payment_intent.succeeded, order.created).
-i, --hook <hookId> Target hook ID (defaults to a random ID).
-t, --token <token> Required. PAT — or set ANONYMILY_TOKEN.
-l, --list List all available provider/event combinations and exit.

Examples:

# List every available provider/event combination
npx @anonymilyhq/cli trigger --list

# Fire a correctly-signed Stripe event at your hook
npx @anonymilyhq/cli trigger stripe payment_intent.succeeded --hook stripe-dev --token pat_example123

replay <hookId> <requestId>

Re-fire a previously captured request back through your hook endpoint.

Plain (single) replay is free and unlimited within your retention window — there is no per-day cap (anonymous, Free, and Pro all get it; a generous anti-abuse rate limit applies). Modify-and-replay — overriding the body/method/headers or re-signing (-b, -m, --resign) — is a Pro feature.

npx @anonymilyhq/cli replay <hookId> <requestId> [options]
Option Description
<hookId> Required. The hook ID that captured the request.
<requestId> Required. The request ID to replay (visible in the dashboard).
-t, --token <token> PAT — or set ANONYMILY_TOKEN. Required for named endpoints you own; modify/re-sign replay requires Pro.
-m, --method <method> Pro. Override the HTTP method (e.g. POST, GET). Triggers a modify-replay.
-b, --body <json> Pro. Override the request body (JSON string). Triggers a modify-replay.
--resign Pro. Re-sign the payload using the hook's stored secret. Triggers a modify-replay.

Examples:

# Plain replay — free, unlimited within retention
npx @anonymilyhq/cli replay stripe-dev abc-123 --token pat_example123

# Pro: modify-and-replay with body override and re-signing
npx @anonymilyhq/cli replay stripe-dev abc-123 \
  --body '{"amount":5000}' --resign --token pat_example123
feedback <rating> [message]

Submit feedback from the terminal.

npx @anonymilyhq/cli feedback 5 "Works perfectly with Shopify webhooks"

How It Works

External Service (Stripe, GitHub, Shopify, …)
        │
        │  POST https://api.anonymily.com/h/<hookId>
        ▼
  Anonymily Backend — captures, verifies signature, stores in Redis
        │
        │  SSE broadcast via /stream/<hookId>
        ▼
  @anonymilyhq/cli  ──forward──►  http://localhost:<port>
        │
        │  Response (status, latency, body) streamed back to dashboard
        ▼
  Anonymily Dashboard — shows full exchange in real time
  1. The CLI opens a persistent SSE connection to the backend.
  2. When a webhook arrives, it is broadcast instantly.
  3. The CLI re-issues the exact HTTP request to your local port, preserving method, headers, query params, and body.
  4. The local response (status code, latency, body) is captured and streamed back to the dashboard so you can see the full exchange without leaving the UI.

Tiers

There are three access levels: anonymous (a random URL, no account), a free account (adds 1 persistent named endpoint + ownership across devices), and Pro (removes the limits and unlocks the power features). The CLI reads the live numbers from GET /pricing; the values below mirror the canonical contract (docs/business-logic.md + packages/shared-types PRICING_CONFIG).

Capability Anonymous (no account) Free account Pro
Random 8-char endpoint
Persistent named endpoint (--id) 1 unlimited
Capture + inspect + live stream
CLI relay (npx, no login)
Requests per hook 200 200 2,000
History retention 48 hours 48 hours 30 days
Replay — single/plain (replay, within retention) unlimited¹ unlimited unlimited
Modify-and-replay (-b / -m / --resign)
Bulk replay
Custom response — basic (status + body + content-type)
Custom response — full (headers + provider presets + templating)
Claim / persist + search hooks across devices
Signature verification helper
Synthetic signed events (trigger)
AI diagnosis + handler generation
Price Free Free $9 / ₹750 per month

¹ Single replay is unlimited within the retention window — there is no per-day cap on any level. A generous per-hook/per-IP anti-abuse rate limit applies; it's set high enough that a real debugging session never hits it. (Team is waitlisted, not sellable — see docs/business-logic.md §7.)

Upgrade at anonymily.com/upgrade.


MCP Server

If you use Claude Code or Cursor, you can drive Anonymily entirely from your AI assistant using the @anonymilyhq/mcp-server package. See the MCP setup guide for configuration.


Troubleshooting

Connection refused when forwarding: Ensure your local server is running on the specified port. Test with curl http://localhost:<port>.

Requests arrive but server returns errors: Check your server logs. The CLI shows Status: 5xx — look at the response body in the dashboard for the error detail.

CLI doesn't reconnect after network drop: The CLI uses eventsource which auto-reconnects. You'll see: Connection dropped. Reconnecting...

401 on stream connection: Named endpoints require a valid PAT. Pass --token <your-pat> or set ANONYMILY_TOKEN.

403 when using --id (named endpoint): A free account includes 1 persistent named endpoint; a 2nd (or more) requires Pro. You'll also see a 403 if the named slug is owned by another account. Remove --id to use a random anonymous endpoint, or upgrade at anonymily.com/upgrade.


Environment Variables

Variable Description
ANONYMILY_TOKEN Personal Access Token for named endpoint authentication
ANONYMILY_API_URL Override the backend URL (default: https://api.anonymily.com)

License

MIT Anonymily

Keywords