From 0da078352876adebe98e7923dc09f4ecc78d17ad Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 16 Jun 2026 10:32:56 +0000 Subject: [PATCH] docs(listen): clarify multi-source support in help text The `listen` command already supports listening to multiple sources via a comma-separated list and "*" for all sources, but the `-h` help text only described a single required source, making the feature hard to discover. - Update Short/Long description and Usage line to mention one or more sources - Mark the source argument as optional and document the comma-separated list and "*" syntax - Add multi-source and "*" examples - Regenerate REFERENCE.md --- REFERENCE.md | 10 +++++++--- pkg/cmd/listen.go | 24 ++++++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 72b673cf..25595668 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -172,9 +172,13 @@ Pinning project to current directory ## Listen -Forward events for a source to your local server. +Forward events for one or more sources to your local server. -This command will create a new Hookdeck Source if it doesn't exist. +You can listen to a single source, a comma-separated list of sources, or +"*" to listen to all of your sources at once. + +This command will create a new Hookdeck Source if it doesn't exist (single +source only). By default the Hookdeck Destination will be named "{source}-cli", and the Destination CLI path will be "/". To set the CLI path, use the "`--path`" flag. @@ -182,7 +186,7 @@ Destination CLI path will be "/". To set the CLI path, use the "`--path`" flag. **Usage:** ```bash -hookdeck listen [port or forwarding URL] [source] [connection] [flags] +hookdeck listen [port or forwarding URL] [source(s)] [connection] [flags] ``` **Arguments:** diff --git a/pkg/cmd/listen.go b/pkg/cmd/listen.go index e2236915..b26bc0c2 100644 --- a/pkg/cmd/listen.go +++ b/pkg/cmd/listen.go @@ -103,11 +103,15 @@ func newListenCmd() *listenCmd { lc := &listenCmd{} lc.cmd = &cobra.Command{ - Use: "listen [port or forwarding URL] [source] [connection]", - Short: "Forward events for a source to your local server", - Long: `Forward events for a source to your local server. + Use: "listen [port or forwarding URL] [source(s)] [connection]", + Short: "Forward events for one or more sources to your local server", + Long: `Forward events for one or more sources to your local server. -This command will create a new Hookdeck Source if it doesn't exist. +You can listen to a single source, a comma-separated list of sources, or +"*" to listen to all of your sources at once. + +This command will create a new Hookdeck Source if it doesn't exist (single +source only). By default the Hookdeck Destination will be named "{source}-cli", and the Destination CLI path will be "/". To set the CLI path, use the "--path" flag.`, @@ -178,12 +182,12 @@ Destination CLI path will be "/". To set the CLI path, use the "--path" flag.`, usage = strings.Replace( usage, "{{.UseLine}}", - `hookdeck listen [port or forwarding URL] [source] [connection] [flags] + `hookdeck listen [port or forwarding URL] [source(s)] [connection] [flags] Arguments: - [port or forwarding URL]: Required. The port or forwarding URL to forward the events to e.g., "3000" or "http://localhost:3000" - - [source]: Required. The name of source to forward the events from e.g., "shopify", "stripe" + - [source(s)]: Optional. One source name, a comma-separated list of source names (e.g. "shopify,stripe"), or "*" to listen to all sources. If omitted, the CLI prompts you to choose. - [connection]: Optional. The name of the connection linking the Source and the Destination `, 1) @@ -195,6 +199,14 @@ Examples: hookdeck listen %[1]d shopify + Forward events from multiple sources to a local server running on port %[1]d: + + hookdeck listen %[1]d shopify,stripe + + Forward events from all of your sources: + + hookdeck listen %[1]d '*' + Forward events to a local server running on "http://myapp.test:%[1]d": hookdeck listen http://myapp.test:%[1]d