### Install Hooklistener CLI Source: https://github.com/hooklistener/hooklistener-cli/blob/main/npm/packages/hooklistener/README.md Install the Hooklistener CLI globally using npm. ```bash npm install -g hooklistener ``` -------------------------------- ### Install via Homebrew Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Install the CLI on macOS or Linux using Homebrew. ```bash brew install hooklistener/tap/hooklistener ``` -------------------------------- ### Install via Cargo Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Install the CLI using the Rust package manager. ```bash cargo install hooklistener-cli ``` -------------------------------- ### Install Hooklistener CLI Source: https://github.com/hooklistener/hooklistener-cli/blob/main/homebrew-tap/README.md Commands to add the tap and install the Hooklistener CLI package. ```bash brew tap hooklistener/tap brew install hooklistener ``` -------------------------------- ### Check Version Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Verify that the CLI is installed correctly by checking its version. ```bash hooklistener --version ``` -------------------------------- ### Run Local Listeners and Save Cases Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Commands to start a local listener and save request cases with assertions for automated testing. ```bash # Keep this running in another terminal; use the endpoint's slug here. hooklistener listen --target http://localhost:3000/webhooks hooklistener cases save \ --name "Payment accepted" --expect-status 200 --expect-json '{"accepted":true}' hooklistener cases run --target cli --wait --timeout 60s ``` -------------------------------- ### Verify Installation with GitHub CLI Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Verify the authenticity of a downloaded binary using the GitHub CLI by checking the repository, signer workflow, source digest, and source reference. ```bash gh attestation verify hooklistener-x86_64-unknown-linux-gnu.tar.gz \ --repo hooklistener/hooklistener-cli \ --signer-workflow hooklistener/hooklistener-cli/.github/workflows/release.yml \ --source-digest \ --source-ref refs/tags/v1.8.0 ``` -------------------------------- ### Prepare and authenticate tunnel Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-authenticated-beta.md Verifies authentication, schema compatibility, target resolution, and activation plan before starting a relay. ```bash hooklistener login hooklistener org use hooklistener tunnel prepare --port 3000 ``` -------------------------------- ### Conventional commit message example Source: https://github.com/hooklistener/hooklistener-cli/blob/main/CONTRIBUTING.md An example of a commit message following the conventional commit format for a new feature. ```text feat(ui): add search functionality Implements fuzzy search for webhook requests with keyboard shortcut (/) and filter persistence. Closes #42 ``` -------------------------------- ### Start Tunnel Alias Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md The command to start a tunnel session on a specific port. ```bash hooklistener tunnel --port 3000 ``` -------------------------------- ### Upgrade Hooklistener CLI Source: https://github.com/hooklistener/hooklistener-cli/blob/main/homebrew-tap/README.md Command to upgrade the installed Hooklistener CLI package. ```bash brew upgrade hooklistener ``` -------------------------------- ### Start authenticated tunnel relay Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-authenticated-beta.md Starts a tunnel relay on the specified port to expose the local handler's response. ```bash hooklistener tunnel start --port 3000 ``` -------------------------------- ### Start an authenticated tunnel Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-anonymous-routes.md Initiates the tunnel using the authenticated path after a name has been claimed. ```text hooklistener tunnel start --slug stable-demo --port 3000 ``` -------------------------------- ### Start an anonymous tunnel in machine mode Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-anonymous-routes.md Emits the creation receipt followed by the standard tunnel NDJSON event stream. ```text hooklistener --json anon tunnel --port 3000 --ttl 900 ``` -------------------------------- ### Manage Tunnel Lifecycle State Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Commands to prepare, start, list, inspect, and stop tunnel sessions. These operations are cloud-authoritative and persist after the CLI process exits. ```bash hooklistener tunnel prepare --port 3000 hooklistener tunnel start --port 3000 hooklistener tunnel list hooklistener tunnel status hooklistener tunnel events --cursor --follow hooklistener tunnel capture hooklistener tunnel attempt hooklistener tunnel detach --reason "switching machines" hooklistener tunnel stop --reason "deployment complete" ``` -------------------------------- ### Disable terminal styling Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Examples of disabling terminal styling using the --color flag or the NO_COLOR environment variable. ```bash hooklistener --color never endpoint list NO_COLOR=1 hooklistener monitor list ``` -------------------------------- ### Start an anonymous tunnel Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-anonymous-routes.md Initiates a public direct-response tunnel without authentication. Anonymous routes have a default duration of 15 minutes and support custom TTL values between 60 and 1,800 seconds. ```text hooklistener anon tunnel --port 3000 hooklistener anon tunnel --port 3000 --name stable-demo --ttl 1200 ``` -------------------------------- ### Clone and build the Hooklistener CLI Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Commands to clone the repository, navigate to the directory, and build or test the project using Cargo. ```bash git clone https://github.com/hooklistener/hooklistener-cli.git cd hooklistener-cli cargo build cargo test ``` -------------------------------- ### Build and Development Commands Source: https://github.com/hooklistener/hooklistener-cli/blob/main/CLAUDE.md Standard commands for building, testing, and maintaining code quality in the project. ```bash make check # workflow/gate tests + Rust tests, fmt, clippy make check-cases # release-profile saved-case + lifecycle conformance cargo build # debug build cargo build --release cargo run -- # e.g. cargo run -- listen cargo test # unit + integration tests cargo fmt --all cargo clippy --all-targets --all-features -- -D warnings cargo machete # unused dependencies (CI runs this too) ``` -------------------------------- ### Fetch dependencies and run initial build measurement Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/build-footprint.md Fetch dependencies using the pinned Rust toolchain and perform the initial build measurement for the release profile. ```sh mise exec -- cargo fetch --locked --target x86_64-unknown-linux-gnu mise exec -- python3 scripts/measure_build.py \ --output target/measurements/before-release --profile release --jobs 8 ``` -------------------------------- ### Inspect active configuration Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Command to display the currently active configuration settings. ```bash hooklistener config show ``` -------------------------------- ### Generate local conformance receipt on macOS/Linux Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/cases-conformance.md Builds the release binary and runs the verification script to generate a conformance receipt at the specified output path. ```sh mise exec -- cargo build --release --locked HOOKLISTENER_CONFORMANCE_BINARY="$PWD/target/release/hooklistener" \ HOOKLISTENER_CASES_CONFORMANCE_OUTPUT="/tmp/cases-conformance.json" \ mise exec -- python3 scripts/verify_cases_release_tests.py ``` -------------------------------- ### Default configuration and log paths Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Standard locations for configuration and log files on Linux systems. ```text ~/.config/hooklistener/config.json ~/.config/hooklistener/logs ``` -------------------------------- ### Authenticate and expose local server Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Log in to the service and create a public HTTPS tunnel to a local port. ```bash hooklistener login hooklistener tunnel --port 3000 ``` -------------------------------- ### Verify repository rules and environment configuration Source: https://github.com/hooklistener/hooklistener-cli/blob/main/CONTRIBUTING.md Use these GitHub CLI commands to inspect the metadata of branch rules, tag rulesets, environment settings, and repository secrets to ensure the release environment is correctly configured. ```sh gh api --paginate --slurp \ 'repos/hooklistener/hooklistener-cli/rules/branches/main?per_page=100' gh api --paginate --slurp \ 'repos/hooklistener/hooklistener-cli/rulesets?targets=tag&per_page=100' gh api repos/hooklistener/hooklistener-cli/environments/release gh api --paginate --slurp \ 'repos/hooklistener/hooklistener-cli/environments/release/deployment-branch-policies?per_page=100' gh secret list --repo hooklistener/hooklistener-cli gh secret list --repo hooklistener/hooklistener-cli --env release ``` -------------------------------- ### Hooklistener CLI Workflow Commands Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md A summary of common CLI commands for forwarding, tunneling, and inspecting requests. ```bash hooklistener listen hooklistener tunnel hooklistener anon tunnel hooklistener endpoint hooklistener cases hooklistener anon hooklistener share hooklistener monitor ``` -------------------------------- ### Run local tunnel phase 1 conformance tests Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-phase1-conformance.md Executes the local verification script, builds the release binary, and runs the conformance test suite with specific environment variables for platform and binary path configuration. ```sh SOURCE_SHA="$(git rev-parse HEAD)" python3 scripts/verify_tunnel_v3_release_tests.py cargo build --release --locked HOOKLISTENER_CONFORMANCE_OUTPUT=tmp/phase1-linux.json \ HOOKLISTENER_CONFORMANCE_PLATFORM=linux \ HOOKLISTENER_CONFORMANCE_BINARY=target/release/hooklistener \ HOOKLISTENER_CLI_GIT_SHA="${SOURCE_SHA}" \ cargo test --release --locked --test tunnel_phase1_conformance -- --nocapture ``` -------------------------------- ### Run project tests and quality checks Source: https://github.com/hooklistener/hooklistener-cli/blob/main/CONTRIBUTING.md Execute these commands to verify changes before submitting a pull request. This includes running all tests, checking code formatting, and linting with Clippy. ```bash cargo test --all-targets --all-features --locked cargo fmt --all -- --check cargo clippy --all-targets --all-features -- -D warnings ``` -------------------------------- ### Run post-change build measurement Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/build-footprint.md Execute a measurement run after applying changes, ensuring a new output directory is used. ```sh mise exec -- python3 scripts/measure_build.py \ --output target/measurements/after-release --profile release --jobs 8 ``` -------------------------------- ### Hooklistener CLI Commands Source: https://github.com/hooklistener/hooklistener-cli/blob/main/npm/packages/hooklistener/README.md Common commands for authenticating, managing endpoints, forwarding webhooks, tunneling local servers, and generating shell completions. ```bash # Authenticate hooklistener login # List orgs and select a default org for API-backed commands hooklistener org list hooklistener org use # Forward webhooks to localhost hooklistener listen my-endpoint # Manage endpoints and requests hooklistener endpoint list hooklistener endpoint requests hooklistener endpoint forward-request http://localhost:3000/webhook # Expose local server with a public URL hooklistener tunnel --port 3000 # Use JSON output for scripts hooklistener --json endpoint list # Generate shell completions hooklistener completions bash ``` -------------------------------- ### Manage Endpoints and Requests Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Commands to create endpoints, inspect traffic, and forward specific requests to a local server. ```bash hooklistener endpoint create "Billing Webhooks" --slug billing-webhooks hooklistener endpoint requests hooklistener endpoint request hooklistener endpoint forward-request \ http://localhost:3000/webhooks ``` -------------------------------- ### Expose localhost anonymously Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Create a temporary 15-minute anonymous tunnel with a stable name. ```bash hooklistener anon tunnel --port 3000 --name stable-demo ``` -------------------------------- ### Manage Saved Cases and Test Suites Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Commands to list, update, and replay saved cases, as well as manage test suites and inspect execution results. ```bash hooklistener cases list hooklistener cases show --json hooklistener cases update --expect-status 202 hooklistener cases replay --target cli --method POST --body '{"test":true}' hooklistener cases suites list hooklistener cases suites show hooklistener cases run --suite --target cli --wait hooklistener cases runs list --suite --page 1 --page-size 20 hooklistener cases runs show --json hooklistener cases runs wait --timeout 60s --json ``` -------------------------------- ### Manage Organizations Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Commands to list and select an organization for account-backed operations. ```bash hooklistener org list hooklistener org use ``` -------------------------------- ### Repository Structure Source: https://github.com/hooklistener/hooklistener-cli/blob/main/homebrew-tap/README.md The required directory structure for the homebrew-tap repository. ```text homebrew-tap/ ├── README.md └── Formula/ └── hooklistener.rb ``` -------------------------------- ### Preview cases with hooklistener Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Use the dry-run flag to preview case or replay execution without creating a run or delivery receipt. These commands report listener counts and use the preview status in JSON output. ```bash hooklistener cases run --target cli --dry-run --json hooklistener cases replay --target cli --dry-run --json ``` -------------------------------- ### Build with symbols for profiling Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/build-footprint.md Use these environment variables to preserve symbols in release builds for profiling purposes without modifying the manifest. ```sh CARGO_PROFILE_RELEASE_STRIP=none mise exec -- cargo build --release --locked ``` -------------------------------- ### Run local CI checks with mise Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/cases-conformance.md Executes the full suite of workflow self-tests, Rust tests, rustfmt, and Clippy, followed by the inventory and release-profile conformance checks. ```sh mise exec -- make check mise exec -- make check-cases ``` -------------------------------- ### Enable Tunnel v3 via Environment Variable Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-streaming-v3.md The service controls the rollout of protocol v3 centrally using this environment variable. ```text Service: TUNNEL_V3_ENABLED=true ``` -------------------------------- ### Execute and replay cases with idempotency keys Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Supply an idempotency key to ensure recovery of a submission receipt if a response is lost. The key must be 8-200 printable ASCII bytes without spaces. ```bash hooklistener cases run --target cli --idempotency-key build-482-smoke --wait --json hooklistener cases replay --target cli --idempotency-key incident-732-replay --json ``` -------------------------------- ### Run project validation suite Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/build-footprint.md Executes the full suite of validation scripts, including build tests, dependency checks, and security audits. ```sh python3 scripts/measure_build_test.py mise exec -- make check mise exec -- cargo machete mise exec -- cargo audit --file Cargo.lock mise exec -- python3 scripts/verify_tunnel_v3_release_tests.py ``` -------------------------------- ### Forward webhook events to local app Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Forward events from a specific provider to a local endpoint. Targets are loopback-only by default. ```bash hooklistener listen stripe-sandbox \ --target http://localhost:3000/webhooks/stripe ``` -------------------------------- ### Create and push an annotated release tag Source: https://github.com/hooklistener/hooklistener-cli/blob/main/CONTRIBUTING.md After verifying the version pull request and required checks, use these commands to create an annotated tag at the merged commit and push it to the remote repository. ```sh version=1.8.0 release_sha= git fetch origin main --tags git merge-base --is-ancestor "${release_sha}" origin/main git tag -a "v${version}" "${release_sha}" -m "Release v${version}" git push origin "refs/tags/v${version}" ``` -------------------------------- ### Create capture-only endpoint Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Generate a temporary endpoint for capturing events without a tunnel. ```bash hooklistener anon create --ttl 3600 ``` -------------------------------- ### Manage tunnel lifecycle and diagnostics Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-authenticated-beta.md Commands for listing, monitoring, and managing tunnel sessions and events. ```text hooklistener tunnel list hooklistener tunnel status hooklistener tunnel events --cursor --follow hooklistener tunnel capture hooklistener tunnel attempt hooklistener tunnel detach --reason "switching machines" hooklistener tunnel stop --reason "deployment complete" ``` -------------------------------- ### Uninstall Hooklistener CLI Source: https://github.com/hooklistener/hooklistener-cli/blob/main/homebrew-tap/README.md Commands to remove the Hooklistener CLI package and untap the repository. ```bash brew uninstall hooklistener brew untap hooklistener/tap ``` -------------------------------- ### Claim a stable name Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-anonymous-routes.md Converts an anonymous route into an authenticated static reservation using the route ID and claim token. This operation is atomic and requires the user to be signed in. ```text hooklistener anon claim --token --org ``` -------------------------------- ### Stream events with listen and tunnel commands Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Long-running commands like listen and tunnel emit newline-delimited JSON events to stdout. ```bash hooklistener --json listen hooklistener --json tunnel --port 3000 hooklistener --json anon tunnel --port 3000 --ttl 900 hooklistener --json tunnel events --cursor --follow ``` -------------------------------- ### Execute non-interactive commands with --json Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Use the --json flag to output command results in JSON format for scripts and CI environments. ```bash hooklistener --json org list hooklistener --json endpoint request hooklistener --json endpoint forward-request \ http://localhost:3000/webhooks --dry-run ``` -------------------------------- ### Conventional commit message format Source: https://github.com/hooklistener/hooklistener-cli/blob/main/CONTRIBUTING.md The standard structure for commit messages, including type, scope, description, and optional body or footer. ```text type(scope): description [optional body] [optional footer] ``` -------------------------------- ### Detach a session Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-anonymous-routes.md Fences an existing connection to allow another CLI to take over the session without closing the route. Use this to hand off sessions between machines. ```text hooklistener tunnel detach --reason "switching machines" ``` -------------------------------- ### Forward captured endpoint request Source: https://github.com/hooklistener/hooklistener-cli/blob/main/docs/tunnel-authenticated-beta.md Forwards a captured request to a local target, keeping the endpoint's configured response public. ```bash hooklistener listen --target http://localhost:3000 ``` -------------------------------- ### Handle runtime errors with JSON envelope Source: https://github.com/hooklistener/hooklistener-cli/blob/main/README.md Runtime errors are returned using a consistent JSON envelope structure. ```json {"$schema":"hooklistener.cli.error/1","schema_version":1,"type":"error","error":{"causes":[],"code":"command_failed","hint":null,"message":"..."},"ok":false} ``` -------------------------------- ### Fixed-width label/value block layout Source: https://github.com/hooklistener/hooklistener-cli/blob/main/DESIGN.md The Label Block Rule requires detail views to use fixed-width alignment for label and value pairs to ensure consistency in terminal environments. ```text ID req_123 METHOD POST STATUS 200 TARGET http://localhost:3000 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.