Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

lumen <file> [options]

Special first arguments

These take the place of a file name and short-circuit everything else:

ArgumentDescription
--introductionWrite a starter helloworld.lmn to the current directory
--examplesList all built-in examples
--examples <name>Write the named example to <name>.lmn
--helpPrint usage and exit
--versionPrint version, git branch, commit, and build date

File flags

Everything else takes <file> as the first argument, followed by any of:

FlagDescription
--verbosePrint extra compiler/VM diagnostics, including the raw compiled bytecode
--compileCompile the source file to <file>.bin
--runExecute compiled bytecode
--disassembleDisassemble a compiled .bin file into readable instructions
--dbgsymEmit a <file>.bin.dbg debug symbols file alongside the bytecode
--debuggerRun under the interactive debugger

Default behavior

If you pass no --compile, --run, or --disassemble flag, Lumen compiles and runs the file in one shot:

lumen script.lmn
# equivalent to:
lumen script.lmn --compile --run

Flag combination rules

Lumen enforces a few sane combinations and will refuse to run with an error otherwise:

  • --disassemble is exclusive. It cannot be combined with --compile or --run — disassembling reads an existing .bin file, it doesn’t produce or execute one.
  • --debugger requires --run. You can’t compile-only into the debugger; the debugger attaches to execution.
  • --dbgsym requires --compile. Debug symbols are only generated as part of compilation.