Query
Run raw TQL against the current app. Two ways:
(a) Inline JSON from $ARGUMENTS — pipe it to tdq query -:
echo '$ARGUMENTS' | tdq query -
(b) JSON file path — pass the path directly:
tdq query $ARGUMENTS
Pick (b) if $ARGUMENTS looks like a file path, else (a).
Writing the TQL
Before writing the JSON, read skills/analytics/tql/index.md in this plugin to route to the right sub-reference (filters, aggregators, intervals, funnel, retention, recipes, etc.). Do not try to recall TQL syntax from memory — the progressive-disclosure tree is there for a reason.
Rules that always apply:
- Set
"filter": { "__auto_app_and_test_mode_filter__": true }unless you need a custom filter (in which case include theappID+isTestMode=falseselectors yourself). - Every query needs
queryTypeandgranularity. - Prefer
userCount/thetaSketchover deprecatedcardinality.
If the user's first query returns (no rows), re-run with --raw to see whether the result is genuinely empty or the parser dropped it:
tdq query /tmp/q.json --raw 2>/tmp/raw.json