hookdeck-cli 1.7.1 → 1.8.0

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
@@ -12,7 +12,7 @@ Although it uses a different approach and philosophy, it's a replacement for ngr
12
12
 
13
13
  Hookdeck for development is completely free, and we monetize the platform with our production offering.
14
14
 
15
- For a complete reference, see the [CLI reference](https://hookdeck.com/docs/cli?ref=github-hookdeck-cli).
15
+ For a complete reference of all commands and flags, see [REFERENCE.md](REFERENCE.md).
16
16
 
17
17
  https://github.com/user-attachments/assets/7a333c5b-e4cb-45bb-8570-29fafd137bd2
18
18
 
@@ -456,25 +456,120 @@ Events • [↑↓] Navigate ─────────────────
456
456
  > ✓ Last event succeeded with status 200 | [r] Retry • [o] Open in dashboard • [d] Show data
457
457
  ```
458
458
 
459
+ ### Event Gateway
460
+
461
+ The `hookdeck gateway` command provides full access to Hookdeck Event Gateway resources. Use these subcommands to manage infrastructure and inspect events:
462
+
463
+ | Command group | Description |
464
+ |---------------|-------------|
465
+ | `hookdeck gateway connection` | Create and manage connections between sources and destinations |
466
+ | `hookdeck gateway source` | Manage inbound webhook sources |
467
+ | `hookdeck gateway destination` | Manage destinations (HTTP endpoints, CLI, etc.) |
468
+ | `hookdeck gateway event` | List, get, retry, cancel, or mute events (processed deliveries) |
469
+ | `hookdeck gateway request` | List, get, and retry requests (raw inbound webhooks) |
470
+ | `hookdeck gateway attempt` | List and get delivery attempts |
471
+ | `hookdeck gateway transformation` | Create and manage JavaScript transformations |
472
+
473
+ **Examples:**
474
+
475
+ ```sh
476
+ # List sources and destinations
477
+ hookdeck gateway source list
478
+ hookdeck gateway destination list
479
+
480
+ # List events (processed deliveries) and requests (raw inbound webhooks)
481
+ hookdeck gateway event list --status FAILED
482
+ hookdeck gateway request list --source-id src_abc123
483
+
484
+ # List attempts for an event
485
+ hookdeck gateway attempt list --event-id evt_abc123
486
+
487
+ # Create a transformation and test-run it
488
+ hookdeck gateway transformation create --name my-transform --code "addHandler(\"transform\", (request, context) => { return request; });"
489
+ hookdeck gateway transformation run --code "addHandler(\"transform\", (request, context) => { return request; });" --request '{"headers":{}}'
490
+ ```
491
+
492
+ For complete command and flag reference, see [REFERENCE.md](REFERENCE.md).
493
+
459
494
  ### Manage connections
460
495
 
461
- Create and manage webhook connections between sources and destinations with inline resource creation, authentication, processing rules, and lifecycle management. For detailed examples with authentication, filters, retry rules, and rate limiting, see the complete [connection management](#manage-connections) section below.
496
+ Create and manage webhook connections between sources and destinations with inline resource creation, authentication, processing rules, and lifecycle management. Use `hookdeck gateway connection` (or the backward-compatible alias `hookdeck connection`). For detailed examples with authentication, filters, retry rules, and rate limiting, see the complete [connection management](#manage-connections) section below.
462
497
 
463
498
  ```sh
464
- hookdeck connection [command]
499
+ hookdeck gateway connection [command]
465
500
 
466
501
  # Available commands
467
- hookdeck connection list # List all connections
468
- hookdeck connection get # Get connection details
469
- hookdeck connection create # Create a new connection
470
- hookdeck connection upsert # Create or update a connection (idempotent)
471
- hookdeck connection delete # Delete a connection
472
- hookdeck connection enable # Enable a connection
473
- hookdeck connection disable # Disable a connection
474
- hookdeck connection pause # Pause a connection
475
- hookdeck connection unpause # Unpause a connection
502
+ hookdeck gateway connection list # List all connections
503
+ hookdeck gateway connection get # Get connection details
504
+ hookdeck gateway connection create # Create a new connection
505
+ hookdeck gateway connection upsert # Create or update a connection (idempotent)
506
+ hookdeck gateway connection update # Update a connection
507
+ hookdeck gateway connection delete # Delete a connection
508
+ hookdeck gateway connection enable # Enable a connection
509
+ hookdeck gateway connection disable # Disable a connection
510
+ hookdeck gateway connection pause # Pause a connection
511
+ hookdeck gateway connection unpause # Unpause a connection
512
+ ```
513
+
514
+ #### Sources and destinations
515
+
516
+ You can manage sources and destinations independently, not only inline when creating connections. Create reusable sources (e.g. Stripe, GitHub) and destinations (HTTP endpoints) that multiple connections can reference.
517
+
518
+ ```sh
519
+ # List and inspect sources and destinations
520
+ hookdeck gateway source list
521
+ hookdeck gateway source get src_abc123
522
+
523
+ hookdeck gateway destination list
524
+ hookdeck gateway destination get dst_abc123
525
+
526
+ # Create a standalone destination
527
+ hookdeck gateway destination create --name "my-api" --type HTTP --url "https://api.example.com/webhooks"
528
+ ```
529
+
530
+ See [Sources](REFERENCE.md#sources) and [Destinations](REFERENCE.md#destinations) in REFERENCE.md.
531
+
532
+ ### Transformations
533
+
534
+ Transformations are JavaScript modules that modify requests before delivery. They are attached to connections and can add headers, transform the body, or filter events. Create, test, and manage transformations with `hookdeck gateway transformation`:
535
+
536
+ ```sh
537
+ # Create a transformation
538
+ hookdeck gateway transformation create --name my-transform --code "addHandler(\"transform\", (request, context) => { return request; });"
539
+
540
+ # Test run transformation code (see transformed output)
541
+ hookdeck gateway transformation run --code "addHandler(\"transform\", (request, context) => { return request; });" --request '{"headers":{}}'
542
+
543
+ # List and use with connections (--transformation-name when creating connections)
544
+ hookdeck gateway transformation list
476
545
  ```
477
546
 
547
+ See [Transformations](REFERENCE.md#transformations) in REFERENCE.md.
548
+
549
+ ### Requests, events, and attempts
550
+
551
+ Webhooks flow through Hookdeck as **requests** (raw inbound), then **events** (processed, routed), then **attempts** (delivery tries). Use these commands to inspect, filter, and retry:
552
+
553
+ ```sh
554
+ # List requests (raw inbound webhooks) and filter by source
555
+ hookdeck gateway request list --source-id src_abc123
556
+ hookdeck gateway request get req_abc123
557
+
558
+ # List events (processed deliveries) by status
559
+ hookdeck gateway event list --status FAILED
560
+ hookdeck gateway event list --status PENDING
561
+ hookdeck gateway event get evt_abc123
562
+
563
+ # Retry a failed event or request
564
+ hookdeck gateway event retry evt_abc123
565
+ hookdeck gateway request retry req_abc123
566
+
567
+ # List attempts (individual delivery tries) for an event
568
+ hookdeck gateway attempt list --event-id evt_abc123
569
+ ```
570
+
571
+ See [Requests](REFERENCE.md#requests), [Events](REFERENCE.md#events), and [Attempts](REFERENCE.md#attempts) in REFERENCE.md.
572
+
478
573
  ### Manage active project
479
574
 
480
575
  If you are a part of multiple projects, you can switch between them using our project management commands.
@@ -642,7 +737,7 @@ Create a new connection between a source and destination. You can create the sou
642
737
 
643
738
  ```sh
644
739
  # Basic connection with inline source and destination
645
- $ hookdeck connection create \
740
+ $ hookdeck gateway connection create \
646
741
  --source-name "github-repo" \
647
742
  --source-type GITHUB \
648
743
  --destination-name "ci-system" \
@@ -656,9 +751,9 @@ Source URL: https://hkdk.events/src_xyz789
656
751
  Destination: ci-system (dst_def456)
657
752
 
658
753
  # Using existing source and destination
659
- $ hookdeck connection create \
660
- --source "existing-source-name" \
661
- --destination "existing-dest-name" \
754
+ $ hookdeck gateway connection create \
755
+ --source-id src_existing123 \
756
+ --destination-id dst_existing456 \
662
757
  --name "new-connection" \
663
758
  --description "Connects existing resources"
664
759
  ```
@@ -669,7 +764,7 @@ Verify webhooks from providers like Stripe, GitHub, or Shopify by adding source
669
764
 
670
765
  ```sh
671
766
  # Stripe webhook signature verification
672
- $ hookdeck connection create \
767
+ $ hookdeck gateway connection create \
673
768
  --source-name "stripe-prod" \
674
769
  --source-type STRIPE \
675
770
  --source-webhook-secret "whsec_abc123xyz" \
@@ -678,7 +773,7 @@ $ hookdeck connection create \
678
773
  --destination-url "https://api.example.com/webhooks/stripe"
679
774
 
680
775
  # GitHub webhook signature verification
681
- $ hookdeck connection create \
776
+ $ hookdeck gateway connection create \
682
777
  --source-name "github-webhooks" \
683
778
  --source-type GITHUB \
684
779
  --source-webhook-secret "ghp_secret123" \
@@ -693,7 +788,7 @@ Secure your destination endpoint with bearer tokens, API keys, or basic authenti
693
788
 
694
789
  ```sh
695
790
  # Destination with bearer token
696
- $ hookdeck connection create \
791
+ $ hookdeck gateway connection create \
697
792
  --source-name "webhook-source" \
698
793
  --source-type HTTP \
699
794
  --destination-name "secure-api" \
@@ -702,7 +797,7 @@ $ hookdeck connection create \
702
797
  --destination-bearer-token "bearer_token_xyz"
703
798
 
704
799
  # Destination with API key
705
- $ hookdeck connection create \
800
+ $ hookdeck gateway connection create \
706
801
  --source-name "webhook-source" \
707
802
  --source-type HTTP \
708
803
  --destination-name "api-endpoint" \
@@ -711,7 +806,7 @@ $ hookdeck connection create \
711
806
  --destination-api-key "your_api_key"
712
807
 
713
808
  # Destination with custom headers
714
- $ hookdeck connection create \
809
+ $ hookdeck gateway connection create \
715
810
  --source-name "webhook-source" \
716
811
  --source-type HTTP \
717
812
  --destination-name "custom-api" \
@@ -725,7 +820,7 @@ Add automatic retry logic with exponential or linear backoff:
725
820
 
726
821
  ```sh
727
822
  # Exponential backoff retry strategy
728
- $ hookdeck connection create \
823
+ $ hookdeck gateway connection create \
729
824
  --source-name "payment-webhooks" \
730
825
  --source-type STRIPE \
731
826
  --destination-name "payment-api" \
@@ -742,7 +837,7 @@ Filter events based on request body, headers, path, or query parameters:
742
837
 
743
838
  ```sh
744
839
  # Filter by event type in body
745
- $ hookdeck connection create \
840
+ $ hookdeck gateway connection create \
746
841
  --source-name "events" \
747
842
  --source-type HTTP \
748
843
  --destination-name "processor" \
@@ -751,7 +846,7 @@ $ hookdeck connection create \
751
846
  --rule-filter-body '{"event_type":"payment.succeeded"}'
752
847
 
753
848
  # Combined filtering
754
- $ hookdeck connection create \
849
+ $ hookdeck gateway connection create \
755
850
  --source-name "shopify-webhooks" \
756
851
  --source-type SHOPIFY \
757
852
  --destination-name "order-processor" \
@@ -768,7 +863,7 @@ Control the rate of event delivery to your destination:
768
863
 
769
864
  ```sh
770
865
  # Limit to 100 requests per minute
771
- $ hookdeck connection create \
866
+ $ hookdeck gateway connection create \
772
867
  --source-name "high-volume-source" \
773
868
  --source-type HTTP \
774
869
  --destination-name "rate-limited-api" \
@@ -784,7 +879,7 @@ Create or update connections idempotently based on connection name - perfect for
784
879
 
785
880
  ```sh
786
881
  # Create if doesn't exist, update if it does
787
- $ hookdeck connection upsert my-connection \
882
+ $ hookdeck gateway connection upsert my-connection \
788
883
  --source-name "stripe-prod" \
789
884
  --source-type STRIPE \
790
885
  --destination-name "api-prod" \
@@ -792,12 +887,12 @@ $ hookdeck connection upsert my-connection \
792
887
  --destination-url "https://api.example.com"
793
888
 
794
889
  # Partial update of existing connection
795
- $ hookdeck connection upsert my-connection \
890
+ $ hookdeck gateway connection upsert my-connection \
796
891
  --description "Updated description" \
797
892
  --rule-retry-count 5
798
893
 
799
894
  # Preview changes without applying (dry-run)
800
- $ hookdeck connection upsert my-connection \
895
+ $ hookdeck gateway connection upsert my-connection \
801
896
  --description "New description" \
802
897
  --dry-run
803
898
 
@@ -812,20 +907,20 @@ View all connections with flexible filtering options:
812
907
 
813
908
  ```sh
814
909
  # List all connections
815
- $ hookdeck connection list
910
+ $ hookdeck gateway connection list
816
911
 
817
912
  # Filter by source or destination
818
- $ hookdeck connection list --source src_abc123
819
- $ hookdeck connection list --destination des_xyz789
913
+ $ hookdeck gateway connection list --source-id src_abc123
914
+ $ hookdeck gateway connection list --destination-id dst_def456
820
915
 
821
916
  # Filter by name pattern
822
- $ hookdeck connection list --name "production-*"
917
+ $ hookdeck gateway connection list --name "production-*"
823
918
 
824
919
  # Include disabled connections
825
- $ hookdeck connection list --disabled
920
+ $ hookdeck gateway connection list --disabled
826
921
 
827
922
  # Output as JSON
828
- $ hookdeck connection list --output json
923
+ $ hookdeck gateway connection list --output json
829
924
  ```
830
925
 
831
926
  #### Get connection details
@@ -834,16 +929,16 @@ View detailed information about a specific connection:
834
929
 
835
930
  ```sh
836
931
  # Get by ID
837
- $ hookdeck connection get conn_123abc
932
+ $ hookdeck gateway connection get conn_123abc
838
933
 
839
934
  # Get by name
840
- $ hookdeck connection get "my-connection"
935
+ $ hookdeck gateway connection get "my-connection"
841
936
 
842
937
  # Get as JSON
843
- $ hookdeck connection get conn_123abc --output json
938
+ $ hookdeck gateway connection get conn_123abc --output json
844
939
 
845
940
  # Include destination authentication credentials
846
- $ hookdeck connection get conn_123abc --include-destination-auth --output json
941
+ $ hookdeck gateway connection get conn_123abc --include-destination-auth --output json
847
942
  ```
848
943
 
849
944
  #### Connection lifecycle management
@@ -852,16 +947,16 @@ Control connection state and event processing behavior:
852
947
 
853
948
  ```sh
854
949
  # Disable a connection (stops receiving events entirely)
855
- $ hookdeck connection disable conn_123abc
950
+ $ hookdeck gateway connection disable conn_123abc
856
951
 
857
952
  # Enable a disabled connection
858
- $ hookdeck connection enable conn_123abc
953
+ $ hookdeck gateway connection enable conn_123abc
859
954
 
860
955
  # Pause a connection (queues events without forwarding)
861
- $ hookdeck connection pause conn_123abc
956
+ $ hookdeck gateway connection pause conn_123abc
862
957
 
863
958
  # Resume a paused connection
864
- $ hookdeck connection unpause conn_123abc
959
+ $ hookdeck gateway connection unpause conn_123abc
865
960
  ```
866
961
 
867
962
  **State differences:**
@@ -874,16 +969,16 @@ Delete a connection permanently:
874
969
 
875
970
  ```sh
876
971
  # Delete with confirmation prompt
877
- $ hookdeck connection delete conn_123abc
972
+ $ hookdeck gateway connection delete conn_123abc
878
973
 
879
974
  # Delete by name
880
- $ hookdeck connection delete "my-connection"
975
+ $ hookdeck gateway connection delete "my-connection"
881
976
 
882
977
  # Skip confirmation
883
- $ hookdeck connection delete conn_123abc --force
978
+ $ hookdeck gateway connection delete conn_123abc --force
884
979
  ```
885
980
 
886
- For complete flag documentation and all examples, see the [CLI reference](https://hookdeck.com/docs/cli?ref=github-hookdeck-cli).
981
+ For complete flag documentation and all examples, see [REFERENCE.md](REFERENCE.md).
887
982
 
888
983
  ## Configuration files
889
984
 
@@ -1010,6 +1105,20 @@ Running from source:
1010
1105
  go run main.go
1011
1106
  ```
1012
1107
 
1108
+ ### Generating REFERENCE.md
1109
+
1110
+ The [REFERENCE.md](REFERENCE.md) file is generated from Cobra command metadata. After changing commands, flags, or help text, regenerate it:
1111
+
1112
+ ```sh
1113
+ go run ./tools/generate-reference --input REFERENCE.template.md --output REFERENCE.md
1114
+ ```
1115
+
1116
+ To validate that REFERENCE.md is up to date (useful in CI):
1117
+
1118
+ ```sh
1119
+ go run ./tools/generate-reference --input REFERENCE.template.md --output REFERENCE.md --check
1120
+ ```
1121
+
1013
1122
  Build from source by running:
1014
1123
 
1015
1124
  ```sh
@@ -1146,6 +1255,21 @@ docker run --rm -it \
1146
1255
  http://host.docker.internal:1234
1147
1256
  ```
1148
1257
 
1258
+ ### Testing the published npm package
1259
+
1260
+ To verify that the published npm package installs correctly and has the expected layout (wrapper script and platform binaries), use the local test script. It installs into a controlled directory (no global install) and runs the same checks as the `test-npm-install` CI workflow.
1261
+
1262
+ ```sh
1263
+ # Test with @latest (default)
1264
+ ./test-scripts/test-npm-install-local.sh
1265
+
1266
+ # Test with a specific version or tag
1267
+ ./test-scripts/test-npm-install-local.sh 1.7.1
1268
+ ./test-scripts/test-npm-install-local.sh @beta
1269
+ ```
1270
+
1271
+ Install output is written to `test-scripts/.install-test/` (gitignored).
1272
+
1149
1273
  ## Releasing
1150
1274
 
1151
1275
  This section describes the release process for the Hookdeck CLI.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hookdeck-cli",
3
- "version": "1.7.1",
3
+ "version": "1.8.0",
4
4
  "description": "Hookdeck CLI",
5
5
  "repository": {
6
6
  "type": "git",