# CLI telemetry preferences (/docs/telemetry)

The CLI collects pseudonymous usage telemetry by default and sends it to
hypequery's first-party ingest endpoint (`https://hypequery.com/api/telemetry`).
Events never contain code, SQL, names, paths or credentials; the event reference
below lists every field. To audit locally, set `HYPEQUERY_TELEMETRY_DEBUG=1`:
valid event envelopes are printed to stderr and nothing is sent. Set
`HYPEQUERY_TELEMETRY_URL` to send to a staging or self-hosted first-party
endpoint instead. Opt-outs apply in every mode.

```bash
hypequery telemetry status
hypequery telemetry disable
hypequery telemetry enable
```

`status` (also the default action) prints the effective preference, the setting
that determined it, and a random install ID. Saving `enable` does not override
environment variables or the global flag.

To disable for one invocation, pass `--no-telemetry` before or after the command,
or set `DO_NOT_TRACK=1` or `HYPEQUERY_TELEMETRY_DISABLED=1`. These take precedence
over saved preferences. Test environments and hypequery's own CI also disable
telemetry; customer CI follows the saved preference, which defaults to enabled.

Settings are stored in `telemetry.json` in the CLI config directory. They contain
the preference, a random install ID, a schema version, and an optional notice
timestamp reserved for the first-run notice. The install ID is generated randomly,
not from hardware, a username, or a hostname. Corrupt or unavailable settings
disable telemetry for that run. A failed explicit save reports an error so you
can use an environment variable or the flag instead.

