Home › CLI
The lairu command-line interface: evaluate, run, render, inspect, and serve.
cd lasso-rust cargo build # debug build cargo build --release # optimised build cargo test # run the full test suite
The built binaries are at target/debug/lairu and
target/debug/lairu-fpm. After cargo install --path .
or copying the binaries to your PATH, you can call lairu
directly without cargo run --.
Evaluate a Lasso expression or short snippet supplied as a string argument.
lairu eval "local(name) = 'LaiRu'; #name + ' 0.1'" lairu eval "array(1, 2, 3)->sum" lairu eval "6 * 7"
The result of the last expression is printed. Assignments print nothing. This is the fastest way to test a snippet without creating a file.
Execute a .lasso file as a script. Text output is written to stdout.
lairu run examples/core.lasso lairu run myscript.lasso
Script mode evaluates the whole file as Lasso code without template processing. Use render instead when you have a file that mixes HTML and Lasso.
Render a template file. Text content passes through and bracketed Lasso expressions are evaluated and substituted into the output.
lairu render examples/index.lasso lairu render mypage.lasso
The output goes to stdout. Useful for testing a template page without starting the full HTTP service.
Parse a file and report any syntax errors without executing it.
lairu check examples/core.lasso lairu check mypage.lasso
Exits with a non-zero status code on parse failure, which makes it suitable for CI checks on Lasso source files.
Parse a file and print its abstract syntax tree.
lairu ast examples/core.lasso
Helpful when debugging a parse problem or understanding how a piece of code is structured internally.
Print a compatibility fixture report — how many fixture files exist per category and how many are passing in the current build.
lairu compat-report
Useful for tracking progress toward Lasso 9 compatibility.
New compatibility work should start with a fixture under
lasso-rust/tests/fixtures/.
Start the built-in HTTP service over a TCP address or unix socket.
lairu serve --addr 127.0.0.1:9010 --docroot /var/www/html lairu serve --unix /run/lairu/lairu.sock --docroot /var/www/html lairu serve --config /etc/lairu/config/lairu.ini
| Flag | Description |
|---|---|
--addr host:port | TCP address to listen on. |
--unix /path/to/file.sock | Unix socket path. |
--docroot /path | Document root directory. |
--config /path/to/lairu.ini | Path to configuration file. |
Without --config, LaiRu searches config/ next to the binary
then falls back to /etc/lairu/config/. See the
Service page for full configuration documentation.
Start LaiRu as a FastCGI process manager. Also available as a standalone
lairu-fpm binary.
lairu fpm --unix /run/lairu/lairu-fpm.sock --docroot /var/www/html lairu fpm --addr 127.0.0.1:9000 --max-children 8 lairu-fpm --config /etc/lairu/config/lairu.ini
| Flag | Description |
|---|---|
--addr host:port | FastCGI TCP address. |
--unix /path/to/file.sock | FastCGI unix socket. |
--docroot /path | Default document root (overridable per-request by nginx/Apache). |
--max-children n | Maximum concurrent worker connections. |
--config /path/to/lairu.ini | Path to configuration file. |
| Variable | Effect |
|---|---|
LAIRU_TEMPLATE_CACHE | Set to 0 to disable template source caching. |
LAIRU_PARSE_CACHE | Set to 0 to disable parsed code-fragment caching. |
LAIRU_RUNTIME_POOL_SIZE | Per-thread runtime pool size (default 8; 0 disables reuse). |
LAIRU_MAX_HEADER_BYTES | Maximum request header size in bytes. |
LAIRU_MAX_REQUEST_BODY | Maximum total request body size. |
LAIRU_MAX_UPLOAD_BYTES | Maximum size per uploaded file. |
LAIRU_UPLOAD_SPOOL_BYTES | Threshold above which uploads are spooled to disk. |
LAIRU_UPLOAD_TMPDIR | Temporary directory for spooled uploads. |
LAIRU_UPLOAD_DESTDIR | Destination directory for accepted uploads. |
LAIRU_UPLOAD_KEEP_TEMP | Set to 1 to keep spooled temp files after render. |
LAIRU_UPLOAD_ALLOWED_EXTENSIONS | Comma-separated extension allow list. |
LAIRU_UPLOAD_ALLOWED_TYPES | Comma-separated MIME type allow list. |
LAIRU_SESSION_STORE | memory, file, or none. |
LAIRU_SESSION_DIR | Directory for file-backed sessions. |
LAIRU_SESSION_SECRET | HMAC-SHA256 secret for signed session cookies. |
LAIRU_TRUST_PROXY | Set to 0 to ignore Forwarded / X-Forwarded-* headers. |
LAIRU_FILE_ROOT | Sandbox root for file API calls. |
LAIRU_FILE_ROOT_REQUIRED | Set to 1 to reject file access without a configured root. |
LAIRU_MAX_SLEEP_MS | Optional cap on sleep() duration. |