Skip to content

Commit 1ab1825

Browse files
Consolidate v8 RC changelog into v8.1.0 release (2026-04-07)
Collapse 8.0.0-rc2 section and add entries for hq CLI, agent-friendly conversion CLIs, template directives, comment loading, and bug fixes shipped since rc2. Update README and getting-started docs with CLI mentions, pipx install, hq examples link, and revised roadmap. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5da4887 commit 1ab1825

3 files changed

Lines changed: 31 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
- Nothing yet.
1111

12-
## \[8.0.0\] - rc2
12+
## \[8.1.0\] - 2026-04-07
1313

1414
### Added
1515

1616
- Full architecture overhaul: bidirectional HCL2 ↔ JSON pipeline with typed rule classes. ([#203](https://github.com/amplify-education/python-hcl2/pull/203))
17-
- add function tuples round-trip test suite ([#268](https://github.com/amplify-education/python-hcl2/pull/268))
17+
- Add function tuples round-trip test suite ([#268](https://github.com/amplify-education/python-hcl2/pull/268))
1818
- Add postlexer to support multiline binary operators and ternary expressions ([#270](https://github.com/amplify-education/python-hcl2/pull/270))
19-
- more robust whitespace handling in reconstruction ([#271](https://github.com/amplify-education/python-hcl2/pull/271))
20-
- SerializationOptions - add an option to strip string quotes in dict/JSON output ([#272](https://github.com/amplify-education/python-hcl2/pull/272))
19+
- More robust whitespace handling in reconstruction ([#271](https://github.com/amplify-education/python-hcl2/pull/271))
20+
- SerializationOptions — add an option to strip string quotes in dict/JSON output ([#272](https://github.com/amplify-education/python-hcl2/pull/272))
21+
- `hq` read-only query CLI for HCL2 files ([#277](https://github.com/amplify-education/python-hcl2/pull/277))
22+
- Add `.[]` as jq-compatible alias for `[*]` and document jq interop ([#283](https://github.com/amplify-education/python-hcl2/pull/283))
23+
- Add adjacent comment support to BlockView and AttributeView queries ([#282](https://github.com/amplify-education/python-hcl2/pull/282))
24+
- Refactor for readability and reduced complexity ([#284](https://github.com/amplify-education/python-hcl2/pull/284))
25+
- Agent-friendly conversion CLIs: `hcl2tojson` and `jsontohcl2` ([#274](https://github.com/amplify-education/python-hcl2/pull/274))
26+
- Add template directives support (`%{if}`, `%{for}`) in quoted strings ([#276](https://github.com/amplify-education/python-hcl2/pull/276))
27+
- Support loading comments ([#134](https://github.com/amplify-education/python-hcl2/issues/134))
2128
- CLAUDE.md ([#260](https://github.com/amplify-education/python-hcl2/pull/260))
2229

2330
### Fixed
@@ -34,7 +41,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3441
- Interpolation literals added to locals/variables in maps ([#252](https://github.com/amplify-education/python-hcl2/issues/252))
3542
- Object literal expression can't be serialized ([#253](https://github.com/amplify-education/python-hcl2/issues/253))
3643
- Heredocs should interpret backslash literally ([#262](https://github.com/amplify-education/python-hcl2/issues/262))
37-
- Parsing a multi-line multi-conditional expression causes exception - Unexpected token Token('QMARK', '?') ([#269](https://github.com/amplify-education/python-hcl2/issues/269))
44+
- Parsing a multi-line multi-conditional expression causes exception — Unexpected token Token('QMARK', '?') ([#269](https://github.com/amplify-education/python-hcl2/issues/269))
45+
- Missing space between binary operator and unary operand in reconstruction ([#275](https://github.com/amplify-education/python-hcl2/pull/275))
3846

3947
### Changed
4048

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
# Python HCL2
88

99
A parser for [HCL2](https://github.com/hashicorp/hcl/blob/hcl2/hclsyntax/spec.md) written in Python using
10-
[Lark](https://github.com/lark-parser/lark). This parser only supports HCL2 and isn't backwards compatible
11-
with HCL v1. It can be used to parse any HCL2 config file such as Terraform.
10+
[Lark](https://github.com/lark-parser/lark). It can be used as a Python library or through its CLI tools:
11+
`hcl2tojson`, `jsontohcl2`, and `hq` — a jq-like query tool for HCL files.
12+
Supports HCL2 only (not backwards compatible with HCL v1) and works with any HCL2 config file such as Terraform.
1213

1314
## About Amplify
1415

@@ -33,6 +34,12 @@ This package can be installed using `pip`
3334
pip3 install python-hcl2
3435
```
3536

37+
To install the CLI tools (`hcl2tojson`, `jsontohcl2`, `hq`) globally without affecting your project environments, use [pipx](https://pipx.pypa.io/):
38+
39+
```sh
40+
pipx install python-hcl2
41+
```
42+
3643
### Usage
3744

3845
**HCL2 to Python dict:**
@@ -75,6 +82,7 @@ hcl_string = hcl2.dumps(doc.build())
7582
| [Querying HCL (Python)](docs/02_querying.md) | DocumentView, BlockView, tree walking, view hierarchy |
7683
| [Advanced API](docs/03_advanced_api.md) | Pipeline stages, Builder |
7784
| [hq Reference](docs/04_hq.md) | `hq` CLI — structural queries, hybrid/eval, introspection |
85+
| [hq Examples](docs/05_hq_examples.md) | Real-world queries for discovery, compliance, extraction |
7886

7987
### CLI Tools
8088

@@ -123,13 +131,10 @@ Github actions will take care of publishing it to PyPi.
123131

124132
Planned features, roughly in priority order:
125133

126-
- **Agent-friendly CLIs** — structured errors, NDJSON streaming, and filtering for `hcl2tojson`/`jsontohcl2`
127-
- **Comment deserialization** — preserve comments through JSON round-trip (issue #134)
128-
- **jq syntax compatibility**`.[]` as alias for `[*]`; canonical `hq --json | jq` patterns for data transforms
129134
- **MCP server** — expose parsing, querying, and formatting as MCP tools for AI agents
130-
- **Canonical formatting**predictable whitespace output, closer to `terraform fmt`
135+
- **Predictable formatting**source-derived formatting heuristics and stable whitespace defaults
131136
- **In-place tree edits**`hq set`, `hq delete` for programmatic HCL modification
132-
- **Comment reserialization** — comments survive tree edits, not just JSON round-trips
137+
- **Comment deserialization** — comments survive JSON round-trips and tree edits
133138
- **Expression intelligence** — variable reference tracking, unused variable detection, cross-file analysis
134139
- **Refactoring operations**`hq rename`, `hq extract-module`, `hq sort` for high-level code transforms
135140

docs/01_getting_started.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ python-hcl2 requires Python 3.8 or higher.
1010
pip install python-hcl2
1111
```
1212

13+
For the CLI tools only (`hcl2tojson`, `jsontohcl2`, `hq`), [pipx](https://pipx.pypa.io/) installs them globally in an isolated environment:
14+
15+
```sh
16+
pipx install python-hcl2
17+
```
18+
1319
## Quick Reference
1420

1521
| Function | Description |

0 commit comments

Comments
 (0)