// SPDX-License-Identifier: CC-BY-SA-4.0
= A2ML CLI (Prototype)

This CLI is a lightweight wrapper around the ReScript prototype parser.

== Commands

* `render <file>` — render HTML to stdout
* `validate <file>` — validate (checked mode) and exit with status 2 on errors
* `ast <file>` — output JSON surface AST

== Options

* `--mode lax|checked` (default: lax)
* `--out <path>` to write output to a file
* `--concat` to join output when multiple inputs are provided
* `--stdin` to read from stdin (equivalent to `-`)
* `-h, --help` show help

== Run

[source,bash]
----
just cli render tests/vectors/module0-basic.a2ml
just cli validate tests/vectors/module0-basic.a2ml
just cli ast tests/vectors/module0-basic.a2ml --out /tmp/ast.json
cat tests/vectors/module0-basic.a2ml | just cli render - --stdin
just cli render tests/vectors/inline-edges.a2ml tests/vectors/inline-formatting.a2ml --concat
----

== Exit Codes

* `0` success
* `2` validation errors

== Man Page

* `docs/a2ml.1`
