@anonymilyhq/cli 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,16 +28,23 @@ anonymily listen <port>
28
28
 
29
29
  ### Example
30
30
 
31
- To forward webhooks to your local development server running on port `3000`:
31
+ To forward webhooks to your local development server running on port `3000` with a randomly generated endpoint ID:
32
32
 
33
33
  ```bash
34
34
  anonymily listen 3000
35
35
  ```
36
36
 
37
- 1. The CLI will generate a unique webhook connection URL and a Hook ID.
37
+ To specify a custom endpoint ID (e.g., `stripe-test`) so that your URL is consistently `api.anonymily.com/h/stripe-test`:
38
+
39
+ ```bash
40
+ anonymily listen 3000 --id stripe-test
41
+ ```
42
+
43
+ 1. The CLI will output a webhook connection URL and automatically connect via Server-Sent Events.
38
44
  2. Send your webhooks to the provided URL.
39
45
  3. The CLI will receive the requests natively and forward them precisely to `http://localhost:3000`, preserving exactly the same method, body, queries, and headers.
40
46
 
47
+
41
48
  ## Issues
42
49
 
43
50
  If you encounter a bug, please create an issue in the main repository or contact our support.
package/bin/cli.js CHANGED
@@ -16,8 +16,9 @@ program
16
16
  .command('listen')
17
17
  .description('Listen for incoming webhooks and forward them to a local port')
18
18
  .argument('<port>', 'Local port to forward to (e.g., 8080)')
19
- .action((port) => {
20
- const hookId = generateHookId();
19
+ .option('-i, --id <id>', 'Provide a custom endpoint ID to listen to')
20
+ .action((port, options) => {
21
+ const hookId = options.id || generateHookId();
21
22
  startForwarding(API_URL, hookId, parseInt(port, 10));
22
23
  });
23
24
 
package/lib/forwarder.js CHANGED
@@ -41,7 +41,7 @@ export function startForwarding(apiUrl, hookId, port) {
41
41
  };
42
42
 
43
43
  es.onerror = () => {
44
- logger.error(`\nConnection error. Attempting to reconnect...`);
44
+ logger.dim(`\n[Network] Connection dropped. Automatically reconnecting...`);
45
45
  };
46
46
 
47
47
  return es;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anonymilyhq/cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "CLI for Anonymily platform",
5
5
  "type": "module",
6
6
  "bin": {