### hookdeck gateway destination get examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocations of the get command, including with --include-auth to include authentication credentials. ```bash hookdeck gateway destination get des_abc123 ``` ```bash hookdeck gateway destination get my-destination --include-auth ``` -------------------------------- ### hookdeck outpost mcp examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of starting the MCP server in various modes. The first starts read-only; the second enables write tools; the third enables writes and publishing events with a Project API key; the fourth pipes a JSON-RPC initialize request for testing, keeping stdin open because the server exits on EOF. ```bash # Start the MCP server, read-only (stdio transport) hookdeck outpost mcp ``` ```bash # Allow tools that change data hookdeck outpost mcp --allow-write ``` ```bash # Allow writes, including publishing events hookdeck outpost mcp --allow-write --publish-api-key $HOOKDECK_OUTPOST_PUBLISH_API_KEY ``` ```bash # Pipe a JSON-RPC initialize request for testing. Keep stdin open: # the server exits on EOF, and a bare echo closes it before the reply lands. { echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"test","version":"1.0"},"capabilities":{}}}'; sleep 1; } | hookdeck outpost mcp ``` -------------------------------- ### hookdeck outpost tenant get examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of getting a tenant by ID, with and without JSON output. ```bash # Get a tenant hookdeck outpost tenant get acme # As JSON hookdeck outpost tenant get acme --output json ``` -------------------------------- ### Metrics use case examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example commands for querying Event Gateway metrics, covering event volume, request acceptance, delivery latency, queue backlog, pending events, events by issue, and transformation errors. All require --start and --end. ```bash hookdeck gateway metrics events --start 2026-02-01T00:00:00Z --end 2026-02-25T00:00:00Z --granularity 1d --measures count,failed_count,error_rate ``` ```bash hookdeck gateway metrics requests --start 2026-02-01T00:00:00Z --end 2026-02-25T00:00:00Z --measures count,accepted_count,rejected_count ``` ```bash hookdeck gateway metrics attempts --start 2026-02-01T00:00:00Z --end 2026-02-25T00:00:00Z --measures response_latency_avg,response_latency_p95 ``` ```bash hookdeck gateway metrics events --start 2026-02-01T00:00:00Z --end 2026-02-25T00:00:00Z --measures max_depth,max_age --destination-id dest_xxx ``` ```bash hookdeck gateway metrics events --start 2026-02-01T00:00:00Z --end 2026-02-25T00:00:00Z --granularity 1h --measures pending ``` ```bash hookdeck gateway metrics events --start 2026-02-01T00:00:00Z --end 2026-02-25T00:00:00Z --measures count --dimensions issue_id --issue-id iss_xxx ``` ```bash hookdeck gateway metrics transformations --start 2026-02-01T00:00:00Z --end 2026-02-25T00:00:00Z --measures count,failed_count,error_rate ``` -------------------------------- ### hookdeck gateway event get - Example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocation of the get command. ```bash hookdeck gateway event get evt_abc123 ``` -------------------------------- ### Install Hookdeck CLI via Scoop (Windows) Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Add the Hookdeck bucket and install the stable version. For beta versions, install hookdeck-beta. ```sh scoop bucket add hookdeck https://github.com/hookdeck/scoop-hookdeck-cli.git scoop install hookdeck ``` ```sh scoop install hookdeck-beta ``` -------------------------------- ### Select active project example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Example of directly selecting an organization and project. Output confirms the active project was set. ```sh $ hookdeck project use my-org my-project Successfully set active project to: my-org / my-project ``` -------------------------------- ### hookdeck gateway usage and examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Shows the base command for the gateway group and common examples for listing connections, creating a source, querying metrics, and starting the MCP server. ```bash hookdeck gateway ``` ```bash # List connections hookdeck gateway connection list # Create a source hookdeck gateway source create --name my-source --type WEBHOOK # Query event metrics hookdeck gateway metrics events --start 2026-01-01T00:00:00Z --end 2026-02-01T00:00:00Z --measures count # Start the MCP server for AI agent access hookdeck gateway mcp ``` -------------------------------- ### hookdeck outpost topic list example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example of listing topics. ```bash # List topics hookdeck outpost topic list ``` -------------------------------- ### hookdeck outpost config get examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Two example invocations of `hookdeck outpost config get`. The first shows everything that is set; the second prints a single value for the `TOPICS` key. ```bash # Show everything that is set hookdeck outpost config get ``` ```bash # Show one value hookdeck outpost config get TOPICS ``` -------------------------------- ### hookdeck outpost tenant portal examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of printing the portal URL, opening it in a browser, and requesting the dark theme. ```bash # Print the portal URL hookdeck outpost tenant portal acme # Open it in a browser hookdeck outpost tenant portal acme --open # Request the dark theme hookdeck outpost tenant portal acme --theme dark ``` -------------------------------- ### hookdeck gateway request get example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocation of the get command with a request ID. ```bash hookdeck gateway request get req_abc123 ``` -------------------------------- ### Claude Desktop MCP Server Configuration with --api-key Source: https://github.com/hookdeck/hookdeck-cli/blob/main/plans/hookdeck_mcp_detailed_implementation_plan.md Example configuration for Claude Desktop to start the Hookdeck MCP server with a pre-authenticated API key. When started with --api-key, the server is pre-authenticated, hookdeck_login is not registered, and all resource tools work immediately. ```json { "mcpServers": { "hookdeck": { "command": "hookdeck", "args": ["gateway", "mcp", "--api-key", "your-api-key-here"] } } } ``` -------------------------------- ### hookdeck gateway transformation get examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Gets a transformation by ID or by name. ```bash hookdeck gateway transformation get trn_abc123 ``` ```bash hookdeck gateway transformation get my-transform ``` -------------------------------- ### Example prompts for MCP server Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Example questions to ask your agent once the MCP server is configured. Each prompt shows how the agent uses specific gateway tools to answer. ```text "Are any of my events failing right now?" → Agent uses gateway_issues to list open issues, then gateway_events to inspect recent failures. "Show me the last 10 events for my Stripe source and check if any failed." → Agent uses gateway_sources to find the Stripe source, then gateway_events filtered by source and status. "What's the error rate for my API destination over the last 24 hours?" → Agent uses gateway_metrics with measures like failed_count and count, grouped by destination. "Trace request req_abc123 — what events did it produce, and did they all deliver successfully?" → Agent uses gateway_request to get the request, then its events action to list generated events. "Why is my checkout endpoint returning 500s? Show me the latest attempt details." → Agent uses gateway_events filtered by status FAILED, then gateway_attempts to inspect delivery details. "Pause the connection between Stripe and my staging endpoint while I debug." → Agent uses gateway_connections_read to find it, then gateway_connections_pause to stop delivery. "Compare failure rates across all my destinations this week." → Agent uses gateway_metrics with dimensions set to destination_id and measures like error_rate. "Find Stripe charge.succeeded events from the last week." → Agent uses gateway_events list with body filter {"type":"charge.succeeded"} and created_after / created_before ISO datetimes. "Show failed events that had delivery attempts in the last 24 hours." → Agent uses gateway_events list with status FAILED and last_attempt_after set to yesterday's ISO datetime. ``` -------------------------------- ### hookdeck gateway attempt get example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example command to get details for a specific attempt ID. ```bash hookdeck gateway attempt get atm_abc123 ``` -------------------------------- ### Event Gateway subcommand examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Examples for managing sources, destinations, events, requests, attempts, and transformations via the `hookdeck gateway` command group. ```sh # List sources and destinations hookdeck gateway source list hookdeck gateway destination list # List events (processed deliveries) and requests (raw inbound webhooks) hookdeck gateway event list --status FAILED hookdeck gateway request list --source-id src_abc123 # List attempts for an event hookdeck gateway attempt list --event-id evt_abc123 # Create a transformation and test-run it hookdeck gateway transformation create --name my-transform --code "addHandler(\"transform\", (request, context) => { return request; });" hookdeck gateway transformation run --code "addHandler(\"transform\", (request, context) => { return request; });" --request '{"headers":{}}' ``` -------------------------------- ### hookdeck outpost attempt get example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example of getting an attempt with the response body using JSON output. ```bash # Get an attempt with the response body hookdeck outpost attempt get att_abc123 --include response_data --output json ``` -------------------------------- ### Idempotent Upsert Example Implementation Source: https://github.com/hookdeck/hookdeck-cli/blob/main/AGENTS.md Example usage of the 'hookdeck connection upsert' command showing create, partial update, dry-run preview, and no-op scenarios. The API handles idempotency natively via PUT; a GET request is only needed for --dry-run preview. ```bash # Create if doesn't exist hookdeck connection upsert my-connection \ --source-name "my-source" --source-type STRIPE \ --destination-name "my-api" --destination-type HTTP \ --destination-url "https://example.com" ``` ```bash # Update only rules (partial update) hookdeck connection upsert my-connection \ --rule-retry-strategy linear --rule-retry-count 5 ``` ```bash # Preview changes before applying hookdeck connection upsert my-connection \ --description "New description" --dry-run ``` ```bash # No-op: connection exists, no flags provided (should not error) hookdeck connection upsert my-connection ``` -------------------------------- ### hookdeck outpost destination get example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example of retrieving a destination by its ID. The --tenant-id flag is required. ```bash # Get a destination hookdeck outpost destination get des_abc123 --tenant-id acme ``` -------------------------------- ### hookdeck outpost tenant list examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples for listing tenants: list all, fetch specific tenants by ID, and page through results with limit and next cursor. ```bash # List tenants hookdeck outpost tenant list ``` ```bash # Fetch specific tenants by ID hookdeck outpost tenant list --id acme,globex ``` ```bash # Page through results hookdeck outpost tenant list --limit 20 --next ``` -------------------------------- ### hookdeck gateway transformation run - Examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of running a transformation by ID, with inline code and a request file, and with a connection ID. ```bash hookdeck gateway transformation run --id trs_abc123 --request '{"headers":{}}' ``` ```bash hookdeck gateway transformation run --code "addHandler(\"transform\", (request, context) => { return request; });" --request-file ./sample.json ``` ```bash hookdeck gateway transformation run --id trs_abc123 --request '{"headers":{},"body":{"foo":"bar"}}' --connection-id web_xxx ``` -------------------------------- ### hookdeck outpost destination enable example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example of resuming delivery to a destination. ```bash # Resume delivery to a destination hookdeck outpost destination enable des_abc123 --tenant-id acme ``` -------------------------------- ### Install Hookdeck CLI via NPM Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Install the stable version globally using npm. For beta (pre-release) versions, use the @beta tag. ```sh npm install hookdeck-cli -g ``` ```sh npm install hookdeck-cli@beta -g ``` -------------------------------- ### hookdeck login examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of the login command, including with --cli-key, interactive mode, and --local flag. ```bash $ hookdeck login $ hookdeck login --cli-key $ hookdeck logout && hookdeck login # existing Platform account $ hookdeck login -i # interactive mode (no browser) $ hookdeck login --local # save credentials to .hookdeck/config.toml ``` -------------------------------- ### hookdeck outpost destination create examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of creating destinations with different configurations: webhook with all topics, specific topics, AWS SQS with credentials and a filter, and webhook with metadata. The --type flag is required. ```bash # A webhook destination subscribed to everything hookdeck outpost destination create --tenant-id acme --type webhook \ --config url=https://example.com/hooks # Subscribed to specific topics hookdeck outpost destination create --tenant-id acme --type webhook \ --config url=https://example.com/hooks --topics user.created,user.updated # With credentials and a filter hookdeck outpost destination create --tenant-id acme --type aws_sqs \ --config queue_url=https://sqs.eu-west-2.amazonaws.com/1/q \ --credential key=AKIA... --credential secret=... \ --filter '{"data":{"tier":"pro"}}' # With metadata of your own to correlate against your systems hookdeck outpost destination create --tenant-id acme --type webhook \ --config url=https://example.com/hooks \ --metadata owner=platform --metadata tier=pro ``` -------------------------------- ### hookdeck outpost tenant token examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of minting a tenant token, with and without JSON output for piping into another tool. ```bash # Mint a token for a tenant hookdeck outpost tenant token acme # As JSON, for piping into another tool hookdeck outpost tenant token acme --output json ``` -------------------------------- ### Install Hookdeck CLI via Homebrew (macOS) Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Install the stable version from homebrew-core. For beta versions, install from the Hookdeck tap. Note: Homebrew 5.2.0/6.0.0 may require an explicit trust step for the beta formula. ```sh brew install hookdeck ``` ```sh brew install hookdeck/hookdeck/hookdeck-beta ``` ```sh brew trust --formula hookdeck/hookdeck/hookdeck-beta ``` -------------------------------- ### Install beta releases via package managers Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Commands to install beta releases of the Hookdeck CLI using NPM, Homebrew, Scoop, and Docker. The Homebrew command installs the hookdeck-beta formula; the commented line forces symlink update if needed. ```sh # NPM npm install hookdeck-cli@beta -g # Homebrew brew install hookdeck/hookdeck/hookdeck-beta # To force the symlink update and overwrite all conflicting files: # brew link --overwrite hookdeck-beta # Scoop scoop install hookdeck-beta # Docker docker run hookdeck/hookdeck-cli:v1.3.0-beta.1 version ``` -------------------------------- ### hookdeck outpost destination-type list example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example of listing available destination types. ```bash # List available destination types hookdeck outpost destination-type list ``` -------------------------------- ### hookdeck gateway destination create examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocations of the create command for HTTP, CLI, and HTTP with bearer token destinations. ```bash hookdeck gateway destination create --name my-api --type HTTP --url https://api.example.com/webhooks ``` ```bash hookdeck gateway destination create --name local-cli --type CLI --cli-path /webhooks ``` ```bash hookdeck gateway destination create --name my-api --type HTTP --url https://api.example.com --bearer-token token123 ``` -------------------------------- ### hookdeck logout examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of the logout command, including the -a flag to clear all projects. ```bash $ hookdeck logout $ hookdeck logout -a # clear all projects ``` -------------------------------- ### hookdeck gateway event raw-body - Example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocation of the raw-body command. ```bash hookdeck gateway event raw-body evt_abc123 ``` -------------------------------- ### hookdeck outpost tenant upsert examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of upserting a tenant: creating or clearing metadata, setting metadata via repeatable flags, and loading metadata from a JSON file. ```bash # Create a tenant, or clear the metadata of one that exists hookdeck outpost tenant upsert acme # With metadata hookdeck outpost tenant upsert acme --metadata plan=pro --metadata region=eu # Metadata from a JSON file hookdeck outpost tenant upsert acme --metadata-file ./tenant.json ``` -------------------------------- ### hookdeck outpost publish examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of publishing events: basic publish, publish to a specific destination, and idempotent publish with a custom event ID. ```bash # Publish an event hookdeck outpost publish --tenant-id acme --topic user.created \ --data '{"user_id":"123"}' --api-key $HOOKDECK_API_KEY ``` ```bash # Publish to one specific destination hookdeck outpost publish --tenant-id acme --topic user.created \ --data '{"user_id":"123"}' --destination-id des_abc123 ``` ```bash # Idempotent publish: repeating the same --event-id will not duplicate hookdeck outpost publish --tenant-id acme --topic user.created \ --event-id my-unique-id --data-file ./payload.json ``` -------------------------------- ### hookdeck outpost destination list examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of listing destinations with optional filters by type or topic. The --tenant-id flag is required. ```bash # List a tenant's destinations hookdeck outpost destination list --tenant-id acme # Filter by type or topic hookdeck outpost destination list --tenant-id acme --type webhook hookdeck outpost destination list --tenant-id acme --topics user.created ``` -------------------------------- ### Set up local acceptance test environment Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Create a .env file in test/acceptance/ with the required API key for local testing. ```bash # test/acceptance/.env HOOKDECK_CLI_TESTING_API_KEY=your_api_key_here ``` -------------------------------- ### hookdeck gateway attempt list example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example command to list attempts for a specific event ID. ```bash hookdeck gateway attempt list --event-id evt_abc123 ``` -------------------------------- ### hookdeck outpost tenant delete examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of deleting a tenant with a confirmation prompt and with --force for scripts and CI. ```bash # Delete a tenant, with a confirmation prompt hookdeck outpost tenant delete acme # Skip the prompt (for scripts and CI) hookdeck outpost tenant delete acme --force ``` -------------------------------- ### hookdeck gateway transformation upsert - Examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of upserting a transformation with inline code, a code file with environment variables, and a dry-run preview. ```bash hookdeck gateway transformation upsert my-transform --code "addHandler(\"transform\", (request, context) => { return request; });" ``` ```bash hookdeck gateway transformation upsert my-transform --code-file ./transform.js --env FOO=bar ``` ```bash hookdeck gateway transformation upsert my-transform --code "addHandler(\"transform\", (request, context) => { return request; });" --dry-run ``` -------------------------------- ### Initialize MCP server with client Source: https://github.com/hookdeck/hookdeck-cli/blob/main/plans/hookdeck_mcp_detailed_implementation_plan.md Creates the MCP server instance using the go-sdk, passing the Hookdeck client and enabling tool capabilities. Registers all tools during initialization. ```go // pkg/gateway/mcp/server.go package mcp import ( "github.com/modelcontextprotocol/go-sdk/mcp" "github.com/modelcontextprotocol/go-sdk/server" "github.com/hookdeck/hookdeck-cli/pkg/hookdeck" ) type Server struct { client *hookdeck.Client mcpServer *server.MCPServer } func NewServer(client *hookdeck.Client) *Server { s := &Server{client: client} s.mcpServer = server.NewMCPServer( "hookdeck-gateway", "1.0.0", server.WithToolCapabilities(true), ) s.registerTools() return s } ``` -------------------------------- ### hookdeck gateway transformation list examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocations of the list command: list all, filter by name, sort by created_at descending, and limit results to 10. ```bash hookdeck gateway transformation list ``` ```bash hookdeck gateway transformation list --name my-transform ``` ```bash hookdeck gateway transformation list --order-by created_at --dir desc ``` ```bash hookdeck gateway transformation list --limit 10 ``` -------------------------------- ### Example config.toml with two profiles Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Shows the resulting configuration file after creating 'dev' and 'prod' profiles. The active profile is set to 'dev'. ```toml profile = "dev" [dev] api_key = "api_key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" project_id = "tm_5JxTelcYxOJy" project_type = "Gateway" [prod] api_key = "api_key_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" project_id = "tm_U9Zod13qtsHp" project_type = "Gateway" ``` -------------------------------- ### hookdeck CLI general usage and help Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Shows the basic command structure and how to access help for any command. ```sh hookdeck [command] # Run `--help` for detailed information about CLI commands hookdeck [command] help ``` -------------------------------- ### hookdeck gateway event list - Examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocations of the list command, including filtering by connection ID, status, search term, and next attempt time. ```bash hookdeck gateway event list ``` ```bash hookdeck gateway event list --connection-id web_abc123 ``` ```bash hookdeck gateway event list --status FAILED --limit 20 ``` ```bash hookdeck gateway event list --search-term cus_1234 ``` ```bash hookdeck gateway event list --status QUEUED --next-attempt-at-before 2026-01-01T00:00:00Z ``` -------------------------------- ### hookdeck gateway source upsert examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of upserting a source: create a WEBHOOK source, create a STRIPE source with a webhook secret, or preview changes with --dry-run without applying them. ```bash hookdeck gateway source upsert my-webhook --type WEBHOOK ``` ```bash hookdeck gateway source upsert stripe-prod --type STRIPE --config '{"webhook_secret":"whsec_xxx"}' ``` ```bash hookdeck gateway source upsert my-webhook --description "Updated" --dry-run ``` -------------------------------- ### Run all Go tests with go test ./... Source: https://github.com/hookdeck/hookdeck-cli/blob/main/AGENTS.md Run the full Go test suite from the repo root. Always run tests when changing code; for CLI-facing changes, also run acceptance tests with the appropriate -tags=... as described in test/acceptance/README.md. ```bash go test ./... ``` -------------------------------- ### hookdeck gateway request list examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocations of the list command: basic listing, filtering by source ID with a limit, searching for a term, and finding requests with zero events. ```bash hookdeck gateway request list ``` ```bash hookdeck gateway request list --source-id src_abc123 --limit 20 ``` ```bash hookdeck gateway request list --search-term cus_1234 ``` ```bash hookdeck gateway request list --events-count 0 ``` -------------------------------- ### hookdeck project use examples for global/local config Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Shows how `hookdeck project use` saves to global or local config based on existence of `.hookdeck/config.toml` and `--local` flag. Includes output messages and security warning. ```sh # No local config exists → saves to global $ hookdeck project use my-org my-project Successfully set active project to: my-org / my-project Saved to: ~/.config/hookdeck/config.toml # Local config exists → automatically updates local $ cd ~/repo-with-local-config # has .hookdeck/config.toml $ hookdeck project use another-org another-project Successfully set active project to: another-org / another-project Updated: .hookdeck/config.toml # Create new local config $ cd ~/my-new-repo # no .hookdeck/ directory $ hookdeck project use my-org my-project --local Successfully set active project to: my-org / my-project Created: .hookdeck/config.toml ⚠️ Security: Add .hookdeck/ to .gitignore (contains credentials) # Update existing local config with confirmation $ hookdeck project use another-org another-project --local Local configuration already exists at: .hookdeck/config.toml ? Overwrite with new project configuration? (y/N) y Successfully set active project to: another-org / another-project Updated: .hookdeck/config.toml ``` -------------------------------- ### Issue get command (pkg/cmd/issue_get.go) Source: https://github.com/hookdeck/hookdeck-cli/blob/main/plans/hookdeck_mcp_detailed_implementation_plan.md Get issue by ID. Requires exactly one argument (issue ID). Follows source_get.go pattern but no name resolution needed since issues are ID-only. ```go // Args: ExactArgs(1) — issue ID // Pattern: same as source_get.go (but no name resolution needed — issues are ID-only) ``` -------------------------------- ### Define MCP command struct and registration Source: https://github.com/hookdeck/hookdeck-cli/blob/main/plans/hookdeck_mcp_detailed_implementation_plan.md Creates a new Cobra command for the MCP server, with no arguments and a short/long description. The runMCPCmd method handles client setup, authentication checks, tool registration, and starting the stdio transport. ```go type mcpCmd struct { cmd *cobra.Command } func newMCPCmd() *mcpCmd { mc := &mcpCmd{} mc.cmd = &cobra.Command{ Use: "mcp", Args: validators.NoArgs, Short: "Start an MCP server for AI agent access to Hookdeck", Long: `Starts a Model Context Protocol (stdio) server...`, RunE: mc.runMCPCmd, } return mc } func addMCPCmdTo(parent *cobra.Command) { parent.AddCommand(newMCPCmd().cmd) } ``` -------------------------------- ### Configure Hookdeck CLI for CI with hookdeck ci Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Authenticates with HOOKDECK_API_KEY and starts forwarding events for CI tests. The --local flag saves credentials to ./.hookdeck/config.toml, and --name identifies the CI run. The example shows the command and its output, including the listening dashboard. ```bash hookdeck ci [flags] ``` ```bash $ hookdeck ci --api-key $HOOKDECK_API_KEY Done! The Hookdeck CLI is configured in project MyProject $ hookdeck listen 3000 shopify orders ●── HOOKDECK CLI ──● Listening on 1 source • 1 connection • [i] Collapse Shopify Source │ Requests to → https://hkdk.events/src_DAjaFWyyZXsFdZrTOKpuHnOH └─ Forwards to → http://localhost:3000/webhooks/shopify/orders (Orders Service) 💡 View dashboard to inspect, retry & bookmark events: https://dashboard.hookdeck.com/events/cli?team_id=... Events • [↑↓] Navigate ────────────────────────────────────────────────────────── > 2025-10-12 14:42:55 [200] POST http://localhost:3000/webhooks/shopify/orders (34ms) → https://dashboard.hookdeck.com/events/evt_... ─────────────────────────────────────────────────────────────────────────────── > ✓ Last event succeeded with status 200 | [r] Retry • [o] Open in dashboard • [d] Show data ``` -------------------------------- ### Run from source with go run main.go Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Starts the CLI directly from source code using Go's run command. ```sh go run main.go ``` -------------------------------- ### project get Source: https://github.com/hookdeck/hookdeck-cli/blob/main/plans/mcp_read_write_tool_split.md Retrieves a project by ID. This command corresponds to the GET /projects/{id} endpoint. ```APIDOC ## GET /projects/{id} ### Description Retrieves a project by ID. ### Method GET ### Endpoint /projects/{id} ### Parameters #### Path Parameters - **id** (string) - Required - ID of the project. ``` -------------------------------- ### org get Source: https://github.com/hookdeck/hookdeck-cli/blob/main/plans/mcp_read_write_tool_split.md Retrieves the current organization details. This command corresponds to the GET /organizations/current endpoint. ```APIDOC ## GET /organizations/current ### Description Retrieves the current organization details. ### Method GET ### Endpoint /organizations/current ``` -------------------------------- ### hookdeck outpost config set examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Three example invocations of `hookdeck outpost config set`. The first sets the `TOPICS` key to a comma-separated list. The second previews a change to `MAX_RETRY_LIMIT` without applying it using `--dry-run`. The third returns `MAX_RETRY_LIMIT` to its default using `--unset`. ```bash # Set the topics destinations can subscribe to hookdeck outpost config set TOPICS=user.created,user.updated ``` ```bash # Preview a change without applying it hookdeck outpost config set MAX_RETRY_LIMIT=5 --dry-run ``` ```bash # Return a key to its default hookdeck outpost config set --unset MAX_RETRY_LIMIT ``` -------------------------------- ### hookdeck listen output modes examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Shows the three `--output` modes: `interactive` (default), `compact`, and `quiet`. `interactive` provides a full-screen TUI; `compact` prints one-line logs; `quiet` only shows fatal connection errors. ```sh # Default - full interactive UI with keyboard shortcuts $ hookdeck listen 3000 shopify # Simple logging mode - prints all events as one-line logs $ hookdeck listen 3000 shopify --output compact # Quiet mode - only shows fatal connection errors $ hookdeck listen 3000 shopify --output quiet ``` -------------------------------- ### Create pre-release from main via gh CLI Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Use this command to create a pre-release (beta) from the main branch. It marks the release as a pre-release and uses a notes file. This is an alternative to the GitHub UI method. ```bash gh release create v1.3.0-beta.1 --target main --prerelease \ --title "v1.3.0-beta.1" --notes-file notes.md ``` -------------------------------- ### hookdeck outpost event get Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Gets an event, including the payload that was published. ```APIDOC ## hookdeck outpost event get ### Description Gets an event, including the payload that was published. ### Usage ```bash hookdeck outpost event get [flags] ``` ### Arguments - `event-id` (string) - **Required.** The ID of the event. ### Flags - `--output` (string) - Output format (json) - `--tenant-id` (string) - Tenant the event belongs to ### Examples ```bash # Get an event hookdeck outpost event get evt_abc123 # Get the payload alone hookdeck outpost event get evt_abc123 --output json | jq .data ``` ``` -------------------------------- ### Using HOOKDECK_API_KEY in CI Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Shows how to set the Project API key via environment variable and run `hookdeck listen` without needing `hookdeck ci`. ```sh export HOOKDECK_API_KEY="your-project-api-key" hookdeck listen 3000 ``` -------------------------------- ### hookdeck gateway request get Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Get detailed information about a request by ID. ```APIDOC ## hookdeck gateway request get ### Description Get detailed information about a request by ID. ### Usage ```bash hookdeck gateway request get [flags] ``` ### Flags | Flag | Type | Description | |------|------|-------------| | `--output` | `string` | Output format (json) | ### Examples ```bash hookdeck gateway request get req_abc123 ``` ``` -------------------------------- ### Homebrew: Link hookdeck or hookdeck-beta with --overwrite Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Both formulae install a binary named hookdeck, so only one can be linked at a time. Use --overwrite to switch between them; the comments indicate which command switches to stable or beta. ```sh # Switch from beta to stable brew link --overwrite hookdeck # Switch from stable to beta brew link --overwrite hookdeck-beta ``` -------------------------------- ### hookdeck gateway event get Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Get detailed information about an event by ID. ```APIDOC ## hookdeck gateway event get ### Description Get detailed information about an event by ID. ### Usage ```bash hookdeck gateway event get [flags] ``` ### Flags | Flag | Type | Description | |------|------|-------------| | `--output` | `string` | Output format (json) | ### Examples ```bash hookdeck gateway event get evt_abc123 ``` ``` -------------------------------- ### GET /issues/{id} Source: https://github.com/hookdeck/hookdeck-cli/blob/main/plans/hookdeck_mcp_detailed_implementation_plan.md Get a single issue by ID. Returns the IssueWithData object for the specified issue. ```APIDOC ## [GET] /issues/{id} ### Description Get a single issue by ID. Returns the IssueWithData object for the specified issue. ### Method GET ### Endpoint /issues/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Issue ID ### Response #### Success Response (200) - **IssueWithData** (object) - The issue with data ``` -------------------------------- ### hookdeck outpost destination disable example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example of pausing delivery to a destination. ```bash # Pause delivery to a destination hookdeck outpost destination disable des_abc123 --tenant-id acme ``` -------------------------------- ### Build from source with go build Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Compiles the CLI binary from source code. ```sh go build ``` -------------------------------- ### hookdeck listen command and flags Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Starts a session to forward events to an HTTP server. The port-or-URL parameter is mandatory; events are forwarded to http://localhost:$PORT/$DESTINATION_PATH when using a valid port or your provided URL. ```sh hookdeck listen [flags] Flags: --path string Sets the path to which events are forwarded (e.g., /webhooks or /api/stripe) --output string Output mode: interactive (full UI), compact (simple logs), quiet (only fatal errors) (default "interactive") --max-connections int Maximum concurrent connections to local endpoint (default: 50, increase for high-volume testing) --filter-body string Filter events by request body using Hookdeck filter syntax (JSON) --filter-headers string Filter events by request headers using Hookdeck filter syntax (JSON) --filter-query string Filter events by query parameters using Hookdeck filter syntax (JSON) --filter-path string Filter events by request path using Hookdeck filter syntax (JSON) --cli-key string Authenticate with a user-scoped CLI key instead of the stored login --api-key string Authenticate with a project-scoped key instead of the stored login ``` -------------------------------- ### hookdeck gateway event mute - Example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocation of the mute command. ```bash hookdeck gateway event mute evt_abc123 ``` -------------------------------- ### hookdeck gateway event cancel - Example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocation of the cancel command. ```bash hookdeck gateway event cancel evt_abc123 ``` -------------------------------- ### hookdeck gateway event retry - Example Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Example invocation of the retry command. ```bash hookdeck gateway event retry evt_abc123 ``` -------------------------------- ### Listen to a specific source with hookdeck listen Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Starts the CLI in interactive mode, listening on all eligible connections for the given source alias. The output shows the connection header, event list, and status bar. Use keyboard shortcuts like 'i' to toggle connection details, 'r' to retry, 'o' to open in dashboard, and 'd' to show data. ```sh $ hookdeck listen 3000 shopify ●── HOOKDECK CLI ──● Listening on 1 source • 2 connections • [i] Collapse Shopify Source │ Requests to → https://events.hookdeck.com/e/src_DAjaFWyyZXsFdZrTOKpuHnOH ├─ Forwards to → http://localhost:3000/webhooks/shopify/inventory (Inventory Service) └─ Forwards to → http://localhost:3000/webhooks/shopify/orders (Orders Service) 💡 Open dashboard to inspect, retry & bookmark events: https://dashboard.hookdeck.com/events/cli?team_id=... Events • [↑↓] Navigate ────────────────────────────────────────────────────────── 2025-10-12 14:32:15 [200] POST http://localhost:3000/webhooks/shopify/orders (23ms) → https://dashboard.hookdeck.com/events/evt_... > 2025-10-12 14:32:18 [200] POST http://localhost:3000/webhooks/shopify/inventory (45ms) → https://dashboard.hookdeck.com/events/evt_... ─────────────────────────────────────────────────────────────────────────────── > ✓ Last event succeeded with status 200 | [r] Retry • [o] Open in dashboard • [d] Show data ``` -------------------------------- ### Dynamic Type-Specific Help in Go Source: https://github.com/hookdeck/hookdeck-cli/blob/main/AGENTS.md Provides a placeholder for generating contextual help text based on the selected type, showing only relevant flags and their requirements. Intended for integration with the help system. ```go func getTypeSpecificHelp(command, selectedType string) string { // Return contextual help for the specific type // Show only relevant flags and their requirements } ``` -------------------------------- ### hookdeck outpost tenant get Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Get details for a tenant, including how many destinations it has. ```APIDOC ## hookdeck outpost tenant get ### Description Get details for a tenant, including how many destinations it has. ### Usage ```bash hookdeck outpost tenant get [flags] ``` ### Arguments | Argument | Type | Description | |----------|------|-------------| | `tenant-id` | `string` | **Required.** The ID of the tenant. | ### Flags | Flag | Type | Description | |------|------|-------------| | `--output` | `string` | Output format (json) | ### Examples ```bash # Get a tenant hookdeck outpost tenant get acme # As JSON hookdeck outpost tenant get acme --output json ``` ``` -------------------------------- ### hookdeck gateway event get - Usage Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Get detailed information about an event by ID. ```bash hookdeck gateway event get [flags] ``` -------------------------------- ### Building and Testing Commands Source: https://github.com/hookdeck/hookdeck-cli/blob/main/AGENTS.md Commands to build the CLI and run unit tests, including specific package tests and race detection. Run from repo root. ```bash # Build the CLI go build -o hookdeck . # Run all unit tests (default packages; run from repo root) go test ./... # Run specific package tests go test ./pkg/cmd/ # Run with race detection go test -race ./... ``` -------------------------------- ### hookdeck gateway transformation count - Examples Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Examples of counting all transformations and filtering by name. ```bash hookdeck gateway transformation count ``` ```bash hookdeck gateway transformation count --name my-transform ``` -------------------------------- ### Manual npm build testing steps Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Step-by-step manual process to test the npm package build: install GoReleaser, build platform binaries, verify structure, test wrapper, and dry-run npm pack. ```sh # Install GoReleaser (if not already installed) # Option 1: Using Homebrew (recommended on macOS) brew install goreleaser # Option 2: Download binary from GitHub releases # Visit https://github.com/goreleaser/goreleaser/releases/latest # Build all platform binaries for npm goreleaser build -f .goreleaser/npm.yml --snapshot --clean # Verify binaries directory structure ls -R binaries/ # Test the wrapper script on your platform node bin/hookdeck.js --version # Test npm package creation (dry-run) npm pack --dry-run ``` -------------------------------- ### hookdeck gateway transformation executions get Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Gets a single execution by transformation ID and execution ID. ```APIDOC ## hookdeck gateway transformation executions get ### Description Get a single execution by transformation ID and execution ID. ### Usage ```bash hookdeck gateway transformation executions get [flags] ``` ### Flags - `--output` (string) - Output format (json) ``` -------------------------------- ### Manually test npm package and wrapper script Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Build all platform binaries with GoReleaser, test the wrapper script, and verify npm pack includes necessary files. The wrapper expects binaries in binaries/{platform}-{arch}/hookdeck[.exe]. ```sh # Ensure GoReleaser is installed (see "Testing the npm package build" section above) # Build all platform binaries goreleaser build -f .goreleaser/npm.yml --snapshot --clean # Test wrapper script on current platform node bin/hookdeck.js version # Verify wrapper script can find binary node bin/hookdeck.js --help # Test npm pack includes all files npm pack --dry-run | grep -E "(bin/hookdeck.js|binaries/)" ``` -------------------------------- ### Format, lint, and vet Go code Source: https://github.com/hookdeck/hookdeck-cli/blob/main/AGENTS.md Run formatting, linting, and vetting on the Go codebase. Use these commands before pushing changes. ```bash # Format code go fmt ./... # Run linter (if available) golangci-lint run # Vet code go vet ./... ``` -------------------------------- ### hookdeck gateway transformation get usage Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Gets detailed information about a specific transformation by ID or name. ```bash hookdeck gateway transformation get [flags] ``` -------------------------------- ### Destination config with key=value pairs Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Shows how to upsert a tenant and create a destination with repeatable `--config key=value` pairs. Config fields are defined by the Outpost deployment, not the CLI. ```sh hookdeck outpost tenant upsert acme hookdeck outpost destination create --tenant-id acme --type webhook \ --config url=https://example.com/hooks --topics user.created ``` -------------------------------- ### hookdeck gateway attempt get usage Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Shows the usage syntax for getting detailed information about an attempt by ID. ```bash hookdeck gateway attempt get [flags] ``` -------------------------------- ### hookdeck gateway request get usage Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Shows the usage syntax for getting detailed information about a request by ID. ```bash hookdeck gateway request get [flags] ``` -------------------------------- ### Create a profile with hookdeck project use Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Creates a profile named 'prod' for a specific organization and project using the project use command with the -p flag. ```sh hookdeck project use org_name proj_name -p prod ``` -------------------------------- ### hookdeck gateway destination get usage Source: https://github.com/hookdeck/hookdeck-cli/blob/main/REFERENCE.md Gets detailed information about a specific destination, specified by ID or name. ```bash hookdeck gateway destination get [flags] ``` -------------------------------- ### hookdeck listen with connection query Source: https://github.com/hookdeck/hookdeck-cli/blob/main/README.md Uses the third parameter `connection-query` to select a connection with a CLI destination. If no connection matches the name, alias, or path, a new connection is created. The output shows the listening status and forwarded events. ```sh $ hookdeck listen 3000 shopify orders ●── HOOKDECK CLI ──● Listening on 1 source • 1 connection • [i] Collapse Shopify Source │ Requests to → https://events.hookdeck.com/e/src_DAjaFWyyZXsFdZrTOKpuHnOH └─ Forwards to → http://localhost:3000/webhooks/shopify/orders (Orders Service) 💡 Open dashboard to inspect, retry & bookmark events: https://dashboard.hookdeck.com/events/cli?team_id=... Events • [↑↓] Navigate ────────────────────────────────────────────────────────── > 2025-10-12 14:38:09 [200] POST http://localhost:3000/webhooks/shopify/orders (27ms) → https://dashboard.hookdeck.com/events/evt_... ─────────────────────────────────────────────────────────────────────────────── > ✓ Last event succeeded with status 200 | [r] Retry • [o] Open in dashboard • [d] Show data ``` -------------------------------- ### Run Go tests with module cache Source: https://github.com/hookdeck/hookdeck-cli/blob/main/AGENTS.md Run unit tests from the repository root. Use this command in Cursor or agent environments to ensure the module cache is populated and accessible. ```bash cd /path/to/hookdeck-cli # repo root containing go.mod GOMODCACHE="$(go env GOPATH)/pkg/mod" go test ./... ```