docs/CLI.md
Leveonas CLI Reference
Command-line flags and usage examples for check, format, compile, serve, inspect, and benchmark.
The Leveonas Command Line Interface (leveonas) provides developer tools for checking, formatting, compiling, verifying, self-hosting, inspecting, auditing, and benchmarking LM codebases.
Usage
leveonas <command> [options] [files...]Global Options
--help,-h: Show usage information.--version,-v: Output current Leveonas version (leveonas v0.6.0).--json: Emit machine-readable JSON.--quiet,-q: Suppress informational output.
Commands
leveonas check <files...>
Validates LM documents offline for syntax validity, duplicate DOM IDs, unresolved reactive dependencies, unknown elements, and unclosed delimiters.
leveonas check app.lm
leveonas check app.lm --streaming
leveonas check src/**/*.lm --quietleveonas format <files...>
Formats LM files deterministically into canonical tag(attr(value) child) style.
leveonas format app.lm --write
leveonas format app.lm --check
leveonas format app.lm --tab-size=2 --writeleveonas compile [<file> | -]
Compiles LM files, piped stdin (-), interactive paste input (--paste), or inline --code="..." across all 48 targets via Leveonas Server (https://leveonas.ainot.site or --server=http://127.0.0.1:4321).
--framework=<name>: Override language/framework dialect (e.g.react,nextjs,vue,html,python).--target=<artifact>: Select output artifact format:code(default),document,ui-ir,ast,runtime-ir, orpatch.
# Compile to actual target code (React TSX, Vue SFC, Svelte, Angular TS, HTML, Python, SQL)
leveonas compile app.lm --framework=react --target=code
# Compile to full HTML5 document (<head> / <style> / <body> / <script>)
leveonas compile app.lm --document
# Inspect Common UI IR JSON output
leveonas compile app.lm --target=ui-ir --output=out.json
# Pipe LM from stdin cleanly (bash / PowerShell)
echo "<REACT>component(App)(state(n, 0) bo(oc(n++) +1))</REACT>" | leveonas compile -
# Paste LM interactively or compile against local `leveonas serve`
leveonas paste --server=http://127.0.0.1:4321leveonas verify [<files...> | -]
Verifies compiled framework code (or LM with --compile) via POST /api/verify.
leveonas verify src/App.tsx --lang=react
leveonas verify app.lm --compileleveonas serve
Starts a standalone local Leveonas Compiler HTTP Server (POST /api/compile, POST /api/validate, POST /api/verify, POST /api/patch, POST /v1/chat/completions, GET /health).
leveonas key create --name="VPC Compiler"
leveonas serve --port=4321 --host=127.0.0.1leveonas inspect <file>
Performs offline multi-stage inspection of Reactivity Graphs, State nodes, Computed expressions, DOM dependencies, and Symbol trees.
leveonas inspect app.lm
leveonas inspect app.lm --jsonleveonas audit <files...>
Audits LM source files offline for unsafe URLs, inline event handlers, and security policy violations (exits with code 3 on findings).
leveonas audit app.lm --jsonleveonas benchmark
Executes paired A/B benchmarks comparing standard native code generation against Leveonas LM generation across providers and frameworks.
leveonas benchmark --framework=react --scenario=scenario_a --iterations=5
leveonas benchmark --provider=gemini --model=gemini-4-hydrogen --json