Command line
The binary is lt. Paths may be files or directories; a directory is searched recursively for *.lt.
lt init [dir] [--name <pkg>] [--force] create a package (cwd by default)
lt check [--offline] <path>... resolve imports and type check
lt fmt [--check] <path> format in place, or check formatting
lt ast <path> dump the AST (debugging)
lt build -t ts|py|go [--offline] <entry> compile a package
lt test -t ts|py|go [--offline] <entry>... emit and optionally run tests
lt ir <entry> dump the typed IR (debugging)
lt add <key> --git <url> --version <req> [--root <dir>]
lt add <key> --path <dir> [--root <dir>]
lt remove <key> remove a dependency
lt update <key>|--all re-resolve dependencies, rewrite lt.lock
lt vendor [--offline] copy locked sources into vendor/
lt migrate [--write] migrate v2 imports to v3
lt lsp LSP server over stdio
lt playground generate the static example gallery
lt init
lt init # current directory
lt init money # ./money
lt init money --name billing
lt init money --force
Creates lt.toml, src/<package>.lt, and .gitignore with /out. The package name is derived from the directory and normalized to lowercase_snake_case; --name overrides it. Existing files are not overwritten unless --force is given.
lt check
lt check src/
lt check --offline src/
Resolves the import graph and type-checks every entry. Diagnostics are printed with a source snippet. Exit code is 1 when any file fails and 0 otherwise. --offline forbids network access; an incomplete lt.lock is an error.
lt fmt
lt fmt src/
lt fmt --check src/
lt fmt rewrites files in the canonical form. lt fmt --check prints the files that differ and exits 1 without writing. Formatting is idempotent.
lt build
lt build -t ts src/money.lt
lt build -t py src/money.lt --out out
lt build -t go src/money.lt --offline
| Flag | Default | Meaning |
|---|---|---|
-t, --target | ts | ts, py, or go |
--out | out | output root; the target name is appended |
--offline | off | forbid network access |
build writes the library package only. Test declarations stay out of the output. It never writes lt.lock.
lt test
lt test -t ts tests/*.lt --out out/conf --run
| Flag | Default | Meaning |
|---|---|---|
-t, --target | ts | ts, py, or go |
--out | out | output root; the target name is appended |
--run | off | run vitest, pytest, or go test |
--usage | off | also emit a runnable calling example per package |
--offline | off | forbid network access |
Without --run, the generated files are written and the command prints the native command to run. --usage is used by the documentation gallery.
Dependencies
lt add foo --git https://github.com/foo/bar --version "^1.2"
lt add foo --git https://github.com/foo/bar --version "^1.2" --root packages/foo
lt add utils --path ../utils
lt remove foo
lt update foo
lt update --all
lt vendor
lt vendor --offline
addwrites the dependency tolt.toml.--rootselects a subdirectory inside the checkout.removedeletes it fromlt.tomlandlt.lock.updateresolves versions and rewriteslt.lock;--allwalks the whole graph.vendorcopies locked sources intovendor/for offline builds.
See Packages and dependencies and import v3.
lt migrate
lt migrate # report v2 imports that need rewriting
lt migrate --write # rewrite them in place
lt ast and lt ir
lt ast src/money.lt
lt ir src/money.lt
Both print a Rust debug representation to stdout. They are debugging aids, not a stable format.
lt lsp
lt lsp
An LSP server over stdio: diagnostics, hover, definition, references, completion, signature help, symbols, highlights, formatting, rename, and import quick fixes.
lt playground
lt playground
lt playground --root playground --out out/playground
lt playground --allow-stale
Generates the static gallery at out/playground/index.html. --allow-stale permits generation when evidence.json does not match the current cases.
Exit codes
| Code | Meaning |
|---|---|
0 | success |
1 | compilation, formatting, dependency, or test failure |
2 | invalid command line |