The [Python CLI](/docs/python/cli#hypequery-telemetry) reads and writes the same
`telemetry.json`, so both CLIs share one install ID, one notice and one saved
preference. It keeps its own kill-switch list under `disabled_python_cli_versions`.

See the [CLI reference](/docs/reference/api/cli#hypequery-telemetry) for precedence
and config-directory details. The event reference is below;
data-handling policy will be documented before default collection is released.

## Delivery and debugging [#delivery-and-debugging]

```bash
HYPEQUERY_TELEMETRY_DEBUG=1 hypequery --version
HYPEQUERY_TELEMETRY_DEBUG=1 hypequery init --no-telemetry # Prints no events
```

Debug output contains the exact validated event envelopes, including their
timestamps and the transport-owned `$process_person_profile: false` and
`$geoip_disable: true` properties. Invalid events are dropped with a fixed
diagnostic that does not echo rejected input. All telemetry output uses stderr.

Delivery uses one in-memory batch per invocation with a 64 KiB /
32-event cap. At exit the CLI writes the batch to a private temporary file and
starts a detached Node process that sends it in one built-in HTTP(S) request
with a 5-second timeout, so delivery never delays the command. The sender
deletes the file before sending. Unsent events are dropped; there is no retry
or persistent queue. Only HTTPS endpoints and HTTP loopback
test endpoints are accepted; URLs with credentials, query strings or fragments
are rejected, and redirects are refused. The first-party proxy holds the real
PostHog API key and must remove client IP information before forwarding.

HTTP 410 from the proxy disables the current CLI version in local settings,
best-effort. Later versions remain eligible; `telemetry status` reports
`kill_switch` when it applies. A read-only config cannot persist the response.

The disclosure appears once on enabled interactive runs, after a successful
stderr write. It is suppressed in CI, on non-TTY streams, during preference
commands, and under MCP.

Known command failures reach the bounded exit flush. Dev shutdown flushes after
runtime teardown, and SIGINT/SIGTERM endings are classified as interrupted.
Crash events use Node's exception monitor so native fatal-error output and exit
behavior are preserved; network delivery during a fatal crash is best-effort.

`init` adds onboarding progress to its single command completion
event: the furthest stage reached, the failing stage on errors, connection results,
scaffold and authentication choices, bucketed schema/dataset counts, and whether
configuration files were created, updated, unchanged, or skipped. Declining setup
is recorded as cancellation. Connection retries share the same invocation and
produce one completion event. Table selections are recorded only as a selection
mode; table names, connection details, and output paths are never included.

Generation commands report bucketed counts from the schema they already
introspect. Type fallbacks are reduced to built-in family names (or `unknown`),
including unsupported fragments inside supported wrappers. Dataset generation
records write/check/diff modes, read-only check outcomes, and counts of known
tenant-scaffolding warnings. Manifest generation counts already loaded registry
entries and generated routes. Schema names, full type expressions, warning text,
and manifest contents are excluded, and telemetry adds no database queries.

## Event reference [#event-reference]

Schema version: **1**. Unless opted out, the CLI sends command/crash lifecycle events, init and generation metrics, and dev/MCP session events to the first-party ingest proxy; debug mode prints them instead. Cloud command and project-feature instrumentation follows separately.

Unknown events, properties, record keys, flag names, enum values, and malformed identities or versions are rejected. No argument values, paths, names, SQL, messages, stacks, hosts, tenants, or credentials are permitted.

Counts use inclusive integer ranges: 0, 1, 2–5, 6–20, 21–100, and 101 or more. Duration and nonzero size buckets include their lower bound and exclude their upper bound. Raw counts, durations, ports and byte sizes are never sent.

### Common properties [#common-properties]

Every event includes these fields. Unknown environment details use the documented unknown value; unavailable optional fields are omitted.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `schema_version` | Required | `1` | Which event contract does this payload use? |
| `cli_version` | Required | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Which CLI releases are in use? |
| `node_version` | Required | Numeric major.minor (1–3 digits per component), or `unknown` | Which Node major.minor releases need support? |
| `os` | Required | `darwin`, `linux`, `win32`, `aix`, `freebsd`, `openbsd`, `sunos`, `android`, `unknown` | Which operating systems need support? |
| `arch` | Required | `arm`, `arm64`, `ia32`, `x64`, `loong64`, `mips`, `mipsel`, `ppc`, `ppc64`, `riscv64`, `s390`, `s390x`, `unknown` | Which CPU architectures need support? |
| `is_ci` | Required | `true`, `false` | How much usage happens in CI? |
| `ci_name` | Required | `none`, `github_actions`, `gitlab`, `circleci`, `buildkite`, `jenkins`, `vercel`, `netlify`, `azure`, `bitbucket`, `teamcity`, `travis`, `codebuild`, `unknown` | Which CI providers need support? |
| `is_tty` | Required | `true`, `false` | How much usage is interactive? |
| `is_docker` | Required | `true`, `false` | How much usage runs in containers? |
| `is_wsl` | Required | `true`, `false` | How much usage runs in WSL? |
| `package_manager` | Required | `npm`, `pnpm`, `yarn`, `bun`, `unknown` | Which package managers need support? |
| `package_manager_major` | Optional | Numeric major (1–3 digits), or `unknown` | Which package-manager major releases need support? |
| `invoked_via` | Required | `npx`, `pnpm_dlx`, `bunx`, `global`, `local_bin`, `unknown` | How is the CLI invoked? |
| `install_id` | Required | Random UUID v4 (36 characters) | Count active installations without hardware or account identifiers. |
| `project_id` | Optional | 64 lowercase hexadecimal characters (salted SHA-256) | Count active projects across installations; omit when no signal exists. |
| `session_id` | Required | Random UUID v4 (36 characters) | Group events from the same invocation. |
| `is_first_run` | Required | `true`, `false` | How many installations are new? |
| `hypequery_packages` | Optional | Object with only the documented keys below | Which toolkit packages and exact versions are adopted? No project dependencies or names. |
| `hypequery_packages.@hypequery/clickhouse` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/datasets` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/serve` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/react` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/cli` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/mcp` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/protocol` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/protocol-conformance` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `hypequery_packages.@hypequery/deployment` | Optional | Exact major.minor.patch (1–3 digits per component); optional canary/alpha/beta/rc/dev/snapshot suffix with 1–14 digit numeric components, or `unknown`; at most 80 characters | Installed exact release version, or unknown. |
| `database` | Required | `clickhouse`, `chdb`, `bigquery`, `unknown` | Which database backends merit investment? |

### `cli_command_completed` [#cli_command_completed]

Measure command adoption, onboarding drop-off and release reliability. Exactly once per invocation; never emit for telemetry disable.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `command` | Required | `init`, `dev`, `mcp`, `generate`, `generate:types`, `generate:datasets`, `generate:manifest`, `generate:client`, `export:client-contract`, `login`, `logout`, `deploy`, `deployment:build`, `deployment:validate`, `deployment:release`, `deployment:submit`, `deployment:status`, `pull`, `diff`, `help`, `version`, `telemetry`, `skill`, `examples`, `create`, `schema`, `onboard`, `cloud-operation`, `unknown` | Which known command was requested? Raw unknown input is never retained. |
| `flags_used` | Required | Unique list of: `--path`, `--style`, `--database`, `--chdb-path`, `--auth`, `--all-tables`, `--tables`, `--exclude-tables`, `--no-example`, `--no-interactive`, `--force`, `--skip-connection`, `--port`, `--hostname`, `--no-watch`, `--no-cache`, `--cache`, `--redis-url`, `--open`, `--cors`, `--quiet`, `--tenant`, `--self-test`, `--url`, `--client-contract-url`, `--http`, `--host`, `--allowed-hosts`, `--allowed-origins`, `--resource`, `--authorization-servers`, `--required-scopes`, `--output`, `--tenant-column`, `--check`, `--diff`, `--cloud`, `--project`, `--environment`, `--endpoint`, `--stdout`, `--cloud-url`, `--device`, `--capabilities`, `--bundle-output`, `--release-output`, `--no-source`, `--replace-restored`, `--take-ownership`, `--mcp-config`, `--draft`, `--client`, `--release`, `--agent`, `--scope`, `--kind`, `--yes`, `--dir`, `--no-install`, `--no-seed`, `--tag`, `--databases`, `--samples`, `--no-query-history`, `--join`, `--input-json`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version` | Which documented flags are adopted? Canonical names only, never values. |
| `outcome` | Required | `success`, `failure`, `cancelled`, `interrupted` | Which commands fail, succeed or are aborted? |
| `duration_bucket` | Required | `<100ms`, `100ms-1s`, `1s-10s`, `10s-1m`, `1m-10m`, `10m-1h`, `1h+` | Which commands need performance work? |
| `error_code` | Optional | `unknown`, `connection_failed`, `auth_failed`, `entrypoint_not_found`, `compile_error`, `prompt_cancelled`, `validation_failed`, `cloud_network_error`, `cloud_rejected`, `not_installed`, `engine_error`, `no_tables`, `no_datasets`, `tenant_required`, `load_error`, `output_missing`, `output_out_of_date`, `unknown_command`, `unknown_option` | Which known failures need reliability work? |

#### `cli_command_completed`: `init` [#cli_command_completed-init]

Allowed `flags_used`: `--path`, `--style`, `--database`, `--chdb-path`, `--auth`, `--all-tables`, `--tables`, `--exclude-tables`, `--no-example`, `--no-interactive`, `--force`, `--skip-connection`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `stage_reached` | Optional | `started`, `database_selected`, `connection_tested`, `style_selected`, `files_written`, `dependencies_installed`, `completed` | Where does onboarding stop? |
| `failed_stage` | Optional | `started`, `database_selected`, `connection_tested`, `style_selected`, `files_written`, `dependencies_installed`, `completed` | Which onboarding stage needs reliability work? |
| `style` | Optional | `queries`, `datasets` | Which scaffold style is adopted? |
| `auth` | Optional | `none`, `context` | Is context authentication adopted? |
| `interactive` | Optional | `true`, `false` | How much onboarding is interactive? |
| `force` | Optional | `true`, `false` | How often are scaffold files overwritten? |
| `example` | Optional | `true`, `false` | Are example queries requested? |
| `skip_connection` | Optional | `true`, `false` | Are offline scaffolds used? |
| `connection_result` | Optional | `ok`, `failed`, `skipped` | Where does connection setup fail? |
| `chdb_failure_reason` | Optional | `not_installed`, `engine_error` | Does embedded onboarding fail at installation or execution? |
| `table_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How large are onboarding schemas? |
| `datasets_generated_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many datasets are scaffolded? |
| `table_selection` | Optional | `all`, `list`, `exclude`, `prompt` | Which table-selection workflows are used? |
| `env_file` | Optional | `created`, `updated`, `unchanged`, `skipped` | Does onboarding create or update environment config? |
| `gitignore` | Optional | `created`, `updated`, `unchanged`, `skipped` | Does onboarding create or update ignore config? |
| `package_json_present` | Optional | `true`, `false` | Does onboarding start in an existing project? |
| `analytics_directory_present` | Optional | `true`, `false` | Does onboarding reuse an analytics directory? |

#### `cli_command_completed`: `dev` [#cli_command_completed-dev]

Allowed `flags_used`: `--port`, `--hostname`, `--no-watch`, `--no-cache`, `--cache`, `--redis-url`, `--open`, `--cors`, `--path`, `--quiet`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `mcp` [#cli_command_completed-mcp]

Allowed `flags_used`: `--path`, `--tenant`, `--self-test`, `--url`, `--client-contract-url`, `--http`, `--port`, `--host`, `--allowed-hosts`, `--allowed-origins`, `--resource`, `--authorization-servers`, `--required-scopes`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `mode` | Optional | `self_test`, `serve` | Is MCP used for validation or serving? |
| `hosted` | Optional | `true`, `false` | Is MCP self-test targeting a hosted endpoint? |
| `http_backend` | Optional | `true`, `false` | Is MCP using an authorized HTTP client contract? Never its URL or principal. |
| `dataset_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many datasets are exposed to agents? |
| `tenant_used` | Optional | `true`, `false` | Is a trusted tenant supplied? Never its value. |
| `tenant_dataset_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many datasets require tenant scope? |

#### `cli_command_completed`: `generate` [#cli_command_completed-generate]

Allowed `flags_used`: `--output`, `--path`, `--tables`, `--database`, `--chdb-path`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `chdb_path_given` | Optional | `true`, `false` | Is persistent embedded ClickHouse adopted? |
| `tables_filter_used` | Optional | `true`, `false` | Are targeted type-generation workflows used? |
| `table_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How large are introspected schemas? |
| `column_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many columns need type generation? |
| `unsupported_type_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How often does type mapping need improvement? |
| `unsupported_type_families` | Optional | Unique list of: `AggregateFunction`, `SimpleAggregateFunction`, `Variant`, `Dynamic`, `Object`, `JSON`, `Nested`, `Tuple`, `Map`, `Array`, `Nullable`, `LowCardinality`, `Decimal`, `Enum`, `DateTime`, `DateTime64`, `unknown` | Which built-in type families need mapping? Never full type expressions. |
| `custom_output` | Optional | `true`, `false` | Was a custom output location supplied? Never the path. |

#### `cli_command_completed`: `generate:types` [#cli_command_completed-generatetypes]

Allowed `flags_used`: `--output`, `--path`, `--tables`, `--database`, `--chdb-path`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `chdb_path_given` | Optional | `true`, `false` | Is persistent embedded ClickHouse adopted? |
| `tables_filter_used` | Optional | `true`, `false` | Are targeted type-generation workflows used? |
| `table_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How large are introspected schemas? |
| `column_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many columns need type generation? |
| `unsupported_type_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How often does type mapping need improvement? |
| `unsupported_type_families` | Optional | Unique list of: `AggregateFunction`, `SimpleAggregateFunction`, `Variant`, `Dynamic`, `Object`, `JSON`, `Nested`, `Tuple`, `Map`, `Array`, `Nullable`, `LowCardinality`, `Decimal`, `Enum`, `DateTime`, `DateTime64`, `unknown` | Which built-in type families need mapping? Never full type expressions. |
| `custom_output` | Optional | `true`, `false` | Was a custom output location supplied? Never the path. |

#### `cli_command_completed`: `generate:datasets` [#cli_command_completed-generatedatasets]

Allowed `flags_used`: `--output`, `--path`, `--tables`, `--exclude-tables`, `--tenant-column`, `--force`, `--check`, `--diff`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `mode` | Optional | `write`, `check`, `diff` | Are datasets generated locally or checked in CI? |
| `check_result` | Optional | `up_to_date`, `out_of_date`, `missing` | Does CI find stale dataset definitions? |
| `force` | Optional | `true`, `false` | Are existing definitions replaced? |
| `tenant_column_used` | Optional | `true`, `false` | Is tenant isolation explicitly scaffolded? Never the column. |
| `tables_filter_used` | Optional | `true`, `false` | Is include filtering adopted? |
| `exclude_filter_used` | Optional | `true`, `false` | Is exclude filtering adopted? |
| `datasets_generated_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many dataset definitions are generated? |
| `warning_counts` | Optional | Object with only the documented keys below | Which tenant-scaffolding warnings need improvement? |
| `warning_counts.tenant-key-candidate` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed warning occurrences. |
| `warning_counts.tenant-column-missing` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed warning occurrences. |

#### `cli_command_completed`: `generate:client` [#cli_command_completed-generateclient]

Allowed `flags_used`: `--output`, `--check`, `--force`, `--cloud`, `--project`, `--environment`, `--endpoint`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `mode` | Optional | `write`, `check` | Are client types generated or checked in CI? |
| `check_result` | Optional | `up_to_date`, `out_of_date`, `missing` | Does CI find stale client types? |
| `force` | Optional | `true`, `false` | Are generated client types replaced? |
| `custom_output` | Optional | `true`, `false` | Was a custom output location supplied? Never the path. |
| `endpoint_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many public endpoints need client types? |

#### `cli_command_completed`: `generate:manifest` [#cli_command_completed-generatemanifest]

Allowed `flags_used`: `--output`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `query_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How much query-based React integration is adopted? |
| `endpoint_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How much endpoint-based React integration is adopted? |
| `custom_output` | Optional | `true`, `false` | Was a custom output location supplied? Never the path. |

#### `cli_command_completed`: `examples` [#cli_command_completed-examples]

Allowed `flags_used`: `--kind`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `kind_filter` | Optional | `example`, `recipe`, `guide` | Which registry kinds are browsed? |
| `output` | Optional | `table`, `json` | Is the registry read by people or by tools? |
| `entry_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many registry entries are listed? |

#### `cli_command_completed`: `create` [#cli_command_completed-create]

Allowed `flags_used`: `--yes`, `--dir`, `--no-install`, `--no-seed`, `--tag`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `example_slug` | Optional | `async-inserts-node`, `chdb-embedded-analytics`, `clickhouse-docker-compose`, `clickhouse-rest-api-openapi`, `clickhouse-vs-postgres-app-analytics`, `cursor-pagination`, `dictionary-lookups`, `django-analytics`, `fastapi-analytics-api`, `funnel-windowfunnel`, `grouparray-user-timelines`, `in-app-analytics-agent`, `iso-week-bucketing`, `materialized-view-rollups`, `mcp-agent-analytics`, `mcp-agent-analytics-python`, `multi-tenant-embedded-analytics`, `multiif-bucketing`, `nextjs-dashboard`, `p95-latency`, `postgres-app-clickhouse-analytics`, `projection-for-dataset-queries`, `refreshable-materialized-views`, `replacingmergetree-upserts`, `retention-cohorts`, `sessionization`, `streamlit-dashboard`, `top-n-per-group-limit-by`, `ttl-data-retention`, `usage-based-billing`, `other` | Which public registry entries are scaffolded? Input that names no registry entry becomes other. |
| `example_kind` | Optional | `example`, `recipe`, `guide` | Are examples, recipes or guides requested? |
| `language` | Optional | `typescript`, `python`, `unknown` | Which language are scaffolded examples written in? |
| `stage_reached` | Optional | `started`, `resolved`, `fetched`, `pinned`, `installed`, `completed` | Where does scaffolding stop? |
| `failed_stage` | Optional | `started`, `resolved`, `fetched`, `pinned`, `installed`, `completed` | Which scaffolding stage needs reliability work? |
| `seed` | Optional | `true`, `false` | Is the shared seed dataset copied? |
| `install_result` | Optional | `ok`, `failed`, `skipped` | Does dependency installation succeed after scaffolding? Python examples, installed later with uv sync, report skipped. |
| `unpublished_pins` | Optional | `true`, `false` | Did a dependency of the scaffold fall back to a dist-tag because its recorded version is not on npm? |
| `interactive` | Optional | `true`, `false` | How much scaffolding is interactive? |

#### `cli_command_completed`: `export:client-contract` [#cli_command_completed-exportclient-contract]

Allowed `flags_used`: `--output`, `--stdout`, `--check`, `--force`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `login` [#cli_command_completed-login]

Allowed `flags_used`: `--cloud-url`, `--environment`, `--device`, `--project`, `--capabilities`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `logout` [#cli_command_completed-logout]

Allowed `flags_used`: `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `deploy` [#cli_command_completed-deploy]

Allowed `flags_used`: `--bundle-output`, `--release-output`, `--project`, `--environment`, `--no-source`, `--endpoint`, `--replace-restored`, `--take-ownership`, `--mcp-config`, `--draft`, `--client`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `deployment:build` [#cli_command_completed-deploymentbuild]

Allowed `flags_used`: `--bundle-output`, `--no-source`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `deployment:validate` [#cli_command_completed-deploymentvalidate]

Allowed `flags_used`: `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `deployment:release` [#cli_command_completed-deploymentrelease]

Allowed `flags_used`: `--project`, `--environment`, `--output`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `deployment:submit` [#cli_command_completed-deploymentsubmit]

Allowed `flags_used`: `--release`, `--endpoint`, `--replace-restored`, `--take-ownership`, `--draft`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `deployment:status` [#cli_command_completed-deploymentstatus]

Allowed `flags_used`: `--project`, `--environment`, `--endpoint`, `--mcp-config`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `pull` [#cli_command_completed-pull]

Allowed `flags_used`: `--output`, `--project`, `--environment`, `--endpoint`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `diff` [#cli_command_completed-diff]

Allowed `flags_used`: `--project`, `--environment`, `--endpoint`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `version` [#cli_command_completed-version]

Allowed `flags_used`: `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `telemetry` [#cli_command_completed-telemetry]

Allowed `flags_used`: `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `skill` [#cli_command_completed-skill]

Allowed `flags_used`: `--agent`, `--scope`, `--force`, `--check`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `schema` [#cli_command_completed-schema]

Allowed `flags_used`: `--databases`, `--tables`, `--samples`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `onboard` [#cli_command_completed-onboard]

Allowed `flags_used`: `--databases`, `--tables`, `--samples`, `--no-query-history`, `--join`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `cloud-operation` [#cli_command_completed-cloud-operation]

Allowed `flags_used`: `--project`, `--yes`, `--input-json`, `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

No additional properties.

#### `cli_command_completed`: `unknown` [#cli_command_completed-unknown]

Allowed `flags_used`: `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `suggested_command` | Optional | `init`, `dev`, `mcp`, `generate`, `generate:types`, `generate:datasets`, `generate:manifest`, `generate:client`, `export:client-contract`, `login`, `logout`, `deploy`, `deployment:build`, `deployment:validate`, `deployment:release`, `deployment:submit`, `deployment:status`, `pull`, `diff`, `help`, `version`, `telemetry`, `skill`, `examples`, `create`, `schema`, `onboard`, `cloud-operation` | Which command was a mistyped invocation closest to? Only the CLI's own suggestion, never the raw input. |

#### `cli_command_completed`: `help` [#cli_command_completed-help]

Allowed `flags_used`: `--no-telemetry`, `--json`, `--no-input`, `--help`, `--version`. The two type-generation aliases remain distinct command values.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `help_topic` | Optional | `root`, `init`, `dev`, `mcp`, `generate`, `generate:types`, `generate:datasets`, `generate:manifest`, `generate:client`, `export:client-contract`, `login`, `logout`, `deploy`, `deployment:build`, `deployment:validate`, `deployment:release`, `deployment:submit`, `deployment:status`, `pull`, `diff`, `help`, `version`, `telemetry`, `skill`, `examples`, `create`, `schema`, `onboard`, `cloud-operation`, `unknown` | Which command help needs improvement? Unknown input becomes unknown. |

### `cli_session_started` [#cli_session_started]

Measure development-server and MCP session configuration; never emit on every reload or request.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `command` | Required | `dev`, `mcp` | Which long-running command starts? |

#### `cli_session_started`: `dev` [#cli_session_started-dev]

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `entry_type` | Required | `hypequery.ts`, `api.ts`, `queries.ts`, `explicit_file`, `unknown` | Which entrypoint convention is used? Never the path. |
| `watch` | Required | `true`, `false` | Is file watching used? |
| `cache_provider` | Required | `none`, `memory`, `redis`, `unknown` | Which cache providers are adopted? |
| `cors` | Required | `true`, `false` | Is cross-origin development adopted? |
| `open` | Required | `true`, `false` | Is the browser opened automatically? |
| `custom_port` | Required | `true`, `false` | Is a non-default port selected? Never its number or hostname. |
| `quiet` | Required | `true`, `false` | Is quiet startup adopted? |

#### `cli_session_started`: `mcp` [#cli_session_started-mcp]

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `entry_type` | Optional | `hypequery.ts`, `api.ts`, `queries.ts`, `explicit_file`, `unknown` | Which entrypoint convention is used? Never the path. |
| `http_backend` | Optional | `true`, `false` | Is MCP using an authorized HTTP client contract? Never its URL or principal. |
| `mode` | Required | `self_test`, `serve` | Is MCP serving or validating? |
| `dataset_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many local datasets are exposed to agents? Omit for HTTP contracts. |
| `tenant_used` | Required | `true`, `false` | Is tenant scope supplied? Never its value. |
| `tenant_dataset_count_bucket` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How many local datasets require tenant scope? Omit for HTTP contracts. |

### `cli_session_ended` [#cli_session_ended]

Measure session duration and aggregated usage on shutdown, without individual requests or tool arguments.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `command` | Required | `dev`, `mcp` | Which long-running command ends? |
| `outcome` | Required | `success`, `failure`, `cancelled`, `interrupted` | How did the session end? |
| `duration_bucket` | Required | `<100ms`, `100ms-1s`, `1s-10s`, `10s-1m`, `1m-10m`, `10m-1h`, `1h+` | How long are development and agent sessions? |

#### `cli_session_ended`: `dev` [#cli_session_ended-dev]

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `reload_count_bucket` | Required | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How heavily is hot reload used? |
| `reload_error_count_bucket` | Required | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How often does hot reload fail? |
| `load_failures` | Required | Object with only the documented keys below | Which load failures need reliability work? |
| `load_failures.unknown` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.connection_failed` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.auth_failed` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.entrypoint_not_found` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.compile_error` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.prompt_cancelled` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.validation_failed` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.cloud_network_error` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.cloud_rejected` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.not_installed` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.engine_error` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.no_tables` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.no_datasets` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.tenant_required` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.load_error` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.output_missing` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.output_out_of_date` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.unknown_command` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |
| `load_failures.unknown_option` | Optional | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed failures by stable code. |

#### `cli_session_ended`: `mcp` [#cli_session_ended-mcp]

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `tool_call_counts` | Required | Object with only the documented keys below | Which MCP tool kinds are adopted? No names or arguments. |
| `tool_call_counts.list` | Required | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed calls by built-in tool kind. |
| `tool_call_counts.describe` | Required | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed calls by built-in tool kind. |
| `tool_call_counts.query` | Required | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | Bucketed calls by built-in tool kind. |
| `error_count_bucket` | Required | `0`, `1`, `2-5`, `6-20`, `21-100`, `101+` | How often do MCP sessions encounter errors? |

### `cli_crash` [#cli_crash]

Measure uncaught failures by stable class and code, with no messages or stacks.

| Property | Presence | Allowed values | Question answered |
| --- | --- | --- | --- |
| `command` | Required | `init`, `dev`, `mcp`, `generate`, `generate:types`, `generate:datasets`, `generate:manifest`, `generate:client`, `export:client-contract`, `login`, `logout`, `deploy`, `deployment:build`, `deployment:validate`, `deployment:release`, `deployment:submit`, `deployment:status`, `pull`, `diff`, `help`, `version`, `telemetry`, `skill`, `examples`, `create`, `schema`, `onboard`, `cloud-operation`, `unknown` | Which command crashed? |
| `exception_class` | Required | `Error`, `TypeError`, `RangeError`, `SyntaxError`, `ReferenceError`, `URIError`, `EvalError`, `AggregateError`, `unknown` | Which built-in exception classes need investigation? |
| `error_code` | Required | `unknown`, `connection_failed`, `auth_failed`, `entrypoint_not_found`, `compile_error`, `prompt_cancelled`, `validation_failed`, `cloud_network_error`, `cloud_rejected`, `not_installed`, `engine_error`, `no_tables`, `no_datasets`, `tenant_required`, `load_error`, `output_missing`, `output_out_of_date`, `unknown_command`, `unknown_option` | Which known failure caused the crash? |

MCP client identity/version is excluded from v1 pending the privacy decision. Auth strategies are recorded only as none/configured/unknown, since user-supplied functions have no safe built-in type identifier.

Cache scopes are classified only as unscoped/tenant/explicit/unknown from configuration presence. Explicit scopes are user content and are never read into a payload.

Project IDs follow HQ-233: the CLI uses the shared global salt, then the ingest proxy re-keys the digest with a server-side HMAC secret before storage. A hash is a pseudonymous project signal, not proof of anonymity. Cloud accounts are never linked to install IDs.