You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hq handles structural HCL navigation (blocks, labels, type filters, predicates). For data transforms on the results, pipe `--json` or `--ndjson` output to jq:
**Mental model:** hq navigates HCL structure (block types, labels, attributes, nesting). Once you have `--json` output, you're in jq's world — use jq for arithmetic, string transforms, reshaping, defaults, and aggregation.
637
+
638
+
## Coming from jq
639
+
640
+
| jq | hq equivalent | Notes |
641
+
|---|---|---|
642
+
|`.key`|`.key`| Same syntax |
643
+
|`.[]`|`.[]` or `[*]`|`.[]` is an alias for `[*]`|
644
+
|`.[N]`|`[N]`| Zero-based index |
645
+
|`select(.x == "y")`|`[select(.x == "y")]`| Bracket or pipe syntax |
0 commit comments