Command-Line Reference
Reference for every subcommand and option of the ljos command-
line tool.
This page describes every subcommand of the
ljos command-line tool, what it is for, its main options and how to invoke it.Opens a window on a QML file. With
--watch, every save to the project's QML, JavaScript, qmldir, CMakeLists.txt or image files is applied to the running application in place.Arguments placed after
-- are passed to the QML application in Application.arguments (with the program and entry file first). Passing -style NAME after -- selects the QtQuick.Controls style before QT_QUICK_CONTROLS_STYLE and the configuration file.--project <DIR>: Project root for module discovery (defaults to the directory of <FILE>).--watch: Watch the project directory and hot-reload on changes.--size <WxH>: Initial window size in logical pixels, such as 1280x800. Without --size, a root item opens at its own width and height (800 by 600 for any side left at 0).--mcp[=<CAPS>]: Start the live MCP inspector with a comma-separated list of capabilities (inspect, input, mutate, eval). Passing --mcp alone enables inspect. Writes the listener address and bearer token to target/ljos/mcp-<pid>.json (mode 0600) and removes it on exit. The directory it goes in is made 0700; a link, one that another user owns, or one that group or others can get into is refused.--mcp-redact: Redact all editable text fields in inspector snapshots, properties and screenshots, and refuse app_eval, methods and signal handlers.--mcp-bind <ADDR>: Bind the MCP HTTP listener to <ip>:<port> instead of 127.0.0.1:0. Non-loopback addresses require --mcp-insecure-lan.--mcp-socket <PATH>: Listen on a Unix domain socket (created mode 0600, maximum 107 bytes on Linux and 103 bytes on macOS) instead of TCP.--mcp-rate <N>: Answer a client up to N calls per second (1 to 1000) instead of 20. For a program that starts the application and drives it as part of its own interface. Grants no capability; the token file states the rate as calls_per_second.--quit-with-stdin: End the run when standard input closes. A program that starts the application as its child keeps the other end of a pipe; the system closes it when the program ends in any way, also when it is killed.--outlive-parent: Keep a --headless run going when the program that started it ends. Without it the run quits as on Qt.quit() when that program ends in any way, also when it is killed: nobody can see or close a run without a window that was left behind. A run started by the system's first process has no parent to follow.--top: Show the top overlay over the window with the time of the last frame by lane and by owner.--example <ID>: Look <ID> up in corpus/examples.json and use its imports.--types <FILE>: The type dump describing the project's native types, instead of ljostypes.json in the project directory. Not with --example. See Previewing without your Rust.Compiles QML projects without opening a window and reports compiler errors, warnings, accessibility lints, internationalisation lints and design rule findings. Every diagnostic line ends with its rule code in brackets (such as
[invalid-assignment] or [a11y-unnamed-interactive]).--tree: Print the parsed syntax tree of each file.--stats: Print expression tier statistics (how many bindings run in tier 0, the tier-1 binding VM or JavaScript) and the top fallback patterns.--top <TOP>: Number of fallback patterns to show with --stats (default: 25).--summary: Print one summary line per directory instead of per-file diagnostics.--quiet: Print only totals and errors.--no-lint: Skip accessibility and internationalisation lints.--port: Report the types and members the project uses that Ljós does not yet support, grouped by module and ordered by frequency.--json: Emit the --port report as JSON.--deny-missing: Exit with status 1 if --port finds any unsupported or dropped APIs.--ledger <FILE>: Path to ledger/qtquick.toml (auto-detected from the working directory by default).--limit <N>: Stop after <N> QML files.--tsc: Give the scripts to TypeScript as well, with Ljós's syntax compiled away, and report its findings at their place in your files. Runs deno check, or the tsc that LJOS_TSC names. See Editor setup.--project <DIR>: The project root, under which .ljos/ holds the declarations of its .lts modules (default: the nearest directory upward with a tsconfig.json).Formats QML files in place to the canonical layout: one member per line, four spaces per indentation level, preserving comments and JavaScript expressions. A file with a syntax error is never modified. Pass
- to format from standard input to standard output.--check: Do not write files; exit with status 1 if any file is not formatted.--diff: Print a unified diff of the changes without writing files.Runs
TestCase items in tst_*.qml files headlessly on a virtual clock and prints the report in qmltestrunner's text format. The exit status is the number of failed tests (clamped to 254).Each path may be a
tst_*.qml file or a directory (searched recursively for tst_*.qml in path order; defaults to .).--import <DIR> (or -import <DIR>): Additional QML module import directory (may be passed more than once).--filter <NAME>: Only run tests matching Case::function, Case::function:tag, a case name or a function name.--json <FILE>: Write a structured JSON report to <FILE>.Draws a QML project to a PNG file headlessly without opening a window, after advancing a virtual clock by a settle duration.
--out <OUT>: Output PNG path (required).--entry <ENTRY>: Entry QML file relative to <DIR> (default: Main.qml).--size <WxH>: Render size in logical pixels. Without --size, uses the root item's size (800x600 for any side left at 0).--settle <MS>: Virtual milliseconds to advance before capturing (default: 1500).--now <RFC3339>: Pin the wall clock that JavaScript Date sees (for example, 2026-03-30T14:00:00Z), which then advances with --settle.--system-fonts: Load host system fonts. Without this flag, only the bundled font is used so renders are deterministic across machines.--network: Allow http: and https: fetches. Without this flag, network requests fail immediately as offline.--example <ID>: Look <ID> up in corpus/examples.json and use its entry, imports and size.Compiles GLSL 440 vertex and fragment shaders referenced by
ShaderEffect items in QML files (or standalone .vert and .frag files) into pre-compiled .ljsh files beside them, so a shipped application does not need to compile shaders at run time.--check: Verify that an up-to-date .ljsh file already exists beside every shader without writing any files; exits with status 1 if any .ljsh is missing or stale.Finds every translatable message in a directory tree and merges them into a catalogue. A
.po (or .pot) catalogue gets Ljós's t`…` messages in ICU MessageFormat; a Linguist .ts catalogue gets Qt's qsTr texts. Existing translations are kept, and a translated message that left the sources is kept as obsolete.-o, --output <OUTPUT>: The catalogue to create or bring up to date: is.po, app.pot or app_is.ts.--language <LANGUAGE>: The language of the translations (is_IS, de), for a new file or one that does not say. A .po file without one takes its name.--check: Write nothing; fail if the file's messages differ from the sources.Serves the authoring Model Context Protocol (MCP) server over standard input and output. Used by coding agents to check, lint, format and query QML projects without running a GUI window.
--project <PROJECT>: Project root directory (default: .).--caps <CAPS>: Comma-separated capabilities to grant (inspect, input, mutate, eval, fs, run; default is "", which is read-only).--features-runner <PROGRAM>: Executable used by features_run to run Gherkin scenarios.Serves the language server protocol over standard input and output, for an editor: what the compiler finds in an open QML file,
.ts or .lts module, at its place in the text, and the rename of a .ts module that uses Ljós's syntax to .lts. See Editor setup.Opens a graphical observer window attached to a running Ljós application that was started with
ljos run --mcp. Displays processes, mailboxes, objects, logs, traces, the supervision tree, frames, memory, models, wakes, components, bindings, growth and design audits.TARGET is either a target/ljos/mcp-<pid>.json token file or a project directory to search for the newest token file (default: .).--remote: Allow connecting to a non-loopback address in the token file.--size <WxH>: Initial observer window size in logical pixels (default: 1200x760).--mcp[=<CAPS>]: Serve an MCP inspector on the observer's own window (target/ljos/mcp-observe-<pid>.json).--mcp-rate <N>: With --mcp, answer up to N calls per second (1 to 1000) instead of 20.Bridges a running application's live MCP inspector (
target/ljos/mcp-<pid>.json) to standard input and output (one JSON-RPC message per line) for MCP clients that launch servers as subprocesses. Re-reads the target file on every message so that if the application restarts, ljos attach reconnects to the new process automatically.--remote: Allow connecting to a non-loopback address in the token file.Measures QML applications on Ljós and on Qt (
qml6) inside a Linux cgroup v2 memory and CPU limit (systemd-run --user --scope), writing report.json and report.md. Exits with status 2 when a run exceeds its budget.--manifest <MANIFEST>: JSON manifest of benchmark cases.--runtime <RUNTIMES>: Comma-separated runtimes to measure (ljos, qt; default: ljos,qt).--profile <PROFILES>: Hardware profiles to enforce (desktop, pi-zero).--memory-max <BYTES>: Memory limit when no --profile is set (default: 256M, with MemorySwapMax=0).--cpus <N> / --cpu-factor <N> / --cpu-list <LIST>: CPU core count, throttle percentage and pinning.--settle <S> / --idle <S> / --load <S>: Durations in seconds for startup settle, idle measurement and synthetic gesture load (--gesture click|drag|scroll).--bisect: Binary-search the lowest memory.max (within --bisect-range, default 8,512 MiB) that completes without an OOM kill.--out <DIR>: Output directory for report.json and report.md (default: target/bench).--limit-by <auto|scope|cgroup|container|process>: What holds a profile's limits where no systemd scope can be had, as in a container (default auto, which never takes process). See docs/BENCHMARKS.md.--check-limits: Only check that each profile's limits can be held here and print what holds them; status 2 if they cannot be.