Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,21 @@ Pinning project to current directory
<!-- GENERATE:listen:START -->
## 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.

**Usage:**

```bash
hookdeck listen [port or forwarding URL] [source] [connection] [flags]
hookdeck listen [port or forwarding URL] [source(s)] [connection] [flags]
```

**Arguments:**
Expand Down
24 changes: 18 additions & 6 deletions pkg/cmd/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.`,
Expand Down Expand Up @@ -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)

Expand All @@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port in the example seems broken

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%[1]d here is a Go fmt.Sprintf verb, not a literal — the whole Examples block is built via fmt.Sprintf(..., 3000), so this renders as hookdeck listen 3000 shopify,stripe. It matches the pre-existing examples in the same block (e.g. hookdeck listen %[1]d shopify a few lines up), which also use %[1]d. GitHub only let you comment on the newly-added lines, so the identical older lines aren't flagged. Happy to switch the entire block to a literal 3000 if you'd prefer that for readability, but I left these consistent with the surrounding examples.


Generated by Claude Code


Forward events from all of your sources:

hookdeck listen %[1]d '*'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, broken port.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above — %[1]d is a fmt.Sprintf placeholder that renders as 3000 (hookdeck listen 3000 '*'), consistent with the rest of the Examples block.


Generated by Claude Code


Forward events to a local server running on "http://myapp.test:%[1]d":

hookdeck listen http://myapp.test:%[1]d
Expand Down
Loading