Packaged command-line reference for this repository.
This file replaces the drifted upstream CLI page with the commands that actually ship from pyproject.toml today. The authoritative entry-point map lives in [project.scripts].
| Command | Entry Point | Purpose |
|---|---|---|
hlf-mcp |
hlf_mcp.server:main |
Start the packaged FastMCP server |
hlfc |
hlf_mcp.hlf.compiler:main |
Compile HLF source to JSON AST |
hlffmt |
hlf_mcp.hlf.formatter:main |
Canonicalize HLF source formatting |
hlflint |
hlf_mcp.hlf.linter:main |
Run static analysis over HLF source |
hlfrun |
hlf_mcp.hlf.runtime:main |
Compile, encode, and execute an HLF program |
hlfpm |
hlf_mcp.hlf.hlfpm:main |
Install and manage HLF modules |
hlfsh |
hlf_mcp.hlf.hlfsh:main |
Launch the interactive HLF shell |
hlflsp |
hlf_mcp.hlf.hlflsp:main |
Start the HLF language server |
hlftest |
hlf_mcp.hlf.hlftest:main |
Compile and lint HLF snippets, files, or directories |
Examples below use uv run, but the commands also work directly after installing the package.
Start the packaged FastMCP server.
uv run hlf-mcp
HLF_TRANSPORT=sse uv run hlf-mcp
HLF_TRANSPORT=streamable-http HLF_PORT=8000 uv run hlf-mcpNotes:
- Transport is controlled by
HLF_TRANSPORT. - Supported values are
stdio,sse, andstreamable-http. HLF_HOSTandHLF_PORTconfigure the HTTP transports.- The HTTP wrapper exposes
/healthin addition to the MCP endpoints.
Compile an HLF source file and print the JSON AST.
uv run hlfc fixtures/hello_world.hlfCurrent behavior:
- Accepts one file path.
- Prints the compiled AST as JSON.
- Exits non-zero on compile failure.
Format HLF source.
uv run hlffmt fixtures/hello_world.hlf
uv run hlffmt fixtures/hello_world.hlf --checkCurrent flags:
--check: exit with status1if the file would be reformatted.
The formatter prints formatted source to stdout; it does not edit files in place.
Lint HLF source.
uv run hlflint fixtures/hello_world.hlf
uv run hlflint fixtures/security_audit.hlf --json
uv run hlflint fixtures/hello_world.hlf --gas-limit 500 --token-limit 40Current flags:
--gas-limit: maximum permitted gas estimate for lint checks.--token-limit: per-line token budget.--json: emit diagnostics as JSON.
The command exits non-zero when lint diagnostics include errors.
Compile and execute an HLF program through the bytecode VM.
uv run hlfrun fixtures/hello_world.hlf
uv run hlfrun fixtures/hello_world.hlf --gas 500 --var name=worldCurrent flags:
--gas: execution gas limit.--var KEY=VALUE: inject one or more runtime variables.
The command prints the runtime result as JSON and exits non-zero when execution does not finish with status == "ok".
Manage HLF modules.
uv run hlfpm list
uv run hlfpm install collections@v1.0.0
uv run hlfpm search math
uv run hlfpm freeze
uv run hlfpm update collections
uv run hlfpm uninstall collectionsSupported subcommands:
listinstall PACKAGEuninstall PACKAGEsearch QUERYfreezeupdate PACKAGE
Current packaged behavior includes an offline-friendly stub install path when OCI access is unavailable.
Interactive shell for the packaged compiler and linter surfaces.
uv run hlfsh
uv run hlfsh --gas-limit 500
uv run hlfsh --no-colorBuilt-in shell commands:
| Command | Meaning |
|---|---|
:help |
Show help |
:env |
Show current SET bindings |
:gas |
Show gas usage summary |
:reset |
Clear shell state |
:load FILE |
Load and evaluate an HLF file |
:ast |
Print the last compiled AST |
:lint |
Lint the last input |
:quit |
Exit the shell |
Start the HLF language server.
uv run hlflsp
uv run hlflsp --tcp 2087 --host 127.0.0.1Current flags:
--tcp PORT: run in TCP mode instead of stdio.--host: host to bind in TCP mode.
Compile and lint HLF snippets, files, or directories.
uv run hlftest fixtures
uv run hlftest fixtures --strict
uv run hlftest fixtures --gas-limit 50Current flags:
--strict: treat lint warnings as failures.--gas-limit N: record a gas limit for the test runner.
The packaged module also exposes assertion helpers for Python tests:
from hlf_mcp.hlf.hlftest import assert_compiles, assert_lints_clean, assert_gas_under
assert_compiles('[HLF-v3]\nRESULT 0 "ok"\nΩ')
assert_lints_clean('[HLF-v3]\nRESULT 0 "ok"\nΩ')
assert_gas_under('[HLF-v3]\nRESULT 0 "ok"\nΩ', 50)docs/HLF_REFERENCE.mddocs/HLF_GRAMMAR_REFERENCE.mddocs/HLF_STDLIB_REFERENCE.md