The lx CLI
The `lx` command-line tool runs the whole workflow: scaffold a project, compile to Erlang / Zig / Android, run with dev hot-reload, manage dependencies, run tests and ship self-contained OTP releases. One binary, every target.
Commands
lx new — Scaffold a project from a template (default, web, binary, mobile_app or lib).
lx new my_app --template=web
lx new my_cli --template=binary
lx new my_lib --lib
lx compile — Compile the project (or a single file) to a backend target.
lx compile
lx compile --target=zig
lx compile --force
lx run — Run the OTP app or a script. Dev hot-reload with --watch.
lx run
lx run --watch
lx run my_script.lx
lx test — Run unit tests (describe/test blocks) and integration tests.
lx test
lx test --only "add"
lx test --unit
lx deps — Manage dependencies: get, compile, list, tree, check, clean.
lx deps get
lx deps compile
lx deps tree
lx release — Build a self-contained OTP release; optionally a tarball or Docker image.
lx release
lx release --tar
lx release --docker
lx format — Format all .lx files in the project.
lx format
lx clean — Remove build artifacts.
lx clean
lx clean --all
lx install — Install / refresh the lx binary and the core libs & templates from GitHub.
lx install
lx install --data-only
Global options & environment
# Global options
--force Force recompilation
--target=lang erlang | zig | android (default: erlang)
--emit-erl, -E Keep intermediate .erl files
--erl-only, -S Generate .erl only, skip erlc
# Environment variables
LX_ENV dev | test | prod (default: dev)
LX_BUILD_PATH build directory (default: _build)
LX_DEPS_PATH dependencies directory (default: deps)
# Configuration
project.yml project config (name, version, deps)
config/config.yml general config (all environments)
config/dev.yml dev environment overrides