From f6d9817bade76cb948e3b8ceba4fd569309ba0db Mon Sep 17 00:00:00 2001 From: Warren Lee <5959690+wrn14897@users.noreply.github.com> Date: Fri, 17 Apr 2026 12:14:53 -0700 Subject: [PATCH] chore(cli): add changeset and fix knip unused-export warning - Add minor changeset for hdx query / hdx connections / --patterns. - Revert ConnectionResponse to a non-exported interface; knip flagged it as an unused export and the type isn't consumed outside client.ts. --- .changeset/cli-query-connections-patterns.md | 10 ++++++++++ packages/cli/src/api/client.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/cli-query-connections-patterns.md diff --git a/.changeset/cli-query-connections-patterns.md b/.changeset/cli-query-connections-patterns.md new file mode 100644 index 00000000..2c7cfab2 --- /dev/null +++ b/.changeset/cli-query-connections-patterns.md @@ -0,0 +1,10 @@ +--- +"@hyperdx/cli": minor +--- + +Add `hdx query` and `hdx connections` commands for agentic ClickHouse workflows: + +- **`hdx connections`** — list ClickHouse connections (`id`, `name`, `host`) for the authenticated team. Supports `--json` for programmatic consumption. +- **`hdx query --connection-id --sql `** — run raw SQL against a configured ClickHouse connection via the `/clickhouse-proxy`. Default `--format` is `JSONEachRow` (NDJSON); any ClickHouse format is accepted. Exit codes: `0` on success (empty stdout = zero rows), `1` on failure. On error, a lazy connection lookup distinguishes "unknown connection ID" from "bad SQL". +- **`hdx query --patterns`** — post-process the result with the Drain algorithm (`@hyperdx/common-utils/dist/drain`) and emit one NDJSON pattern object per cluster, sorted by count desc: `{"pattern":"